From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423549AbdEYIJq (ORCPT ); Thu, 25 May 2017 04:09:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50746 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423468AbdEYIId (ORCPT ); Thu, 25 May 2017 04:08:33 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4315E80489 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jolsa@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 4315E80489 Date: Thu, 25 May 2017 10:08:26 +0200 From: Jiri Olsa To: David Carrillo-Cisneros Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Andi Kleen , Simon Que , Wang Nan , Jiri Olsa , He Kuang , Masami Hiramatsu , David Ahern , Namhyung Kim , Stephane Eranian , Paul Turner Subject: Re: [PATCH v2 11/13] perf header: change FEAT_OP* macros Message-ID: <20170525080826.GF14467@krava> References: <20170523074853.54892-1-davidcc@google.com> <20170523074853.54892-12-davidcc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170523074853.54892-12-davidcc@google.com> User-Agent: Mutt/1.8.0 (2017-02-23) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 25 May 2017 08:08:33 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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 > #include > #include > +#include > #include > #include > #include > @@ -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