Skip site navigation (1) Skip section navigation (2)

Re: Sampling profiler updated

From: Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
Subject: Re: Sampling profiler updated
Date: 2009-07-22 01:30:36
Message-ID: 20090722093930.A05A.52131E4D@oss.ntt.co.jp (view raw or flat)
Thread:
Lists: pgsql-hackers
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> For the record, I think this patch is a waste of manpower and we should
> rely on dtrace/systemtap.  However, if we are going to make our own
> homegrown substitute for those facilities, a minimum requirement should
> be that it uses the dtrace macros already put into the sources, rather
> than expecting that it gets to clutter the code some more with its own
> set of tracing markers.

How about export dtrace functions as hook function pointers?
For example:

    void (*LWLOCK_WAIT_START_hook)(int, int);
    #define TRACE_POSTGRESQL_LWLOCK_WAIT_START(INT1, INT2) \
        if (LWLOCK_WAIT_START_hook == NULL); else \
            LWLOCK_WAIT_START_hook(INT1, INT2)
    #define TRACE_POSTGRESQL_LWLOCK_WAIT_START_ENABLED() \
        (LWLOCK_WAIT_START_hook != NULL)

If there were such hooks, my profiler could be implemented as
a loadable module on top of the hooks. It might be good to initialize
LWLOCK_WAIT_START_hook with lwlock__wait__start(). If do so, dtrace
probes still work and we can avoid if-null checks for each call.

If acceptable, I'll also suggest new probe functions like
SLEEP, SEND, RECV, SPINLOCK_FAILURE and so on.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center



In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2009-07-22 01:32:09
Subject: Re: Higher TOAST compression.
Previous:From: Tom LaneDate: 2009-07-22 01:23:28
Subject: Re: Modifying TOAST_TUPLE_THRESHOLD and TOAST_TUPLE_TARGET?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group