Patch to avoid gprof profiling overwrites

From: <korryd(at)enterprisedb(dot)com>
To: <pgsql-patches(at)postgresql(dot)org>
Subject: Patch to avoid gprof profiling overwrites
Date: 2007-01-31 16:14:52
Message-ID: 1170260092.6941.32.camel@sakai.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

It's difficult to profile a backend server process (using gprof)
because each process overwrites any earlier profile as it exits.

It is especially tricky to nab a useful profile if you happen to have
autovacuum enabled.

This patch reduces the problem by forcing the backend to 'cd' to a new
directory ($PGDATA/gprof/pid) just before calling exit(), but only if
the backend was compiled with -DLINUX_PROFILE.

I've tested this with Linux, but not with other host architectures.

-- Korry

--
Korry Douglas korryd(at)enterprisedb(dot)com
EnterpriseDB http://www.enterprisedb.com

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2007-01-31 17:14:41 Re: uuid patch 3.0 (8.3devel)
Previous Message Tom Lane 2007-01-31 15:11:13 Re: [HACKERS] pgsql: Fix for plpython functions; return true/false for boolean,