This patch addresses the bogus "Invocation mismatch" messages seen in parallel
profiledbootstrap builds of gcc. See PR bootstrap/55051 for a discussion of
why this is occurring and why this checking is inaccurate. Leave it in when
!GCOV_LOCKED, to warn about concurrent update issues requiring locking.
2012-11-18 Teresa Johnson <tejohnson@google.com>
PR bootstrap/55051
* libgcov.c (gcov_exit): Remove merged program summary
comparison unless !GCOV_LOCKED.
From-SVN: r193612
This fixes part of the issue described in PR gcov-profile/54487 where
there were warnings about mismatches due to slight differences in the
merged histograms in different object files. This can happen due to
the truncating integer division in the merge routine, which could result
in slightly different histograms when summaries are merged in different
orders.
2012-09-07 Teresa Johnson <tejohnson@google.com>
PR gcov-profile/54487
* libgcc/libgcov.c (gcov_exit): Avoid warning on histogram
differences.
From-SVN: r191074
Enhances the gcov program summary by adding a histogram of arc counter
entries. This is used to compute working set information in the compiler
for use by optimizations that need information on hot vs cold counter
values or the rough working set size in terms of the number of counters.
Each working set data point is the minimum counter value and number of
counters required to reach a given percentage of the cumulative counter
sum across the profiled execution (sum_all in the program summary).
2012-09-04 Teresa Johnson <tejohnson@google.com>
* libgcc/libgcov.c (struct gcov_summary_buffer): New structure.
(gcov_histogram_insert): New function.
(gcov_compute_histogram): Ditto.
(gcov_exit): Invoke gcov_compute_histogram, and perform merging of
histograms during summary merging.
* gcc/gcov-io.c (gcov_write_summary): Write out non-zero histogram
entries to function summary along with an occupancy bit vector.
(gcov_read_summary): Read in the histogram entries.
(gcov_histo_index): New function.
(void gcov_histogram_merge): Ditto.
* gcc/gcov-io.h (gcov_type_unsigned): New type.
(struct gcov_bucket_type): Ditto.
(struct gcov_ctr_summary): Include histogram.
(GCOV_TAG_SUMMARY_LENGTH): Update to include histogram entries.
(GCOV_HISTOGRAM_SIZE): New macro.
(GCOV_HISTOGRAM_BITVECTOR_SIZE): Ditto.
* gcc/profile.c (NUM_GCOV_WORKING_SETS): Ditto.
(gcov_working_sets): New global variable.
(compute_working_sets): New function.
(find_working_set): Ditto.
(get_exec_counts): Invoke compute_working_sets.
* gcc/coverage.c (read_counts_file): Merge histograms, and
fix bug with accessing summary info for non-summable counters.
* gcc/basic-block.h (gcov_type_unsigned): New type.
(struct gcov_working_set_info): Ditto.
(find_working_set): Declare.
* gcc/gcov-dump.c (tag_summary): Dump out histogram.
From-SVN: r190952
gcc/
* coverage.c: Refer to "notes file" instead of "graph file"
in all comments. Explain history of bbg prefix.
* gcov-io.h: Likewise.
* gcov.c: Likewise.
(find_source): Likewise in fnotice.
(read_graph_file): Likewise.
(read_count_file): Likewise.
* doc/gcov.texi: Document -fprofile-dir flag. Add "notes file"
and "data file" explicitly in the explanation of the files.
libgcc/
* libgcov.c (__gcov_ior_profiler): Benign comment fix.
From-SVN: r189781
This patch adds functionality to libgcov to enable user applications to
collect profile data only in regions of interest. This is useful, for
example, to collect profile data from a long-running server only
during the time when it is serving requests.
Specifically, the new routines __gcov_reset will clear all profile counters
to zero and __gcov_dump will write out the profile information collected so
far. A global variable is used to prevent writing out the profile a
second time during exit.
2012-05-08 Teresa Johnson <tejohnson@google.com>
* libgcc/libgcov.c (gcov_clear, __gcov_reset): New functions.
(__gcov_dump): Ditto.
(gcov_dump_complete): New global variable.
(gcov_exit): Export hidden to enable use in L_gcov_dump.
(__gcov_flush): Outline functionality now in gcov_clear.
* libgcc/Makefile.in (L_gcov_reset, L_gcov_dump): Define.
* gcc/gcov-io.h (__gcov_reset, __gcov_dump): Declare.
* gcc/doc/gcov.texi: Add note on using __gcov_reset and __gcov_dump.
From-SVN: r187297
2012-03-12 Richard Guenther <rguenther@suse.de>
* gthr.h (__GTHREAD_MUTEX_INIT_FUNCTION): Adjust specification.
* gthr-posix.h (__GTHREAD_MUTEX_INIT_FUNCTION): Define.
(__gthread_mutex_init_function): New function.
* gthr-single.h (__GTHREAD_MUTEX_INIT_FUNCTION): Define.
PR gcov/49484
* libgcov.c: Include gthr.h.
(__gcov_flush_mx): New global variable.
(init_mx, init_mx_once): New functions.
(__gcov_flush): Protect self with a mutex.
(__gcov_fork): Re-initialize mutex after forking.
* unwind-dw2-fde.c: Change condition under which to use
__GTHREAD_MUTEX_INIT_FUNCTION.
From-SVN: r185231
* libgcov.c (gcov_crc32): Remove global var.
(free_fn_data): New function.
(buffer_fn_data): Pass in filename, more robust error recovery.
(crc32_unsigned): New function.
(gcov_exit): More robust detection of new program. More robust
error recovery.
(__gcov_init): Do not update program's crc here.
From-SVN: r182743
libgcc/
* libgcov.c (struct gcov_fn_buffer): New struct.
(buffer_fn_data): New helper.
(gcov_exit): Rework for new gcov data structures.
gcc/
* gcov.c (object_summary): Replace with ...
(object_runs): ... this.
(process_file): Remove functions with no data.
(generate_results): Ignore files with no lines.
(release_function): New helper, broken out of ...
(release_structures): ... here. Use it.
(read_count_file): Adjust for new data file format.
(output_lines): Use object_runs.
* gcov-io.h (GCOV_TAG_OBJECT_SUMMARY): Obsolete.
(struct gcov_ctr_info): Move definition.
(struct gcov_fn_info): Add key field, use gcov_ctr_info for
trailing array.
(struct gcov_info): Add merge function array, remove mask and
counts. Trailing array is array of pointers to function info.
* coverage.c (struct function_list): Replace counter numbers with
counter arrays. Add fndecl field. GTYify.
(counts_entry): Remove chain workspace.
(functions_head): GTYify.
(prg_n_ctrs): Remove.
(fn_v_ctrs): New.
(tree_ctr_tables): Remove.
(read_counts_file): Cope with blank entries and expect program
summaries before functions. Don't warn on missing entries.
(coverage_counter_alloc): Allocate individual function arrays.
(tree_coverage_counter_ref, tree_coverage_counter_addr): Adjust
for individual function arrays.
(coverage_end_function): GTYify function list object. Finalize
function's counter arrays.
(build_var): New. Create a counter-related variable with
appropriate linkage.
(build_fn_info_type): Adjust for new runtime structure.
(build_fn_info_value): Rename to ...
(build_fn_info): ... here. Build new format data.
(build_ctr_info_type, build_ctr_info_value): Remove.
(build_info_type): New. Build new format data structure.
(build_info): Adjust for new format data.
(create_coverage): Likewise.
* gcov-dump.c (tag_function): Recognize placeholders.
gcc/testsuite/
* gcc.dg/profile-dir-1.c: Adjust final scan.
* gcc.dg/profile-dir-2.c: Adjust final scan.
* gcc.dg/profile-dir-3.c: Adjust final scan.
* gcc.misc-tests/gcov.exp: Adjust regexp.
* gcc.misc-tests/gcov-12.c: New.
* gcc.misc-tests/gcov-13.c: New.
* gcc.misc-tests/gcovpart-13b.c: New.
* gcc.misc-tests/gcov-14.c: New.
From-SVN: r181105