Messages in this thread | | | Date | Tue, 14 Jul 2015 08:54:58 +0200 | From | Jiri Olsa <> | Subject | Re: [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
| |