public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v4 0/3] perf/sdt : Support for SDT markers
@ 2014-08-28  3:42 Hemant Kumar
  2014-08-28  3:43 ` [PATCH v4 1/3] perf/sdt : Raw SDT parsing functions Hemant Kumar
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Hemant Kumar @ 2014-08-28  3:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: srikar, peterz, oleg, hegdevasant, mingo, anton, systemtap,
	namhyung, masami.hiramatsu.pt, aravinda, penberg

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

-- 

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-09-01  6:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-28  3:42 [PATCH v4 0/3] perf/sdt : Support for SDT markers Hemant Kumar
2014-08-28  3:43 ` [PATCH v4 1/3] perf/sdt : Raw SDT parsing functions Hemant Kumar
2014-08-29  7:22   ` Namhyung Kim
2014-08-28  3:50 ` [PATCH v4 2/3] perf/sdt : Support perf-list to print SDT events in a single file Hemant Kumar
2014-08-28 10:54   ` Masami Hiramatsu
2014-08-28 12:24     ` Hemant Kumar
2014-08-28  3:52 ` [PATCH v4 3/3] perf/sdt : Documentation for SDT events Hemant Kumar
2014-08-29  7:26   ` Namhyung Kim
2014-09-01  6:01     ` Masami Hiramatsu
2014-08-28 11:20 ` [PATCH v4 0/3] perf/sdt : Support for SDT markers Masami Hiramatsu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).