pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Tweaking a C Function I wrote
3+ messages / 3 participants
[nested] [flat]

* Tweaking a C Function I wrote
@ 2005-04-06 23:22  Adam Palmblad <adam@aers.ca>
  0 siblings, 1 reply; 3+ messages in thread

From: Adam Palmblad @ 2005-04-06 23:22 UTC (permalink / raw)
  To: pgsql-performance

I wanted to see if I could squeeze any more performance out of a C set 
returning function I wrote.  As such, I looked to a profiler.  Is it 
possible to get profile information on the function I wrote?  I've got 
postmaster and my function compiled with profiling support, and can find 
the gmon.out files... can I actually look at the call tree that occurs 
when my function is being executed or will I be limited to viewing calls 
to functions in the postmaster binary?

-Adam




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Tweaking a C Function I wrote
@ 2005-04-06 23:42  Neil Conway <neilc@samurai.com>
  parent: Adam Palmblad <adam@aers.ca>
  0 siblings, 1 reply; 3+ messages in thread

From: Neil Conway @ 2005-04-06 23:42 UTC (permalink / raw)
  To: Adam Palmblad <adam@aers.ca>; +Cc: pgsql-performance

Adam Palmblad wrote:
> can I actually look at the call tree that occurs when my function is
> being executed or will I be limited to viewing calls to functions in
> the postmaster binary?

You're the one with the gprof data, you tell us :)

It wouldn't surprise me if gprof didn't get profiling data for dlopen'ed 
shared libraries (I haven't checked), but I think both oprofile and 
callgrind should be able to.

(If you do decide to use gprof and you're on Linux, be sure to compile 
Postgres with CFLAGS="-DLINUX_PROFILE", to get valid profiling data.)

-Neil



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Tweaking a C Function I wrote
@ 2005-04-07 04:03  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Neil Conway <neilc@samurai.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2005-04-07 04:03 UTC (permalink / raw)
  To: Neil Conway <neilc@samurai.com>; +Cc: Adam Palmblad <adam@aers.ca>; pgsql-performance

Neil Conway <neilc@samurai.com> writes:
> It wouldn't surprise me if gprof didn't get profiling data for dlopen'ed 
> shared libraries (I haven't checked), but I think both oprofile and 
> callgrind should be able to.

None of the platforms I use are very good at this :-(.  Consider
building a special backend binary with the functions of interest
statically linked into it...

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2005-04-07 04:03 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-04-06 23:22 Tweaking a C Function I wrote Adam Palmblad <adam@aers.ca>
2005-04-06 23:42 ` Neil Conway <neilc@samurai.com>
2005-04-07 04:03   ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox