SystemTap for Android - patchset

Frank Ch. Eigler fche@redhat.com
Wed Jul 6 16:42:00 GMT 2016


Alexander Lochmann <alexander.lochmann@tu-dortmund.de> writes:

> [...]
> I chose the letters randomly. For me, it doesn't matter. I just need an
> argument to tell staprun to create a pid file. :)

Would it be enough for staprun to have that pid option?
That would mean the stap script would have to be compiled
through to -p4 only, then staprun invoked manually.

> Yeah, sure. Since I run stap on Android, I have a background service,
> which periodically checks if every single stap instance is still
> running. Yes, it might be possible having more than one stap script
> running. :) [...]

Since your background service is already custom, maybe a custom shell
script wrapper like this could serve your purposes without having to
change staprun/stap at all:

% cat pidwrapper
#! /bin/sh
pidfile="$1"; shift
program="$1"; shift
echo $$ > $pidfile
exec $program ${1+$@}  # exec to preserve $$ pid

and then you invoke staprun via:

% sh pidwrapper /path/to/this.pid staprun foo bar baz


- FChE



More information about the Systemtap mailing list