Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1650282

Re: [PATCH v2 11/13] perf header: change FEAT_OP* macros

From Jiri Olsa <jolsa@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 11/13] perf header: change FEAT_OP* macros
Date 2017-05-25 10:20 +0200
Message-ID <tKW9X-5J4-19@gated-at.bofh.it> (permalink)
References <tKcTv-a4-3@gated-at.bofh.it> <tKcTx-a4-41@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, May 23, 2017 at 12:48:51AM -0700, David Carrillo-Cisneros wrote:
> There are three FEAT_OP* macros:
>   - FEAT_OPA: for features without process record.
>   - FEAT_OPP: for features with process record.
>   - FEAT_OPF: like FEAT_OPP but to show only if show_full_info flags
>     is set.
> 
> To add pipe-mode headers we need to specify whether a feature generates a
> corresponding sample record. This is an extra variation to the existing

nit, the sample word here is confusing, it's an aux event

> macros. To simplify, redefine macros instead so that:
>   - show_full_info is specified as an argument (to remove the
>   FEAT_OPF variation) and,
>   - it always sets "process" handler (to remove the FEAT_OPA variation).
>   Individual process handlers can be NULLed individually.
> 
> This allows to define two variations only:
>   - FEAT_OPR: has sample record.
>   - FEAT_OPN: doesn't has sample record.
> 
> Signed-off-by: David Carrillo-Cisneros <davidcc@google.com>
> ---
>  tools/perf/util/header.c | 72 +++++++++++++++++++++++++++++-------------------
>  1 file changed, 44 insertions(+), 28 deletions(-)
> 
> diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
> index b7704b30ed52..7aa84a02b9bd 100644
> --- a/tools/perf/util/header.c
> +++ b/tools/perf/util/header.c
> @@ -11,6 +11,7 @@
>  #include <linux/list.h>
>  #include <linux/kernel.h>
>  #include <linux/bitops.h>
> +#include <linux/stringify.h>
>  #include <sys/stat.h>
>  #include <sys/types.h>
>  #include <sys/utsname.h>
> @@ -2106,42 +2107,57 @@ struct feature_ops {
>  	int (*process)(struct feat_fd *fd, void *data);
>  	const char *name;
>  	bool full_only;
> +	bool has_record;

'synthesize' might be better choice

jirka

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 00/13] perf tool: add meta-data header support for pipe-mode David Carrillo-Cisneros <davidcc@google.com> - 2017-05-23 10:00 +0200
  [PATCH v2 09/13] perf header: use struct feat_fd in read header records David Carrillo-Cisneros <davidcc@google.com> - 2017-05-23 10:00 +0200
  [PATCH v2 12/13] perf tool: add show_feature_header to perf_tool David Carrillo-Cisneros <davidcc@google.com> - 2017-05-23 10:00 +0200
  [PATCH v2 06/13] perf header: add struct feat_fd for write David Carrillo-Cisneros <davidcc@google.com> - 2017-05-23 10:00 +0200
    Re: [PATCH v2 06/13] perf header: add struct feat_fd for write Jiri Olsa <jolsa@redhat.com> - 2017-05-25 10:10 +0200
      Re: [PATCH v2 06/13] perf header: add struct feat_fd for write David Carrillo-Cisneros <davidcc@google.com> - 2017-06-05 04:00 +0200
  [PATCH v2 03/13] perf header: fail on write_padded error David Carrillo-Cisneros <davidcc@google.com> - 2017-05-23 10:00 +0200
  [PATCH v2 11/13] perf header: change FEAT_OP* macros David Carrillo-Cisneros <davidcc@google.com> - 2017-05-23 10:00 +0200
    Re: [PATCH v2 11/13] perf header: change FEAT_OP* macros Jiri Olsa <jolsa@redhat.com> - 2017-05-25 10:10 +0200
    Re: [PATCH v2 11/13] perf header: change FEAT_OP* macros Jiri Olsa <jolsa@redhat.com> - 2017-05-25 10:20 +0200
      Re: [PATCH v2 11/13] perf header: change FEAT_OP* macros David Carrillo-Cisneros <davidcc@google.com> - 2017-06-05 04:20 +0200
  [PATCH v2 01/13] perf header: encapsulate read and swap David Carrillo-Cisneros <davidcc@google.com> - 2017-05-23 10:00 +0200
    Re: [PATCH v2 01/13] perf header: encapsulate read and swap Namhyung Kim <namhyung@kernel.org> - 2017-05-24 17:40 +0200
      Re: [PATCH v2 01/13] perf header: encapsulate read and swap David Carrillo-Cisneros <davidcc@google.com> - 2017-06-05 01:20 +0200
    Re: [PATCH v2 01/13] perf header: encapsulate read and swap Jiri Olsa <jolsa@redhat.com> - 2017-05-25 10:10 +0200
      Re: [PATCH v2 01/13] perf header: encapsulate read and swap David Carrillo-Cisneros <davidcc@google.com> - 2017-06-05 01:30 +0200
  [PATCH v2 05/13] perf header: revamp do_write David Carrillo-Cisneros <davidcc@google.com> - 2017-05-23 10:00 +0200
    Re: [PATCH v2 05/13] perf header: revamp do_write Jiri Olsa <jolsa@redhat.com> - 2017-05-25 10:20 +0200
      Re: [PATCH v2 05/13] perf header: revamp do_write David Carrillo-Cisneros <davidcc@google.com> - 2017-06-05 04:30 +0200

csiph-web