Re: [PATCH RFC V5 2/4] perf,tool: per-event time support

2015-07-21 Thread Jiri Olsa
On Tue, Jul 21, 2015 at 03:39:17AM +, Liang, Kan wrote: SNIP > > + case PERF_EVSEL__CONFIG_TERM_PERIOD: > > + attr->sample_period = term->val.period; > > + default: > > + break; > > + } > > + } > > +} > > + > > /* > > *

Re: [PATCH RFC V5 2/4] perf,tool: per-event time support

2015-07-21 Thread Jiri Olsa
On Tue, Jul 21, 2015 at 11:45:01PM +0900, Namhyung Kim wrote: SNIP > > > > > > [jolsa@krava perf]$ ./perf record -e 'cpu/instructions,period=2/' -c > > > 1000 sleep 1 [ perf record: Woken up 1 times to write data ] /proc/kcore > > > requires CAP_SYS_RAWIO capability to access. > > > [ perf

Re: [PATCH RFC V5 2/4] perf,tool: per-event time support

2015-07-21 Thread Namhyung Kim
Hi, On Tue, Jul 21, 2015 at 03:39:17AM +, Liang, Kan wrote: > > On Mon, Jul 20, 2015 at 03:04:20PM +, Liang, Kan wrote: > > > > SNIP > > > > > break; > > > + case PARSE_EVENTS__TERM_TYPE_TIME: > > > + if (time_set) > > > + *time_set = true; > > > +

Re: [PATCH RFC V5 2/4] perf,tool: per-event time support

2015-07-21 Thread Namhyung Kim
Hi, On Tue, Jul 21, 2015 at 03:39:17AM +, Liang, Kan wrote: On Mon, Jul 20, 2015 at 03:04:20PM +, Liang, Kan wrote: SNIP break; + case PARSE_EVENTS__TERM_TYPE_TIME: + if (time_set) + *time_set = true; +

Re: [PATCH RFC V5 2/4] perf,tool: per-event time support

2015-07-21 Thread Jiri Olsa
On Tue, Jul 21, 2015 at 11:45:01PM +0900, Namhyung Kim wrote: SNIP [jolsa@krava perf]$ ./perf record -e 'cpu/instructions,period=2/' -c 1000 sleep 1 [ perf record: Woken up 1 times to write data ] /proc/kcore requires CAP_SYS_RAWIO capability to access. [ perf record:

Re: [PATCH RFC V5 2/4] perf,tool: per-event time support

2015-07-21 Thread Jiri Olsa
On Tue, Jul 21, 2015 at 03:39:17AM +, Liang, Kan wrote: SNIP + case PERF_EVSEL__CONFIG_TERM_PERIOD: + attr-sample_period = term-val.period; + default: + break; + } + } +} + /* * The

RE: [PATCH RFC V5 2/4] perf,tool: per-event time support

2015-07-20 Thread Liang, Kan
> On Mon, Jul 20, 2015 at 03:04:20PM +, Liang, Kan wrote: > > SNIP > > > break; > > + case PARSE_EVENTS__TERM_TYPE_TIME: > > + if (time_set) > > + *time_set = true; > > + CHECK_TYPE_VAL(NUM); > > + if (term->val.num > 1) > > +

Re: [PATCH RFC V5 2/4] perf,tool: per-event time support

2015-07-20 Thread Jiri Olsa
On Mon, Jul 20, 2015 at 03:04:20PM +, Liang, Kan wrote: SNIP > break; > + case PARSE_EVENTS__TERM_TYPE_TIME: > + if (time_set) > + *time_set = true; > + CHECK_TYPE_VAL(NUM); > + if (term->val.num > 1) > +

RE: [PATCH RFC V5 2/4] perf,tool: per-event time support

2015-07-20 Thread Liang, Kan
> > > [jolsa@krava perf]$ ./perf record -e 'cpu/cpu- > cycles/,cpu/instructions,time/' kill > > > ... > > > [jolsa@krava perf]$ ./perf evlist -v > > > cpu/cpu-cycles/: type: 4, size: 112, config: 0x3c, { sample_period, > > > sample_freq }: 4000, sample_type: IP|TID|PERIOD|IDENTIFIER, > > >

RE: [PATCH RFC V5 2/4] perf,tool: per-event time support

2015-07-20 Thread Liang, Kan
[jolsa@krava perf]$ ./perf record -e 'cpu/cpu- cycles/,cpu/instructions,time/' kill ... [jolsa@krava perf]$ ./perf evlist -v cpu/cpu-cycles/: type: 4, size: 112, config: 0x3c, { sample_period, sample_freq }: 4000, sample_type: IP|TID|PERIOD|IDENTIFIER, read_format: ID,

Re: [PATCH RFC V5 2/4] perf,tool: per-event time support

2015-07-20 Thread Jiri Olsa
On Mon, Jul 20, 2015 at 03:04:20PM +, Liang, Kan wrote: SNIP break; + case PARSE_EVENTS__TERM_TYPE_TIME: + if (time_set) + *time_set = true; + CHECK_TYPE_VAL(NUM); + if (term-val.num 1) +

RE: [PATCH RFC V5 2/4] perf,tool: per-event time support

2015-07-20 Thread Liang, Kan
On Mon, Jul 20, 2015 at 03:04:20PM +, Liang, Kan wrote: SNIP break; + case PARSE_EVENTS__TERM_TYPE_TIME: + if (time_set) + *time_set = true; + CHECK_TYPE_VAL(NUM); + if (term-val.num 1) +

Re: [PATCH RFC V5 2/4] perf,tool: per-event time support

2015-07-19 Thread Jiri Olsa
On Sun, Jul 19, 2015 at 12:21:28PM +0900, Namhyung Kim wrote: SNIP > > > > [jolsa@krava perf]$ ./perf record -e > > 'cpu/cpu-cycles/,cpu/instructions,time/' kill > > ... > > [jolsa@krava perf]$ ./perf evlist -v > > cpu/cpu-cycles/: type: 4, size: 112, config: 0x3c, { sample_period, > >

Re: [PATCH RFC V5 2/4] perf,tool: per-event time support

2015-07-19 Thread Jiri Olsa
On Sun, Jul 19, 2015 at 12:21:28PM +0900, Namhyung Kim wrote: SNIP [jolsa@krava perf]$ ./perf record -e 'cpu/cpu-cycles/,cpu/instructions,time/' kill ... [jolsa@krava perf]$ ./perf evlist -v cpu/cpu-cycles/: type: 4, size: 112, config: 0x3c, { sample_period, sample_freq }:

Re: [PATCH RFC V5 2/4] perf,tool: per-event time support

2015-07-18 Thread Namhyung Kim
Hi Jiri, On Sat, Jul 18, 2015 at 02:45:47PM +0200, Jiri Olsa wrote: > On Fri, Jul 17, 2015 at 07:30:53AM -0400, kan.li...@intel.com wrote: > > SNIP > > > diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c > > index a71eeb2..c9981df 100644 > > ---

Re: [PATCH RFC V5 2/4] perf,tool: per-event time support

2015-07-18 Thread Jiri Olsa
On Fri, Jul 17, 2015 at 07:30:53AM -0400, kan.li...@intel.com wrote: SNIP > diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c > index a71eeb2..c9981df 100644 > --- a/tools/perf/util/parse-events.c > +++ b/tools/perf/util/parse-events.c > @@ -25,6 +25,9 @@ > #ifdef

Re: [PATCH RFC V5 2/4] perf,tool: per-event time support

2015-07-18 Thread Jiri Olsa
On Fri, Jul 17, 2015 at 07:30:53AM -0400, kan.li...@intel.com wrote: SNIP diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index a71eeb2..c9981df 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -25,6 +25,9 @@ #ifdef

Re: [PATCH RFC V5 2/4] perf,tool: per-event time support

2015-07-18 Thread Namhyung Kim
Hi Jiri, On Sat, Jul 18, 2015 at 02:45:47PM +0200, Jiri Olsa wrote: On Fri, Jul 17, 2015 at 07:30:53AM -0400, kan.li...@intel.com wrote: SNIP diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index a71eeb2..c9981df 100644 --- a/tools/perf/util/parse-events.c

[PATCH RFC V5 2/4] perf,tool: per-event time support

2015-07-17 Thread kan . liang
From: Kan Liang This patchkit adds the ability to turn off time stamps per event. One usable case of partial time is to work with per-event callgraph to enable "PEBS threshold > 1" (https://lkml.org/lkml/2015/5/10/196), which can significantly reduce the sampling overhead. The event samples with

[PATCH RFC V5 2/4] perf,tool: per-event time support

2015-07-17 Thread kan . liang
From: Kan Liang kan.li...@intel.com This patchkit adds the ability to turn off time stamps per event. One usable case of partial time is to work with per-event callgraph to enable PEBS threshold 1 (https://lkml.org/lkml/2015/5/10/196), which can significantly reduce the sampling overhead. The