lkml.org 
[lkml]   [2015]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V8 11/25] perf auxtrace: Fix period type 'i' not working
Em Fri, Jul 17, 2015 at 07:33:46PM +0300, Adrian Hunter escreveu:
> PERF_ITRACE_PERIOD_INSTRUCTIONS is zero so it
> got overwritten by the default period type.
> Fix by checking if the period type was set
> rather than if the value was zero when applying
> the default.

Applied

> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> ---
> tools/perf/util/auxtrace.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c
> index 3f3b40fa87c8..4ec3acf6fabb 100644
> --- a/tools/perf/util/auxtrace.c
> +++ b/tools/perf/util/auxtrace.c
> @@ -949,6 +949,7 @@ int itrace_parse_synth_opts(const struct option *opt, const char *str,
> struct itrace_synth_opts *synth_opts = opt->value;
> const char *p;
> char *endptr;
> + bool period_type_set = false;
>
> synth_opts->set = true;
>
> @@ -977,10 +978,12 @@ int itrace_parse_synth_opts(const struct option *opt, const char *str,
> case 'i':
> synth_opts->period_type =
> PERF_ITRACE_PERIOD_INSTRUCTIONS;
> + period_type_set = true;
> break;
> case 't':
> synth_opts->period_type =
> PERF_ITRACE_PERIOD_TICKS;
> + period_type_set = true;
> break;
> case 'm':
> synth_opts->period *= 1000;
> @@ -993,6 +996,7 @@ int itrace_parse_synth_opts(const struct option *opt, const char *str,
> goto out_err;
> synth_opts->period_type =
> PERF_ITRACE_PERIOD_NANOSECS;
> + period_type_set = true;
> break;
> case '\0':
> goto out;
> @@ -1046,7 +1050,7 @@ int itrace_parse_synth_opts(const struct option *opt, const char *str,
> }
> out:
> if (synth_opts->instructions) {
> - if (!synth_opts->period_type)
> + if (!period_type_set)
> synth_opts->period_type =
> PERF_ITRACE_DEFAULT_PERIOD_TYPE;
> if (!synth_opts->period)
> --
> 1.9.1


\
 
 \ /
  Last update: 2015-08-07 04:21    [W:0.925 / U:0.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site