aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcov.c
AgeCommit message (Collapse)AuthorFilesLines
2019-02-05GCOV: remove misleading branches and calls info for -f option (PR ↵Martin Liska1-7/+17
gcov-profile/89000). 2019-02-05 Martin Liska <mliska@suse.cz> PR gcov-profile/89000 * gcov.c (function_summary): Remove argument. (file_summary): New function. (print_usage): Replace tabs with spaces. (generate_results): Use new function file_summary. From-SVN: r268533
2019-01-24Fix broken filename for .gcda files starting with '..' (PR gcov-profile/88994).Martin Liska1-7/+9
2019-01-24 Martin Liska <mliska@suse.cz> PR gcov-profile/88994 * gcov-io.c (mangle_path): Do not allocate a bigger buffer, result will be always smaller or equal to the original. * gcov.c (mangle_name): Fix else branch where we should also copy to PTR and shift the pointer. From-SVN: r268233
2019-01-01Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r267494
2019-01-01gcc.c (process_command): Update copyright notice dates.Jakub Jelinek1-1/+1
* gcc.c (process_command): Update copyright notice dates. * gcov-dump.c (print_version): Ditto. * gcov.c (print_version): Ditto. * gcov-tool.c (print_version): Ditto. * gengtype.c (create_file): Ditto. * doc/cpp.texi: Bump @copying's copyright year. * doc/cppinternals.texi: Ditto. * doc/gcc.texi: Ditto. * doc/gccint.texi: Ditto. * doc/gcov.texi: Ditto. * doc/install.texi: Ditto. * doc/invoke.texi: Ditto. gcc/fortran/ * gfortranspec.c (lang_specific_driver): Update copyright notice dates. * gfc-internals.texi: Bump @copying's copyright year. * gfortran.texi: Ditto. * intrinsic.texi: Ditto. * invoke.texi: Ditto. gcc/go/ * gccgo.texi: Bump @copyrights-go year. gcc/ada/ * gnat_ugn.texi: Bump @copying's copyright year. * gnat_rm.texi: Likewise. gcc/d/ * gdc.texi: Bump @copyrights-d year. libitm/ * libitm.texi: Bump @copying's copyright year. libgomp/ * libgomp.texi: Bump @copying's copyright year. libquadmath/ * libquadmath.texi: Bump @copying's copyright year. From-SVN: r267492
2018-12-27Fix slowness in gcov (PR gcov-profile/88225).Martin Liska1-48/+64
2018-12-27 Martin Liska <mliska@suse.cz> PR gcov-profile/88225 * gcov.c(source_info::get_functions_at_location): Use newly added line_to_function_map. (source_info::add_function): New. (output_json_intermediate_file): Use a pointer return type for get_functions_at_location. (process_all_functions): Use add_function instead of direct push to a s->functions container. (release_structures): Release ident_to_fn. (read_graph_file): Register function into ident_to_fn. (read_count_file): Use the map. (output_lines): Handle pointer return type of get_functions_at_location. From-SVN: r267431
2018-11-27gcov: do not ICE on NULL string in JSON export.Martin Liska1-1/+3
2018-11-27 Martin Liska <mliska@suse.cz> * gcov.c (generate_results): Append current_working_directory only when exists. From-SVN: r266521
2018-10-30* gcov.c (output_lines): Remove duplicate line.Eric Botcazou1-2/+0
From-SVN: r265634
2018-10-29GCOV: introduce --json-format.Martin Liska1-106/+154
2018-10-29 Martin Liska <mliska@suse.cz> * Makefile.in: Make dependency to json.o. * doc/gcov.texi: Document new JSON format, remove old intermediate format documentation. * gcov.c (struct function_info): Come up with m_name and m_demangled_name. (function_info::function_info): Initialize it. (function_info::~function_info): Release it. (main): Rename flag_intermediate_format to flag_json_format. (print_usage): Describe --json-format. (process_args): Set flag_json_format. (output_intermediate_line): Remove. (output_intermediate_json_line): Likewise. (get_gcov_intermediate_filename): Return new extension ".gcov.json.gz". (output_intermediate_file): Implement JSON emission. (output_json_intermediate_file): Implement JSON emission. (generate_results): Use ::get_name for function name. Handle JSON output file. (read_graph_file): Use ::get_name instead of cplus_demangle. (read_count_file): Likewise. (solve_flow_graph): Likewise. (add_line_counts): Likewise. (accumulate_line_counts): Use new flag_json_format. (output_function_details): Use ::get_name instead of cplus_demangle. (output_lines): Likewise. * json.cc (test_writing_literals): Add new tests. * json.h (class literal): Add new boolean constructor. 2018-10-29 Martin Liska <mliska@suse.cz> * g++.dg/gcov/gcov-8.C: Do not check intermediate format. * lib/gcov.exp: Remove legacy verify-intermediate. From-SVN: r265587
2018-09-24Improve colorization legend in gcov reports.Martin Liska1-2/+12
2018-09-24 Martin Liska <mliska@suse.cz> * gcov.c (output_lines): Print colorization legend for both flag_use_colors and flag_use_hotness_colors. Reword the help. From-SVN: r264531
2018-09-21Remove arc profile histogram in non-LTO mode.Martin Liska1-5/+2
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-17Fix out-of-bounds in gcov.c (PR gcov-profile/85871).Martin Liska1-1/+2
2018-09-17 Martin Liska <mliska@suse.cz> PR gcov-profile/85871 * gcov.c (output_intermediate_file): Fix out of bounds access. From-SVN: r264363
2018-09-17gcov: emit hotness colors to easily find hot code.Martin Liska1-7/+49
2018-09-17 Martin Liska <mliska@suse.cz> * doc/gcov.texi: Document new option --use-hotness-colors. * gcov.c (struct source_info): Declare new field. (source_info::source_info): Set default for maximum_count. (print_usage): Add new -q option. (process_args): Process it. (accumulate_line_info): Save src->maximum_count. (output_line_beginning): Make color line number if flag_use_hotness_colors is set. (output_line_details): Pass default argument value. (output_lines): Pass src->maximum_count. From-SVN: r264360
2018-09-05GCOV: Print one decimal place in human readable mode.Martin Liska1-2/+2
2018-09-05 Martin Liska <mliska@suse.cz> * doc/gcov.texi: Update documentation of humar readable mode. * gcov.c (format_count): Print one decimal place, it provides more fine number of situations like '1G' vs. '1.4G'. 2018-09-05 Martin Liska <mliska@suse.cz> * g++.dg/gcov/loop.C: Update test to support new format. From-SVN: r264112
2018-08-27Do not read gcda files multiple times (PR gcov-profile/87069).Martin Liska1-0/+15
2018-08-27 Martin Liska <mliska@suse.cz> PR gcov-profile/87069 * gcov.c (process_file): Record files already processed and warn about a file being processed multiple times. From-SVN: r263871
2018-08-02Fix gcov misleading error (PR gcov-profile/86817).Martin Liska1-4/+8
2018-08-02 Martin Liska <mliska@suse.cz> PR gcov-profile/86817 * gcov.c (process_all_functions): New function. (main): Call it. (process_file): Move functions processing to process_all_functions. From-SVN: r263248
2018-07-26gcov: Fix wrong usage of NAN in statistics (PR gcov-profile/86536).Martin Liska1-36/+10
2018-07-26 Martin Liska <mliska@suse.cz> PR gcov-profile/86536 * gcov.c (format_gcov): Use printf format %.*f directly and do not handle special values. 2018-07-26 Martin Liska <mliska@suse.cz> PR gcov-profile/86536 * gcc.misc-tests/gcov-pr86536.c: New test. From-SVN: r262991
2018-06-29When using -fprofile-generate=/some/path mangle absolute path of file (PR ↵Martin Liska1-36/+1
lto/85759). 2018-06-29 Martin Liska <mliska@suse.cz> PR lto/85759 * coverage.c (coverage_init): Mangle full path name. * doc/invoke.texi: Document the change. * gcov-io.c (mangle_path): New. * gcov-io.h (mangle_path): Likewise. * gcov.c (mangle_name): Use mangle_path for path mangling. From-SVN: r262251
2018-06-05Simplify gcov_histogram as it's used only for ARCS counters.Martin Liska1-1/+1
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-05Print working directory only in intermediate format (PR gcov-profile/84846).Martin Liska1-2/+0
2018-06-05 Martin Liska <mliska@suse.cz> PR gcov-profile/84846 * gcov.c (output_lines): Print working directory only in intermediate format. From-SVN: r261188
2018-05-18gcov: add new option -t that prints output to stdout (PR gcov-profile/84846).Martin Liska1-7/+29
2018-05-18 Martin Liska <mliska@suse.cz> PR gcov-profile/84846 * gcov.c (print_usage): Add new -t option. (process_args): Handle the option. (generate_results): Use stdout as output when requested by the option. 2018-05-18 Martin Liska <mliska@suse.cz> PR gcov-profile/84846 * doc/gcov.texi: Document -t option of gcov tool. From-SVN: r260361
2018-05-18Print working directory to gcov files (PR gcov-profile/84846).Martin Liska1-0/+7
2018-05-18 Martin Liska <mliska@suse.cz> PR gcov-profile/84846 * coverage.c (coverage_init): Write PWD to .gcno file. * doc/gcov.texi: Document how working directory is printed. * gcov-dump.c (dump_gcov_file): Print PWD. * gcov.c (output_intermediate_file): Likewise. (read_graph_file): Read PWD string. (output_lines): Print PWD. From-SVN: r260359
2018-02-27Make groups more generic (PR gcov-profile/84548).Martin Liska1-2/+8
2018-02-27 Martin Liska <mliska@suse.cz> PR gcov-profile/84548 * gcov.c (process_file): Allow partial overlap and consider it also as group functions. (output_lines): Properly calculate range of lines for a group. 2018-02-27 Martin Liska <mliska@suse.cz> PR gcov-profile/84548 * g++.dg/gcov/pr84548.C: New test. From-SVN: r258033
2018-01-04Add version to intermediate gcov file (PR gcov-profile/83669).Martin Liska1-0/+1
2018-01-04 Martin Liska <mliska@suse.cz> PR gcov-profile/83669 * gcov.c (output_intermediate_file): Add version to intermediate gcov file. * doc/gcov.texi: Document new field 'version' in intermediate file format. Fix location of '-k' option of gcov command. From-SVN: r256227
2018-01-03Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r256169
2018-01-03gcc.c (process_command): Update copyright notice dates.Jakub Jelinek1-1/+1
gcc/ * gcc.c (process_command): Update copyright notice dates. * gcov-dump.c (print_version): Ditto. * gcov.c (print_version): Ditto. * gcov-tool.c (print_version): Ditto. * gengtype.c (create_file): Ditto. * doc/cpp.texi: Bump @copying's copyright year. * doc/cppinternals.texi: Ditto. * doc/gcc.texi: Ditto. * doc/gccint.texi: Ditto. * doc/gcov.texi: Ditto. * doc/install.texi: Ditto. * doc/invoke.texi: Ditto. gcc/fortran/ * gfortranspec.c (lang_specific_driver): Update copyright notice dates. * gfc-internals.texi: Bump @copying's copyright year. * gfortran.texi: Ditto. * intrinsic.texi: Ditto. * invoke.texi: Ditto. gcc/ada/ * gnat_ugn.texi: Bump @copying's copyright year. * gnat_rm.texi: Likewise. gcc/go/ * gccgo.texi: Bump @copyrights-go year. libitm/ * libitm.texi: Bump @copying's copyright year. libgomp/ * libgomp.texi: Bump @copying's copyright year. libquadmath/ * libquadmath.texi: Bump @copying's copyright year. From-SVN: r256166
2017-11-13GCOV: remove typedef of coverage_t.Martin Liska1-12/+12
2017-11-13 Martin Liska <mliska@suse.cz> * gcov.c (struct coverage_info): Remove typedef of coverage_t. (struct source_info): Likewise. (add_branch_counts): Likewise. (add_line_counts): Likewise. (function_summary): Likewise. (output_intermediate_line): Likewise. (generate_results): Likewise. From-SVN: r254678
2017-11-13GCOV: remove typedef for block_tMartin Liska1-26/+26
2017-11-13 Martin Liska <mliska@suse.cz> * gcov.c (struct block_info): Remove typedef for block_t. (struct line_info): Likewise. (line_info::has_block): Likewise. (EXIT_BLOCK): Likewise. (unblock): Likewise. (circuit): Likewise. (get_cycles_count): Likewise. (process_file): Likewise. (read_graph_file): Likewise. (solve_flow_graph): Likewise. (find_exception_blocks): Likewise. (add_line_counts): Likewise. (accumulate_line_info): Likewise. (output_line_details): Likewise. From-SVN: r254677
2017-11-13GCOV: remove typedef for arc_tMartin Liska1-29/+29
2017-11-13 Martin Liska <mliska@suse.cz> * gcov.c (struct arc_info): Remove typedef for arc_t. (struct line_info): Likewise. (add_branch_counts): Likewise. (output_branch_count): Likewise. (function_info::~function_info): Likewise. (circuit): Likewise. (output_intermediate_line): Likewise. (read_graph_file): Likewise. (solve_flow_graph): Likewise. (find_exception_blocks): Likewise. (add_line_counts): Likewise. (accumulate_line_info): Likewise. (output_line_details): Likewise. (output_function_details): Likewise. From-SVN: r254676
2017-11-13GCOV: remove typedef for function_tMartin Liska1-35/+35
2017-11-13 Martin Liska <mliska@suse.cz> * gcov.c (struct function_info): Remove typedef for function_t. (struct source_info): Likewise. (source_info::get_functions_at_location): Likewise. (solve_flow_graph): Likewise. (find_exception_blocks): Likewise. (add_line_counts): Likewise. (output_intermediate_file): Likewise. (process_file): Likewise. (generate_results): Likewise. (release_structures): Likewise. (read_graph_file): Likewise. (read_count_file): Likewise. (accumulate_line_counts): Likewise. (output_lines): Likewise. From-SVN: r254675
2017-11-13GCOV: introduce vector for function_info::counts.Martin Liska1-13/+8
2017-11-13 Martin Liska <mliska@suse.cz> * gcov.c (function_info::function_info): Remove num_counts and add vector<gcov_type>. (function_info::~function_info): Use the vector. (process_file): Likewise. (read_graph_file): Likewise. (read_count_file): Likewise. (solve_flow_graph): Likewise. From-SVN: r254674
2017-11-13GCOV: simplify usage of function_info::artificial.Martin Liska1-26/+40
2017-11-13 Martin Liska <mliska@suse.cz> * gcov.c (function_info::is_artificial): New function. (process_file): Erase all artificial early. (generate_results): Skip as all artificial are already removed. From-SVN: r254673
2017-11-13GCOV: introduce global vector of functionsMartin Liska1-66/+44
2017-11-13 Martin Liska <mliska@suse.cz> * gcov.c (read_graph_file): Store to global vector of functions. (read_count_file): Iterate the vector. (process_file): Likewise. (generate_results): Likewise. (release_structures): Likewise. From-SVN: r254672
2017-11-10GCOV: create one intermediate file per a gcno file (PR gcov-profile/82702).Martin Liska1-20/+76
2017-11-10 Martin Liska <mliska@suse.cz> PR gcov-profile/82702 * gcov.c (main): Handle intermediate files in a different way. (get_gcov_intermediate_filename): New function. (output_gcov_file): Remove support of intermediate files. (generate_results): Allocate intermediate file. (release_structures): Clean-up properly fn_end. (output_intermediate_file): Start iterating with line 1. From-SVN: r254629
2017-11-10GCOV: do not support unexecuted blocks in AdaMartin Liska1-1/+6
2017-11-10 Martin Liska <mliska@suse.cz> * coverage.c (coverage_init): Stream information about support of has_unexecuted_blocks. * doc/gcov.texi: Document that. * gcov-dump.c (dump_gcov_file): Support it in gcov_dump tool. * gcov.c (read_graph_file): Likewise. (output_line_beginning): Fix a small issue with color output. From-SVN: r254627
2017-11-09GCOV: support multiple functions per a line (PR gcov-profile/48463)Martin Liska1-266/+589
2017-11-09 Martin Liska <mliska@suse.cz> PR gcov-profile/48463 * coverage.c (coverage_begin_function): Output also end locus of a function and information whether the function is artificial. * gcov-dump.c (tag_function): Parse and print the information. * gcov.c (INCLUDE_MAP): Add include. (INCLUDE_SET): Likewise. (struct line_info): Move earlier in the source file because of vector<line_info> in function_info structure. (line_info::line_info): Likewise. (line_info::has_block): Likewise. (struct source_info): Add new member index. (source_info::get_functions_at_location): New function. (function_info::group_line_p): New function. (output_intermediate_line): New function. (output_intermediate_file): Use the mentioned function. (struct function_start): New. (struct function_start_pair_hash): Likewise. (process_file): Add code that identifies group functions. Assign lines either to global or function scope. (generate_results): Skip artificial functions. (find_source): Assign index for each source file. (read_graph_file): Read new flag artificial and end_line. (add_line_counts): Assign it either to global of function scope. (accumulate_line_counts): Isolate core of the function to accumulate_line_info and call it for both function and global scope lines. (accumulate_line_info): New function. (output_line_beginning): Fix GNU coding style. (print_source_line): New function. (output_line_details): Likewise. (output_function_details): Likewise. (output_lines): Iterate both source (global) scope and function scope. (struct function_line_start_cmp): New class. * doc/gcov.texi: Reflect changes in documentation. From-SVN: r254562
2017-10-31GCOV: add -j argument (human readable format).Martin Liska1-2/+38
2017-10-31 Martin Liska <mliska@suse.cz> * doc/gcov.texi: Document new option. * gcov.c (print_usage): Likewise print it. (process_args): Support the argument. (format_count): New function. (format_gcov): Use the function. 2017-10-31 Martin Liska <mliska@suse.cz> * g++.dg/gcov/loop.C: New test. * lib/gcov.exp: Support human readable format for counts. From-SVN: r254269
2017-10-31GCOV: std::vector refactoring IIIMartin Liska1-75/+58
2017-10-31 Martin Liska <mliska@suse.cz> * gcov.c (struct name_map): do not use typedef. Define operator== and operator<. (name_search): Remove. (name_sort): Remove. (main): Do not allocate names. (process_file): Add vertical space. (generate_results): Use std::find. (release_structures): Do not release memory. (find_source): Use std::find. From-SVN: r254262
2017-10-31GCOV: Vector refactoring IIMartin Liska1-76/+73
2017-10-31 Martin Liska <mliska@suse.cz> * gcov.c (struct line_info): Remove it's typedef. (line_info::line_info): Add proper ctor. (line_info::has_block): Do not use a typedef. (struct source_info): Do not use typedef. (circuit): Likewise. (get_cycles_count): Likewise. (output_intermediate_file): Iterate via vector iterator. (add_line_counts): Use std::vector methods. (accumulate_line_counts): Likewise. (output_lines): Likewise. From-SVN: r254261
2017-10-31GCOV: std::vector refactoring.Martin Liska1-50/+39
2017-10-31 Martin Liska <mliska@suse.cz> * gcov.c (struct source_info): Remove typedef. (source_info::source_info): Add proper ctor. (accumulate_line_counts): Use struct, not it's typedef. (output_gcov_file): Likewise. (output_lines): Likewise. (main): Do not allocate an array. (output_intermediate_file): Use size of vector container. (process_file): Resize the vector. (generate_results): Do not preallocate, use newly added vector lines. (release_structures): Do not release sources. (find_source): Use vector methods. (add_line_counts): Do not use typedef. From-SVN: r254260
2017-10-31GCOV: add support for lines with an unexecuted lines.Martin Liska1-27/+23
2017-10-31 Martin Liska <mliska@suse.cz> * doc/gcov.texi: Document that. * gcov.c (add_line_counts): Mark lines with a non-executed statement. (output_line_beginning): Handle such lines. (output_lines): Pass new argument. (output_intermediate_file): Print it in intermediate format. 2017-10-31 Martin Liska <mliska@suse.cz> * g++.dg/gcov/ternary.C: New test. * g++.dg/gcov/gcov-threads-1.C (main): Update expected line count. * lib/gcov.exp: Support new format for intermediate file format. From-SVN: r254259
2017-10-31GCOV: introduce usage of terminal colors.Martin Liska1-17/+88
2017-10-31 Martin Liska <mliska@suse.cz> * color-macros.h: New file. * diagnostic-color.c: Factor out color related to macros to color-macros.h. * doc/gcov.texi: Document -k option. * gcov.c (INCLUDE_STRING): Include string.h. (print_usage): Add -k option. (process_args): Parse it. (pad_count_string): New function. (output_line_beginning): Likewise. (DEFAULT_LINE_START): New macro. (output_lines): Support color output. From-SVN: r254258
2017-08-01Fix segfault in gcov.c (PR gcov-profile/81561).Martin Liska1-5/+5
2017-08-01 Martin Liska <mliska@suse.cz> PR gcov-profile/81561 * gcov.c (unblock): Make unblocking safe as we need to preserve index correspondence of blocks and block_lists. From-SVN: r250780
2017-06-08gcov: Add block_info::block_info (PR gcov-profile/80911).Martin Liska1-0/+11
2017-06-08 Martin Liska <mliska@suse.cz> PR gcov-profile/80911 * gcov.c (block_info::block_info): New constructor. From-SVN: r249006
2017-05-02Fix documentation and a ctor in gcov.cMartin Liska1-3/+4
2017-05-02 Martin Liska <mliska@suse.cz> * doc/gcov.texi: Add missing preposition. * gcov.c (function_info::function_info): Properly fill up all member variables. From-SVN: r247507
2017-04-28Sort options of gcov, gcov-dump and gcov-tool both in --help and documentationMartin Liska1-1/+1
2017-04-28 Martin Liska <mliska@suse.cz> * doc/gcov.texi: Sort options in alphabetic order. * doc/gcov-dump.texi: Likewise. * doc/gcov-tool.texi: Likewise. * gcov.c (print_usage): Likewise. * gcov-dump.c (print_usage): Likewise. * gcov-tool.c (print_merge_usage_message): Likewise. (print_rewrite_usage_message): Likewise. (print_overlap_usage_message): Likewise. From-SVN: r247376
2017-04-28Fix format_gcov to not print misleading values (PR gcov-profile/53915)Martin Liska1-0/+7
2017-04-28 Martin Liska <mliska@suse.cz> PR gcov-profile/53915 * gcov.c (format_gcov): Print 'NAN %' when top > bottom. From-SVN: r247375
2017-04-28Make gcno more precise about BBs really belonging to a line (PR ↵Martin Liska1-57/+33
gcov-profile/79891). 2017-04-28 Martin Liska <mliska@suse.cz> PR gcov-profile/79891 * gcov.c (add_line_counts): Assign BBs to lines just if the BB is marked by compiler as living on a line. (get_cycles_count): Remove usage of the union. (output_intermediate_file): Likewise. (find_source): Fix GNU coding style. (accumulate_line_counts): Remove old non-all block mode. (output_lines): Remove usage of the union. * profile.c (output_location): Include all BBs, even if belonging to a same line (and file) as a previous BB. 2017-04-28 Martin Liska <mliska@suse.cz> PR gcov-profile/79891 * gcc.misc-tests/gcov-17.c: New test. * gcc.misc-tests/gcov-18.c: New test. From-SVN: r247374
2017-04-28Introduce new option -w which shows verbose informations.Martin Liska1-8/+30
2017-04-28 Martin Liska <mliska@suse.cz> * gcov.c (process_args): Handle new argument 'w'. (read_graph_file): Assign ID to BBs. (output_branch_count): Display BB # if verbose flag is set. (output_lines): Likewise for arcs. (print_usage): Add '--verbose' option help. * doc/gcov.texi: Document --verbose (-w) option. From-SVN: r247373
2017-04-28Simplify representation of locations of a block.Martin Liska1-139/+118
2017-04-28 Martin Liska <mliska@suse.cz> * gcov.c (struct block_location_info): New struct. (process_file): Fill up the new structure. (read_graph_file): Replace usage of encoding by the newly added struct. (add_line_counts): Likewise. (accumulate_line_counts): Remove usage of the union. (function_info::function_info): New function. (function_info::~function_info): Likewise. (process_file): Call delete instead of release_function. (release_function): Release the function. (release_structures): Call delete instead of release_function. (solve_flow_graph): Replace usage of num_blocks. (find_exception_blocks): Likewise. (output_lines): Fix GNU coding style. From-SVN: r247372
2017-04-28gcno file: do not stream block flags (PR gcov-profile/80031).Martin Liska1-6/+1
2017-04-28 Martin Liska <mliska@suse.cz> PR gcov-profile/80031 * gcov-dump.c (tag_blocks): Just print number of basic blocks. * gcov-io.h (GCOV_TAG_BLOCKS_NUM): Remove unused macro. * gcov.c (read_graph_file): Read just number of blocks. * profile.c (branch_prob): Do not stream 0 flags per a basic block. From-SVN: r247370