Commit Graph

20 Commits

Author SHA1 Message Date
Jakub Jelinek a554497024 Update copyright years.
From-SVN: r267494
2019-01-01 13:31:55 +01:00
Martin Liska 512cc01512 Remove arc profile histogram in non-LTO mode.
2018-09-21  Martin Liska  <mliska@suse.cz>

	* auto-profile.c (autofdo_source_profile::read): Do not
	set sum_all.
	(read_profile): Do not add working sets.
	(read_autofdo_file): Remove sum_all.
	(afdo_callsite_hot_enough_for_early_inline): Remove const
	qualifier.
	* coverage.c (struct counts_entry): Remove gcov_summary.
	(read_counts_file): Read new GCOV_TAG_OBJECT_SUMMARY,
	do not support GCOV_TAG_PROGRAM_SUMMARY.
	(get_coverage_counts): Remove summary and expected
	arguments.
	* coverage.h (get_coverage_counts): Likewise.
	* doc/gcov-dump.texi: Remove -w option.
	* gcov-dump.c (dump_working_sets): Remove.
	(main): Do not support '-w' option.
	(print_usage): Likewise.
	(tag_summary): Likewise.
	* gcov-io.c (gcov_write_summary): Do not dump
	histogram.
	(gcov_read_summary): Likewise.
	(gcov_histo_index): Remove.
	(gcov_histogram_merge): Likewise.
	(compute_working_sets): Likewise.
	* gcov-io.h (GCOV_TAG_OBJECT_SUMMARY): Mark
	it not obsolete.
	(GCOV_TAG_PROGRAM_SUMMARY): Mark it obsolete.
	(GCOV_TAG_SUMMARY_LENGTH): Adjust.
	(GCOV_HISTOGRAM_SIZE): Remove.
	(GCOV_HISTOGRAM_BITVECTOR_SIZE): Likewise.
	(struct gcov_summary): Simplify rapidly just
	to runs and sum_max fields.
	(gcov_histo_index): Remove.
	(NUM_GCOV_WORKING_SETS): Likewise.
	(compute_working_sets): Likewise.
	* gcov-tool.c (print_overlap_usage_message): Remove
	trailing empty line.
	* gcov.c (read_count_file): Read GCOV_TAG_OBJECT_SUMMARY.
	(output_lines): Remove program related line.
	* ipa-profile.c (ipa_profile): Do not consider GCOV histogram.
	* lto-cgraph.c (output_profile_summary): Do not stream GCOV
	histogram.
	(input_profile_summary): Do not read it.
	(merge_profile_summaries): And do not merge it.
	(input_symtab): Do not call removed function.
	* modulo-sched.c (sms_schedule): Do not print sum_max.
	* params.def (HOT_BB_COUNT_FRACTION): Reincarnate param that was
	removed when histogram method was invented.
	(HOT_BB_COUNT_WS_PERMILLE): Mention that it's used only in LTO
	mode.
	* postreload-gcse.c (eliminate_partially_redundant_load): Fix
	GCOV coding style.
	* predict.c (get_hot_bb_threshold): Use HOT_BB_COUNT_FRACTION
	and dump selected value.
	* profile.c (add_working_set): Remove.
	(get_working_sets): Likewise.
	(find_working_set): Likewise.
	(get_exec_counts): Do not work with working sets.
	(read_profile_edge_counts): Do not inform as sum_max is removed.
	(compute_branch_probabilities): Likewise.
	(compute_value_histograms): Remove argument for call of
	get_coverage_counts.
	* profile.h: Do not make gcov_summary const.
2018-09-21  Martin Liska  <mliska@suse.cz>

	* libgcov-driver.c (crc32_unsigned): Remove.
	(gcov_histogram_insert): Likewise.
	(gcov_compute_histogram): Likewise.
	(compute_summary): Simplify rapidly.
	(merge_one_data): Do not handle PROGRAM_SUMMARY tag.
	(merge_summary): Rapidly simplify.
	(dump_one_gcov): Ignore gcov_summary.
	(gcov_do_dump): Do not handle program summary, it's not
	used.
	* libgcov-util.c (tag_summary): Remove.
	(read_gcda_finalize): Fix coding style.
	(read_gcda_file): Initialize curr_object_summary.
	(compute_summary): Remove.
	(calculate_overlap): Remove settings of run_max.

From-SVN: r264462
2018-09-21 08:41:17 +00:00
Martin Liska 6c086e8c75 Fix libgcov-driver-system bootstrap failure (PR bootstrap/86057).
2018-06-07  Martin Liska  <mliska@suse.cz>

        PR bootstrap/86057
	* libgcov-driver-system.c (replace_filename_variables): Use
        memcpy instead of mempcpy.
	(allocate_filename_struct): Do not allocate filename, allocate
        prefix and set it.
	(gcov_exit_open_gcda_file): Allocate memory for gf->filename
        here and properly copy content into it.
	* libgcov-driver.c (struct gcov_filename): Remove max_length
        field, change prefix from size_t into char *.
	(compute_summary): Do not calculate longest filename.
	(gcov_do_dump): Release memory of gf.filename after each file.
	* libgcov-util.c (compute_summary): Use new signature of
        compute_summary.
	(calculate_overlap): Likewise.

From-SVN: r261260
2018-06-07 04:21:35 +00:00
Martin Liska 7f3577f528 Simplify gcov_histogram as it's used only for ARCS counters.
2018-06-05  Martin Liska  <mliska@suse.cz>

	* auto-profile.c (read_autofdo_file): Do not use
	gcov_ctr_summary struct.
	(afdo_callsite_hot_enough_for_early_inline): Likewise.
	* coverage.c (struct counts_entry): Likewise.
	(read_counts_file): Read just single summary entry.
	(get_coverage_counts): Use gcov_summary struct.
	* coverage.h (get_coverage_counts): Likewise.
	* gcov-dump.c (dump_working_sets): Likewise.
	(tag_summary): Dump just single summary.
	* gcov-io.c (gcov_write_summary): Write just histogram
	summary.
	(gcov_read_summary): Read just single summary.
	(compute_working_sets): Use gcov_summary struct.
	* gcov-io.h (GCOV_TAG_SUMMARY_LENGTH): Remove usage
	of GCOV_COUNTERS_SUMMABLE.
	(GCOV_COUNTERS_SUMMABLE): Remove.
	(GCOV_FIRST_VALUE_COUNTER): Replace with
	GCOV_COUNTER_V_INTERVAL.
	(struct gcov_ctr_summary): Remove.
	(struct gcov_summary): Directly use fields of former
	gcov_ctr_summary.
	(compute_working_sets): Use gcov_summary struct.
	* gcov.c (read_count_file): Do not use ctrs fields.
	* lto-cgraph.c (merge_profile_summaries): Use gcov_summary
	struct.
	* lto-streamer.h (struct GTY): Make profile_info gcov_summary
	struct.
	* profile.c: Likewise.
	* profile.h: Likewise.
2018-06-05  Martin Liska  <mliska@suse.cz>

	* libgcov-driver.c (gcov_compute_histogram): Remove usage
	of gcov_ctr_summary.
	(compute_summary): Do it just for a single summary.
	(merge_one_data): Likewise.
	(merge_summary): Simplify as we read just single summary.
	(dump_one_gcov): Pass proper argument.
	* libgcov-util.c (compute_one_gcov): Simplify as we have just
	single summary.
	(gcov_info_count_all_cold): Likewise.
	(calculate_overlap): Likewise.

From-SVN: r261189
2018-06-05 08:13:31 +00:00
Jakub Jelinek 85ec4feb11 Update copyright years.
From-SVN: r256169
2018-01-03 11:03:58 +01:00
Jakub Jelinek cbe34bb5ed Update copyright years.
From-SVN: r243994
2017-01-01 13:07:43 +01:00
Martin Liska 56b653f1a3 Remove __gcov_merge_delta (PR bootstrap/77749)
PR bootstrap/77749
	* gcov-counter.def: Remove GCOV_COUNTER_V_DELTA.
	PR bootstrap/77749
	* Makefile.in: Remove _gcov_merge_delta.
	* libgcov-merge.c (void __gcov_merge_delta): Remove.
	* libgcov-util.c (__gcov_delta_counter_op): Remove.
	* libgcov.h: Remove declaration of __gcov_merge_delta.

From-SVN: r240524
2016-09-27 10:04:39 +00:00
Gilles Gouaillardet 2e6fc1acd0 gcov-tool: Do not segfault in merge operation (PR
PR gcov-profile/67097
	* libgcov-util.c (gcov_profile_merge): Skip missing files.

From-SVN: r239478
2016-08-15 11:23:27 +00:00
Martin Liska e0c8eebff7 Fix typo in gcov.texi
* doc/gcov.texi: Change _gcov_dump to __gcov_dump and
	_gcov_reset to __gcov_reset.
	* doc/gcov-tool.texi: Fix typo.
	* libgcov-util.c: Fix typo and GNU coding style.

From-SVN: r239307
2016-08-09 21:02:24 +00:00
Jakub Jelinek 818ab71a41 Update copyright years.
From-SVN: r232055
2016-01-04 15:30:50 +01:00
Uros Bizjak 98b5dc6118 libgcov-util.c: Add space between string literal and macro name.
* libgcov-util.c: Add space between string literal and macro name.

From-SVN: r223073
2015-05-12 16:40:49 +02:00
Kai Tietz 0e4a0def1e re PR libgcc/65038 ([regression 5] Unable to find ftw.h for libgcov-util.c)
PR target/65038
        * config.in: Regenerated.
        * configure: Likewise.
        * configure.ac (AC_HEADER_STDC): Added explicit.
        (AC_CHECK_HEADERS): Check for default headers  plus
        for ftw.h header.
        * libgcov-util.c (gcov_read_profile_dir): Disable use
        of ftw-function, if header is not found.
        (ftw_read_file): Likewise.

From-SVN: r221059
2015-02-27 14:19:38 +01:00
Kai Tietz 0824d92489 Revert change
From-SVN: r221058
2015-02-27 13:32:30 +01:00
Kai Tietz a2a5609b4b re PR libgcc/65038 ([regression 5] Unable to find ftw.h for libgcov-util.c)
PR target/65038
	* config.in: Regenerated.
	* configure: Likewise.
	* configure.ac (AC_HEADER_STDC): Add explicit.
	(AC_CHECK_HEADERS): Check for default headers
	plus for ftw.h one.
	* libgcov-util.c (gcov_read_profile_dir): Disable use
	of ftw-function, if header not found.
	(ftw_read_file): Don't translate if ftw header isn't
	present.

From-SVN: r221055
2015-02-27 13:05:02 +01:00
Jakub Jelinek 5624e564d2 Update copyright years.
From-SVN: r219188
2015-01-05 13:33:28 +01:00
Rong Xu 9b84e7a836 Add overlap functionality to gcov-tool.
2014-10-08  Rong Xu  <xur@google.com>

	* gcc/gcov-tool.c (profile_overlap): New driver function
        to compute profile overlap. 
	(print_overlap_usage_message): New.
	(overlap_usage): New.
	(do_overlap): New.
	(print_usage): Add calls to overlap function.
	(main): Ditto.
	* libgcc/libgcov-util.c (read_gcda_file): Fix format.
	(find_match_gcov_info): Ditto.
	(calculate_2_entries): New.
	(compute_one_gcov): Ditto.
	(gcov_info_count_all_cold): Ditto.
	(gcov_info_count_all_zero): Ditto.
	(extract_file_basename): Ditto.
	(get_file_basename): Ditto.
	(set_flag): Ditto.
	(matched_gcov_info): Ditto.
	(calculate_overlap): Ditto.
	(gcov_profile_overlap): Ditto.
	* libgcc/libgcov-driver.c (compute_summary): Make
        it avavilable for external calls.
	* gcc/doc/gcov-tool.texi: Add documentation.

From-SVN: r216015
2014-10-08 21:51:41 +00:00
Rong Xu afe0c5ee91 Makefile.in: Fix dependence.
2014-10-06  Rong Xu  <xur@google.com>

	* gcc/Makefile.in: Fix dependence.
	* gcc/gcov-counter.def (GCOV_COUNTER_ICALL_TOPNV): Add
        indirect call topn profiler.
	* gcc/gcov-io.h: Ditto.
	* libgcc/Makefile.in: Ditto.
	* libgcc/libgcov-driver.c (gcov_sort_n_vals): New utility function.
	(gcov_sort_icall_topn_counter): Ditto.
	(gcov_sort_topn_counter_arrays): Ditto.
	(dump_one_gcov): Sort indirect_call topn counters.
	* libgcc/libgcov-merge.c (__gcov_merge_icall_topn): New merge
        function.
	* libgcc/libgcov-profiler.c (__gcov_topn_value_profiler_body): New
        utility function.
	(__gcov_indirect_call_topn_profiler): New profiler function.
	* libgcc/libgcov-util.c (__gcov_icall_topn_counter_op): New.
	* libgcc/libgcov.h: New decls.

From-SVN: r215962
2014-10-07 04:02:31 +00:00
Nathan Sidwell 6dc33097cc libgcov-driver.c (struct gcov_filename_aux): Rename ...
* libgcov-driver.c (struct gcov_filename_aux): Rename ...
	(struct gcov_filename): ... here.  Include buffer and max length
	fields.
	(gcov_max_filename): Remove.
	(gi_filename): Remove.
	(gcov_exit_compute_summary): Compute max filename here.
	(gcov_exit_merge_gcda): Add filename parm, adjust.
	(gcov_exit_merge_summary): Likewise.
	(gcov_exit_dump_gcov): Adjust for struct gcov_filename changes.
	(gcov_exit): Likewise.
	(__gcov_init): Don't calculate max length here.
	* libgcov_util.c (max_filename_len): Remove.
	(read_gcda_file): Don't calculate max length here.
	(gcov_read_profile_dir): Don't propagate here.
	* libgcov-driver-system.c (alloc_filename_struct): Adjust for
	struct gcov_filename changes.
	(gcov_exit_open_gcda_file): Likewise.

From-SVN: r213092
2014-07-27 07:22:47 +00:00
Rong Xu d5313205ef libgcov-util.c (gcov_max_filename): Fix declartion.
2014-07-11  Rong Xu  <xur@google.com>

	* libgcov-util.c (gcov_max_filename): Fix declartion.

From-SVN: r212463
2014-07-11 17:02:18 +00:00
Rong Xu c77556a5d1 Add gcov-tool: an offline gcda profile processing tool Support.
2014-07-10  Rong Xu  <xur@google.com>

	Add gcov-tool: an offline gcda profile processing tool
	Support.
	* gcc/gcov-io.c (gcov_position): Make avaialble to gcov-tool.
	(gcov_is_error): Ditto.
	(gcov_read_string): Ditto.
	(gcov_read_sync): Ditto.
	* gcc/gcov-io.h: Move counter defines to gcov-counter.def.
	* gcc/gcov-dump.c (tag_counters): Use gcov-counter.def.
	* gcc/coverage.c: Ditto.
	* gcc/gcov-tool.c: Offline gcda profile processing tool.
        (unlink_gcda_file): Remove one gcda file.
	(unlink_profile_dir): Remove gcda files from the profile path.
	(gcov_output_files): Output gcda files to an output dir.
	(profile_merge): Merge two profiles in directory.
	(print_merge_usage_message): Print merge usage.
	(merge_usage): Print merge usage and exit.
	(do_merge): Driver for profile merge sub-command.
	(profile_rewrite): Rewrite profile.
	(print_rewrite_usage_message): Print rewrite usage.
	(rewrite_usage): Print rewrite usage and exit.
	(do_rewrite): Driver for profile rewrite sub-command.
	(print_usage): Print gcov-info usage and exit.
	(print_version): Print gcov-info version.
	(process_args): Process arguments.
	(main): Main routine for gcov-tool.
	* gcc/Makefile.in: Build and install gcov-tool.
	* gcc/gcov-counter.def: New file split from gcov-io.h.
	* libgcc/libgcov-driver.c (gcov_max_filename): Make available
        to gcov-tool.
	* libgcc/libgcov-merge.c (__gcov_merge_add): Replace
        gcov_read_counter() with a Macro.
	(__gcov_merge_ior): Ditto.
	(__gcov_merge_time_profile): Ditto.
	(__gcov_merge_single): Ditto.
	(__gcov_merge_delta): Ditto.
	* libgcc/libgcov-util.c (void gcov_set_verbose): Set the verbose flag
        in the utility functions.
	(set_fn_ctrs): Utility function for reading gcda files to in-memory
        gcov_list object link lists.
	(tag_function): Ditto.
	(tag_blocks): Ditto.
	(tag_arcs): Ditto.
	(tag_lines): Ditto.
	(tag_counters): Ditto.
	(tag_summary): Ditto.
	(read_gcda_finalize): Ditto.
	(read_gcda_file): Ditto.
	(ftw_read_file): Ditto.
	(read_profile_dir_init): Ditto.
	(gcov_read_profile_dir): Ditto.
	(gcov_read_counter_mem): Ditto.
	(gcov_get_merge_weight): Ditto.
	(merge_wrapper): A wrapper function that calls merging handler.
	(gcov_merge): Merge two gcov_info objects with weights.
	(find_match_gcov_info): Find the matched gcov_info in the list.
	(gcov_profile_merge): Merge two gcov_info object lists.
	(__gcov_add_counter_op): Process edge profile counter values.
	(__gcov_ior_counter_op): Process IOR profile counter values.
	(__gcov_delta_counter_op): Process delta profile counter values.
	(__gcov_single_counter_op): Process single  profile counter values.
	(fp_scale): Callback function for float-point scaling.
	(int_scale): Callback function for integer fraction scaling. 
	(gcov_profile_scale): Scaling profile counters.
	(gcov_profile_normalize): Normalize profile counters.
	* libgcc/libgcov.h: Add headers and functions for gcov-tool use.
        (gcov_get_counter): New.
        (gcov_get_counter_target): Ditto.
        (struct gcov_info): Make the functions field mutable in gcov-tool
        compilation.
	* gcc/doc/gcc.texi: Include gcov-tool.texi.
	* gcc/doc/gcov-tool.texi: Document for gcov-tool.

From-SVN: r212448
2014-07-11 05:48:07 +00:00