ceph-client: start laying the groundwork for Linux tracepoints
Linux supports a mechanism for very efficiently inserting trace points
in code, which allow for an arbitrary function to be executed at each
point when enabled. This can be used for fine-grained tracing of
activity in the code at runtime, including recording and exporting to
user space data that is available at the time an event occurs. Control
of whether a particular trace point (or group of them) is enabled is
provided by pseudo files under /sys/kernel/debug/tracing.
A trace point "call" occupies only a few bytes of instruction at the
place it's used. Conceptually it amounts to a test of a memory location,
and if it's non-zero, call a function whose address is recorded in a
separate memory location. This allows both memory locations to exist
but hold zero value for the default inactive case. This construct also
allows trace points can be installed at run-time (via a separate kernel
module, for example), so the actual jumped-to functions do not even need
to exist in memory unless and until that is desired.
Event trace points are structured to gather some data when they are
called, and that data can be extracted via other utilities and then
graphed or aggregated.
There is a lot of flexibility, but there's some sort of baseline
infrastructure that you need to put in place for a module to begin
using these. Once the baseline is done you can add new trace points
I would really like to do this soon, given the trouble I've had
understanding what's going on for bug 2260.
#2 Updated by Alex Elder about 11 years ago
- File 0001-ceph-add-tracepoints-for-message-submission-on-read-.patch View added
- File 0002-ceph-add-tracepoints-for-message-send-queueing-and-c.patch View added
No progress on this yet.
However, I got this e-mail from Jim Schutt shortly after creating
this bug, and just want to document it here. I said I would gladly
use his work as a starting point once I get a chance to work on this.
(The two patch messages--ported to the current state of the testing
I ran across tracker #2374 today - I've been carrying these two
tracepoint patches for a while. Perhaps you'll find them useful.
Jim Schutt (2):
ceph: add tracepoints for message submission on read/write requests
ceph: add tracepoints for message send queueing and completion, reply
fs/ceph/addr.c | 8 +
include/trace/events/ceph.h | 144 ++
net/ceph/messenger.c | 9 ++
5 files changed, 174 insertions(+), 1 deletions(-)
create mode 100644 include/trace/events/ceph.h