Skip to contentSkip to conversation

perf: Add 'perf sched' tool

tip:perfcounters/core tip-bot for Ingo Molnar 1 participant 1 message Sep 15, 2009 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  0a02ad9331dd4db56c29c60db2e99c4daaad8a48
Gitweb:     http://git.kernel.org/tip/0a02ad9331dd4db56c29c60db2e99c4daaad8a48
Author:     Ingo Molnar <[email protected]>
AuthorDate: Fri, 11 Sep 2009 12:12:54 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Sun, 13 Sep 2009 10:22:36 +0200

perf: Add 'perf sched' tool

This turn-key tool allows scheduler measurements to be conducted and the results be displayed numerically.

First baby step towards that goal: clone the new command off of perf trace.

Fix a few other details along the way:

- add (minimal) perf trace documentation

- reorder a few places

- list perf trace in the mainporcelain list as well as it's a very useful utility.

Cc: Peter Zijlstra <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
LKML-Reference: <new-submission>

---
 tools/perf/Documentation/perf-sched.txt |   25 +++
 tools/perf/Documentation/perf-trace.txt |   25 +++
 tools/perf/Makefile                     |    1 +
 tools/perf/builtin-sched.c              |  297 +++++++++++++++++++++++++++++++
 tools/perf/builtin.h                    |    5 +-
 tools/perf/command-list.txt             |    2 +
 tools/perf/perf.c                       |    1 +
 7 files changed, 354 insertions(+), 2 deletions(-)
tools/perf/Documentation/perf-sched.txt new file +25 -0
new file mode 100644
index 0000000..056320e
@@ -0,0 +1,25 @@
+perf-sched(1)
+==============
+
+NAME
+----
+perf-sched - Read perf.data (created by perf record) and display sched output
+
+SYNOPSIS
+--------
+[verse]
+'perf sched' [-i <file> | --input=file] symbol_name
+
+DESCRIPTION
+-----------
+This command reads the input file and displays the latencies recorded.
+
+OPTIONS
+-------
+-D::
+--dump-raw-trace=::
+        Display verbose dump of the sched data.
+
+SEE ALSO
+--------
+linkperf:perf-record[1]
tools/perf/Documentation/perf-trace.txt new file +25 -0
new file mode 100644
index 0000000..41ed753
@@ -0,0 +1,25 @@
+perf-trace(1)
+==============
+
+NAME
+----
+perf-trace - Read perf.data (created by perf record) and display trace output
+
+SYNOPSIS
+--------
+[verse]
+'perf trace' [-i <file> | --input=file] symbol_name
+
+DESCRIPTION
+-----------
+This command reads the input file and displays the trace recorded.
+
+OPTIONS
+-------
+-D::
+--dump-raw-trace=::
+        Display verbose dump of the trace data.
+
+SEE ALSO
+--------
+linkperf:perf-record[1]
tools/perf/Makefile +1 -0
index 9f8d207..2cb8cc3 100644
@@ -376,6 +376,7 @@ LIB_OBJS += util/trace-event-info.o
 
 BUILTIN_OBJS += builtin-annotate.o
 BUILTIN_OBJS += builtin-help.o
+BUILTIN_OBJS += builtin-sched.o
 BUILTIN_OBJS += builtin-list.o
 BUILTIN_OBJS += builtin-record.o
 BUILTIN_OBJS += builtin-report.o
tools/perf/builtin-sched.c new file +297 -0

297 lines not on this page · raw message

tools/perf/builtin.h +3 -2
index 3a63e41..b09cadb 100644
@@ -16,12 +16,13 @@ extern int check_pager_config(const char *cmd);
 
 extern int cmd_annotate(int argc, const char **argv, const char *prefix);
 extern int cmd_help(int argc, const char **argv, const char *prefix);
+extern int cmd_sched(int argc, const char **argv, const char *prefix);
+extern int cmd_list(int argc, const char **argv, const char *prefix);
 extern int cmd_record(int argc, const char **argv, const char *prefix);
 extern int cmd_report(int argc, const char **argv, const char *prefix);
 extern int cmd_stat(int argc, const char **argv, const char *prefix);
 extern int cmd_top(int argc, const char **argv, const char *prefix);
-extern int cmd_version(int argc, const char **argv, const char *prefix);
-extern int cmd_list(int argc, const char **argv, const char *prefix);
 extern int cmd_trace(int argc, const char **argv, const char *prefix);
+extern int cmd_version(int argc, const char **argv, const char *prefix);
 
 #endif
tools/perf/command-list.txt +2 -0
index eebce30..3133c74 100644
@@ -4,7 +4,9 @@
 #
 perf-annotate			mainporcelain common
 perf-list			mainporcelain common
+perf-sched			mainporcelain common
 perf-record			mainporcelain common
 perf-report			mainporcelain common
 perf-stat			mainporcelain common
 perf-top			mainporcelain common
+perf-trace			mainporcelain common
tools/perf/perf.c +1 -0
index fe4589d..c972d1c 100644
@@ -293,6 +293,7 @@ static void handle_internal_command(int argc, const char **argv)
 		{ "annotate", cmd_annotate, 0 },
 		{ "version", cmd_version, 0 },
 		{ "trace", cmd_trace, 0 },
+		{ "sched", cmd_sched, 0 },
 	};
 	unsigned int i;
 	static const char ext[] = STRIP_EXTENSION;