]> www.infradead.org Git - users/jedix/linux-maple.git/commit
dtrace: record SDT and perf probe types in a new ELF section
authorNick Alcock <nick.alcock@oracle.com>
Wed, 14 Sep 2016 01:10:06 +0000 (02:10 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Fri, 28 Oct 2016 12:45:44 +0000 (13:45 +0100)
commit243433293dc4bda8e67df4eadc9d74f4238ab7a3
treeaaf6b13546e208e5709864ea7c9a311bb1731952
parent0cfa93f7150627f850f2d5af2a5133ffb17fd07c
dtrace: record SDT and perf probe types in a new ELF section

Before now, the types specified in the SDT probe macros in
include/linux/sdt.h were simply thrown away: DTrace was never
informed of them, and instead got type information for SDT probes
from a hardwired list in the out-of-tree sdt module.

As a start to fixing this, export the SDT type information into
a new ELF section named _dtrace_sdt_args.  Both native SDT probes
and perf probes translated into SDT probes use the same section:
its format is a sequence of probe type strings, with individual
arguments separated by commas, each type string separated from the
next by a NUL:

type string, comma-separated\0
...

(This is the same format used by perf probe prototype declarations,
and is what you'd get if you removed the argument names from a DTrace
SDT probe specification.)

The only difference between SDT and perf probe type strings is that the
type string for perf probes is also used to define a tracing function,
so it includes argument names.  The SDT format has various other
extensions which do not affect this commit so will be described later.

The type strings in the section are in no particular order (it depends on the
order in the source code) and may contain duplicates, so to associate
each string with a probe, there is another section, _dtrace_sdt_names,
which is a simple null-terminated array (string table) of names, associated
1:1 with the type strings in the _dtrace_sdt_types section.

At this point in the patch series, nothing uses the newly-added sections.

Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
Acked-by: Kris Van Hees <kris.van.hees@oracle.com>
Orabug: 24661801
include/asm-generic/vmlinux.lds.h
include/linux/sdt.h
include/linux/tracepoint.h