Re: [PATCH 7/7] perf tools: add feature header record to pipe-mode

2017-05-18 Thread David Carrillo-Cisneros
On Thu, May 18, 2017 at 9:12 AM, Jiri Olsa wrote: > On Wed, May 17, 2017 at 09:16:02PM -0700, David Carrillo-Cisneros wrote: >> Add header record types to pipe-mode, reusing the functions >> used in file-mode and leveraging the new struct feat_fd. >> >> Add the perf_event__synthesize_feature event

Re: [PATCH 7/7] perf tools: add feature header record to pipe-mode

2017-05-18 Thread David Carrillo-Cisneros
On Thu, May 18, 2017 at 9:13 AM, Jiri Olsa wrote: > On Wed, May 17, 2017 at 09:16:02PM -0700, David Carrillo-Cisneros wrote: > > SNIP > >> >> @@ -2107,42 +2109,80 @@ struct feature_ops { >> int (*process)(struct feat_fd *fd, void *data); >> const char *name; >> bool full_only; >>

Re: [PATCH 7/7] perf tools: add feature header record to pipe-mode

2017-05-18 Thread David Carrillo-Cisneros
On Thu, May 18, 2017 at 9:13 AM, Jiri Olsa wrote: > On Wed, May 17, 2017 at 09:16:02PM -0700, David Carrillo-Cisneros wrote: > > SNIP > >> static const char *perf_ns__names[] = { >> diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h >> index db2de6413518..d404f50260f8 100644 >> --- a/

Re: [PATCH 7/7] perf tools: add feature header record to pipe-mode

2017-05-18 Thread Jiri Olsa
On Wed, May 17, 2017 at 09:16:02PM -0700, David Carrillo-Cisneros wrote: SNIP > > @@ -2107,42 +2109,80 @@ struct feature_ops { > int (*process)(struct feat_fd *fd, void *data); > const char *name; > bool full_only; > + int record_type; > }; > > -#define FEAT_OPA(n, func

Re: [PATCH 7/7] perf tools: add feature header record to pipe-mode

2017-05-18 Thread Jiri Olsa
On Wed, May 17, 2017 at 09:16:02PM -0700, David Carrillo-Cisneros wrote: SNIP > static const char *perf_ns__names[] = { > diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h > index db2de6413518..d404f50260f8 100644 > --- a/tools/perf/util/event.h > +++ b/tools/perf/util/event.h > @@

Re: [PATCH 7/7] perf tools: add feature header record to pipe-mode

2017-05-18 Thread Jiri Olsa
On Wed, May 17, 2017 at 09:16:02PM -0700, David Carrillo-Cisneros wrote: SNIP > - (*p)->offset = lseek(fd->fd, 0, SEEK_CUR); > + (*p)->offset = lseek(fdd->fd, 0, SEEK_CUR); > > - err = feat_ops[type].write(fd, evlist); > + err = feat_ops[type].wri

Re: [PATCH 7/7] perf tools: add feature header record to pipe-mode

2017-05-18 Thread Jiri Olsa
On Wed, May 17, 2017 at 09:16:02PM -0700, David Carrillo-Cisneros wrote: SNIP > struct header_print_data { > @@ -2218,33 +2258,33 @@ int perf_header__fprintf_info(struct perf_session > *session, FILE *fp, bool full) > return 0; > } > > -static int do_write_feat(struct feat_fd *fd, stru

Re: [PATCH 7/7] perf tools: add feature header record to pipe-mode

2017-05-18 Thread Jiri Olsa
On Wed, May 17, 2017 at 09:16:02PM -0700, David Carrillo-Cisneros wrote: > Add header record types to pipe-mode, reusing the functions > used in file-mode and leveraging the new struct feat_fd. > > Add the perf_event__synthesize_feature event call back to > process the new header records. > > Bef

[PATCH 7/7] perf tools: add feature header record to pipe-mode

2017-05-17 Thread David Carrillo-Cisneros
Add header record types to pipe-mode, reusing the functions used in file-mode and leveraging the new struct feat_fd. Add the perf_event__synthesize_feature event call back to process the new header records. Before this patch: $ perf record -o - -e cycles -c 10 sleep 1 | perf report --stdio