From: roland@redhat.com (Roland McGrath)
Subject: [ltt-dev] LTTng-UST vs SystemTap userspace tracing benchmarks
Date: Wed, 16 Feb 2011 10:50:56 -0800 (PST) [thread overview]
Message-ID: <20110216185056.CAD7B1806E0@magilla.sf.frob.com> (raw)
In-Reply-To: Mark Wielaard's message of Wednesday, 16 February 2011 11:56:18 +0100 <1297853778.3224.90.camel@springer.wildebeest.org>
Stefan was referring to #4 in your taxonomy.
It's indeed the case that what UST uses today is an always-there normal
C code sequence that loads global variables to decide whether to make
indirect function calls. I don't recall off hand how many layers of
function calls to the libust DSO and such there are in either the
disabled or enabled cases. At best, there is the always the overhead of
several instructions and at least one load in the hot code path, and the
i-cache pollution that goes with that.
It's indeed the cast that what Systemtap uses today is a
sometimes-inserted normal breakpoint instruction, which is indeed a
software interrupt that requires kernel mediation. When disabled, there
is as close to zero overhead as you can have, being a tiny placeholder
instruction sequence (currently just one nop), so the runtime overhead
is under a cycle and the i-cache pollution is the smallest possible unit
(one instruction, being just one byte on x86).
The "sweet spot" between the two is to have overhead close to
Systemtap's epsilon for a disabled probe, while having overhead close to
UST's pure-user method when a probe is enabled. In the in-kernel
context, this is what the Linux kernel's latest code (still being hashed
out, but mostly done) has for kernel tracepoints using the so-called
"jump label" method. That is also possible for sdt markers with some
careful consideration and attention to machine-specific details for each
machine architecture of concern. It entails making the placeholder in
the hot code path slightly larger (at least for x86, it has to be a
"long nop", being probably neglibly more runtime overhead, and a few
bytes more i-cache pollution), and adding some additional static code
outside the hot path. The work to enable or disable a probe becomes
just as costly as the current Systemtap method, since it involves
modifying the program text in place (inserting jump instructions rather
than breakpoint ones). Once enabled, the runtime work of the probes
firing can be very much like what UST does today.
Thanks,
Roland
next prev parent reply other threads:[~2011-02-16 18:50 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-15 15:53 Julien Desfossez
2011-02-15 16:25 ` William Cohen
2011-02-17 16:20 ` Julien Desfossez
2011-02-15 16:26 ` Frank Ch. Eigler
2011-02-15 16:54 ` Mathieu Desnoyers
2011-02-15 17:39 ` Frank Ch. Eigler
2011-02-15 22:25 ` Mathieu Desnoyers
2011-02-15 17:00 ` Stefan Hajnoczi
2011-02-15 17:04 ` Mathieu Desnoyers
2011-02-16 10:56 ` Mark Wielaard
2011-02-16 18:50 ` Roland McGrath [this message]
2011-02-16 20:00 ` [ltt-dev] Porting "jump labels" to userspace (was: Re: LTTng-UST vs SystemTap userspace tracing benchmarks) Mathieu Desnoyers
2011-02-16 20:04 ` Roland McGrath
2011-02-16 20:17 ` [ltt-dev] Porting "jump labels" to userspace David Daney
2011-02-16 20:39 ` Mathieu Desnoyers
2011-02-16 20:45 ` Thomas Gleixner
2011-02-16 21:42 ` Peter Zijlstra
2011-02-17 13:58 ` Ingo Molnar
2011-02-16 20:14 ` David Daney
2011-02-16 20:36 ` Mathieu Desnoyers
2011-02-16 20:55 ` [ltt-dev] LTTng-UST vs SystemTap userspace tracing benchmarks Stefan Hajnoczi
2011-02-16 21:05 ` Mathieu Desnoyers
2011-02-16 21:16 ` Mark Wielaard
2011-02-15 17:03 ` Mark Wielaard
2011-02-16 15:30 ` Tom Tromey
2011-02-16 18:19 ` Roland McGrath
2011-02-17 17:33 ` Julien Desfossez
2011-02-17 19:11 ` Josh Stone
2011-02-17 19:33 ` Julien Desfossez
2011-02-17 19:47 ` Josh Stone
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110216185056.CAD7B1806E0@magilla.sf.frob.com \
--to=roland@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox