Add --userspace-probe kernel event type
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Fri, 29 Jun 2018 19:22:36 +0000 (15:22 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 24 Aug 2018 20:06:50 +0000 (16:06 -0400)
This commit wires up all the elements necessary to use the
userspace-probe feature.

This event type is defined by the user with --userspace-probe option. At
the moment, probing location can be specified by the user using two
location types: ELF function and STD probe.

It's important to note that userspace-probes are traced by the kernel
tracer and the generated events will thus be recorded in the kernel
trace. This is due to the fact that this feature uses the uprobe kernel
interface to instrument binaries. A root session daemon is needed to
load the kernel modules necessary to use this feature.

To ensure that the file pointed by the provided path does not change
while processing the user command, we use a fd-passing scheme. It
consist of calling open of the executable path early on in the
enable-event command and passing that file descriptor to the sessiond
for ELF parsing and the kernel to do the instrumentation. This ensures
that the inode backing that file is not reused for another file in the
case of a file deletion-and-reuse race.

Command syntax:
* The syntax to enable an ELF function userspace probe is the following:
  `--userspace-probe=elf:/path/to/executable:my_target_symbol`

  Omitting the first element of the colon-separated list would also work
  as the ELF function location is the default location type.

  Here are two equivalent usage examples of this location type:
    lttng enable-enable --kernel --userspace-probe=/path/to/executable:my_symbol event_name
    lttng enable-enable --kernel --userspace-probe=elf:/path/to/executable:my_symbol event_name

* SDT probes are DTrace-style tracepoint distributed in multiple
  libraries and applications. This implementation supports tracing of
  SDT probes that are NOT guarded by semaphore.

  The syntax to enable an SDT tracepoint userspace probe is the following:
  `--userspace-probe=sdt:/path/to/executable:provider:probe`
  Here is an usage example:
    lttng enable-enable --kernel --userspace-probe=sdt:/path/to/executable:provider:probe event_name

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>

No differences found
This page took 0.027447 seconds and 5 git commands to generate.