Skip to contentSkip to conversation

sprofil() implementation

Linux-ia64 Ulrich Drepper 2 participants 3 messages Mar 21, 2001 – Mar 22, 2001

lore
Share & tools
lore
#0 lore raw
Quoted 1 line · David Mosberger

Attached below is an implementation of the sprofil() call.

Thanks, I've added the patch. There was one bug left (on 32-bit archs) and I did some reformatting but essentially it is plainly accepted. Thanks.

But one word of warning: this interface is insufficient. We need a way to dynamically add and remove new segments. This is necessary to support dlopen() etc.

Signature · 3 lines
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------
#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Ulrich Drepper
Quoted 1 line · Uli> David Mosberger <[email protected]> writes:
Quoted 1 line

Attached below is an implementation of the sprofil() call.

Uli> Thanks, I've added the patch. There was one bug left (on 32-bit Uli> archs) and I did some reformatting but essentially it is plainly Uli> accepted. Thanks.

Thanks!

Uli> But one word of warning: this interface is insufficient. We need a Uli> way to dynamically add and remove new segments. This is necessary to Uli> support dlopen() etc.

Yes, I considered that. I thought it would be OK to use sprofil() to stop profiling completely on a dlopen(), register the new library, and then call sprofil() again. Apart from being a bit slower than strictly necessary, I don't think there is an issue with this. Are you concerned about performance or something else?

On a related topic: the gmon.out file currently does not encode any filenames. That's would create problems with dlopen(). I think the best way to fix this is to add a new gmon.out tag that encodes the filename to which the remainder of the file applies (GMON_TAG_IMAGE_PATH or something like that).

	--david
#2 lore raw
In reply to Ulrich Drepper
Quoted 5 lines · David Mosberger

Yes, I considered that. I thought it would be OK to use sprofil() to stop profiling completely on a dlopen(), register the new library, and then call sprofil() again. Apart from being a bit slower than strictly necessary, I don't think there is an issue with this. Are you concerned about performance or something else?

Multi-threaded applications will have a problem with this. I prefer to see a possibility to actually add and remove segments.

Quoted 5 lines

On a related topic: the gmon.out file currently does not encode any filenames. That's would create problems with dlopen(). I think the best way to fix this is to add a new gmon.out tag that encodes the filename to which the remainder of the file applies (GMON_TAG_IMAGE_PATH or something like that).

Definitely, there are quite a lot of changes necessary to the gmon format. I haven't even started thinking about this.

Signature · 3 lines
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------