/usr/share/systemtap/tapset
NameSizeModeActions
arm/-0755rm
arm64/-0755rm
bpf/-0755rm
dyninst/-0755rm
i386/-0755rm
ia64/-0755rm
linux/-0755rm
mips/-0755rm
powerpc/-0755rm
riscv/-0755rm
s390/-0755rm
x86_64/-0755rm
ansi.stp41780644editdlrm
argv.stp27210644editdlrm
choose_defined.stpm2080644editdlrm
container_of.stpm2350644editdlrm
context.stp61030644editdlrm
errno.stp91180644editdlrm
floatingpoint.stp69360644editdlrm
indent-default.stp590644editdlrm
indent.stp45900644editdlrm
init.stp2690644editdlrm
input.stp2630644editdlrm
java.stp13460644editdlrm
libperl5.26.3-64.stp13390644editdlrm
libpython2.7-64.stp5220644editdlrm
livepatch.stp30060644editdlrm
logging.stp41320644editdlrm
macros.stpm5620644editdlrm
null.stp170644editdlrm
offsetof.stpm1830644editdlrm
oneshot.stp380644editdlrm
pn.stp15880644editdlrm
print_stats.stpm17190644editdlrm
private30.stpm800644editdlrm
prometheus.stp1290644editdlrm
prometheus.stpm83800644editdlrm
python.stp4740644editdlrm
python2.stp294350644editdlrm
python3.stp366550644editdlrm
queue_stats.stp94870644editdlrm
random.stp4320644editdlrm
README3710644editdlrm
regex.stp41070644editdlrm
registers.stp110810644editdlrm
sizeof.stpm2120644editdlrm
speculative.stp17460644editdlrm
sreg_arch.stpm2630644editdlrm
stap_staticmarkers.stp96700644editdlrm
stopwatch.stp30630644editdlrm
string.stp75140644editdlrm
switchfile.stp6120644editdlrm
system.stp5930644editdlrm
this.stp1600644editdlrm
timers.stp9240644editdlrm
tls.stp80990644editdlrm
tokenize.stp21240644editdlrm
try_assign.stpm7680644editdlrm
type_defined.stpm3740644editdlrm
tzinfo.stp9300644editdlrm
uconversions-guru.stp60780644editdlrm
uconversions.stp366400644editdlrm
Edit: /usr/share/systemtap/tapset/stopwatch.stp (3063B)
// stopwatch tapset // Copyright (C) 2012 Red Hat Inc. // // This file is part of systemtap, and is free software. You can // redistribute it and/or modify it under the terms of the GNU General // Public License (GPL); either version 2, or (at your option) any // later version. @__private30 global _stopwatch_starttime, _stopwatch_acc /* * Description of the stopwatch states: * if (! name in _stopwatch_acc) {stopwatch doesn't exist} * if (_stopwatch_starttime[name] == 0 ) {stopwatch not running} * if (_stopwatch_starttime[name] != 0 ) {stopwatch running} */ /** * sfunction delete_stopwatch - Remove an existing stopwatch * @name: the stopwatch name * * Remove stopwatch @name. */ function delete_stopwatch (name:string) { delete _stopwatch_starttime[name]; delete _stopwatch_acc[name]; } /** * sfunction start_stopwatch - Start a stopwatch * @name: the stopwatch name * * Start stopwatch @name. * Creates stopwatch @name if it does not currently exist. */ function start_stopwatch (name:string) { stime = _stopwatch_starttime[name] if (stime == 0) _stopwatch_starttime[name] = gettimeofday_ns() /* make sure there is an entry in _stopwatch_acc */ _stopwatch_acc[name] = _stopwatch_acc[name] } /** * sfunction stop_stopwatch - Stop a stopwatch * @name: the stopwatch name * * Stop stopwatch @name. * Creates stopwatch @name if it does not currently exist. */ function stop_stopwatch (name:string) { stime = _stopwatch_starttime[name] if (stime != 0) delta = gettimeofday_ns() - stime else delta = 0 _stopwatch_starttime[name] = 0 _stopwatch_acc[name] = _stopwatch_acc[name] + delta } /** * sfunction read_stopwatch_ns - Reads the time in nanoseconds for a stopwatch * @name: stopwatch name * * Returns time in nanoseconds for stopwatch @name. * Creates stopwatch @name if it does not currently exist. */ function read_stopwatch_ns:long (name:string) { stime = _stopwatch_starttime[name] if (stime != 0) delta = gettimeofday_ns() - stime else delta = 0 _stopwatch_acc[name] = _stopwatch_acc[name] return (_stopwatch_acc[name] + delta) } /** * sfunction read_stopwatch_us - Reads the time in microseconds for a stopwatch * @name: stopwatch name * * Returns time in microseconds for stopwatch @name. * Creates stopwatch @name if it does not currently exist. */ function read_stopwatch_us:long (name:string) { return read_stopwatch_ns(name)/1000; } /** * sfunction read_stopwatch_ms - Reads the time in milliseconds for a stopwatch * @name: stopwatch name * * Returns time in milliseconds for stopwatch @name. * Creates stopwatch @name if it does not currently exist. */ function read_stopwatch_ms:long (name:string) { return read_stopwatch_ns(name)/1000000; } /** * sfunction read_stopwatch_s - Reads the time in seconds for a stopwatch * @name: stopwatch name * * Returns time in seconds for stopwatch @name. * Creates stopwatch @name if it does not currently exist. */ function read_stopwatch_s:long (name:string) { return read_stopwatch_ns(name)/1000000000; }