Re: Generic Monitoring Framework Proposal - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: Generic Monitoring Framework Proposal
Date
Msg-id 20060620123612.GA24606@svana.org
Whole thread Raw
In response to Re: Generic Monitoring Framework Proposal  (Chris Browne <cbbrowne@acm.org>)
List pgsql-hackers
On Mon, Jun 19, 2006 at 05:14:15PM -0400, Chris Browne wrote:
> Robert.Lor@Sun.COM (Robert Lor) writes:
> > For DTrace, probes can be enabled using a D script. When the probes
> > are not enabled, there is absolutely no performance hit whatsoever.
>
> That seems inconceivable.
>
> In order to have a way of deciding whether or not the probes are
> enabled, there has *got* to be at least one instruction executed, and
> that can't be costless.

I think the trick is that the probe are enabled by overwriting bits of
code. So by default you might put a No-Op instruction and if you want
to trace you replace that with an illegal instruction or the special
one-byte INT3 instruction x86 system have for this purpose.

With a 17-stage pipelined processor I imagine the cost of a no-op would
indeed be almost unmeasurable (increase code size I suppose).

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

pgsql-hackers by date:

Previous
From: "Andrew Dunstan"
Date:
Subject: Re: shall we have a TRACE_MEMORY mode
Next
From: Alvaro Herrera
Date:
Subject: Re: shall we have a TRACE_MEMORY mode