From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934026AbbDWOJE (ORCPT ); Thu, 23 Apr 2015 10:09:04 -0400 Received: from mail.kernel.org ([198.145.29.136]:37795 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756002AbbDWOJB (ORCPT ); Thu, 23 Apr 2015 10:09:01 -0400 Date: Thu, 23 Apr 2015 11:08:56 -0300 From: Arnaldo Carvalho de Melo To: Adrian Hunter 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 Message-ID: <20150423140856.GC7881@kernel.org> 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> <55373E4D.9040408@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55373E4D.9040408@intel.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Wed, Apr 22, 2015 at 09:23:09AM +0300, Adrian Hunter escreveu: > 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 That comes later in the patchkit, right? I am ammending this patch to put a reference to these files, which ammeliorates the current situation, but people doing bisects will scratch their heads... - Arnaldo