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?
void (*LWLOCK_WAIT_START_hook)(int, int);
#define TRACE_POSTGRESQL_LWLOCK_WAIT_START(INT1, INT2) \
if (LWLOCK_WAIT_START_hook == NULL); else \
#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.
NTT Open Source Software Center
In response to
pgsql-hackers by date
|Next:||From: Tom Lane||Date: 2009-07-22 01:32:09|
|Subject: Re: Higher TOAST compression. |
|Previous:||From: Tom Lane||Date: 2009-07-22 01:23:28|
|Subject: Re: Modifying TOAST_TUPLE_THRESHOLD and TOAST_TUPLE_TARGET? |