From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754763AbbCPMpH (ORCPT ); Mon, 16 Mar 2015 08:45:07 -0400 Received: from mga11.intel.com ([192.55.52.93]:26474 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754592AbbCPMpB (ORCPT ); Mon, 16 Mar 2015 08:45:01 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,409,1422950400"; d="scan'208";a="467867113" From: Adrian Hunter To: Peter Zijlstra , Arnaldo Carvalho de Melo Cc: linux-kernel@vger.kernel.org, David Ahern , Frederic Weisbecker , Jiri Olsa , Namhyung Kim , Paul Mackerras , Stephane Eranian , Alexander Shishkin , Andi Kleen Subject: [PATCH V6 24/25] perf auxtrace: Add option to synthesize events for transactions Date: Mon, 16 Mar 2015 14:41:46 +0200 Message-Id: <1426509707-24961-25-git-send-email-adrian.hunter@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1426509707-24961-1-git-send-email-adrian.hunter@intel.com> References: <1426509707-24961-1-git-send-email-adrian.hunter@intel.com> Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add AUX area tracing option 'x' to synthesize events for transactions. This will be used by Intel PT to synthesize an event record for each TSX start, commit or abort. Signed-off-by: Adrian Hunter --- tools/perf/Documentation/perf-report.txt | 9 +++++---- tools/perf/Documentation/perf-script.txt | 9 +++++---- tools/perf/util/auxtrace.c | 5 ++++- tools/perf/util/auxtrace.h | 2 ++ 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt index fa6f36b..dc41c93 100644 --- a/tools/perf/Documentation/perf-report.txt +++ b/tools/perf/Documentation/perf-report.txt @@ -326,11 +326,12 @@ OPTIONS b synthesize branches events c synthesize branches events (calls only) r synthesize branches events (returns only) + x synthesize transactions events e synthesize error events d create a debug log - g synthesize a call chain for instructions events + g synthesize a call chain (use with i or x) - The default is all events i.e. the same as -Zibe + The default is all events i.e. the same as -Zibxe In addition, the period (default 100000) for instructions events can be specified in units of: @@ -341,8 +342,8 @@ OPTIONS us microseconds ns nanoseconds (default) - Also the call chain size (default 16, max. 1024) for instructions - events can be specified. + Also the call chain size (default 16, max. 1024) for instructions or + transactions events can be specified. To disable decoding entirely, use --no-itrace. diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt index 88da93a..b46f443c 100644 --- a/tools/perf/Documentation/perf-script.txt +++ b/tools/perf/Documentation/perf-script.txt @@ -223,11 +223,12 @@ OPTIONS b synthesize branches events c synthesize branches events (calls only) r synthesize branches events (returns only) + x synthesize transactions events e synthesize error events d create a debug log - g synthesize a call chain for instructions events + g synthesize a call chain (use with i or x) - The default is all events i.e. the same as -Zibe + The default is all events i.e. the same as -Zibxe In addition, the period (default 100000) for instructions events can be specified in units of: @@ -238,8 +239,8 @@ OPTIONS us microseconds ns nanoseconds (default) - Also the call chain size (default 16, max. 1024) for instructions - events can be specified. + Also the call chain size (default 16, max. 1024) for instructions or + transactions events can be specified. To disable decoding entirely, use --no-itrace. diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c index 5a95767..2308c6e 100644 --- a/tools/perf/util/auxtrace.c +++ b/tools/perf/util/auxtrace.c @@ -899,6 +899,7 @@ void itrace_synth_opts__set_default(struct itrace_synth_opts *synth_opts) { synth_opts->instructions = true; synth_opts->branches = true; + synth_opts->transactions = true; synth_opts->errors = true; synth_opts->period_type = PERF_ITRACE_DEFAULT_PERIOD_TYPE; synth_opts->period = PERF_ITRACE_DEFAULT_PERIOD; @@ -966,6 +967,9 @@ int itrace_parse_synth_opts(const struct option *opt, const char *str, case 'b': synth_opts->branches = true; break; + case 'x': + synth_opts->transactions = true; + break; case 'e': synth_opts->errors = true; break; @@ -981,7 +985,6 @@ int itrace_parse_synth_opts(const struct option *opt, const char *str, synth_opts->returns = true; break; case 'g': - synth_opts->instructions = true; synth_opts->callchain = true; synth_opts->callchain_sz = PERF_ITRACE_DEFAULT_CALLCHAIN_SZ; diff --git a/tools/perf/util/auxtrace.h b/tools/perf/util/auxtrace.h index 8441dee..f1137a5 100644 --- a/tools/perf/util/auxtrace.h +++ b/tools/perf/util/auxtrace.h @@ -54,6 +54,7 @@ enum itrace_period_type { * because 'perf inject' will write it out * @instructions: whether to synthesize 'instructions' events * @branches: whether to synthesize 'branches' events + * @transactions: whether to synthesize events for transactions * @errors: whether to synthesize decoder error events * @dont_decode: whether to skip decoding entirely * @log: write a decoding log @@ -69,6 +70,7 @@ struct itrace_synth_opts { bool inject; bool instructions; bool branches; + bool transactions; bool errors; bool dont_decode; bool log; -- 1.9.1