summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.examples/profiling
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/systemtap.examples/profiling')
-rwxr-xr-xtestsuite/systemtap.examples/profiling/latencytap.stp10
1 files changed, 4 insertions, 6 deletions
diff --git a/testsuite/systemtap.examples/profiling/latencytap.stp b/testsuite/systemtap.examples/profiling/latencytap.stp
index d202ec81..7fdbbc4e 100755
--- a/testsuite/systemtap.examples/profiling/latencytap.stp
+++ b/testsuite/systemtap.examples/profiling/latencytap.stp
@@ -1,4 +1,4 @@
-#! /usr/bin/stap -g
+#! /usr/bin/env stap
# Record the time that a process has spent asleep, and in what function
@@ -7,8 +7,7 @@ global sleep_time
global process_names
global sleep_agg
-function _get_sleep_time:long(rq_param:long, p_param:long)
-%{
+function _get_sleep_time:long(rq_param:long, p_param:long) %{ /* pure */
struct rq *rq = (struct rq *)(unsigned long)THIS->rq_param;
struct task_struct *p = (struct task_struct *)(unsigned long)THIS->p_param;
struct sched_entity *se = &p->se;
@@ -19,9 +18,8 @@ function _get_sleep_time:long(rq_param:long, p_param:long)
THIS->__retvalue = delta;
%}
-# Get the backtrace from an arbitrary task
-function task_backtrace:string (task:long)
-%{
+# Get the backtrace from an arbitrary task
+function task_backtrace:string (task:long) %{ /* pure */
_stp_stack_snprint_tsk(THIS->__retvalue, MAXSTRINGLEN,
(struct task_struct *)(unsigned long)THIS->task, 0, MAXTRACE);
%}