Re: [PATCH] dtrace probes for memory manager
Frank Ch. Eigler <fche@redhat.com>
From: fche@redhat.com (Frank Ch. Eigler)
To: Zdenek Kotala <Zdenek.Kotala@Sun.COM>
Cc: Bernd Helmle <mailings@oopsware.de>, Greg Smith <greg@2ndquadrant.com>, Robert Haas <robertmhaas@gmail.com>, Alvaro Herrera <alvherre@commandprompt.com>, pgsql-hackers@postgresql.org
Date: 2009-12-10T19:11:20Z
Lists: pgsql-hackers
Zdenek Kotala <Zdenek.Kotala@Sun.COM> writes:
> [...]
> + header = (StandardChunkHeader *)
> + ((char *) ret - STANDARDCHUNKHEADERSIZE);
> +
> +// TRACE_POSTGRESQL_MCXT_ALLOC(context->name, context, size, header->size, true);
> +
> [...]
If the dormant overhead of these probes is measured or suspected to be
excessive, consider using the dtrace-generated per-probe foo_ENABLED()
conditional, or a postgres configuration global thusly:
if (__builtin_expect(TRACE_POSTGRESQL_MCXT_ALLOC_ENABLED(), 0))
TRACE_POSTGRESQL_MCXT_ALLOC(...);
so that the whole instrumentation parameter setup/call can be placed
out of the hot line with gcc -freorder-blocks.
- FChE