diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-27 14:05:02 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-27 14:05:02 -0700 |
commit | 365aa51e11cc537ac39a96f765ad8e7511aa93ff (patch) | |
tree | f47c7455d06be57bb63835f53bed6c2df1bed0a7 /drivers/staging/ktap/scripts/basic/function_time.kp | |
parent | 9908b4f32f91aafa86239dd092e9e5540e8615e0 (diff) |
staging: ktap: remove code from tree
ktap should be merged through the "proper" place in the kernel tree, in
the perf tool, not as a stand-alone kernel module in staging. So remove
it from here for now so that it can be merged correctly later.
Reported-by: Ingo Molnar <mingo@kernel.org>
Cc: Jovi Zhangwei <jovi.zhangwei@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/ktap/scripts/basic/function_time.kp')
-rw-r--r-- | drivers/staging/ktap/scripts/basic/function_time.kp | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/drivers/staging/ktap/scripts/basic/function_time.kp b/drivers/staging/ktap/scripts/basic/function_time.kp deleted file mode 100644 index e7859a396d95..000000000000 --- a/drivers/staging/ktap/scripts/basic/function_time.kp +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env ktap - -#Demo for thread-local variable -# -#Note this kind of function time tracing already handled concurrent issue, -#but not aware on the recursion problem, user need to aware this limitation, -#so don't use this script to trace function which could be called recursive. - -self = {} -count_max = 0 -count_min = 0 -count_num = 0 -total_time = 0 - -printf("measure time(us) of function vfs_read\n"); - -trace probe:vfs_read { - if (execname() == "ktap") { - return - } - - self[tid()] = gettimeofday_us() -} - -trace probe:vfs_read%return { - if (execname() == "ktap") { - return - } - - if (self[tid()] == nil) { - return - } - - local durtion = gettimeofday_us() - self[tid()] - if (durtion > count_max) { - count_max = durtion - } - local min = count_min - if (min == 0 || durtion < min) { - count_min = durtion - } - - count_num = count_num + 1 - total_time = total_time + durtion - - self[tid()] = nil -} - -trace_end { - printf("avg\tmax\tmin\n"); - printf("-------------------\n") - - printf("%d\t%d\t%d\n", total_time/count_num, - count_max, count_min) -} - - |