[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140827213745.13454.46266.stgit@hemant-fedora>
Date: Thu, 28 Aug 2014 03:13:13 +0530
From: Hemant Kumar <hemant@...ux.vnet.ibm.com>
To: linux-kernel@...r.kernel.org
Cc: srikar@...ux.vnet.ibm.com, peterz@...radead.org, oleg@...hat.com,
hegdevasant@...ux.vnet.ibm.com, mingo@...hat.com, anton@...hat.com,
systemtap@...rceware.org, namhyung@...nel.org,
masami.hiramatsu.pt@...achi.com, aravinda@...ux.vnet.ibm.com,
penberg@....fi
Subject: [PATCH v4 0/3] perf/sdt : Support for SDT markers
The v3 patchset had some spacing errors because of my editor messing up during
sending the patches. Resending the patchset again.
This patchset helps in listing dtrace style markers(SDT) present in user space
applications through perf.
Notes/markers are placed at important places by the
developers. They have a negligible overhead when not enabled.
We can enable them and probe at these places and find some important information
like the arguments' values, etc.
We have lots of applications which use SDT markers today, like:
Postgresql, MySql, Mozilla, Perl, Python, Java, Ruby, libvirt, QEMU, glib
To add SDT markers into user applications:
We need to have this header sys/sdt.h present.
sys/sdt.h used is version 3.
If not present, install systemtap-sdt-devel package (for fedora-18).
Please refer to the Documentation patch (3rd patch in this series) to see how the
SDT markers are added into a program.
With this patchset,
- Use perf to list the markers in the app:
# perf list sdt ./user_app
./user_app :
%user_app:foo_start
%user_app:fun_start
This link shows an example of marker probing with Systemtap:
https://sourceware.org/systemtap/wiki/AddingUserSpaceProbingToApps
Also, this link provides important info regarding SDT notes:
http://sourceware.org/systemtap/wiki/UserSpaceProbeImplementation
This patchset has undergone a lot of changes since it was first introduced.
Hence, the patchset has now been subdivided for more simplicity and ease of
review (thanks to the suggestion from Namhyung Kim). This contains the first 2
of the 4 patches as suggested here:
https://lkml.org/lkml/2014/7/20/284
- Markers in binaries :
These SDT markers are present in the ELF in the section named
".note.stapsdt".
Here, the name of the marker, its provider, type, location, base
address, semaphore address.
We can retrieve these values using the members name_off and desc_off in
Nhdr structure. If these are not enabled, they are present in the ELF as nop.
Changes since last series :
- Subdivided the previous patchset into 4 patches to make it easier to review
as suggested by Namhyung Kim. (This set includes first two of the four patches)
- Made the required changes and some optimizations suggested by Masami, Namhyung
and Andi.
TODO:
- Listing SDT events present in most of the binaries present in a system.
- Maintaining a cache of the SDT events for faster lookup.
- Add support to probe these SDT markers and integrate with a previous patch
(support to perf to probe SDT markers) posted in lkml.
https://lkml.org/lkml/2013/10/23/10
- Recognizing arguments and support to probe on them.
- Add semaphore support.
---
Hemant Kumar (3):
Raw SDT parsing functions
Support perf-list to print SDT events in a single file
Adds documentation for perf support to SDT events.
tools/perf/Documentation/SDT-support.txt | 48 ++++++
tools/perf/Documentation/perf-list.txt | 4
tools/perf/Makefile.perf | 1
tools/perf/builtin-list.c | 2
tools/perf/util/parse-events.h | 2
tools/perf/util/sdt.c | 113 ++++++++++++++
tools/perf/util/symbol-elf.c | 244 ++++++++++++++++++++++++++++++
tools/perf/util/symbol.h | 19 ++
8 files changed, 432 insertions(+), 1 deletion(-)
create mode 100644 tools/perf/Documentation/SDT-support.txt
create mode 100644 tools/perf/util/sdt.c
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists