lkml.org 
[lkml]   [2011]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/4] perf: add scripts for profiling sleep times
Date
E.g.:
# ./perf script record sched-stat -- -e sched:sched_stat_sleep &
# ./foo;
# killall -SIGINT perf
./perf script report sched-stat

Signed-off-by: Andrew Vagin <avagin@openvz.org>
---
tools/perf/scripts/python/bin/sched-stat-record | 2 ++
tools/perf/scripts/python/bin/sched-stat-report | 6 ++++++
2 files changed, 8 insertions(+), 0 deletions(-)
create mode 100644 tools/perf/scripts/python/bin/sched-stat-record
create mode 100644 tools/perf/scripts/python/bin/sched-stat-report

diff --git a/tools/perf/scripts/python/bin/sched-stat-record b/tools/perf/scripts/python/bin/sched-stat-record
new file mode 100644
index 0000000..b9873d9
--- /dev/null
+++ b/tools/perf/scripts/python/bin/sched-stat-record
@@ -0,0 +1,2 @@
+#!/bin/bash
+perf record -ag -e sched:sched_switch --filter "prev_state == 1 || prev_state == 2" -e sched:sched_process_exit ${@/--/}
diff --git a/tools/perf/scripts/python/bin/sched-stat-report b/tools/perf/scripts/python/bin/sched-stat-report
new file mode 100644
index 0000000..d225a37
--- /dev/null
+++ b/tools/perf/scripts/python/bin/sched-stat-report
@@ -0,0 +1,6 @@
+#!/bin/bash
+# description: profiling sleep times
+# args: -e sched:sched_stat_[smth]
+perf inject -s -i perf.data -o perf.data.d || exit
+perf report -i perf.data.d || exit
+unlink perf.data.d
--
1.7.1


\
 
 \ /
  Last update: 2011-11-03 00:03    [W:0.118 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site