lkml.org 
[lkml]   [2015]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RFC V3 3/5] perf,tool: partial time support
On Wed, Jul 08, 2015 at 04:44:55AM -0400, kan.liang@intel.com wrote:
> From: Kan Liang <kan.liang@intel.com>
>

SNIP

> +
> + /*
> + * Event parsing doesn't check the availability
> + * Clear the bit which event parsing may be set.
> + * Let following code check and reset if available
> + *
> + * Also, the sample size may be caculated mistakenly,
> + * because event parsing may set the PERF_SAMPLE_TIME.
> + * Remove the size which add in perf_evsel__init
> + */
> + if (attr->sample_type & PERF_SAMPLE_TIME) {
> + attr->sample_type &= ~PERF_SAMPLE_TIME;
> + evsel->sample_size -= sizeof(u64);
> + }

why not use perf_evsel__reset_sample_bit?

> +
> perf_evsel__set_sample_bit(evsel, IP);
> perf_evsel__set_sample_bit(evsel, TID);
>
> @@ -705,14 +732,15 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts)
> /*
> * When the user explicitely disabled time don't force it here.
> */

SNIP

> diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
> index a71eeb2..9510047 100644
> --- a/tools/perf/util/parse-events.c
> +++ b/tools/perf/util/parse-events.c
> @@ -598,6 +598,13 @@ do { \
> * attr->branch_sample_type = term->val.num;
> */
> break;
> + case PARSE_EVENTS__TERM_TYPE_TIME:
> + CHECK_TYPE_VAL(NUM);
> + if (term->val.num > 1)
> + return -EINVAL;
> + if (term->val.num == 1)
> + attr->sample_type |= PERF_SAMPLE_TIME;

why not use perf_evsel__set_sample_bit?

> + break;
> case PARSE_EVENTS__TERM_TYPE_NAME:
> CHECK_TYPE_VAL(STR);
> break;

SNIP

jirka


\
 
 \ /
  Last update: 2015-07-14 09:01    [W:0.086 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site