On Oct 25, 2013, at 13:51 , Mark Johnston <[email protected]> wrote:

>> 
>> BTW, I've been pondering an idea of reimplementing how the SDT probes get
>> called.  In FreeBSD we have a special hook function pointer that we check for
>> not being NULL and then make a function call.
>> In illumos they compile the code with an unconditional function call.  This 
>> way
>> the probe parameters are placed into the proper registers (or stack 
>> locations).
>> But during run-time linking the call instructions are replaced with series of
>> 1-byte NOP instructions (5 x 0x90 for amd64).  When a probe gets activated 
>> then
>> the first of those NOPs gets replaced with 0xf0 (lock prefix), which results 
>> in
>> an invalid instruction (and that happens atomically).  So, that allows for 
>> the
>> SDT hook to be invoked via the trap handler.
>> 
>> So, I think that that results in less overhead for inactive probes, but 
>> probably
>> in more overhead for active probes.  There is a trade off, but I believe that
>> less overhead for inactive probes is preferred.
> 
> I'd like to find a good way of quantifying the overhead of the current
> approach when probes are disabled. Do you have any suggestions? One
> thing I'd like to try is just doing a TCP bulk transfer to localhost,
> since that'll trip the ip and tcp probes for each packet, and then
> just measure throughput with the current implementation and with the
> approach used in illumos.
> _

Are you wanting to quantify just the workload involved with the probes being on 
and
off?  If so, you want something simpler, and lower overhead than a TCP
connection.  Perhaps measuring fork() (not exec) with unixbench.

I gather you’re going to do this with hwpmc?

Best,
George


Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to