Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 | 1 |
2 /* Performance monitoring unit (PMU) profiler. If available, use an | 2 /* Performance monitoring unit (PMU) profiler. If available, use an |
3 external tool to collect hardware performance counter data and | 3 external tool to collect hardware performance counter data and |
4 write it in the .gcda files. | 4 write it in the .gcda files. |
5 | 5 |
6 Copyright (C) 2011. Free Software Foundation, Inc. | 6 Copyright (C) 2011. Free Software Foundation, Inc. |
7 Contributed by Sharad Singhai <singhai@google.com>. | 7 Contributed by Sharad Singhai <singhai@google.com>. |
8 | 8 |
9 This file is part of GCC. | 9 This file is part of GCC. |
10 | 10 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
68 #define XDELETEVEC(p) free(p) | 68 #define XDELETEVEC(p) free(p) |
69 #define XDELETE(p) free(p) | 69 #define XDELETE(p) free(p) |
70 | 70 |
71 static unsigned convert_pct_to_unsigned (float pct); | 71 static unsigned convert_pct_to_unsigned (float pct); |
72 static void *init_pmu_load_latency (void); | 72 static void *init_pmu_load_latency (void); |
73 static void *init_pmu_branch_mispredict (void); | 73 static void *init_pmu_branch_mispredict (void); |
74 static void destroy_load_latency_infos (void *info); | 74 static void destroy_load_latency_infos (void *info); |
75 static void destroy_branch_mispredict_infos (void *info); | 75 static void destroy_branch_mispredict_infos (void *info); |
76 static gcov_unsigned_t gcov_tag_pmu_tool_header_length (gcov_pmu_tool_header_t | 76 static gcov_unsigned_t gcov_tag_pmu_tool_header_length (gcov_pmu_tool_header_t |
77 *header); | 77 *header); |
78 void gcov_write_tool_header (gcov_pmu_tool_header_t *header); | |
79 void gcov_write_ll_line (const gcov_pmu_ll_info_t *ll_info); | |
80 void gcov_write_branch_mispredict_line (const gcov_pmu_brm_info_t | |
81 *brm_info); | |
82 void gcov_write_string_table_entry (const gcov_pmu_st_entry_t *st_entry); | |
83 | |
davidxl
2012/08/24 22:30:30
Who is the caller to this interface?
It should be
cmang2
2012/08/24 22:56:32
The only current caller of this is https://critiqu
| |
84 | 78 |
85 /* Convert a fractional PCT to an unsigned integer after | 79 /* Convert a fractional PCT to an unsigned integer after |
86 muliplying by 100. */ | 80 muliplying by 100. */ |
87 | 81 |
88 static unsigned | 82 static unsigned |
89 convert_pct_to_unsigned (float pct) | 83 convert_pct_to_unsigned (float pct) |
90 { | 84 { |
91 return (unsigned)(pct * 100.0f); | 85 return (unsigned)(pct * 100.0f); |
92 } | 86 } |
93 | 87 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
195 gcov_write_unsigned (brm_info->filetag); | 189 gcov_write_unsigned (brm_info->filetag); |
196 } | 190 } |
197 | 191 |
198 /* Write the string table entry ST_ENTRY into the gcda file. */ | 192 /* Write the string table entry ST_ENTRY into the gcda file. */ |
199 | 193 |
200 void | 194 void |
201 gcov_write_string_table_entry (const gcov_pmu_st_entry_t *st_entry) | 195 gcov_write_string_table_entry (const gcov_pmu_st_entry_t *st_entry) |
202 { | 196 { |
203 gcov_write_tag_length (GCOV_TAG_PMU_STRING_TABLE_ENTRY, | 197 gcov_write_tag_length (GCOV_TAG_PMU_STRING_TABLE_ENTRY, |
204 GCOV_TAG_PMU_STRING_TABLE_ENTRY_LENGTH( | 198 GCOV_TAG_PMU_STRING_TABLE_ENTRY_LENGTH( |
205 st_entry->filename)); | 199 st_entry->str)); |
206 gcov_write_unsigned(st_entry->index); | 200 gcov_write_unsigned(st_entry->index); |
207 gcov_write_string(st_entry->filename); | 201 gcov_write_string(st_entry->str); |
208 } | 202 } |
209 | 203 |
210 /* Compute TOOL_HEADER length for writing into the gcov file. */ | 204 /* Compute TOOL_HEADER length for writing into the gcov file. */ |
211 | 205 |
212 static gcov_unsigned_t | 206 static gcov_unsigned_t |
213 gcov_tag_pmu_tool_header_length (gcov_pmu_tool_header_t *header) | 207 gcov_tag_pmu_tool_header_length (gcov_pmu_tool_header_t *header) |
214 { | 208 { |
215 gcov_unsigned_t len = 0; | 209 gcov_unsigned_t len = 0; |
216 if (header) | 210 if (header) |
217 { | 211 { |
(...skipping 17 matching lines...) Expand all Loading... | |
235 gcov_write_tag_length (GCOV_TAG_PMU_TOOL_HEADER, len); | 229 gcov_write_tag_length (GCOV_TAG_PMU_TOOL_HEADER, len); |
236 gcov_write_string (header->host_cpu); | 230 gcov_write_string (header->host_cpu); |
237 gcov_write_string (header->hostname); | 231 gcov_write_string (header->hostname); |
238 gcov_write_string (header->kernel_version); | 232 gcov_write_string (header->kernel_version); |
239 gcov_write_string (header->column_header); | 233 gcov_write_string (header->column_header); |
240 gcov_write_string (header->column_description); | 234 gcov_write_string (header->column_description); |
241 gcov_write_string (header->full_header); | 235 gcov_write_string (header->full_header); |
242 } | 236 } |
243 | 237 |
244 #endif | 238 #endif |
LEFT | RIGHT |