[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200831084404.GD287892@krava>
Date: Mon, 31 Aug 2020 10:44:04 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: Kajol Jain <kjain@...ux.ibm.com>
Cc: acme@...nel.org, peterz@...radead.org, mingo@...hat.com,
mark.rutland@....com, alexander.shishkin@...ux.intel.com,
pc@...ibm.com, namhyung@...nel.org, ak@...ux.intel.com,
yao.jin@...ux.intel.com, linux-kernel@...r.kernel.org,
linux-perf-users@...r.kernel.org, irogers@...gle.com,
maddy@...ux.ibm.com, ravi.bangoria@...ux.ibm.com,
john.garry@...wei.com
Subject: Re: [PATCH v6 3/5] perf jevents: Add support for parsing
perchip/percore events
On Thu, Aug 27, 2020 at 06:39:56PM +0530, Kajol Jain wrote:
> Initially, every time we want to add new terms like chip, core thread etc,
> we need to create corrsponding fields in pmu_events and event struct.
> This patch adds an enum called 'aggr_mode_class' which store all these
> aggregation like perchip/percore. It also adds new field 'aggr_mode'
> to capture these terms.
> Now, if user wants to add any new term, they just need to add it in
> the enum defined.
>
> Signed-off-by: Kajol Jain <kjain@...ux.ibm.com>
> ---
> tools/perf/pmu-events/jevents.c | 16 ++++++++++++++++
> tools/perf/pmu-events/pmu-events.h | 6 ++++++
> 2 files changed, 22 insertions(+)
>
> diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c
> index b205cd904a4f..f4ad2d403533 100644
> --- a/tools/perf/pmu-events/jevents.c
> +++ b/tools/perf/pmu-events/jevents.c
> @@ -48,6 +48,7 @@
> #include <linux/list.h>
> #include "jsmn.h"
> #include "json.h"
> +#include "pmu-events.h"
>
> int verbose;
> char *prog;
> @@ -60,6 +61,7 @@ struct json_event {
> char *pmu;
> char *unit;
> char *perpkg;
> + char *aggr_mode;
> char *metric_expr;
> char *metric_name;
> char *metric_group;
> @@ -74,6 +76,14 @@ struct json_event {
> (void)(&_min1 == &_min2); \
> _min1 < _min2 ? _min1 : _min2; })
> #endif
please add new line in here
> +enum aggr_mode_class convert(const char *aggr_mode)
> +{
> + if (!strcmp(aggr_mode, "PerCore"))
> + return PerCore;
> + else if (!strcmp(aggr_mode, "PerChip"))
> + return PerChip;
> + return -1;
should we display some warning in here?
thanks,
jirka
Powered by blists - more mailing lists