[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200717085301.GB528602@krava>
Date: Fri, 17 Jul 2020 10:53:01 +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,
anju@...ux.vnet.ibm.com, kan.liang@...ux.intel.com,
nasastry@...ibm.com
Subject: Re: [PATCH v3 1/5] perf/pmu-events/jevents: Add enum to store
aggregation like PerPkg
On Thu, Jul 16, 2020 at 03:12:12PM +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 perpkg/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 | 39 +++++++++++++++++++-----------
> tools/perf/pmu-events/jevents.h | 2 +-
> tools/perf/pmu-events/pmu-events.h | 6 ++++-
> tools/perf/tests/pmu-events.c | 8 +++---
> tools/perf/util/pmu.c | 6 ++---
> 5 files changed, 38 insertions(+), 23 deletions(-)
>
> diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c
> index fa86c5f997cc..b2f59f0af63d 100644
> --- a/tools/perf/pmu-events/jevents.c
> +++ b/tools/perf/pmu-events/jevents.c
> @@ -53,6 +53,17 @@
> int verbose;
> char *prog;
>
> +enum aggr_mode_class {
> + PerPkg = 1
> +};
> +
> +enum aggr_mode_class convert(const char *aggr_mode)
> +{
> + if (!strcmp(aggr_mode, "PerPkg"))
> + return PerPkg;
> + return -1;
> +}
I just noticed you define aggr_mode_class twice,
I think we should keep it just in pmu-events.h
like in change below (compiles for me)
thanks,
jirka
---
diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c
index e1c43f739083..2f48b783a64d 100644
--- a/tools/perf/pmu-events/jevents.c
+++ b/tools/perf/pmu-events/jevents.c
@@ -49,16 +49,11 @@
#include "jsmn.h"
#include "json.h"
#include "jevents.h"
+#include "pmu-events.h"
int verbose;
char *prog;
-enum aggr_mode_class {
- PerPkg = 1,
- PerChip,
- PerCore
-};
-
enum aggr_mode_class convert(const char *aggr_mode)
{
if (!strcmp(aggr_mode, "PerPkg"))
Powered by blists - more mailing lists