Skip to contentSkip to conversation

New glibc with profiling fixed.

parisc-linux Tres Melton 5 participants 11 messages Jul 22, 2005 – Jul 26, 2005 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

Grant,

While searching the web I came across your email:
http://lists.parisc-linux.org/pipermail/parisc-linux/2004-January/022125.html

where you said:

Here's "apps/openssl speed rsa" gprof output from my c3000. (2.6.0-pa7, Debian testing)

TBH, it looks wrong.

It is wrong. For details please see:

http://bugs.gentoo.org/show_bug.cgi?id=90090

If you have any more information on the subject I would appreciate it
as a number of us are preparing to take this issue to the LKML. I'm specifically looking at a convincing reason to put forth to Linus to export the correct clock-ticks/second. Linus has stated in the past that user space has no need for the information. A couple of other kernel devs are going to back me up here but we need a good argument to get Linus to change his mind.

Thanks,

Signature · 6 lines
Tres

_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
#1 lore raw
Quoted 8 lines · Tres Melton
| Here's "apps/openssl speed rsa" gprof output from my c3000.
| (2.6.0-pa7, Debian testing)
|  
| TBH, it looks wrong.

It is wrong. For details please see:

http://bugs.gentoo.org/show_bug.cgi?id=90090

Ugh. user space vs kernel space HZ battles.

Quoted 1 line

If you have any more information on the subject

Sorry - I really don't.
I'm happy to run more tests on kernel patches if that would help.

Quoted 7 lines

I would appreciate it
as a number of us are preparing to take this issue to the LKML. I'm specifically looking at a convincing reason to put forth to Linus to export the correct clock-ticks/second. Linus has stated in the past that user space has no need for the information. A couple of other kernel devs are going to back me up here but we need a good argument to get Linus to change his mind.

I'm certainly not the one who has a solid grasp of the problem. I just recognized the output looked wrong.

Another kernel developer has suggested this is a gprof bug. I was told the kernel has two types of ticks: one for kernel and another for users space - some conversation needs to take place by gprof that I know nothing about.

thanks,
grant
_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

#3 lore raw
In reply to a message not in the archive

Tres,
please keep this conversation on the parisc-linux mailing list. I've added them back into the CC list.

Quoted 7 lines · Tres Melton
Quoted 1 line

I'm happy to run more tests on kernel patches if that would help.

There is a patch to the kernel in the above bug report that makes Linux put the right value in the elf header. That is going to be one of the proposed patches. I've been running a patched kernel for about a week with no noticeable side effects. If you would like you could try that and note any breakage in user space.

I can do that in August...thanks for pointing that out. I read the first parts of the report but don't recall seeing the kernel patch.

Quoted 1 line

When you said 'conversation' did you mean 'conversion'?

Yes - thanks for catching that.

Quoted 4 lines

If so, there is no way for gprof to due that
conversion without knowing what the conversion rate is. The HZ is now set at compile time, as of 2.6.13-rc3, and the conversion rate to USER_HZ is not available to user space.

Right. That's why jiffies exported to user space has to be "normalized" for whatever rate user space *thinks* the kernel is running.

Quoted 4 lines

You spoke of another kernel
dev, could you ask him if he is opposed to exporting the correct value in the elf header (or /proc) and to give a quick justification for his response, pro or con. Thanks.

He's already flown back to germany and it was just incidental that he was available. I'd rather not pester him about this since it seems to be a fairly well understood issue...at least to some people.

thanks,
grant
_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

#4 lore raw
Quoted 3 lines · Grant Grundler

I can do that in August...thanks for pointing that out. I read the first parts of the report but don't recall seeing the kernel patch.

http://bugs.gentoo.org/show_bug.cgi?id=90090#c21
It is not a patch file just in the comment.

Quoted 2 lines

Right. That's why jiffies exported to user space has to be "normalized" for whatever rate user space *thinks* the kernel is running.

I'm advocating a way for user space to *know* what the kernel is running. It is this thinking crap that is messing things up.

Quoted 8 lines
Quoted 4 lines

You spoke of another kernel
dev, could you ask him if he is opposed to exporting the correct value in the elf header (or /proc) and to give a quick justification for his response, pro or con. Thanks.

He's already flown back to germany and it was just incidental that he was available. I'd rather not pester him about this since it seems to be a fairly well understood issue...at least to some people.

If you happen to speak to him again I would still like any extra info. Don't bother him explicitly for this though. The issue will be taken to the LKML by the end of the week.

Quoted 2 lines

thanks,
grant

Signature · 6 lines
Tres

_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
#5 lore raw
Quoted 2 lines · Tres Melton

I'm advocating a way for user space to *know* what the kernel is running. It is this thinking crap that is messing things up.

User space should not "know" what HZ the kernel is using. Instead, all interfaces should be properly reported in terms of whatever HZ userspace used to assume (100 on i386, other values on other platforms). I don't know what interface gprof is using, but it needs to be fixed.

Otherwise we stand no chance of going to a dynamic HZ in the future.

Signature · 10 lines
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain
_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
#6 lore raw
Quoted 4 lines

User space should not "know" what HZ the kernel is using. Instead, all interfaces should be properly reported in terms of whatever HZ userspace used to assume (100 on i386, other values on other platforms). I don't know what interface gprof is using, but it needs to be fixed.

I thought gprof uses a SIGPROF timer using the setitimer interface. Why is it HZ dependent?

randolph
_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

#10 lore raw
In reply to Matthew Wilcox
Quoted 8 lines · Matthew Wilcox
Quoted 2 lines · Tres Melton

I'm advocating a way for user space to *know* what the kernel is running. It is this thinking crap that is messing things up.

User space should not "know" what HZ the kernel is using. Instead, all interfaces should be properly reported in terms of whatever HZ userspace used to assume (100 on i386, other values on other platforms). I don't know what interface gprof is using, but it needs to be fixed.

I disagree as do others but many agree with you. The issue will soon be brought to the LKML so you can discuss it there later this week. It is not gprof that is messing up it is gcc/glibc. When a program is compiled with the "-pg" options it emits a gmon.out file when run and that file has bad data that gprof is trusting.

Quoted 1 line

Otherwise we stand no chance of going to a dynamic HZ in the future.

When you say, dynamic tick are you referring to things like speed step and power now things or just changing the kernel's internal frequency on the fly?

Signature · 6 lines
Tres

_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
#7 lore raw
In reply to Randolph Chung
Quoted 7 lines · Randolph Chung
Quoted 4 lines

User space should not "know" what HZ the kernel is using. Instead, all interfaces should be properly reported in terms of whatever HZ userspace used to assume (100 on i386, other values on other platforms). I don't know what interface gprof is using, but it needs to be fixed.

I thought gprof uses a SIGPROF timer using the setitimer interface. Why is it HZ dependent?

Even though you get a signal you have to calculate the elapsed time. The profiling codes prefers "times" to "getrusage" to "clock."

Unfortunately to interpret "times" information you need to multiply by ticks_to_msec.

IMO any interface exporting/using ticks is broken. Accurate time can be provided through other interfaces. Userspace should never see ticks, only converted time.

c.

_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

#8 lore raw
Quoted 12 lines · Carlos O'Donell
Quoted 7 lines · Randolph Chung
Quoted 4 lines

User space should not "know" what HZ the kernel is using. Instead, all interfaces should be properly reported in terms of whatever HZ userspace used to assume (100 on i386, other values on other platforms). I don't know what interface gprof is using, but it needs to be fixed.

I thought gprof uses a SIGPROF timer using the setitimer interface. Why is it HZ dependent?

Even though you get a signal you have to calculate the elapsed time. The profiling codes prefers "times" to "getrusage" to "clock."

Quoted 6 lines

Unfortunately to interpret "times" information you need to multiply by ticks_to_msec.

IMO any interface exporting/using ticks is broken. Accurate time can be provided through other interfaces. Userspace should never see ticks, only converted time.

userspace should see converted ticks. ie divide by 10 if CONFIG_HZ is 1000 since PA userspace expects to see 100Hz.

Signature · 10 lines
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain
_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
#11 lore raw
In reply to Matthew Wilcox
Quoted 10 lines · Matthew Wilcox
Quoted 2 lines · Tres Melton

I'm advocating a way for user space to *know* what the kernel is running. It is this thinking crap that is messing things up.

User space should not "know" what HZ the kernel is using. Instead, all interfaces should be properly reported in terms of whatever HZ userspace used to assume (100 on i386, other values on other platforms). I don't know what interface gprof is using, but it needs to be fixed.

Otherwise we stand no chance of going to a dynamic HZ in the future.

Or better yet a precise time interface with feedback about the accuracy of the returned time.

For example, while cr16 on parisc is a very precise measurement of insn execution speed, it varies too much to be used for a stable and accurate global clock.

c.

_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

#9 lore raw
In reply to Matthew Wilcox
Quoted 6 lines · Matthew Wilcox
Quoted 3 lines

IMO any interface exporting/using ticks is broken. Accurate time can be provided through other interfaces. Userspace should never see ticks, only converted time.

userspace should see converted ticks. ie divide by 10 if CONFIG_HZ is 1000 since PA userspace expects to see 100Hz.

I meant "ideologicall" broken. Yes, converting ticks to an expected value preserves userspace compatibility.

gprof may want to stop using times() when a more suitable interface becomes available.

c.

_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux