Merge aosp-toolchain/gcc/gcc-4_9 changes.
[official-gcc.git] / gcc-4_8 / gcc / gcov-io.h
blob063a8ce82039b0e7de40e85334d45e2225a55b97
1 /* File format for coverage information
2 Copyright (C) 1996-2013 Free Software Foundation, Inc.
3 Contributed by Bob Manson <manson@cygnus.com>.
4 Completely remangled by Nathan Sidwell <nathan@codesourcery.com>.
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 3, or (at your option) any later
11 version.
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 for more details.
18 Under Section 7 of GPL version 3, you are granted additional
19 permissions described in the GCC Runtime Library Exception, version
20 3.1, as published by the Free Software Foundation.
22 You should have received a copy of the GNU General Public License and
23 a copy of the GCC Runtime Library Exception along with this program;
24 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
25 <http://www.gnu.org/licenses/>. */
28 /* Coverage information is held in two files. A notes file, which is
29 generated by the compiler, and a data file, which is generated by
30 the program under test. Both files use a similar structure. We do
31 not attempt to make these files backwards compatible with previous
32 versions, as you only need coverage information when developing a
33 program. We do hold version information, so that mismatches can be
34 detected, and we use a format that allows tools to skip information
35 they do not understand or are not interested in.
37 Numbers are recorded in the 32 bit unsigned binary form of the
38 endianness of the machine generating the file. 64 bit numbers are
39 stored as two 32 bit numbers, the low part first. Strings are
40 padded with 1 to 4 NUL bytes, to bring the length up to a multiple
41 of 4. The number of 4 bytes is stored, followed by the padded
42 string. Zero length and NULL strings are simply stored as a length
43 of zero (they have no trailing NUL or padding).
45 int32: byte3 byte2 byte1 byte0 | byte0 byte1 byte2 byte3
46 int64: int32:low int32:high
47 string: int32:0 | int32:length char* char:0 padding
48 padding: | char:0 | char:0 char:0 | char:0 char:0 char:0
49 item: int32 | int64 | string
51 The basic format of the files is
53 file : int32:magic int32:version int32:stamp record*
55 The magic ident is different for the notes and the data files. The
56 magic ident is used to determine the endianness of the file, when
57 reading. The version is the same for both files and is derived
58 from gcc's version number. The stamp value is used to synchronize
59 note and data files and to synchronize merging within a data
60 file. It need not be an absolute time stamp, merely a ticker that
61 increments fast enough and cycles slow enough to distinguish
62 different compile/run/compile cycles.
64 Although the ident and version are formally 32 bit numbers, they
65 are derived from 4 character ASCII strings. The version number
66 consists of the single character major version number, a two
67 character minor version number (leading zero for versions less than
68 10), and a single character indicating the status of the release.
69 That will be 'e' experimental, 'p' prerelease and 'r' for release.
70 Because, by good fortune, these are in alphabetical order, string
71 collating can be used to compare version strings. Be aware that
72 the 'e' designation will (naturally) be unstable and might be
73 incompatible with itself. For gcc 3.4 experimental, it would be
74 '304e' (0x33303465). When the major version reaches 10, the
75 letters A-Z will be used. Assuming minor increments releases every
76 6 months, we have to make a major increment every 50 years.
77 Assuming major increments releases every 5 years, we're ok for the
78 next 155 years -- good enough for me.
80 A record has a tag, length and variable amount of data.
82 record: header data
83 header: int32:tag int32:length
84 data: item*
86 Records are not nested, but there is a record hierarchy. Tag
87 numbers reflect this hierarchy. Tags are unique across note and
88 data files. Some record types have a varying amount of data. The
89 LENGTH is the number of 4bytes that follow and is usually used to
90 determine how much data. The tag value is split into 4 8-bit
91 fields, one for each of four possible levels. The most significant
92 is allocated first. Unused levels are zero. Active levels are
93 odd-valued, so that the LSB of the level is one. A sub-level
94 incorporates the values of its superlevels. This formatting allows
95 you to determine the tag hierarchy, without understanding the tags
96 themselves, and is similar to the standard section numbering used
97 in technical documents. Level values [1..3f] are used for common
98 tags, values [41..9f] for the notes file and [a1..ff] for the data
99 file.
101 The notes file contains the following records
102 note: unit function-graph*
103 unit: header int32:checksum string:source
104 function-graph: announce_function basic_blocks {arcs | lines}*
105 announce_function: header int32:ident
106 int32:lineno_checksum int32:cfg_checksum
107 string:name string:source int32:lineno
108 basic_block: header int32:flags*
109 arcs: header int32:block_no arc*
110 arc: int32:dest_block int32:flags
111 lines: header int32:block_no line*
112 int32:0 string:NULL
113 line: int32:line_no | int32:0 string:filename
115 The BASIC_BLOCK record holds per-bb flags. The number of blocks
116 can be inferred from its data length. There is one ARCS record per
117 basic block. The number of arcs from a bb is implicit from the
118 data length. It enumerates the destination bb and per-arc flags.
119 There is one LINES record per basic block, it enumerates the source
120 lines which belong to that basic block. Source file names are
121 introduced by a line number of 0, following lines are from the new
122 source file. The initial source file for the function is NULL, but
123 the current source file should be remembered from one LINES record
124 to the next. The end of a block is indicated by an empty filename
125 - this does not reset the current source file. Note there is no
126 ordering of the ARCS and LINES records: they may be in any order,
127 interleaved in any manner. The current filename follows the order
128 the LINES records are stored in the file, *not* the ordering of the
129 blocks they are for.
131 The data file contains the following records.
132 data: {unit summary:program* build_info zero_fixup parameter-data
133 function-data*}*
134 unit: header int32:checksum
135 function-data: announce_function present counts
136 announce_function: header int32:ident
137 int32:lineno_checksum int32:cfg_checksum
138 present: header int32:present
139 counts: header int64:count*
140 summary: int32:checksum {count-summary}GCOV_COUNTERS_SUMMABLE
141 count-summary: int32:num int32:runs int64:sum
142 int64:max int64:sum_max histogram
143 histogram: {int32:bitvector}8 histogram-buckets*
144 histogram-buckets: int32:num int64:min int64:sum
145 parameter-data: header parm-value*
146 parm-value: string:macro_name int64:value
147 build_info: string:info*
148 zero_fixup: int32:num int32:bitvector*
150 The ANNOUNCE_FUNCTION record is the same as that in the note file,
151 but without the source location. The COUNTS gives the
152 counter values for instrumented features. The about the whole
153 program. The checksum is used for whole program summaries, and
154 disambiguates different programs which include the same
155 instrumented object file. There may be several program summaries,
156 each with a unique checksum. Note that the data file might contain
157 information from several runs concatenated, or the data might be merged.
159 BUILD_INFO record contains a list of strings that is used
160 to include in the data file information about the profile generate
161 build. For example, it can be used to include source revision
162 information that is useful in diagnosing profile mis-matches.
164 ZERO_FIXUP record contains a count of functions in the gcda file
165 and an array of bitvectors indexed by the function index's in the
166 function-data section. Each bit flags whether the function was a
167 COMDAT that had all-zero profiles that was fixed up by dyn-ipa
168 using profiles from functions with matching checksums in other modules.
170 This file is included by both the compiler, gcov tools and the
171 runtime support library libgcov. IN_LIBGCOV and IN_GCOV are used to
172 distinguish which case is which. If IN_LIBGCOV is nonzero,
173 libgcov is being built. If IN_GCOV is nonzero, the gcov tools are
174 being built. Otherwise the compiler is being built. IN_GCOV may be
175 positive or negative. If positive, we are compiling a tool that
176 requires additional functions (see the code for knowledge of what
177 those functions are). */
179 #ifndef GCC_GCOV_IO_H
180 #define GCC_GCOV_IO_H
182 #ifndef IN_LIBGCOV
183 /* About the host */
185 typedef unsigned gcov_unsigned_t;
186 typedef unsigned gcov_position_t;
188 #if LONG_LONG_TYPE_SIZE > 32
189 #define GCOV_TYPE_ATOMIC_FETCH_ADD_FN __atomic_fetch_add_8
190 #define GCOV_TYPE_ATOMIC_FETCH_ADD BUILT_IN_ATOMIC_FETCH_ADD_8
191 #else
192 #define GCOV_TYPE_ATOMIC_FETCH_ADD_FN __atomic_fetch_add_4
193 #define GCOV_TYPE_ATOMIC_FETCH_ADD BUILT_IN_ATOMIC_FETCH_ADD_4
194 #endif
195 #define PROFILE_GEN_EDGE_ATOMIC (flag_profile_gen_atomic == 1 || \
196 flag_profile_gen_atomic == 3)
197 #define PROFILE_GEN_VALUE_ATOMIC (flag_profile_gen_atomic == 2 || \
198 flag_profile_gen_atomic == 3)
200 /* gcov_type is typedef'd elsewhere for the compiler */
201 #if IN_GCOV
202 #define GCOV_LINKAGE static
203 typedef HOST_WIDEST_INT gcov_type;
204 typedef unsigned HOST_WIDEST_INT gcov_type_unsigned;
205 #if IN_GCOV > 0
206 #include <sys/types.h>
207 #endif
209 #define FUNC_ID_WIDTH HOST_BITS_PER_WIDE_INT/2
210 #define FUNC_ID_MASK ((1L << FUNC_ID_WIDTH) - 1)
211 #define EXTRACT_MODULE_ID_FROM_GLOBAL_ID(gid) (unsigned)(((gid) >> FUNC_ID_WIDTH) & FUNC_ID_MASK)
212 #define EXTRACT_FUNC_ID_FROM_GLOBAL_ID(gid) (unsigned)((gid) & FUNC_ID_MASK)
213 #define FUNC_GLOBAL_ID(m,f) ((((HOST_WIDE_INT) (m)) << FUNC_ID_WIDTH) | (f)
215 #else /*!IN_GCOV */
216 #define GCOV_TYPE_SIZE (LONG_LONG_TYPE_SIZE > 32 ? 64 : 32)
217 #endif
219 #if defined (HOST_HAS_F_SETLKW)
220 #define GCOV_LOCKED 1
221 #else
222 #define GCOV_LOCKED 0
223 #endif
225 #define ATTRIBUTE_HIDDEN
227 #endif /* !IN_LIBGCOV */
229 #ifndef GCOV_LINKAGE
230 #define GCOV_LINKAGE extern
231 #endif
233 /* File suffixes. */
234 #define GCOV_DATA_SUFFIX ".gcda"
235 #define GCOV_NOTE_SUFFIX ".gcno"
237 /* File magic. Must not be palindromes. */
238 #define GCOV_DATA_MAGIC ((gcov_unsigned_t)0x67636461) /* "gcda" */
239 #define GCOV_NOTE_MAGIC ((gcov_unsigned_t)0x67636e6f) /* "gcno" */
241 /* gcov-iov.h is automatically generated by the makefile from
242 version.c, it looks like
243 #define GCOV_VERSION ((gcov_unsigned_t)0x89abcdef)
245 #include "gcov-iov.h"
247 /* Convert a magic or version number to a 4 character string. */
248 #define GCOV_UNSIGNED2STRING(ARRAY,VALUE) \
249 ((ARRAY)[0] = (char)((VALUE) >> 24), \
250 (ARRAY)[1] = (char)((VALUE) >> 16), \
251 (ARRAY)[2] = (char)((VALUE) >> 8), \
252 (ARRAY)[3] = (char)((VALUE) >> 0))
254 /* The record tags. Values [1..3f] are for tags which may be in either
255 file. Values [41..9f] for those in the note file and [a1..ff] for
256 the data file. The tag value zero is used as an explicit end of
257 file marker -- it is not required to be present. */
259 #define GCOV_TAG_FUNCTION ((gcov_unsigned_t)0x01000000)
260 #define GCOV_TAG_FUNCTION_LENGTH (3)
261 #define GCOV_TAG_BLOCKS ((gcov_unsigned_t)0x01410000)
262 #define GCOV_TAG_BLOCKS_LENGTH(NUM) (NUM)
263 #define GCOV_TAG_BLOCKS_NUM(LENGTH) (LENGTH)
264 #define GCOV_TAG_ARCS ((gcov_unsigned_t)0x01430000)
265 #define GCOV_TAG_ARCS_LENGTH(NUM) (1 + (NUM) * 2)
266 #define GCOV_TAG_ARCS_NUM(LENGTH) (((LENGTH) - 1) / 2)
267 #define GCOV_TAG_LINES ((gcov_unsigned_t)0x01450000)
268 #define GCOV_TAG_COUNTER_BASE ((gcov_unsigned_t)0x01a10000)
269 #define GCOV_TAG_COUNTER_LENGTH(NUM) ((NUM) * 2)
270 #define GCOV_TAG_COUNTER_NUM(LENGTH) ((LENGTH) / 2)
271 #define GCOV_TAG_OBJECT_SUMMARY ((gcov_unsigned_t)0xa1000000) /* Obsolete */
272 #define GCOV_TAG_PROGRAM_SUMMARY ((gcov_unsigned_t)0xa3000000)
273 #define GCOV_TAG_COMDAT_ZERO_FIXUP ((gcov_unsigned_t)0xa9000000)
274 /* Ceiling divide by 32 bit word size, plus one word to hold NUM. */
275 #define GCOV_TAG_COMDAT_ZERO_FIXUP_LENGTH(NUM) (1 + (NUM + 31) / 32)
276 #define GCOV_TAG_SUMMARY_LENGTH(NUM) \
277 (1 + GCOV_COUNTERS_SUMMABLE * (10 + 3 * 2) + (NUM) * 5)
278 #define GCOV_TAG_PARAMETERS ((gcov_unsigned_t)0xa5000000)
279 #define GCOV_TAG_BUILD_INFO ((gcov_unsigned_t)0xa7000000)
280 #define GCOV_TAG_MODULE_INFO ((gcov_unsigned_t)0xab000000)
281 #define GCOV_TAG_AFDO_FILE_NAMES ((gcov_unsigned_t)0xaa000000)
282 #define GCOV_TAG_AFDO_FUNCTION ((gcov_unsigned_t)0xac000000)
283 #define GCOV_TAG_AFDO_MODULE_GROUPING ((gcov_unsigned_t)0xae000000)
284 #define GCOV_TAG_AFDO_WORKING_SET ((gcov_unsigned_t)0xaf000000)
286 /* Counters that are collected. */
287 #define GCOV_COUNTER_ARCS 0 /* Arc transitions. */
288 #define GCOV_COUNTERS_SUMMABLE 1 /* Counters which can be
289 summaried. */
290 #define GCOV_FIRST_VALUE_COUNTER 1 /* The first of counters used for value
291 profiling. They must form a consecutive
292 interval and their order must match
293 the order of HIST_TYPEs in
294 value-prof.h. */
295 #define GCOV_COUNTER_V_INTERVAL 1 /* Histogram of value inside an interval. */
296 #define GCOV_COUNTER_V_POW2 2 /* Histogram of exact power2 logarithm
297 of a value. */
298 #define GCOV_COUNTER_V_SINGLE 3 /* The most common value of expression. */
299 #define GCOV_COUNTER_V_DELTA 4 /* The most common difference between
300 consecutive values of expression. */
302 #define GCOV_COUNTER_V_INDIR 5 /* The most common indirect address */
303 #define GCOV_COUNTER_AVERAGE 6 /* Compute average value passed to the
304 counter. */
305 #define GCOV_COUNTER_IOR 7 /* IOR of the all values passed to
306 counter. */
307 #define GCOV_COUNTER_ICALL_TOPNV 8 /* Top N value tracking for indirect calls */
308 #define GCOV_LAST_VALUE_COUNTER 8 /* The last of counters used for value
309 profiling. */
310 #define GCOV_COUNTER_DIRECT_CALL 9 /* Direct call counts. */
311 #define GCOV_COUNTERS 10
313 /* Number of counters used for value profiling. */
314 #define GCOV_N_VALUE_COUNTERS \
315 (GCOV_LAST_VALUE_COUNTER - GCOV_FIRST_VALUE_COUNTER + 1)
317 /* A list of human readable names of the counters */
318 #define GCOV_COUNTER_NAMES {"arcs", "interval", "pow2", "single", \
319 "delta","indirect_call", "average", "ior", \
320 "indirect_call_topn", "direct_call"}
322 #define GCOV_ICALL_TOPN_VAL 2 /* Track two hottest callees */
323 #define GCOV_ICALL_TOPN_NCOUNTS 9 /* The number of counter entries per icall callsite */
324 /* Names of merge functions for counters. */
325 #define GCOV_MERGE_FUNCTIONS {"__gcov_merge_add", \
326 "__gcov_merge_add", \
327 "__gcov_merge_add", \
328 "__gcov_merge_single", \
329 "__gcov_merge_delta", \
330 "__gcov_merge_single", \
331 "__gcov_merge_add", \
332 "__gcov_merge_ior", \
333 "__gcov_merge_icall_topn",\
334 "__gcov_merge_dc" }
336 /* Convert a counter index to a tag. */
337 #define GCOV_TAG_FOR_COUNTER(COUNT) \
338 (GCOV_TAG_COUNTER_BASE + ((gcov_unsigned_t)(COUNT) << 17))
339 /* Convert a tag to a counter. */
340 #define GCOV_COUNTER_FOR_TAG(TAG) \
341 ((unsigned)(((TAG) - GCOV_TAG_COUNTER_BASE) >> 17))
342 /* Check whether a tag is a counter tag. */
343 #define GCOV_TAG_IS_COUNTER(TAG) \
344 (!((TAG) & 0xFFFF) && GCOV_COUNTER_FOR_TAG (TAG) < GCOV_COUNTERS)
346 /* The tag level mask has 1's in the position of the inner levels, &
347 the lsb of the current level, and zero on the current and outer
348 levels. */
349 #define GCOV_TAG_MASK(TAG) (((TAG) - 1) ^ (TAG))
351 /* Return nonzero if SUB is an immediate subtag of TAG. */
352 #define GCOV_TAG_IS_SUBTAG(TAG,SUB) \
353 (GCOV_TAG_MASK (TAG) >> 8 == GCOV_TAG_MASK (SUB) \
354 && !(((SUB) ^ (TAG)) & ~GCOV_TAG_MASK(TAG)))
356 /* Return nonzero if SUB is at a sublevel to TAG. */
357 #define GCOV_TAG_IS_SUBLEVEL(TAG,SUB) \
358 (GCOV_TAG_MASK (TAG) > GCOV_TAG_MASK (SUB))
360 /* Basic block flags. */
361 #define GCOV_BLOCK_UNEXPECTED (1 << 1)
363 /* Arc flags. */
364 #define GCOV_ARC_ON_TREE (1 << 0)
365 #define GCOV_ARC_FAKE (1 << 1)
366 #define GCOV_ARC_FALLTHROUGH (1 << 2)
368 /* Structured records. */
370 /* Structure used for each bucket of the log2 histogram of counter values. */
371 typedef struct
373 /* Number of counters whose profile count falls within the bucket. */
374 gcov_unsigned_t num_counters;
375 /* Smallest profile count included in this bucket. */
376 gcov_type min_value;
377 /* Cumulative value of the profile counts in this bucket. */
378 gcov_type cum_value;
379 } gcov_bucket_type;
381 /* For a log2 scale histogram with each range split into 4
382 linear sub-ranges, there will be at most 64 (max gcov_type bit size) - 1 log2
383 ranges since the lowest 2 log2 values share the lowest 4 linear
384 sub-range (values 0 - 3). This is 252 total entries (63*4). */
386 #define GCOV_HISTOGRAM_SIZE 252
388 /* How many unsigned ints are required to hold a bit vector of non-zero
389 histogram entries when the histogram is written to the gcov file.
390 This is essentially a ceiling divide by 32 bits. */
391 #define GCOV_HISTOGRAM_BITVECTOR_SIZE (GCOV_HISTOGRAM_SIZE + 31) / 32
393 /* Cumulative counter data. */
394 struct gcov_ctr_summary
396 gcov_unsigned_t num; /* number of counters. */
397 gcov_unsigned_t runs; /* number of program runs */
398 gcov_type sum_all; /* sum of all counters accumulated. */
399 gcov_type run_max; /* maximum value on a single run. */
400 gcov_type sum_max; /* sum of individual run max values. */
401 gcov_bucket_type histogram[GCOV_HISTOGRAM_SIZE]; /* histogram of
402 counter values. */
405 /* Object & program summary record. */
406 struct gcov_summary
408 gcov_unsigned_t checksum; /* checksum of program */
409 struct gcov_ctr_summary ctrs[GCOV_COUNTERS_SUMMABLE];
412 #define GCOV_MODULE_UNKNOWN_LANG 0
413 #define GCOV_MODULE_C_LANG 1
414 #define GCOV_MODULE_CPP_LANG 2
415 #define GCOV_MODULE_FORT_LANG 3
417 #define GCOV_MODULE_ASM_STMTS (1 << 16)
418 #define GCOV_MODULE_LANG_MASK 0xffff
420 /* Source module info. The data structure is used in
421 both runtime and profile-use phase. Make sure to allocate
422 enough space for the variable length member. */
423 struct gcov_module_info
425 gcov_unsigned_t ident;
426 gcov_unsigned_t is_primary; /* this is overloaded to mean two things:
427 (1) means FDO/LIPO in instrumented binary.
428 (2) means IS_PRIMARY in persistent file or
429 memory copy used in profile-use. */
430 gcov_unsigned_t flags; /* bit 0: is_exported,
431 bit 1: need to include all the auxiliary
432 modules in use compilation. */
433 gcov_unsigned_t lang; /* lower 16 bits encode the language, and the upper
434 16 bits enocde other attributes, such as whether
435 any assembler is present in the source, etc. */
436 gcov_unsigned_t ggc_memory; /* memory needed for parsing in kb */
437 char *da_filename;
438 char *source_filename;
439 gcov_unsigned_t num_quote_paths;
440 gcov_unsigned_t num_bracket_paths;
441 gcov_unsigned_t num_system_paths;
442 gcov_unsigned_t num_cpp_defines;
443 gcov_unsigned_t num_cpp_includes;
444 gcov_unsigned_t num_cl_args;
445 char *string_array[1];
448 extern struct gcov_module_info **module_infos;
449 extern unsigned primary_module_id;
450 #define SET_MODULE_INCLUDE_ALL_AUX(modu) ((modu->flags |= 0x2))
451 #define MODULE_INCLUDE_ALL_AUX_FLAG(modu) ((modu->flags & 0x2))
452 #define SET_MODULE_EXPORTED(modu) ((modu->flags |= 0x1))
453 #define MODULE_EXPORTED_FLAG(modu) ((modu->flags & 0x1))
454 #define PRIMARY_MODULE_EXPORTED \
455 (MODULE_EXPORTED_FLAG (module_infos[0]) \
456 && !((module_infos[0]->lang & GCOV_MODULE_ASM_STMTS) \
457 && flag_ripa_disallow_asm_modules))
459 /* Parameter values determined at profile time that should be applied to
460 profile-use compiles as macro definitions. */
461 struct gcov_parameter_value
463 struct gcov_parameter_value *next;
464 char *macro_name;
465 gcov_type value;
468 #if !defined(inhibit_libc)
470 /* Functions for reading and writing gcov files. In libgcov you can
471 open the file for reading then writing. Elsewhere you can open the
472 file either for reading or for writing. When reading a file you may
473 use the gcov_read_* functions, gcov_sync, gcov_position, &
474 gcov_error. When writing a file you may use the gcov_write
475 functions, gcov_seek & gcov_error. When a file is to be rewritten
476 you use the functions for reading, then gcov_rewrite then the
477 functions for writing. Your file may become corrupted if you break
478 these invariants. */
479 #if !IN_LIBGCOV
480 GCOV_LINKAGE int gcov_open (const char */*name*/, int /*direction*/);
481 GCOV_LINKAGE int gcov_magic (gcov_unsigned_t, gcov_unsigned_t);
482 #endif
484 /* Available everywhere. */
485 GCOV_LINKAGE int gcov_close (void) ATTRIBUTE_HIDDEN;
486 GCOV_LINKAGE gcov_unsigned_t gcov_read_unsigned (void) ATTRIBUTE_HIDDEN;
487 GCOV_LINKAGE gcov_type gcov_read_counter (void) ATTRIBUTE_HIDDEN;
488 GCOV_LINKAGE void gcov_read_summary (struct gcov_summary *) ATTRIBUTE_HIDDEN;
489 GCOV_LINKAGE int *gcov_read_comdat_zero_fixup (gcov_unsigned_t,
490 gcov_unsigned_t *)
491 ATTRIBUTE_HIDDEN;
492 GCOV_LINKAGE char **gcov_read_build_info (gcov_unsigned_t, gcov_unsigned_t *)
493 ATTRIBUTE_HIDDEN;
494 GCOV_LINKAGE struct gcov_parameter_value *gcov_read_parameters (gcov_unsigned_t)
495 ATTRIBUTE_HIDDEN;
496 GCOV_LINKAGE const char *gcov_read_string (void);
497 GCOV_LINKAGE void gcov_sync (gcov_position_t /*base*/,
498 gcov_unsigned_t /*length */);
499 GCOV_LINKAGE gcov_unsigned_t gcov_read_string_array (char **, gcov_unsigned_t)
500 ATTRIBUTE_HIDDEN;
502 #if !IN_LIBGCOV && IN_GCOV != 1
503 GCOV_LINKAGE void gcov_read_module_info (struct gcov_module_info *mod_info,
504 gcov_unsigned_t len) ATTRIBUTE_HIDDEN;
505 #endif
507 #if !IN_GCOV
508 /* Available outside gcov */
509 GCOV_LINKAGE void gcov_write_unsigned (gcov_unsigned_t) ATTRIBUTE_HIDDEN;
510 GCOV_LINKAGE gcov_unsigned_t gcov_compute_string_array_len (char **,
511 gcov_unsigned_t)
512 ATTRIBUTE_HIDDEN;
513 GCOV_LINKAGE void gcov_write_string_array (char **, gcov_unsigned_t)
514 ATTRIBUTE_HIDDEN;
515 GCOV_LINKAGE void gcov_write_string (const char *);
516 #endif
518 #if !IN_GCOV && !IN_LIBGCOV
519 /* Available only in compiler */
520 GCOV_LINKAGE unsigned gcov_histo_index (gcov_type value);
521 GCOV_LINKAGE gcov_position_t gcov_write_tag (gcov_unsigned_t);
522 GCOV_LINKAGE void gcov_write_length (gcov_position_t /*position*/);
523 #endif
525 #if IN_GCOV <= 0 && !IN_LIBGCOV
526 /* Available in gcov-dump and the compiler. */
528 /* Number of data points in the working set summary array. Using 128
529 provides information for at least every 1% increment of the total
530 profile size. The last entry is hardwired to 99.9% of the total. */
531 #define NUM_GCOV_WORKING_SETS 128
533 /* Working set size statistics for a given percentage of the entire
534 profile (sum_all from the counter summary). */
535 typedef struct gcov_working_set_info
537 /* Number of hot counters included in this working set. */
538 unsigned num_counters;
539 /* Smallest counter included in this working set. */
540 gcov_type min_counter;
541 } gcov_working_set_t;
543 GCOV_LINKAGE void compute_working_sets (const struct gcov_ctr_summary *summary,
544 gcov_working_set_t *gcov_working_sets);
545 #endif
547 #if IN_GCOV > 0
548 /* Available in gcov */
549 GCOV_LINKAGE time_t gcov_time (void);
550 #endif
552 #endif /* !inhibit_libc */
554 #endif /* GCC_GCOV_IO_H */