[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1420721547-26470-19-git-send-email-adrian.hunter@intel.com>
Date: Thu, 8 Jan 2015 14:52:22 +0200
From: Adrian Hunter <adrian.hunter@...el.com>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>,
linux-kernel@...r.kernel.org, David Ahern <dsahern@...il.com>,
Frederic Weisbecker <fweisbec@...il.com>,
Jiri Olsa <jolsa@...hat.com>,
Namhyung Kim <namhyung@...il.com>,
Paul Mackerras <paulus@...ba.org>,
Stephane Eranian <eranian@...gle.com>
Subject: [PATCH V4 18/23] perf report: Add Instruction Tracing support
Add support for decoding an Instruction Trace.
Signed-off-by: Adrian Hunter <adrian.hunter@...el.com>
---
tools/perf/Documentation/perf-report.txt | 28 ++++++++++++++++++++++++++++
tools/perf/builtin-report.c | 12 ++++++++++++
2 files changed, 40 insertions(+)
diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt
index dd7cccd..835d1e0 100644
--- a/tools/perf/Documentation/perf-report.txt
+++ b/tools/perf/Documentation/perf-report.txt
@@ -318,6 +318,34 @@ OPTIONS
--header-only::
Show only perf.data header (forces --stdio).
+-Z::
+--itrace::
+ Options for decoding Instruction Tracing data. The options are:
+
+ i synthesize instructions events
+ b synthesize branches events
+ c synthesize branches events (calls only)
+ r synthesize branches events (returns only)
+ e synthesize error events
+ d create a debug log
+ g synthesize a call chain for instructions events
+
+ The default is all events i.e. the same as -Zibe
+
+ In addition, the period (default 1000) for instructions events can be
+ specified in units of:
+
+ i instructions (default)
+ t ticks
+ ms milliseconds
+ us microseconds
+ ns nanoseconds
+
+ Also the call chain size (default 16, max. 1024) for instructions
+ events can be specified.
+
+ To disable decoding entirely, use --no-itrace.
+
SEE ALSO
--------
linkperf:perf-stat[1], linkperf:perf-annotate[1]
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 2f91094..1533dbd 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -36,6 +36,8 @@
#include "util/data.h"
#include "arch/common.h"
+#include "util/itrace.h"
+
#include <dlfcn.h>
#include <linux/bitmap.h>
@@ -583,6 +585,7 @@ parse_percent_limit(const struct option *opt, const char *str,
int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
{
struct perf_session *session;
+ struct itrace_synth_opts itrace_synth_opts = {0};
struct stat st;
bool has_br_stack = false;
int branch_mode = -1;
@@ -605,6 +608,10 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
.attr = perf_event__process_attr,
.tracing_data = perf_event__process_tracing_data,
.build_id = perf_event__process_build_id,
+ .id_index = perf_event__process_id_index,
+ .itrace_info = perf_event__process_itrace_info,
+ .itrace = perf_event__process_itrace,
+ .itrace_error = perf_event__count_itrace_error,
.ordered_events = true,
.ordering_requires_timestamps = true,
},
@@ -711,6 +718,9 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
"Don't show entries under that percent", parse_percent_limit),
OPT_CALLBACK(0, "percentage", NULL, "relative|absolute",
"how to display percentage of filtered entries", parse_filter_percentage),
+ OPT_CALLBACK_OPTARG('Z', "itrace", &itrace_synth_opts, NULL, "opts",
+ "Instruction Tracing options",
+ itrace_parse_synth_opts),
OPT_END()
};
struct perf_data_file file = {
@@ -755,6 +765,8 @@ repeat:
report.queue_size);
}
+ session->itrace_synth_opts = &itrace_synth_opts;
+
report.session = session;
has_br_stack = perf_header__has_feat(&session->header,
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists