diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2015-12-01 23:23:33 +0100 |
---|---|---|
committer | Lukas Slebodnik <lslebodn@redhat.com> | 2016-06-10 18:15:27 +0200 |
commit | 53f1b03f4e61ebe21df0c2fd05e09e0504fd8881 (patch) | |
tree | ae6b40b1cec430d7a5f1b233918fbc362b1baa4a /Makefile.am | |
parent | 6574e41a8d1c2af293df2f57916628344eaa3560 (diff) | |
download | sssd-53f1b03f4e61ebe21df0c2fd05e09e0504fd8881.tar.gz sssd-53f1b03f4e61ebe21df0c2fd05e09e0504fd8881.tar.xz sssd-53f1b03f4e61ebe21df0c2fd05e09e0504fd8881.zip |
UTIL: Add a PROBE macro into probes.h
The macros are inspired by very similar macros in libvirt code.
Adds a macro PROBE that can be used by SSSD developers to add systemtap
marks to code. These marks, when coupled with a location in a binary can
be in turn used to call probes. The mark can be called like this:
PROBE(PROBE_NAME, arguments)
This is cleaner than using the SSSD_$(PROBE_NAME) directly as it
directly shows that a probe is being called at that place.
If the systemtap tracing is disabled, they would expand to an empty macro. If
the systemtap tracing is enabled, the systemtap probe will be called.
The overhead of calling the probes is close to zero. As one of the
systemtap developers explained to me:
"""
STAP_PROBE() macros cost apprx. one nop in the executable, so apprx.
no cost at all. The more the merrier. Only when activated by a
stap script do we generally think of it like a microsecond of time.
"""
The probe arguments can be used in the probes to be printed or passed
on to functions. There was an issue in case a string argument was NULL.
This commit adds a helper macro to deal with NULL-strings as if they were
empty ("").
This file would be included by any source file that wants to call the
PROBE() macro.
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
Diffstat (limited to 'Makefile.am')
-rw-r--r-- | Makefile.am | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am index a504a4f61..eb4ea65fa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -682,6 +682,7 @@ dist_noinst_HEADERS = \ src/tests/cmocka/test_utils.h \ src/tools/common/sss_tools.h \ src/tools/common/sss_colondb.h \ + src/util/probes.h \ $(NULL) |