lkml.org 
[lkml]   [2013]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v0 55/71] perf report: Add Instruction Tracing support
Date
From: Adrian Hunter <adrian.hunter@intel.com>

Add support for decoding an Instruction Trace.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
tools/perf/Documentation/perf-report.txt | 21 +++++++++++++++++++++
tools/perf/builtin-report.c | 12 ++++++++++++
2 files changed, 33 insertions(+)

diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt
index 10a2798..0c10bfb 100644
--- a/tools/perf/Documentation/perf-report.txt
+++ b/tools/perf/Documentation/perf-report.txt
@@ -237,6 +237,27 @@ OPTIONS
Do not show entries which have an overhead under that percent.
(Default: 0).

+-Z::
+--itrace::
+ Options for decoding Instruction Tracing data. The options are:
+
+ i synthesize instructions events
+ b synthesize branches events
+ e synthesize error 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
+
+ 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 8cf8e66..97e3ee6 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>

@@ -768,6 +770,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;
@@ -790,6 +793,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_samples = true,
.ordering_requires_timestamps = true,
},
@@ -884,6 +891,9 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
OPT_BOOLEAN(0, "mem-mode", &report.mem_mode, "mem access profile"),
OPT_CALLBACK(0, "percent-limit", &report, "percent",
"Don't show entries under that percent", parse_percent_limit),
+ OPT_CALLBACK_OPTARG('Z', "itrace", &itrace_synth_opts, NULL, "opts",
+ "Instruction Tracing options",
+ itrace_parse_synth_opts),
OPT_END()
};
struct perf_data_file file = {
@@ -919,6 +929,8 @@ repeat:
if (session == NULL)
return -ENOMEM;

+ session->itrace_synth_opts = &itrace_synth_opts;
+
report.session = session;

has_br_stack = perf_header__has_feat(&session->header,
--
1.8.5.1


\
 
 \ /
  Last update: 2013-12-11 14:01    [W:0.436 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site