Post #49,206
8/13/02 11:14:16 AM
|
Profilers?
I've been using gprof for quite a while, and usually it gives pretty good results. This time, however, it says one function is calling another when it quite clearly *never* calls it. (It's a very short 11-line function, so it's quite unlikely I've accidentally missed the call. There are two strcmp()'s and no other calls inside it.) The problem is that this seems to be one of the bottlenecks in the program.
Anyway, this is a problem that I'm not sure anyone here will be able to help with, but perhaps someone knows of a better/new&improved profiling tool? I've heard of a couple but can't bring their names to mind, and Google isn't being very helpful with the words and phrases I'm searching for. ("Profiler" brings up a heck of a lot of hits for the television series... not quite what I'm looking for.)
If I can't get the company to actually buy a license, well, I can say I tried.
The lawyers would mostly rather be what they are than get out of the way even if the cost was Hammerfall. - Jerry Pournelle
|
Post #49,245
8/13/02 4:21:25 PM
|
google gprof replacement got
[link|http://www.netsys.com/cgi-bin/display_article.cgi?1197|link] a page of debuggers mentions mprof to be used like gprof thanx, bill
."Once, in the wilds of Afghanistan, I had to subsist on food and water for several weeks." W.C. Fields
|
Post #49,248
8/13/02 4:47:40 PM
|
From readme, looks like it's memory only
But there are a number of other tools on that page that look interesting.
The lawyers would mostly rather be what they are than get out of the way even if the cost was Hammerfall. - Jerry Pournelle
|
Post #49,276
8/13/02 9:18:19 PM
|
Re: google gprof replacement got
From what I can see, all those are memory debugging tools, not really profiling tools - which is what I really need. For some reason, gprof (despite built-in compiler support) is just reporting the call stack of various functions dead wrong - and it's not a complicated case such as some function calling a system function that hasn't been compiled for profiling, it's mis-reporting one function as calling another directly when it quite clearly is doing no such thing.
I'll have to try a couple other systems (we've got an HPUX and an AIX system and can get access to a Linux system), but it's annoying when a (supposedly) "standard" Unix tool, supposedly supported by the vendor, doesn't work.
And, Ben, I can do things with macros if I must, but it's also annoying to have to hand-instrument code with printf's (or however I go about it) when I shouldn't have to.
The lawyers would mostly rather be what they are than get out of the way even if the cost was Hammerfall. - Jerry Pournelle
|
Post #49,394
8/14/02 7:05:02 PM
|
You might have missed why I asked that...
It wasn't a recommendation of what to do, it was a question about how an unknown function call could slip into 11 lines without obvious function calls.
Cheers, Ben
Computer Science is no more about computers than astronomy is about telescopes. -- Edsger Wybe Dijkstra (1930-2002)
|
Post #49,404
8/14/02 9:05:18 PM
|
Ah, no I don't think that's it
The function call HPUX 11.x claims is being called *is* actually in the program, but I can set a breakpoint in the program compiled for debugging and very clearly see it's being called from a completely different "known" function. The only thing I can think is that HP's implementation is totally mis-reading the call stack, or the compiler is (for some reason) inserting the wrong profiling instrumentation, or something like that.
It does seem to work much better under AIX 4.3, but still not perfectly - but in this case the weird function call is truly an unknown call, and in *this* case I can believe it may well be a system call inserted by the compiler implementing some sort of profiling statistical monitoring function. It otherwise does seem to give a more accurate call stack, although working under AIX is (usually) more painful than working under HPUX. Fer crying out loud, AIX still comes with dbx. Even HP eventually adopted gdb, contributing a terminal interface, rather than trying to maintain xdb or dde.
The lawyers would mostly rather be what they are than get out of the way even if the cost was Hammerfall. - Jerry Pournelle
|
Post #49,260
8/13/02 7:00:19 PM
|
Could the call be hidden within a macro?
Computer Science is no more about computers than astronomy is about telescopes. -- Edsger Wybe Dijkstra (1930-2002)
|
Post #49,307
8/13/02 11:32:45 PM
|
On the outside chance your system is RH 7.3...
Red Hat 7.3 has just updated to glibc-2.2.5-39 and said it affects gprof.
Alex
"Television: chewing gum for the eyes." -- Frank Lloyd Wright
|
Post #49,309
8/14/02 12:10:41 AM
|
Nah
Primary system at work is HPUX 11.x.
The lawyers would mostly rather be what they are than get out of the way even if the cost was Hammerfall. - Jerry Pournelle
|