OLD | NEW |
1 /* Dump a gcov file, for debugging use. | 1 /* Dump a gcov file, for debugging use. |
2 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, | 2 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, |
3 2012 Free Software Foundation, Inc. | 3 2012 Free Software Foundation, Inc. |
4 Contributed by Nathan Sidwell <nathan@codesourcery.com> | 4 Contributed by Nathan Sidwell <nathan@codesourcery.com> |
5 | 5 |
6 Gcov is free software; you can redistribute it and/or modify | 6 Gcov is free software; you can redistribute it and/or modify |
7 it under the terms of the GNU General Public License as published by | 7 it under the terms of the GNU General Public License as published by |
8 the Free Software Foundation; either version 3, or (at your option) | 8 the Free Software Foundation; either version 3, or (at your option) |
9 any later version. | 9 any later version. |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 static void print_version (void); | 36 static void print_version (void); |
37 static void tag_function (const char *, unsigned, unsigned); | 37 static void tag_function (const char *, unsigned, unsigned); |
38 static void tag_blocks (const char *, unsigned, unsigned); | 38 static void tag_blocks (const char *, unsigned, unsigned); |
39 static void tag_arcs (const char *, unsigned, unsigned); | 39 static void tag_arcs (const char *, unsigned, unsigned); |
40 static void tag_lines (const char *, unsigned, unsigned); | 40 static void tag_lines (const char *, unsigned, unsigned); |
41 static void tag_counters (const char *, unsigned, unsigned); | 41 static void tag_counters (const char *, unsigned, unsigned); |
42 static void tag_summary (const char *, unsigned, unsigned); | 42 static void tag_summary (const char *, unsigned, unsigned); |
43 static void tag_module_info (const char *, unsigned, unsigned); | 43 static void tag_module_info (const char *, unsigned, unsigned); |
44 static void tag_pmu_load_latency_info (const char *, unsigned, unsigned); | 44 static void tag_pmu_load_latency_info (const char *, unsigned, unsigned); |
45 static void tag_pmu_branch_mispredict_info (const char *, unsigned, unsigned); | 45 static void tag_pmu_branch_mispredict_info (const char *, unsigned, unsigned); |
| 46 static void tag_pmu_string_table_entry (const char*, unsigned, unsigned); |
46 static void tag_pmu_tool_header (const char *, unsigned, unsigned); | 47 static void tag_pmu_tool_header (const char *, unsigned, unsigned); |
47 | 48 |
48 extern int main (int, char **); | 49 extern int main (int, char **); |
49 | 50 |
50 typedef struct tag_format | 51 typedef struct tag_format |
51 { | 52 { |
52 unsigned tag; | 53 unsigned tag; |
53 char const *name; | 54 char const *name; |
54 void (*proc) (const char *, unsigned, unsigned); | 55 void (*proc) (const char *, unsigned, unsigned); |
55 } tag_format_t; | 56 } tag_format_t; |
(...skipping 21 matching lines...) Expand all Loading... |
77 {GCOV_TAG_ARCS, "ARCS", tag_arcs}, | 78 {GCOV_TAG_ARCS, "ARCS", tag_arcs}, |
78 {GCOV_TAG_LINES, "LINES", tag_lines}, | 79 {GCOV_TAG_LINES, "LINES", tag_lines}, |
79 {GCOV_TAG_OBJECT_SUMMARY, "OBJECT_SUMMARY", tag_summary}, | 80 {GCOV_TAG_OBJECT_SUMMARY, "OBJECT_SUMMARY", tag_summary}, |
80 {GCOV_TAG_PROGRAM_SUMMARY, "PROGRAM_SUMMARY", tag_summary}, | 81 {GCOV_TAG_PROGRAM_SUMMARY, "PROGRAM_SUMMARY", tag_summary}, |
81 {GCOV_TAG_MODULE_INFO, "MODULE INFO", tag_module_info}, | 82 {GCOV_TAG_MODULE_INFO, "MODULE INFO", tag_module_info}, |
82 {GCOV_TAG_PMU_LOAD_LATENCY_INFO, "PMU_LOAD_LATENCY_INFO", | 83 {GCOV_TAG_PMU_LOAD_LATENCY_INFO, "PMU_LOAD_LATENCY_INFO", |
83 tag_pmu_load_latency_info}, | 84 tag_pmu_load_latency_info}, |
84 {GCOV_TAG_PMU_BRANCH_MISPREDICT_INFO, "PMU_BRANCH_MISPREDICT_INFO", | 85 {GCOV_TAG_PMU_BRANCH_MISPREDICT_INFO, "PMU_BRANCH_MISPREDICT_INFO", |
85 tag_pmu_branch_mispredict_info}, | 86 tag_pmu_branch_mispredict_info}, |
86 {GCOV_TAG_PMU_TOOL_HEADER, "PMU_TOOL_HEADER", tag_pmu_tool_header}, | 87 {GCOV_TAG_PMU_TOOL_HEADER, "PMU_TOOL_HEADER", tag_pmu_tool_header}, |
| 88 {GCOV_TAG_PMU_STRING_TABLE_ENTRY, "PMU_STRING_TABLE_ENTRY", |
| 89 tag_pmu_string_table_entry}, |
87 {0, NULL, NULL} | 90 {0, NULL, NULL} |
88 }; | 91 }; |
89 | 92 |
90 int | 93 int |
91 main (int argc ATTRIBUTE_UNUSED, char **argv) | 94 main (int argc ATTRIBUTE_UNUSED, char **argv) |
92 { | 95 { |
93 int opt; | 96 int opt; |
94 const char *p; | 97 const char *p; |
95 | 98 |
96 p = argv[0] + strlen (argv[0]); | 99 p = argv[0] + strlen (argv[0]); |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 /* Read gcov tag GCOV_TAG_PMU_LOAD_LATENCY_INFO from the gcda file and | 569 /* Read gcov tag GCOV_TAG_PMU_LOAD_LATENCY_INFO from the gcda file and |
567 print the contents in a human readable form. */ | 570 print the contents in a human readable form. */ |
568 | 571 |
569 static void | 572 static void |
570 tag_pmu_load_latency_info (const char *filename ATTRIBUTE_UNUSED, | 573 tag_pmu_load_latency_info (const char *filename ATTRIBUTE_UNUSED, |
571 unsigned tag ATTRIBUTE_UNUSED, unsigned length) | 574 unsigned tag ATTRIBUTE_UNUSED, unsigned length) |
572 { | 575 { |
573 gcov_pmu_ll_info_t ll_info; | 576 gcov_pmu_ll_info_t ll_info; |
574 gcov_read_pmu_load_latency_info (&ll_info, length); | 577 gcov_read_pmu_load_latency_info (&ll_info, length); |
575 print_load_latency_line (stdout, &ll_info, no_newline); | 578 print_load_latency_line (stdout, &ll_info, no_newline); |
576 free (ll_info.filename); | |
577 } | 579 } |
578 | 580 |
579 /* Read gcov tag GCOV_TAG_PMU_BRANCH_MISPREDICT_INFO from the gcda | 581 /* Read gcov tag GCOV_TAG_PMU_BRANCH_MISPREDICT_INFO from the gcda |
580 file and print the contents in a human readable form. */ | 582 file and print the contents in a human readable form. */ |
581 | 583 |
582 static void | 584 static void |
583 tag_pmu_branch_mispredict_info (const char *filename ATTRIBUTE_UNUSED, | 585 tag_pmu_branch_mispredict_info (const char *filename ATTRIBUTE_UNUSED, |
584 unsigned tag ATTRIBUTE_UNUSED, unsigned length) | 586 unsigned tag ATTRIBUTE_UNUSED, unsigned length) |
585 { | 587 { |
586 gcov_pmu_brm_info_t brm_info; | 588 gcov_pmu_brm_info_t brm_info; |
587 gcov_read_pmu_branch_mispredict_info (&brm_info, length); | 589 gcov_read_pmu_branch_mispredict_info (&brm_info, length); |
588 print_branch_mispredict_line (stdout, &brm_info, no_newline); | 590 print_branch_mispredict_line (stdout, &brm_info, no_newline); |
589 free (brm_info.filename); | |
590 } | 591 } |
591 | 592 |
| 593 static void |
| 594 tag_pmu_string_table_entry (const char *filename ATTRIBUTE_UNUSED, |
| 595 unsigned tag ATTRIBUTE_UNUSED, unsigned length) |
| 596 { |
| 597 gcov_pmu_st_entry_t st_entry; |
| 598 gcov_read_pmu_string_table_entry(&st_entry, length); |
| 599 print_pmu_string_table_entry(stdout, &st_entry, no_newline); |
| 600 free(st_entry.str); |
| 601 } |
592 | 602 |
593 /* Read gcov tag GCOV_TAG_PMU_TOOL_HEADER from the gcda file and print | 603 /* Read gcov tag GCOV_TAG_PMU_TOOL_HEADER from the gcda file and print |
594 the contents in a human readable form. */ | 604 the contents in a human readable form. */ |
595 | 605 |
596 static void | 606 static void |
597 tag_pmu_tool_header (const char *filename ATTRIBUTE_UNUSED, | 607 tag_pmu_tool_header (const char *filename ATTRIBUTE_UNUSED, |
598 unsigned tag ATTRIBUTE_UNUSED, unsigned length) | 608 unsigned tag ATTRIBUTE_UNUSED, unsigned length) |
599 { | 609 { |
600 gcov_pmu_tool_header_t tool_header; | 610 gcov_pmu_tool_header_t tool_header; |
601 gcov_read_pmu_tool_header (&tool_header, length); | 611 gcov_read_pmu_tool_header (&tool_header, length); |
602 print_pmu_tool_header (stdout, &tool_header, no_newline); | 612 print_pmu_tool_header (stdout, &tool_header, no_newline); |
603 destroy_pmu_tool_header (&tool_header); | 613 destroy_pmu_tool_header (&tool_header); |
604 } | 614 } |
OLD | NEW |