diff options
-rw-r--r-- | tools/perf/pmu-events/jevents.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c index c4c074a49b6e..c9bf9a7dc7b2 100644 --- a/tools/perf/pmu-events/jevents.c +++ b/tools/perf/pmu-events/jevents.c | |||
@@ -477,7 +477,12 @@ static int process_mapfile(FILE *outfp, char *fpath) | |||
477 | 477 | ||
478 | print_mapping_table_prefix(outfp); | 478 | print_mapping_table_prefix(outfp); |
479 | 479 | ||
480 | line_num = 0; | 480 | /* Skip first line (header) */ |
481 | p = fgets(line, n, mapfp); | ||
482 | if (!p) | ||
483 | goto out; | ||
484 | |||
485 | line_num = 1; | ||
481 | while (1) { | 486 | while (1) { |
482 | char *cpuid, *version, *type, *fname; | 487 | char *cpuid, *version, *type, *fname; |
483 | 488 | ||
@@ -521,8 +526,8 @@ static int process_mapfile(FILE *outfp, char *fpath) | |||
521 | fprintf(outfp, "},\n"); | 526 | fprintf(outfp, "},\n"); |
522 | } | 527 | } |
523 | 528 | ||
529 | out: | ||
524 | print_mapping_table_suffix(outfp); | 530 | print_mapping_table_suffix(outfp); |
525 | |||
526 | return 0; | 531 | return 0; |
527 | } | 532 | } |
528 | 533 | ||