Left: | ||
Right: |
OLD | NEW |
---|---|
1 /* File format for coverage information | 1 /* File format for coverage information |
2 Copyright (C) 1996, 1997, 1998, 2000, 2002, | 2 Copyright (C) 1996, 1997, 1998, 2000, 2002, |
3 2003, 2004, 2005, 2008, 2009 Free Software Foundation, Inc. | 3 2003, 2004, 2005, 2008, 2009 Free Software Foundation, Inc. |
4 Contributed by Bob Manson <manson@cygnus.com>. | 4 Contributed by Bob Manson <manson@cygnus.com>. |
5 Completely remangled by Nathan Sidwell <nathan@codesourcery.com>. | 5 Completely remangled by Nathan Sidwell <nathan@codesourcery.com>. |
6 | 6 |
7 This file is part of GCC. | 7 This file is part of GCC. |
8 | 8 |
9 GCC is free software; you can redistribute it and/or modify it under | 9 GCC is free software; you can redistribute it and/or modify it under |
10 the terms of the GNU General Public License as published by the Free | 10 the terms of the GNU General Public License as published by the Free |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
435 #define GCOV_TAG_ARCS_NUM(LENGTH) (((LENGTH) - 1) / 2) | 435 #define GCOV_TAG_ARCS_NUM(LENGTH) (((LENGTH) - 1) / 2) |
436 #define GCOV_TAG_LINES ((gcov_unsigned_t)0x01450000) | 436 #define GCOV_TAG_LINES ((gcov_unsigned_t)0x01450000) |
437 #define GCOV_TAG_COUNTER_BASE ((gcov_unsigned_t)0x01a10000) | 437 #define GCOV_TAG_COUNTER_BASE ((gcov_unsigned_t)0x01a10000) |
438 #define GCOV_TAG_COUNTER_LENGTH(NUM) ((NUM) * 2) | 438 #define GCOV_TAG_COUNTER_LENGTH(NUM) ((NUM) * 2) |
439 #define GCOV_TAG_COUNTER_NUM(LENGTH) ((LENGTH) / 2) | 439 #define GCOV_TAG_COUNTER_NUM(LENGTH) ((LENGTH) / 2) |
440 #define GCOV_TAG_OBJECT_SUMMARY ((gcov_unsigned_t)0xa1000000) /* Obsolete */ | 440 #define GCOV_TAG_OBJECT_SUMMARY ((gcov_unsigned_t)0xa1000000) /* Obsolete */ |
441 #define GCOV_TAG_PROGRAM_SUMMARY ((gcov_unsigned_t)0xa3000000) | 441 #define GCOV_TAG_PROGRAM_SUMMARY ((gcov_unsigned_t)0xa3000000) |
442 #define GCOV_TAG_SUMMARY_LENGTH \ | 442 #define GCOV_TAG_SUMMARY_LENGTH \ |
443 (1 + GCOV_COUNTERS_SUMMABLE * (3 + 3 * 2)) | 443 (1 + GCOV_COUNTERS_SUMMABLE * (3 + 3 * 2)) |
444 #define GCOV_TAG_PMU_LOAD_LATENCY_INFO ((gcov_unsigned_t)0xa5000000) | 444 #define GCOV_TAG_PMU_LOAD_LATENCY_INFO ((gcov_unsigned_t)0xa5000000) |
445 #define GCOV_TAG_PMU_LOAD_LATENCY_LENGTH(filename) \ | 445 #define GCOV_TAG_PMU_LOAD_LATENCY_LENGTH() (15) |
446 (gcov_string_length (filename) + 12 + 2) | |
447 #define GCOV_TAG_PMU_BRANCH_MISPREDICT_INFO ((gcov_unsigned_t)0xa7000000) | 446 #define GCOV_TAG_PMU_BRANCH_MISPREDICT_INFO ((gcov_unsigned_t)0xa7000000) |
448 #define GCOV_TAG_PMU_BRANCH_MISPREDICT_LENGTH(filename) \ | 447 #define GCOV_TAG_PMU_BRANCH_MISPREDICT_LENGTH() (8) |
449 (gcov_string_length (filename) + 5 + 2) | |
450 #define GCOV_TAG_PMU_TOOL_HEADER ((gcov_unsigned_t)0xa9000000) | 448 #define GCOV_TAG_PMU_TOOL_HEADER ((gcov_unsigned_t)0xa9000000) |
451 #define GCOV_TAG_MODULE_INFO ((gcov_unsigned_t)0xab000000) | 449 #define GCOV_TAG_MODULE_INFO ((gcov_unsigned_t)0xab000000) |
450 #define GCOV_TAG_PMU_STRING_TABLE_ENTRY ((gcov_unsigned_t)0xad000000) | |
451 #define GCOV_TAG_PMU_STRING_TABLE_ENTRY_LENGTH(filename) \ | |
452 (gcov_string_length (filename) + 1) | |
452 | 453 |
453 /* Counters that are collected. */ | 454 /* Counters that are collected. */ |
454 #define GCOV_COUNTER_ARCS 0 /* Arc transitions. */ | 455 #define GCOV_COUNTER_ARCS 0 /* Arc transitions. */ |
455 #define GCOV_COUNTERS_SUMMABLE 1 /* Counters which can be | 456 #define GCOV_COUNTERS_SUMMABLE 1 /* Counters which can be |
456 summaried. */ | 457 summaried. */ |
457 #define GCOV_FIRST_VALUE_COUNTER 1 /* The first of counters used for value | 458 #define GCOV_FIRST_VALUE_COUNTER 1 /* The first of counters used for value |
458 profiling. They must form a consecutive | 459 profiling. They must form a consecutive |
459 interval and their order must match | 460 interval and their order must match |
460 the order of HIST_TYPEs in | 461 the order of HIST_TYPEs in |
461 value-prof.h. */ | 462 value-prof.h. */ |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
628 gcov_unsigned_t lt_10; /* per 10k with latency <= 10 cycles */ | 629 gcov_unsigned_t lt_10; /* per 10k with latency <= 10 cycles */ |
629 gcov_unsigned_t lt_32; /* per 10k with latency <= 32 cycles */ | 630 gcov_unsigned_t lt_32; /* per 10k with latency <= 32 cycles */ |
630 gcov_unsigned_t lt_64; /* per 10k with latency <= 64 cycles */ | 631 gcov_unsigned_t lt_64; /* per 10k with latency <= 64 cycles */ |
631 gcov_unsigned_t lt_256; /* per 10k with latency <= 256 cycles */ | 632 gcov_unsigned_t lt_256; /* per 10k with latency <= 256 cycles */ |
632 gcov_unsigned_t lt_1024; /* per 10k with latency <= 1024 cycles */ | 633 gcov_unsigned_t lt_1024; /* per 10k with latency <= 1024 cycles */ |
633 gcov_unsigned_t gt_1024; /* per 10k with latency > 1024 cycles */ | 634 gcov_unsigned_t gt_1024; /* per 10k with latency > 1024 cycles */ |
634 gcov_unsigned_t wself; /* weighted average cost of this miss in cycles */ | 635 gcov_unsigned_t wself; /* weighted average cost of this miss in cycles */ |
635 gcov_type code_addr; /* the actual miss address (pc+1 for Intel) */ | 636 gcov_type code_addr; /* the actual miss address (pc+1 for Intel) */ |
636 gcov_unsigned_t line; /* line number corresponding to this miss */ | 637 gcov_unsigned_t line; /* line number corresponding to this miss */ |
637 gcov_unsigned_t discriminator; /* discriminator information for this miss */ | 638 gcov_unsigned_t discriminator; /* discriminator information for this miss */ |
638 char *filename; /* filename corresponding to this miss */ | 639 gcov_unsigned_t filetag; /* location in string table of filename */ |
639 } gcov_pmu_ll_info_t; | 640 } gcov_pmu_ll_info_t; |
640 | 641 |
641 /* This structure is used during runtime as well as in gcov. */ | 642 /* This structure is used during runtime as well as in gcov. */ |
642 typedef struct load_latency_infos | 643 typedef struct load_latency_infos |
643 { | 644 { |
644 /* An array describing the total number of load latency fields. */ | 645 /* An array describing the total number of load latency fields. */ |
645 gcov_pmu_ll_info_t **ll_array; | 646 gcov_pmu_ll_info_t **ll_array; |
646 /* The total number of entries in the load latency array. */ | 647 /* The total number of entries in the load latency array. */ |
647 unsigned ll_count; | 648 unsigned ll_count; |
648 /* The total number of entries currently allocated in the array. | 649 /* The total number of entries currently allocated in the array. |
649 Used for bookkeeping. */ | 650 Used for bookkeeping. */ |
650 unsigned alloc_ll_count; | 651 unsigned alloc_ll_count; |
651 /* PMU tool header */ | 652 /* PMU tool header */ |
652 gcov_pmu_tool_header_t *pmu_tool_header; | 653 gcov_pmu_tool_header_t *pmu_tool_header; |
653 } ll_infos_t; | 654 } ll_infos_t; |
654 | 655 |
655 /* Available only for PMUs which support PEBS or IBS using pfmon | 656 /* Available only for PMUs which support PEBS or IBS using pfmon |
656 tool. If any field here is changed, the length computation in | 657 tool. If any field here is changed, the length computation in |
657 GCOV_TAG_PMU_BR_MISPREDICT_LENGTH must be updated as well. All | 658 GCOV_TAG_PMU_BR_MISPREDICT_LENGTH must be updated as well. All |
658 percentages are multiplied by 100 to make them out of 10000 and | 659 percentages are multiplied by 100 to make them out of 10000 and |
659 only integer part is kept. */ | 660 only integer part is kept. */ |
660 typedef struct gcov_pmu_branch_mispredict_info | 661 typedef struct gcov_pmu_branch_mispredict_info |
661 { | 662 { |
662 gcov_unsigned_t counts; /* raw count of samples */ | 663 gcov_unsigned_t counts; /* raw count of samples */ |
663 gcov_unsigned_t self; /* per 10k of total samples */ | 664 gcov_unsigned_t self; /* per 10k of total samples */ |
664 gcov_unsigned_t cum; /* per 10k cumulative weight */ | 665 gcov_unsigned_t cum; /* per 10k cumulative weight */ |
665 gcov_type code_addr; /* the actual mispredict address */ | 666 gcov_type code_addr; /* the actual mispredict address */ |
666 gcov_unsigned_t line; /* line number corresponding to this event */ | 667 gcov_unsigned_t line; /* line number corresponding to this event */ |
667 gcov_unsigned_t discriminator; /* discriminator for this event */ | 668 gcov_unsigned_t discriminator; /* discriminator for this event */ |
668 char *filename; /* filename corresponding to this event */ | 669 gcov_unsigned_t filetag; /* location in string table of filename */ |
669 } gcov_pmu_brm_info_t; | 670 } gcov_pmu_brm_info_t; |
670 | 671 |
671 /* This structure is used during runtime as well as in gcov. */ | 672 /* This structure is used during runtime as well as in gcov. */ |
672 typedef struct branch_mispredict_infos | 673 typedef struct branch_mispredict_infos |
673 { | 674 { |
674 /* An array describing the total number of mispredict entries. */ | 675 /* An array describing the total number of mispredict entries. */ |
675 gcov_pmu_brm_info_t **brm_array; | 676 gcov_pmu_brm_info_t **brm_array; |
676 /* The total number of entries in the above array. */ | 677 /* The total number of entries in the above array. */ |
677 unsigned brm_count; | 678 unsigned brm_count; |
678 /* The total number of entries currently allocated in the array. | 679 /* The total number of entries currently allocated in the array. |
679 Used for bookkeeping. */ | 680 Used for bookkeeping. */ |
680 unsigned alloc_brm_count; | 681 unsigned alloc_brm_count; |
681 /* PMU tool header */ | 682 /* PMU tool header */ |
682 gcov_pmu_tool_header_t *pmu_tool_header; | 683 gcov_pmu_tool_header_t *pmu_tool_header; |
683 } brm_infos_t; | 684 } brm_infos_t; |
684 | 685 |
686 typedef struct gcov_pmu_string_table_entry | |
687 { | |
688 gcov_unsigned_t index; /* The corresponding string table index */ | |
davidxl
2012/08/24 22:30:30
Is this field necessary?
cmang2
2012/08/24 22:56:32
For the purposes of gcov_dump output we wanted to
| |
689 char* filename; /* The filename that belongs at this index */ | |
davidxl
2012/08/24 22:30:30
Can this field name be generalized?
cmang2
2012/08/24 22:56:32
Generalized in what way? I used this name because
| |
690 } gcov_pmu_st_entry_t; | |
691 | |
692 typedef struct string_table | |
693 { | |
694 /* An array describing the total number of string table entries. */ | |
695 gcov_pmu_st_entry_t **st_array; | |
696 /* The total number of entries in the above array. */ | |
697 unsigned st_count; | |
698 /* The total number of entries currently allocated in the array. | |
699 Used for bookkeeping. */ | |
700 unsigned alloc_st_count; | |
701 /* PMU tool header */ | |
702 gcov_pmu_tool_header_t *pmu_tool_header; | |
703 } string_table_t; | |
704 | |
685 /* Structures embedded in coveraged program. The structures generated | 705 /* Structures embedded in coveraged program. The structures generated |
686 by write_profile must match these. */ | 706 by write_profile must match these. */ |
687 | 707 |
688 #if IN_LIBGCOV | 708 #if IN_LIBGCOV |
689 /* Information about counters for a single function. */ | 709 /* Information about counters for a single function. */ |
690 struct gcov_ctr_info | 710 struct gcov_ctr_info |
691 { | 711 { |
692 gcov_unsigned_t num; /* number of counters. */ | 712 gcov_unsigned_t num; /* number of counters. */ |
693 gcov_type *values; /* their values. */ | 713 gcov_type *values; /* their values. */ |
694 }; | 714 }; |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
864 GCOV_LINKAGE gcov_type gcov_read_counter (void) ATTRIBUTE_HIDDEN; | 884 GCOV_LINKAGE gcov_type gcov_read_counter (void) ATTRIBUTE_HIDDEN; |
865 GCOV_LINKAGE void gcov_read_summary (struct gcov_summary *) ATTRIBUTE_HIDDEN; | 885 GCOV_LINKAGE void gcov_read_summary (struct gcov_summary *) ATTRIBUTE_HIDDEN; |
866 GCOV_LINKAGE char *gcov_canonical_filename (char *filename) ATTRIBUTE_HIDDEN; | 886 GCOV_LINKAGE char *gcov_canonical_filename (char *filename) ATTRIBUTE_HIDDEN; |
867 GCOV_LINKAGE void | 887 GCOV_LINKAGE void |
868 gcov_read_pmu_load_latency_info (gcov_pmu_ll_info_t *ll_info, | 888 gcov_read_pmu_load_latency_info (gcov_pmu_ll_info_t *ll_info, |
869 gcov_unsigned_t len) ATTRIBUTE_HIDDEN; | 889 gcov_unsigned_t len) ATTRIBUTE_HIDDEN; |
870 GCOV_LINKAGE void | 890 GCOV_LINKAGE void |
871 gcov_read_pmu_branch_mispredict_info (gcov_pmu_brm_info_t *brm_info, | 891 gcov_read_pmu_branch_mispredict_info (gcov_pmu_brm_info_t *brm_info, |
872 gcov_unsigned_t len) ATTRIBUTE_HIDDEN; | 892 gcov_unsigned_t len) ATTRIBUTE_HIDDEN; |
873 GCOV_LINKAGE void | 893 GCOV_LINKAGE void |
894 gcov_read_pmu_string_table_entry (gcov_pmu_st_entry_t *entry, | |
895 gcov_unsigned_t len) ATTRIBUTE_HIDDEN; | |
896 | |
897 GCOV_LINKAGE void | |
874 gcov_read_pmu_tool_header (gcov_pmu_tool_header_t *tool_header, | 898 gcov_read_pmu_tool_header (gcov_pmu_tool_header_t *tool_header, |
875 gcov_unsigned_t len) ATTRIBUTE_HIDDEN; | 899 gcov_unsigned_t len) ATTRIBUTE_HIDDEN; |
876 #ifndef __GCOV_KERNEL__ | 900 #ifndef __GCOV_KERNEL__ |
877 GCOV_LINKAGE float convert_unsigned_to_pct ( | 901 GCOV_LINKAGE float convert_unsigned_to_pct ( |
878 const unsigned number) ATTRIBUTE_HIDDEN; | 902 const unsigned number) ATTRIBUTE_HIDDEN; |
879 #endif /* __GCOV_KERNEL__ */ | 903 #endif /* __GCOV_KERNEL__ */ |
880 | 904 |
881 #if !IN_LIBGCOV && IN_GCOV != 1 | 905 #if !IN_LIBGCOV && IN_GCOV != 1 |
882 GCOV_LINKAGE void gcov_read_module_info (struct gcov_module_info *mod_info, | 906 GCOV_LINKAGE void gcov_read_module_info (struct gcov_module_info *mod_info, |
883 gcov_unsigned_t len) ATTRIBUTE_HIDDEN; | 907 gcov_unsigned_t len) ATTRIBUTE_HIDDEN; |
884 GCOV_LINKAGE void print_load_latency_line (FILE *fp, | 908 GCOV_LINKAGE void print_load_latency_line (FILE *fp, |
885 const gcov_pmu_ll_info_t *ll_info, | 909 const gcov_pmu_ll_info_t *ll_info, |
886 const enum print_newline); | 910 const enum print_newline); |
887 GCOV_LINKAGE void | 911 GCOV_LINKAGE void |
888 print_branch_mispredict_line (FILE *fp, const gcov_pmu_brm_info_t *brm_info, | 912 print_branch_mispredict_line (FILE *fp, const gcov_pmu_brm_info_t *brm_info, |
889 const enum print_newline); | 913 const enum print_newline); |
914 GCOV_LINKAGE void | |
915 print_pmu_string_table_entry (FILE* fp, const gcov_pmu_st_entry_t *entry, | |
916 const enum print_newline); | |
890 GCOV_LINKAGE void print_pmu_tool_header (FILE *fp, | 917 GCOV_LINKAGE void print_pmu_tool_header (FILE *fp, |
891 gcov_pmu_tool_header_t *tool_header, | 918 gcov_pmu_tool_header_t *tool_header, |
892 const enum print_newline); | 919 const enum print_newline); |
893 #endif | 920 #endif |
894 | 921 |
895 #if IN_GCOV != 1 | 922 #if IN_GCOV != 1 |
896 GCOV_LINKAGE void destroy_pmu_tool_header (gcov_pmu_tool_header_t *tool_header) | 923 GCOV_LINKAGE void destroy_pmu_tool_header (gcov_pmu_tool_header_t *tool_header) |
897 ATTRIBUTE_HIDDEN; | 924 ATTRIBUTE_HIDDEN; |
898 #endif | 925 #endif |
899 | 926 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
965 gcov_var.mode = -1; | 992 gcov_var.mode = -1; |
966 gcov_var.start = 0; | 993 gcov_var.start = 0; |
967 gcov_var.offset = 0; | 994 gcov_var.offset = 0; |
968 _GCOV_fseek (gcov_var.file, 0L, SEEK_SET); | 995 _GCOV_fseek (gcov_var.file, 0L, SEEK_SET); |
969 } | 996 } |
970 #endif | 997 #endif |
971 | 998 |
972 #endif /* IN_LIBGCOV >= 0 */ | 999 #endif /* IN_LIBGCOV >= 0 */ |
973 | 1000 |
974 #endif /* GCC_GCOV_IO_H */ | 1001 #endif /* GCC_GCOV_IO_H */ |
OLD | NEW |