Re: [PATCH 04/10] perf, tools: Handle header line in mapfile

2015-06-01 Thread Jiri Olsa
On Fri, May 29, 2015 at 10:49:27PM -0700, Andi Kleen wrote:
 On Fri, May 29, 2015 at 11:13:15AM +0200, Jiri Olsa wrote:
  On Thu, May 28, 2015 at 10:45:06PM -0700, Sukadev Bhattiprolu wrote:
   Jiri Olsa [jo...@redhat.com] wrote:
   |if (line[0] == '#' || line[0] == '\n')
   |continue;
   |  + if (!strncmp(line, Family, 6))
   |  + continue;
   | 
   | I think we should fix mapfiles to put the 'Family' starting
   | line as a comment.. the way powerpc mapfile is done
   
   You mean add something like this to the Intel mapfile:
   
 # Power8 entries
 004d0100,1,power8.json,core
   
   and drop this patch?
  
  right
 
 But it's a CSV file. CSV files are supposed to have column headers.
 There are lots of tools that work better with them if they have headers.

header could be behind '#'

 Please keep the header.

hum, do all arch start with 'Family' column? I guess not, so eventualy
we will need to add first column of each arch in here? ending up with
list of 'keywords' which we ignore

or let's just ignore first line?

I'd rather go with just one comment char and place the header behind it

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

Re: [PATCH 04/10] perf, tools: Handle header line in mapfile

2015-05-29 Thread Jiri Olsa
On Thu, May 28, 2015 at 10:45:06PM -0700, Sukadev Bhattiprolu wrote:
 Jiri Olsa [jo...@redhat.com] wrote:
 |if (line[0] == '#' || line[0] == '\n')
 |continue;
 |  + if (!strncmp(line, Family, 6))
 |  + continue;
 | 
 | I think we should fix mapfiles to put the 'Family' starting
 | line as a comment.. the way powerpc mapfile is done
 
 You mean add something like this to the Intel mapfile:
 
   # Power8 entries
   004d0100,1,power8.json,core
 
 and drop this patch?

right

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

Re: [PATCH 04/10] perf, tools: Handle header line in mapfile

2015-05-29 Thread Andi Kleen
On Fri, May 29, 2015 at 11:13:15AM +0200, Jiri Olsa wrote:
 On Thu, May 28, 2015 at 10:45:06PM -0700, Sukadev Bhattiprolu wrote:
  Jiri Olsa [jo...@redhat.com] wrote:
  |  if (line[0] == '#' || line[0] == '\n')
  |  continue;
  |  +   if (!strncmp(line, Family, 6))
  |  +   continue;
  | 
  | I think we should fix mapfiles to put the 'Family' starting
  | line as a comment.. the way powerpc mapfile is done
  
  You mean add something like this to the Intel mapfile:
  
  # Power8 entries
  004d0100,1,power8.json,core
  
  and drop this patch?
 
 right

But it's a CSV file. CSV files are supposed to have column headers.
There are lots of tools that work better with them if they have headers.
Please keep the header.

-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 04/10] perf, tools: Handle header line in mapfile

2015-05-28 Thread Sukadev Bhattiprolu
Jiri Olsa [jo...@redhat.com] wrote:
|  if (line[0] == '#' || line[0] == '\n')
|  continue;
|  +   if (!strncmp(line, Family, 6))
|  +   continue;
| 
| I think we should fix mapfiles to put the 'Family' starting
| line as a comment.. the way powerpc mapfile is done

You mean add something like this to the Intel mapfile:

# Power8 entries
004d0100,1,power8.json,core

and drop this patch?

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

Re: [PATCH 04/10] perf, tools: Handle header line in mapfile

2015-05-28 Thread Jiri Olsa
On Wed, May 27, 2015 at 02:23:23PM -0700, Sukadev Bhattiprolu wrote:
 From: Andi Kleen a...@linux.intel.com
 
 Support a header line in the mapfile.csv, to match the existing
 mapfiles
 
 Signed-off-by: Andi Kleen a...@linux.intel.com
 ---
  tools/perf/pmu-events/jevents.c |2 ++
  1 file changed, 2 insertions(+)
 
 diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c
 index 03f7b65..43651cc 100644
 --- a/tools/perf/pmu-events/jevents.c
 +++ b/tools/perf/pmu-events/jevents.c
 @@ -452,6 +452,8 @@ static int process_mapfile(FILE *outfp, char *fpath)
  
   if (line[0] == '#' || line[0] == '\n')
   continue;
 + if (!strncmp(line, Family, 6))
 + continue;

I think we should fix mapfiles to put the 'Family' starting
line as a comment.. the way powerpc mapfile is done

jirka

  
   if (line[strlen(line)-1] != '\n') {
   /* TODO Deal with lines longer than 16K */
 -- 
 1.7.9.5
 
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 04/10] perf, tools: Handle header line in mapfile

2015-05-27 Thread Sukadev Bhattiprolu
From: Andi Kleen a...@linux.intel.com

Support a header line in the mapfile.csv, to match the existing
mapfiles

Signed-off-by: Andi Kleen a...@linux.intel.com
---
 tools/perf/pmu-events/jevents.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c
index 03f7b65..43651cc 100644
--- a/tools/perf/pmu-events/jevents.c
+++ b/tools/perf/pmu-events/jevents.c
@@ -452,6 +452,8 @@ static int process_mapfile(FILE *outfp, char *fpath)
 
if (line[0] == '#' || line[0] == '\n')
continue;
+   if (!strncmp(line, Family, 6))
+   continue;
 
if (line[strlen(line)-1] != '\n') {
/* TODO Deal with lines longer than 16K */
-- 
1.7.9.5

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