From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932677AbbDVGZX (ORCPT ); Wed, 22 Apr 2015 02:25:23 -0400 Received: from mga14.intel.com ([192.55.52.115]:32076 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932476AbbDVGZT (ORCPT ); Wed, 22 Apr 2015 02:25:19 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,622,1422950400"; d="scan'208";a="717286743" Message-ID: <55373E4D.9040408@intel.com> Date: Wed, 22 Apr 2015 09:23:09 +0300 From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Arnaldo Carvalho de Melo CC: Peter Zijlstra , linux-kernel@vger.kernel.org, David Ahern , Frederic Weisbecker , Jiri Olsa , Namhyung Kim , Stephane Eranian Subject: Re: [PATCH 09/44] perf session: Add instruction tracing options References: <1428594864-29309-1-git-send-email-adrian.hunter@intel.com> <1428594864-29309-10-git-send-email-adrian.hunter@intel.com> <20150421145038.GD11111@kernel.org> In-Reply-To: <20150421145038.GD11111@kernel.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21/04/15 17:50, Arnaldo Carvalho de Melo wrote: > Em Thu, Apr 09, 2015 at 06:53:49PM +0300, Adrian Hunter escreveu: > >> It is assumed that AUX area decoding will synthesize events for >> consumption by other tools. At this time, the main use of AUX area >> tracing will be to capture instruction trace (aka processor trace) >> data. The nature of instruction tracing suggests the initial >> inclusion of options for "instructions" and "branches" events, but >> more could be added as needed. > >> +++ b/tools/perf/util/auxtrace.c >> @@ -37,6 +37,7 @@ >> >> #include "event.h" >> #include "debug.h" >> +#include "parse-options.h" >> >> int auxtrace_mmap__mmap(struct auxtrace_mmap *mm, >> struct auxtrace_mmap_params *mp, >> @@ -200,6 +201,136 @@ out_free: >> return err; >> } >> >> +#define PERF_ITRACE_DEFAULT_PERIOD_TYPE PERF_ITRACE_PERIOD_NANOSECS >> +#define PERF_ITRACE_DEFAULT_PERIOD 100000 >> +#define PERF_ITRACE_DEFAULT_CALLCHAIN_SZ 16 >> +#define PERF_ITRACE_MAX_CALLCHAIN_SZ 1024 >> + >> +void itrace_synth_opts__set_default(struct itrace_synth_opts *synth_opts) >> +{ >> + synth_opts->instructions = true; >> + synth_opts->branches = true; >> + synth_opts->errors = true; >> + synth_opts->period_type = PERF_ITRACE_DEFAULT_PERIOD_TYPE; >> + synth_opts->period = PERF_ITRACE_DEFAULT_PERIOD; >> + synth_opts->callchain_sz = PERF_ITRACE_DEFAULT_CALLCHAIN_SZ; >> +} >> + >> +int itrace_parse_synth_opts(const struct option *opt, const char *str, >> + int unset) >> +{ >> + struct itrace_synth_opts *synth_opts = opt->value; >> + const char *p; >> + char *endptr; >> + >> + synth_opts->set = true; >> + >> + if (unset) { >> + synth_opts->dont_decode = true; >> + return 0; >> + } >> + >> + if (!str) { >> + itrace_synth_opts__set_default(synth_opts); >> + return 0; >> + } >> + >> + for (p = str; *p;) { >> + switch (*p++) { >> + case 'i': >> + synth_opts->instructions = true; > > Is this documented anywhere? I.e. examples for setting up this synth > ops? They are documented for each tool that uses them: Documentation/perf-script.txt Documentation/perf-record.txt and also in: Documentation/intel-pt.txt