Re: [PATCH v13 12/14] perf, tools: Add support for event list topics

2015-06-03 Thread Jiri Olsa
On Tue, Jun 02, 2015 at 12:16:41PM -0700, Sukadev Bhattiprolu wrote:

SNIP

[Speculative and retired macro-conditional branches]
   br_inst_exec.all_direct_jmp
[Speculative and retired macro-unconditional branches excluding calls 
 and indirects]
   br_inst_exec.all_direct_near_call
[Speculative and retired direct near calls]
   br_inst_exec.all_indirect_jump_non_call_ret
 
 Signed-off-by: Andi Kleen a...@linux.intel.com
 Signed-off-by: Sukadev Bhattiprolu suka...@linux.vnet.ibm.com
 
 Changelog[v2]
   Dropped an unnecessary patch before this and fixed resulting
   conflicts in tools/perf/util/pmu.c
 ---
  tools/perf/pmu-events/jevents.c| 16 +++-
  tools/perf/pmu-events/jevents.h|  3 ++-
  tools/perf/pmu-events/pmu-events.h |  1 +
  tools/perf/util/pmu.c  | 34 --
  tools/perf/util/pmu.h  |  1 +
  5 files changed, 39 insertions(+), 16 deletions(-)

please split at least the jevents Topic parsing from the rest
idelay also the alias update and the display change

jirka
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v13 12/14] perf, tools: Add support for event list topics

2015-06-03 Thread Jiri Olsa
On Wed, Jun 03, 2015 at 05:57:33AM -0700, Andi Kleen wrote:
  please split at least the jevents Topic parsing from the rest
  idelay also the alias update and the display change
 
 What's the point of all these splits? It's already one logical unit,
 not too large, and is bisectable.

splitting the patch in logical pieces helps review and distro
backporting 

You changed the parsing tool and perf alias code that uses
the new output. IMO it's separate enough to be placed into
separate patches.

I believe the review would have been easier for me if those changes
were separate, also easing my job when backporting this change later
into the distro

jirka
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v13 12/14] perf, tools: Add support for event list topics

2015-06-03 Thread Andi Kleen
 please split at least the jevents Topic parsing from the rest
 idelay also the alias update and the display change

What's the point of all these splits? It's already one logical unit,
not too large, and is bisectable.

-andi

-- 
a...@linux.intel.com -- Speaking for myself only
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v13 12/14] perf, tools: Add support for event list topics

2015-06-03 Thread Arnaldo Carvalho de Melo
Em Wed, Jun 03, 2015 at 05:57:33AM -0700, Andi Kleen escreveu:
  please split at least the jevents Topic parsing from the rest
  idelay also the alias update and the display change
 
 What's the point of all these splits? It's already one logical unit,
 not too large, and is bisectable.

Eases review, improves bisectability, and its a reasonable request from
a reviewer/maintainer that has to look at an evergrowing number of patch
flows.

- Arnaldo
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v13 12/14] perf, tools: Add support for event list topics

2015-06-02 Thread Sukadev Bhattiprolu
Sukadev Bhattiprolu [suka...@linux.vnet.ibm.com] wrote:
| From: Andi Kleen a...@linux.intel.com
| 
| Add support to group the output of perf list by the Topic field
| in the JSON file.

[PATCH 9/14] has been dropped from this set. This alters the current,
patch [PATCH 12/14], slightly, which is included below.

The branch 'json-v13.1' on github has the updated set of patches:

https://github.com/sukadev/linux/tree/json-v13.1

From 0d8fe0d46423ee1e2dcf7d92014b693a3ab14086 Mon Sep 17 00:00:00 2001
From: Andi Kleen a...@linux.intel.com
Date: Sun, 31 May 2015 21:19:20 -0400
Subject: [PATCH 12/14] perf, tools: Add support for event list topics

Add support to group the output of perf list by the Topic field
in the JSON file.

Example output:

% perf list
...
Cache:
  l1d.replacement
   [L1D data line replacements]
  l1d_pend_miss.pending
   [L1D miss oustandings duration in cycles]
  l1d_pend_miss.pending_cycles
   [Cycles with L1D load Misses outstanding]
  l2_l1d_wb_rqsts.all
   [Not rejected writebacks from L1D to L2 cache lines in any state]
  l2_l1d_wb_rqsts.hit_e
   [Not rejected writebacks from L1D to L2 cache lines in E state]
  l2_l1d_wb_rqsts.hit_m
   [Not rejected writebacks from L1D to L2 cache lines in M state]

...
Pipeline:
  arith.fpu_div
   [Divide operations executed]
  arith.fpu_div_active
   [Cycles when divider is busy executing divide operations]
  baclears.any
   [Counts the total number when the front end is resteered, mainly when 
the BPU cannot provide a correct prediction and this is corrected by
other branch handling mechanisms at the front end]
  br_inst_exec.all_branches
   [Speculative and retired branches]
  br_inst_exec.all_conditional
   [Speculative and retired macro-conditional branches]
  br_inst_exec.all_direct_jmp
   [Speculative and retired macro-unconditional branches excluding calls 
and indirects]
  br_inst_exec.all_direct_near_call
   [Speculative and retired direct near calls]
  br_inst_exec.all_indirect_jump_non_call_ret

Signed-off-by: Andi Kleen a...@linux.intel.com
Signed-off-by: Sukadev Bhattiprolu suka...@linux.vnet.ibm.com

Changelog[v2]
Dropped an unnecessary patch before this and fixed resulting
conflicts in tools/perf/util/pmu.c
---
 tools/perf/pmu-events/jevents.c| 16 +++-
 tools/perf/pmu-events/jevents.h|  3 ++-
 tools/perf/pmu-events/pmu-events.h |  1 +
 tools/perf/util/pmu.c  | 34 --
 tools/perf/util/pmu.h  |  1 +
 5 files changed, 39 insertions(+), 16 deletions(-)

diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c
index 8990d71..14707fb 100644
--- a/tools/perf/pmu-events/jevents.c
+++ b/tools/perf/pmu-events/jevents.c
@@ -203,7 +203,7 @@ static void print_events_table_prefix(FILE *fp, const char 
*tblname)
 }
 
 static int print_events_table_entry(void *data, char *name, char *event,
-   char *desc, char *long_desc)
+   char *desc, char *long_desc, char *topic)
 {
FILE *outfp = data;
/*
@@ -216,7 +216,9 @@ static int print_events_table_entry(void *data, char *name, 
char *event,
fprintf(outfp, \t.event = \%s\,\n, event);
fprintf(outfp, \t.desc = \%s\,\n, desc);
if (long_desc  long_desc[0])
-   fprintf(outfp, \t.long_desc = \%s\, long_desc);
+   fprintf(outfp, \t.long_desc = \%s\,\n, long_desc);
+   if (topic)
+   fprintf(outfp, \t.topic = \%s\,\n, topic);
fprintf(outfp, },\n);
 
return 0;
@@ -236,7 +238,8 @@ static void print_events_table_suffix(FILE *outfp)
 
 /* Call func with each event in the json file */
 int json_events(const char *fn,
- int (*func)(void *data, char *name, char *event, char *desc, char 
*long_desc),
+ int (*func)(void *data, char *name, char *event, char *desc,
+ char *long_desc, char *topic),
  void *data)
 {
int err = -EIO;
@@ -255,7 +258,7 @@ int json_events(const char *fn,
tok = tokens + 1;
for (i = 0; i  tokens-size; i++) {
char *event = NULL, *desc = NULL, *name = NULL, *long_desc = 
NULL;
-   char *extra_desc = NULL;
+   char *extra_desc = NULL, *topic = NULL;
struct msrmap *msr = NULL;
jsmntok_t *msrval = NULL;
jsmntok_t *precise = NULL;
@@ -294,6 +297,8 @@ int json_events(const char *fn,
   !json_streq(map, val, null)) {
addfield(map, extra_desc, . ,
 Spec update: , val);
+   } else if (json_streq(map, field, Topic)) {
+   addfield(map, topic, , , val);
} else if (json_streq(map, field, Data_LA)  nz) {
addfield(map, 

[PATCH v13 12/14] perf, tools: Add support for event list topics

2015-06-02 Thread Sukadev Bhattiprolu
From: Andi Kleen a...@linux.intel.com

Add support to group the output of perf list by the Topic field
in the JSON file.

Example output:

% perf list
...
Cache:
  l1d.replacement
   [L1D data line replacements]
  l1d_pend_miss.pending
   [L1D miss oustandings duration in cycles]
  l1d_pend_miss.pending_cycles
   [Cycles with L1D load Misses outstanding]
  l2_l1d_wb_rqsts.all
   [Not rejected writebacks from L1D to L2 cache lines in any state]
  l2_l1d_wb_rqsts.hit_e
   [Not rejected writebacks from L1D to L2 cache lines in E state]
  l2_l1d_wb_rqsts.hit_m
   [Not rejected writebacks from L1D to L2 cache lines in M state]

...
Pipeline:
  arith.fpu_div
   [Divide operations executed]
  arith.fpu_div_active
   [Cycles when divider is busy executing divide operations]
  baclears.any
   [Counts the total number when the front end is resteered, mainly when 
the BPU cannot provide a correct prediction and this is corrected by
other branch handling mechanisms at the front end]
  br_inst_exec.all_branches
   [Speculative and retired branches]
  br_inst_exec.all_conditional
   [Speculative and retired macro-conditional branches]
  br_inst_exec.all_direct_jmp
   [Speculative and retired macro-unconditional branches excluding calls 
and indirects]
  br_inst_exec.all_direct_near_call
   [Speculative and retired direct near calls]
  br_inst_exec.all_indirect_jump_non_call_ret

Signed-off-by: Andi Kleen a...@linux.intel.com
Signed-off-by: Sukadev Bhattiprolu suka...@linux.vnet.ibm.com
---
 tools/perf/pmu-events/jevents.c|   16 +++-
 tools/perf/pmu-events/jevents.h|3 ++-
 tools/perf/pmu-events/pmu-events.h |1 +
 tools/perf/util/pmu.c  |   34 --
 tools/perf/util/pmu.h  |1 +
 5 files changed, 39 insertions(+), 16 deletions(-)

diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c
index 8990d71..14707fb 100644
--- a/tools/perf/pmu-events/jevents.c
+++ b/tools/perf/pmu-events/jevents.c
@@ -203,7 +203,7 @@ static void print_events_table_prefix(FILE *fp, const char 
*tblname)
 }
 
 static int print_events_table_entry(void *data, char *name, char *event,
-   char *desc, char *long_desc)
+   char *desc, char *long_desc, char *topic)
 {
FILE *outfp = data;
/*
@@ -216,7 +216,9 @@ static int print_events_table_entry(void *data, char *name, 
char *event,
fprintf(outfp, \t.event = \%s\,\n, event);
fprintf(outfp, \t.desc = \%s\,\n, desc);
if (long_desc  long_desc[0])
-   fprintf(outfp, \t.long_desc = \%s\, long_desc);
+   fprintf(outfp, \t.long_desc = \%s\,\n, long_desc);
+   if (topic)
+   fprintf(outfp, \t.topic = \%s\,\n, topic);
fprintf(outfp, },\n);
 
return 0;
@@ -236,7 +238,8 @@ static void print_events_table_suffix(FILE *outfp)
 
 /* Call func with each event in the json file */
 int json_events(const char *fn,
- int (*func)(void *data, char *name, char *event, char *desc, char 
*long_desc),
+ int (*func)(void *data, char *name, char *event, char *desc,
+ char *long_desc, char *topic),
  void *data)
 {
int err = -EIO;
@@ -255,7 +258,7 @@ int json_events(const char *fn,
tok = tokens + 1;
for (i = 0; i  tokens-size; i++) {
char *event = NULL, *desc = NULL, *name = NULL, *long_desc = 
NULL;
-   char *extra_desc = NULL;
+   char *extra_desc = NULL, *topic = NULL;
struct msrmap *msr = NULL;
jsmntok_t *msrval = NULL;
jsmntok_t *precise = NULL;
@@ -294,6 +297,8 @@ int json_events(const char *fn,
   !json_streq(map, val, null)) {
addfield(map, extra_desc, . ,
 Spec update: , val);
+   } else if (json_streq(map, field, Topic)) {
+   addfield(map, topic, , , val);
} else if (json_streq(map, field, Data_LA)  nz) {
addfield(map, extra_desc, . ,
 Supports address when precise,
@@ -316,12 +321,13 @@ int json_events(const char *fn,
if (msr != NULL)
addfield(map, event, ,, msr-pname, msrval);
fixname(name);
-   err = func(data, name, event, desc, long_desc);
+   err = func(data, name, event, desc, long_desc, topic);
free(event);
free(desc);
free(name);
free(extra_desc);
free(long_desc);
+   free(topic);
if (err)
break;
tok += j;
diff --git a/tools/perf/pmu-events/jevents.h