diff options
author | Harald Welte <laforge@osmocom.org> | 2020-09-26 11:51:32 +0200 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2021-02-03 13:55:40 +0000 |
commit | 433005c87c88912358bfd02d4b0d997b52b04013 (patch) | |
tree | d5f71f3faff20b53daf14a4975b33b3284babe1d /tapset | |
parent | dc43f7d3c73dc4cbe4e94668c635f056756f6d8a (diff) |
initial support for static userspace probes via systemtap
This adds a --enable-systemtap configure option, which will then
add static tracepoints to the generated libosmocore binary.
At this point, only two tracepoints are supported: log_start
and log_done. They can be used to trace the amount of time
a libosmocore-using application spends in potentiall blocking calls to
log to stderr or to files.
Related: OS#4311
Change-Id: I7e1ab664241deb524c9582cbd1bec31af46c747e
Diffstat (limited to 'tapset')
-rw-r--r-- | tapset/Makefile.am | 22 | ||||
-rw-r--r-- | tapset/libosmocore.stp | 18 |
2 files changed, 40 insertions, 0 deletions
diff --git a/tapset/Makefile.am b/tapset/Makefile.am new file mode 100644 index 00000000..a07a3b1d --- /dev/null +++ b/tapset/Makefile.am @@ -0,0 +1,22 @@ +.PHONY: clean-local install-data-hook uninstall-local + +EXTRA_DIST = libosmocore.stp +TAPSET_FILES = $(EXTRA_DIST) +TAPSET_INSTALL_DIR = $(DESTDIR)@ABS_TAPSET_DIR@ + +if ENABLE_SYSTEMTAP +all-local: $(TAPSET_FILES) + +clean-local: + +install-data-hook: + $(MKDIR_P) $(TAPSET_INSTALL_DIR) + $(INSTALL_DATA) $(TAPSET_FILES) $(TAPSET_INSTALL_DIR) + +uninstall-local: + @list='$(TAPSET_FILES)'; for p in $$list; do \ + echo " rm -f '$(TAPSET_INSTALL_DIR)/$$p'"; \ + rm -f "$(TAPSET_INSTALL_DIR)/$$p"; \ + done + +endif diff --git a/tapset/libosmocore.stp b/tapset/libosmocore.stp new file mode 100644 index 00000000..0ec3c423 --- /dev/null +++ b/tapset/libosmocore.stp @@ -0,0 +1,18 @@ +/* libosmocore tapset + * + * This file is part of libosmocore. + * + * Each probe defines the probe name and a full probestr which consist of the probe name and between + * brackets all argument names and values. + */ + +probe libosmocore_log_start = process("libosmocore").mark("log_start") +{ + count = $arg1; + probestr = sprintf("%s(count=%d), $$name, count); +} + +probe libosmocore_log_done = process("libosmocore").mark("log_done") +{ + probestr = sprintf("%s", $$name); +} |