GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "intl.h"
#include "diagnostic.h"
#include "version.h"
#include "demangle.h"
#include "color-macros.h"
#include "pretty-print.h"
#include "json.h"
#include "hwint.h"
#include "xregex.h"
#include <zlib.h>
#include <getopt.h>
#include "md5.h"
#include "gcov-io.h"
#include "gcov-io.cc"
Data Structures | |
struct | arc_info |
class | block_location_info |
struct | condition_info |
class | block_info |
class | line_info |
class | function_info |
struct | function_line_start_cmp |
struct | coverage_info |
class | source_info |
class | name_map |
struct | fnfilter |
struct | function_start |
struct | function_start_pair_hash |
Macros | |
#define | INCLUDE_ALGORITHM |
#define | INCLUDE_VECTOR |
#define | INCLUDE_STRING |
#define | INCLUDE_MAP |
#define | INCLUDE_SET |
#define | IN_GCOV 1 |
#define | GCOV_JSON_FORMAT_VERSION "2" |
#define | ENTRY_BLOCK (0) |
#define | EXIT_BLOCK (1) |
#define | DEFAULT_LINE_START " -: 0:" |
#define | FN_SEPARATOR "------------------\n" |
Typedefs | |
typedef vector< arc_info * > | arc_vector_t |
typedef vector< const block_info * > | block_vector_t |
Functions | |
static int | process_args (int, char **) |
static void | print_usage (int) ATTRIBUTE_NORETURN |
static void | print_version (void) ATTRIBUTE_NORETURN |
static void | process_file (const char *) |
static void | process_all_functions (void) |
static void | generate_results (const char *) |
static void | create_file_names (const char *) |
static char * | canonicalize_name (const char *) |
static unsigned | find_source (const char *) |
static void | read_graph_file (void) |
static int | read_count_file (void) |
static void | solve_flow_graph (function_info *) |
static void | find_exception_blocks (function_info *) |
static void | add_branch_counts (coverage_info *, const arc_info *) |
static void | add_condition_counts (coverage_info *, const block_info *) |
static void | add_line_counts (coverage_info *, function_info *) |
static void | executed_summary (unsigned, unsigned) |
static void | function_summary (const coverage_info *) |
static void | file_summary (const coverage_info *) |
static const char * | format_gcov (gcov_type, gcov_type, int) |
static void | accumulate_line_counts (source_info *) |
static void | output_gcov_file (const char *, source_info *) |
static int | output_branch_count (FILE *, int, const arc_info *) |
static void | output_conditions (FILE *, const block_info *) |
static void | output_lines (FILE *, const source_info *) |
static string | make_gcov_file_name (const char *, const char *) |
static char * | mangle_name (const char *) |
static void | release_structures (void) |
int | main (int, char **) |
static const vector< const char * > & | slurp (const source_info &src, FILE *gcov_file, const char *line_start) |
static void | handle_cycle (const arc_vector_t &edges, int64_t &count) |
static void | unblock (const block_info *u, block_vector_t &blocked, vector< block_vector_t > &block_lists) |
static bool | path_contains_zero_or_negative_cycle_arc (arc_vector_t &path) |
static bool | circuit (block_info *v, arc_vector_t &path, block_info *start, block_vector_t &blocked, vector< block_vector_t > &block_lists, line_info &linfo, int64_t &count) |
static gcov_type | get_cycles_count (line_info &linfo) |
static void | output_intermediate_json_line (json::array *object, line_info *line, unsigned line_num, const char *function_name) |
static string | strip_extention (string str) |
static string | get_md5sum (const char *input) |
static string | get_gcov_intermediate_filename (const char *input_file_name) |
static void | output_json_intermediate_file (json::array *json_files, source_info *src) |
static char const * | format_count (gcov_type count) |
static void | accumulate_line_info (line_info *line, source_info *src, bool add_coverage) |
static const char * | read_line (FILE *file) |
static void | pad_count_string (string &s) |
static void | output_line_beginning (FILE *f, bool exists, bool unexceptional, bool has_unexecuted_block, gcov_type count, unsigned line_num, const char *exceptional_string, const char *unexceptional_string, unsigned int maximum_count) |
static void | print_source_line (FILE *f, const vector< const char * > &source_lines, unsigned line) |
static void | output_line_details (FILE *f, const line_info *line, unsigned line_num) |
static void | output_function_details (FILE *f, function_info *fn) |
Variables | |
static int | flag_demangled_names = 0 |
static vector< function_info * > | functions |
static map< unsigned, function_info * > | ident_to_fn |
static vector< source_info > | sources |
static vector< name_map > | names |
static vector< char * > | processed_files |
static vector< vector< const char * > * > | source_lines |
static unsigned | object_runs |
static unsigned | total_lines |
static unsigned | total_executed |
static time_t | bbg_file_time |
static char * | bbg_file_name |
static unsigned | bbg_stamp |
static unsigned | bbg_supports_has_unexecuted_blocks |
static const char * | bbg_cwd |
static char * | da_file_name |
static int | no_data_file |
static int | multiple_files = 0 |
static int | flag_branches = 0 |
static bool | flag_conditions = 0 |
static int | flag_unconditional = 0 |
static int | flag_gcov_file = 1 |
static int | flag_use_stdout = 0 |
static int | flag_display_progress = 0 |
static int | flag_json_format = 0 |
static int | flag_long_names = 0 |
static int | flag_hash_filenames = 0 |
static int | flag_verbose = 0 |
static int | flag_use_colors = 0 |
static int | flag_use_hotness_colors = 0 |
static int | flag_all_blocks = 0 |
static int | flag_human_readable_numbers = 0 |
static int | flag_function_summary = 0 |
static int | flag_debug = 0 |
static char * | object_directory = 0 |
static char * | source_prefix = 0 |
static size_t | source_length = 0 |
static int | flag_relative_only = 0 |
static int | flag_preserve_paths = 0 |
static int | flag_counts = 0 |
static int | return_code = 0 |
static bool | default_keep = true |
static bool | flag_filter_on_demangled = false |
static vector< fnfilter > | filters |
static const struct option | options [] |
#define DEFAULT_LINE_START " -: 0:" |
Referenced by output_lines().
#define ENTRY_BLOCK (0) |
Referenced by output_function_details(), and solve_flow_graph().
#define EXIT_BLOCK (1) |
Referenced by output_function_details(), and solve_flow_graph().
#define FN_SEPARATOR "------------------\n" |
Referenced by output_lines().
#define GCOV_JSON_FORMAT_VERSION "2" |
Referenced by generate_results(), and print_version().
#define IN_GCOV 1 |
#define INCLUDE_ALGORITHM |
Gcov.c: prepend line execution counts and branch probabilities to a source file. Copyright (C) 1990-2024 Free Software Foundation, Inc. Contributed by James E. Wilson of Cygnus Support. Mangled by Bob Manson of Cygnus Support. Mangled further by Nathan Sidwell <nathan@codesourcery.com> Gcov is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. Gcov is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Gcov; see the file COPYING3. If not see <http://www.gnu.org/licenses/>.
??? Print a list of the ten blocks with the highest execution counts, and list the line numbers corresponding to those blocks. Also, perhaps list the line numbers with the highest execution counts, only printing the first if there are several which are all listed in the same block.
??? Should have an option to print the number of basic blocks, and the percent of them that are covered.
Need an option to show individual block counts, and show probabilities of fall through arcs.
#define INCLUDE_MAP |
#define INCLUDE_SET |
#define INCLUDE_STRING |
#define INCLUDE_VECTOR |
typedef vector<arc_info *> arc_vector_t |
Cycle detection! There are a bajillion algorithms that do this. Boost's function is named hawick_cycles, so I used the algorithm by K. A. Hawick and H. A. James in "Enumerating Circuits and Loops in Graphs with Self-Arcs and Multiple-Arcs" (url at <http://complexity.massey.ac.nz/cstn/013/cstn-013.pdf>). The basic algorithm is simple: effectively, we're finding all simple paths in a subgraph (that shrinks every iteration). Duplicates are filtered by "blocking" a path when a node is added to the path (this also prevents non- simple paths)--the node is unblocked only when it participates in a cycle.
typedef vector<const block_info *> block_vector_t |
|
static |
Accumulate the line counts of a file.
References accumulate_line_info(), line_info::count, source_info::coverage, line_info::exists, flag_json_format, source_info::functions, line_info::has_unexecuted_block, i, source_info::index, function_info::is_group, coverage_info::lines, function_info::lines, source_info::lines, coverage_info::lines_executed, function_info::src, function_info::start_line, and line_info::unexceptional.
Referenced by generate_results().
|
static |
Accumulate info for LINE that belongs to SRC source file. If ADD_COVERAGE is set to true, update source file summary.
References add_branch_counts(), add_condition_counts(), line_info::blocks, line_info::branches, count, line_info::count, source_info::coverage, line_info::exists, get_cycles_count(), line_info::has_block(), coverage_info::lines, coverage_info::lines_executed, and source_info::maximum_count.
Referenced by accumulate_line_counts().
|
static |
Increment totals in COVERAGE according to arc ARC.
References coverage_info::branches, coverage_info::branches_executed, coverage_info::branches_taken, coverage_info::calls, and coverage_info::calls_executed.
Referenced by accumulate_line_info().
|
static |
Increment totals in COVERAGE according to block BLOCK.
References block_info::conditions, coverage_info::conditions, coverage_info::conditions_covered, condition_info::n_terms, and condition_info::popcount().
Referenced by accumulate_line_info().
|
static |
Scan through the bb_data for each line in the block, increment the line number execution count indicated by the execution count of the appropriate basic block.
References block_info::arc, bbg_file_name, function_info::blocks, line_info::blocks, function_info::blocks_executed, line_info::branches, block_info::count, line_info::count, block_info::cycle, block_info::exceptional, line_info::exists, flag_branches, fnotice(), gcc_assert, function_info::get_name(), function_info::group_line_p(), line_info::has_unexecuted_block, i, block_info::ident, coverage_info::lines, function_info::lines, coverage_info::lines_executed, block_info::locations, NULL, sources, function_info::start_line, block_info::succ, and line_info::unexceptional.
Referenced by generate_results().
|
static |
Canonicalize the filename NAME by canonicalizing directory separators, eliding . components and resolving .. components appropriately. Always returns a unique string.
Referenced by find_source(), and generate_results().
|
static |
Find circuit going to block V, PATH is provisional seen cycle. BLOCKED is vector of blocked vertices, BLOCK_LISTS contains vertices blocked by a block. COUNT is accumulated count of the current LINE. Returns what type of loop it contains.
References circuit(), count, find(), gcc_assert, handle_cycle(), line_info::has_block(), path_contains_zero_or_negative_cycle_arc(), block_info::succ, and unblock().
Referenced by circuit(), and get_cycles_count().
|
static |
Generate the names of the graph and data files. If OBJECT_DIRECTORY is not specified, these are named from FILE_NAME sans extension. If OBJECT_DIRECTORY is specified and is a directory, the files are in that directory, but named from the basename of the FILE_NAME, sans extension. Otherwise OBJECT_DIRECTORY is taken to be the name of the object *file* and the data files are named from that.
References bbg_file_name, bbg_file_time, bbg_stamp, CONST_CAST, da_file_name, free(), GCOV_DATA_SUFFIX, GCOV_NOTE_SUFFIX, NULL, object_directory, and S_ISDIR.
Referenced by process_file().
|
static |
Summary of execution
References fnotice(), and format_gcov().
Referenced by file_summary(), function_summary(), and main().
|
static |
Output summary info for a file.
References coverage_info::branches, coverage_info::branches_executed, coverage_info::branches_taken, coverage_info::calls, coverage_info::calls_executed, coverage_info::conditions, coverage_info::conditions_covered, executed_summary(), flag_branches, flag_conditions, fnotice(), format_gcov(), coverage_info::lines, coverage_info::lines_executed, and coverage_info::name.
Referenced by generate_results().
|
static |
Mark all the blocks only reachable via an incoming catch.
References function_info::blocks, queue, and block_info::succ.
Referenced by process_all_functions().
|
static |
Find or create a source file structure for FILE_NAME. Copies FILE_NAME on creation
References bbg_file_name, bbg_file_time, canonicalize_name(), source_info::coverage, source_info::file_time, fnotice(), source_info::index, coverage_info::name, name_map::name, source_info::name, names, source_length, source_prefix, and sources.
Referenced by read_graph_file().
|
static |
Format COUNT, if flag_human_readable_numbers is set, return it human readable format.
References count, flag_human_readable_numbers, i, PRId64, and r.
Referenced by format_gcov().
Format a GCOV_TYPE integer as either a percent ratio, or absolute count. If DECIMAL_PLACES >= 0, format TOP/BOTTOM * 100 to DECIMAL_PLACES. If DECIMAL_PLACES is zero, no decimal point is printed. Only print 100% when TOP==BOTTOM and only print 0% when TOP=0. If DECIMAL_PLACES < 0, then simply format TOP. Return pointer to a static string.
References format_count().
Referenced by executed_summary(), file_summary(), output_branch_count(), output_function_details(), and output_line_beginning().
|
static |
Output summary info for a function.
References executed_summary(), fnotice(), coverage_info::lines, coverage_info::lines_executed, and coverage_info::name.
Referenced by generate_results(), clone_info::get_create(), nested_function_info::get_create(), and save_inline_function_body().
|
static |
References accumulate_line_counts(), add_line_counts(), bbg_cwd, canonicalize_name(), source_info::coverage, source_info::debug(), json::value::dump(), file_summary(), flag_debug, flag_function_summary, flag_gcov_file, flag_json_format, flag_relative_only, flag_use_stdout, fnotice(), function_summary(), functions, GCOV_JSON_FORMAT_VERSION, get_gcov_intermediate_filename(), function_info::get_name(), coverage_info::lines, coverage_info::lines_executed, coverage_info::name, name_map::name, names, NULL, output_gcov_file(), output_json_intermediate_file(), output_lines(), pp_formatted_text(), json::object::print(), return_code, json::object::set(), json::object::set_string(), sources, total_executed, and total_lines.
Referenced by main().
Find cycles for a LINFO.
References line_info::blocks, circuit(), count, and path.
Referenced by accumulate_line_info().
|
static |
Get the name of the gcov file. The return value must be free'd. It appends the '.gcov' extension to the *basename* of the file. The resulting file name will be in PWD. e.g., input: foo.da, output: foo.da.gcov input: a/b/foo.cc, output: foo.cc.gcov
References flag_hash_filenames, flag_preserve_paths, get_md5sum(), mangle_path(), and strip_extention().
Referenced by generate_results().
|
static |
Calcualte md5sum for INPUT string and return it in hex string format.
Referenced by get_gcov_intermediate_filename(), and make_gcov_file_name().
|
static |
Handle cycle identified by EDGES, where the function finds minimum cs_count and subtract the value from all counts. The subtracted value is added to COUNT. Returns type of loop.
References count, gcc_assert, i, and INTTYPE_MAXIMUM.
Referenced by circuit().
|
extern |
References diagnostic_initialize(), executed_summary(), flag_display_progress, flag_json_format, flag_use_stdout, gcc_init_libintl, generate_results(), global_dc, multiple_files, print_usage(), process_all_functions(), process_args(), process_file(), progname, release_structures(), return_code, total_executed, and total_lines.
|
static |
Generate an output file name. INPUT_NAME is the canonicalized main input file and SRC_NAME is the canonicalized file name. LONG_OUTPUT_NAMES and PRESERVE_PATHS affect name generation. With long_output_names we prepend the processed name of the input file to each output name (except when the current source file is the input file, so you don't get a double concatenation). The two components are separated by '##'. With preserve_paths we create a filename from all path components of the source file, replacing '/' with '#', and .. with '^', without it we simply take the basename component. (Remember, the canonicalized name will already have elided '.' components and converted \\ separators.)
References flag_hash_filenames, flag_long_names, get_md5sum(), and mangle_name().
Referenced by output_gcov_file().
|
static |
Mangle BASE name, copy it at the beginning of PTR buffer and return address of the \0 character of the buffer.
References flag_preserve_paths, and mangle_path().
Referenced by make_gcov_file_name().
|
static |
Output information about ARC number IX. Returns nonzero if anything is output.
References flag_counts, flag_unconditional, flag_verbose, fnotice(), and format_gcov().
Referenced by output_line_details().
|
static |
Output information about the conditions in block BINFO. The output includes * a summary (n/m outcomes covered) and a list of the missing (uncovered) * outcomes.
References block_info::conditions, condition_info::falsev, fnotice(), i, condition_info::n_terms, condition_info::popcount(), and condition_info::truev.
Referenced by output_line_details().
|
static |
Output detail statistics about function FN to file F.
References function_info::blocks, function_info::blocks_executed, ENTRY_BLOCK, EXIT_BLOCK, flag_branches, format_gcov(), function_info::get_block_count(), and function_info::get_name().
Referenced by output_lines().
|
static |
References source_info::coverage, fnotice(), fopen, coverage_info::lines, make_gcov_file_name(), coverage_info::name, output_lines(), and return_code.
Referenced by generate_results().
|
static |
Output intermediate LINE sitting on LINE_NUM to JSON OBJECT. Add FUNCTION_NAME to the LINE.
References json::array::append(), line_info::blocks, line_info::branches, count, line_info::count, line_info::exists, condition_info::falsev, flag_branches, flag_conditions, function_name(), line_info::has_unexecuted_block, i, block_info::id, condition_info::n_terms, NULL, condition_info::popcount(), json::object::set(), json::object::set_bool(), json::object::set_integer(), json::object::set_string(), and condition_info::truev.
Referenced by output_json_intermediate_file().
|
static |
Output the result in JSON intermediate format. Source info SRC is dumped into JSON_FILES which is JSON array.
References json::array::append(), function_info::end_line, functions, source_info::functions, source_info::get_functions_at_location(), i, source_info::lines, function_info::m_name, source_info::name, NULL, output_intermediate_json_line(), json::object::set(), and json::object::set_string().
Referenced by generate_results().
|
static |
Print GCOV line beginning to F stream. If EXISTS is set to true, the line exists in source file. UNEXCEPTIONAL indicated that it's not in an exceptional statement. The output is printed for LINE_NUM of given COUNT of executions. EXCEPTIONAL_STRING and UNEXCEPTIONAL_STRING are used to indicate non-executed blocks.
References bbg_supports_has_unexecuted_blocks, COLOR_BG_CYAN, COLOR_BG_GREEN, COLOR_BG_MAGENTA, COLOR_BG_RED, COLOR_BG_YELLOW, COLOR_FG_WHITE, COLOR_SEPARATOR, count, flag_use_colors, flag_use_hotness_colors, format_gcov(), pad_count_string(), SGR_RESET, and SGR_SEQ.
Referenced by output_line_details(), and output_lines().
|
static |
Output line details for LINE and print it to F file. LINE lives on LINE_NUM.
References line_info::blocks, line_info::branches, line_info::exists, flag_all_blocks, flag_branches, flag_conditions, flag_verbose, output_branch_count(), output_conditions(), and output_line_beginning().
Referenced by output_lines().
|
static |
Read in the source file one line at a time, and output that line to the gcov file preceded by its execution count and other information.
References bbg_file_name, COLOR_BG_CYAN, COLOR_BG_GREEN, COLOR_BG_MAGENTA, COLOR_BG_RED, COLOR_BG_YELLOW, COLOR_FG_CYAN, line_info::count, source_info::coverage, da_file_name, DEFAULT_LINE_START, function_info::end_line, line_info::exists, filters, flag_use_colors, flag_use_hotness_colors, FN_SEPARATOR, source_info::get_functions_at_location(), function_info::get_name(), line_info::has_unexecuted_block, i, function_info::lines, source_info::lines, source_info::maximum_count, multiple_files, coverage_info::name, no_data_file, NULL, object_runs, output_function_details(), output_line_beginning(), output_line_details(), print_source_line(), SGR_RESET, SGR_SEQ, slurp(), source_lines, function_info::start_line, and line_info::unexceptional.
Referenced by generate_results(), and output_gcov_file().
|
static |
Pad string S with spaces from left to have total width equal to 9.
Referenced by output_line_beginning().
|
static |
|
static |
References gcc_assert, and source_lines.
Referenced by output_lines().
|
static |
Print a usage message and exit. If ERROR_P is nonzero, this is an error, otherwise the output of --help.
References FATAL_EXIT_CODE, fnotice(), and SUCCESS_EXIT_CODE.
|
static |
Print version information and exit.
References _, fnotice(), GCOV_JSON_FORMAT_VERSION, and SUCCESS_EXIT_CODE.
Referenced by process_args().
|
static |
Process all functions in all files.
References source_info::add_function(), function_info::blocks, function_info::counts, function_info::end_line, find_exception_blocks(), functions, hash_map< KeyId, Value, Traits >::get(), function_info::has_catch, i, function_info::is_artificial(), function_info::is_group, function_info::lines, source_info::lines, block_info::locations, no_data_file, hash_map< KeyId, Value, Traits >::put(), solve_flow_graph(), function_start::source_file_idx, sources, function_info::src, function_info::start_line, and function_start::start_line.
Referenced by main().
|
static |
Forward declarations.
Process args, return index to first non-arg.
References default_keep, filters, flag_all_blocks, flag_branches, flag_conditions, flag_counts, flag_debug, flag_demangled_names, flag_display_progress, flag_filter_on_demangled, flag_function_summary, flag_gcov_file, flag_hash_filenames, flag_human_readable_numbers, flag_json_format, flag_long_names, flag_preserve_paths, flag_relative_only, flag_unconditional, flag_use_colors, flag_use_hotness_colors, flag_use_stdout, flag_verbose, NULL, object_directory, print_usage(), print_version(), source_length, and source_prefix.
Referenced by main().
|
static |
Process a single input file.
References create_file_names(), da_file_name, fnotice(), i, processed_files, read_count_file(), and read_graph_file().
Referenced by main().
|
static |
Reads profiles from the count file and attach to each function. Return nonzero if fatal error.
References bbg_stamp, function_info::cfg_checksum, function_info::conditions, function_info::counts, da_file_name, error(), fnotice(), gcov_close(), GCOV_DATA_MAGIC, gcov_is_error(), gcov_magic(), gcov_open(), gcov_position(), gcov_read_counter(), gcov_read_summary(), gcov_read_unsigned(), gcov_sync(), GCOV_TAG_COUNTER_LENGTH, GCOV_TAG_FOR_COUNTER, GCOV_TAG_FUNCTION, GCOV_TAG_FUNCTION_LENGTH, GCOV_TAG_OBJECT_SUMMARY, GCOV_UNSIGNED2STRING, function_info::get_name(), ident_to_fn, function_info::lineno_checksum, N_, no_data_file, NULL, object_runs, return_code, and gcov_summary::runs.
Referenced by process_file().
|
static |
Read the notes file. Save functions to FUNCTIONS global vector.
References function_info::artificial, bbg_cwd, bbg_file_name, bbg_file_time, bbg_stamp, bbg_supports_has_unexecuted_blocks, function_info::blocks, function_info::cfg_checksum, function_info::conditions, function_info::counts, default_keep, function_info::end_column, function_info::end_line, filters, find_source(), flag_filter_on_demangled, fnotice(), function_name(), functions, GCOV_ARC_FAKE, GCOV_ARC_FALLTHROUGH, GCOV_ARC_FALSE, GCOV_ARC_ON_TREE, GCOV_ARC_TRUE, gcov_close(), gcov_is_error(), gcov_magic(), GCOV_NOTE_MAGIC, gcov_open(), gcov_position(), gcov_read_string(), gcov_read_unsigned(), gcov_sync(), GCOV_TAG_ARCS, GCOV_TAG_ARCS_NUM, GCOV_TAG_BLOCKS, GCOV_TAG_CONDS, GCOV_TAG_CONDS_NUM, GCOV_TAG_FUNCTION, GCOV_TAG_IS_SUBTAG, GCOV_TAG_LINES, GCOV_UNSIGNED2STRING, function_info::get_demangled_name(), function_info::get_name(), function_info::has_catch, i, function_info::ident, ident_to_fn, function_info::lineno_checksum, block_info::locations, function_info::m_name, condition_info::n_terms, NULL, block_info::num_succ, return_code, arc_info::src, function_info::src, function_info::start_column, function_info::start_line, and block_info::succ.
Referenced by process_file().
|
static |
Release all memory used.
References filters, free(), functions, ident_to_fn, names, source_lines, and sources.
Referenced by main().
|
static |
Get the vector with the contents SRC, possibly from a cache. If the reading fails, a message prefixed with LINE_START is written to GCOV_FILE.
References source_info::file_time, fnotice(), fopen, source_info::index, line_start(), source_info::name, read_line(), and source_lines.
Referenced by output_lines().
|
static |
Solve the flow graph. Propagate counts from the instrumented arcs to the blocks and the uninstrumented arcs.
References bbg_file_name, function_info::blocks, block_info::chain, changes, arc_info::count, block_info::count, arc_info::count_valid, block_info::count_valid, function_info::counts, arc_info::dst, ENTRY_BLOCK, EXIT_BLOCK, fnotice(), function_info::get_name(), i, block_info::invalid_chain, block_info::is_call_site, NULL, block_info::num_pred, block_info::num_succ, block_info::pred, arc_info::src, block_info::succ, arc_info::succ_next, and block_info::valid_chain.
Referenced by process_all_functions().
|
static |
Strip filename extension in STR.
Referenced by get_gcov_intermediate_filename().
|
static |
|
static |
Working directory in which a TU was compiled.
Referenced by generate_results(), and read_graph_file().
|
static |
Name of the notes (gcno) output file. The "bbg" prefix is for historical reasons, when the notes file contained only the basic block graph notes.
Referenced by add_line_counts(), create_file_names(), find_source(), output_lines(), read_graph_file(), and solve_flow_graph().
|
static |
Modification time of graph file.
Referenced by create_file_names(), find_source(), and read_graph_file().
|
static |
Stamp of the bbg file
Referenced by create_file_names(), read_count_file(), and read_graph_file().
|
static |
Supports has_unexecuted_blocks functionality.
Referenced by output_line_beginning(), and read_graph_file().
|
static |
Name and file pointer of the input file for the count data (gcda).
Referenced by create_file_names(), output_lines(), process_file(), and read_count_file().
"Keep policy" when adding functions to the global function table. This will be set to false when --include is used, otherwise every function should be added to the table. Used for --include/exclude.
Referenced by process_args(), and read_graph_file().
|
static |
A collection of filter functions for including/exclude functions in the output. This is empty unless --include/--exclude is used.
Referenced by output_lines(), process_args(), process_register_constraint_filters(), read_graph_file(), and release_structures().
|
static |
Output count information for every basic block, not merely those that contain line number information.
Referenced by output_line_details(), and process_args().
|
static |
Output branch probabilities.
Referenced by add_line_counts(), file_summary(), output_function_details(), output_intermediate_json_line(), output_line_details(), and process_args().
|
static |
Output conditions (modified condition/decision coverage).
Referenced by file_summary(), output_intermediate_json_line(), output_line_details(), and process_args().
|
static |
Output the number of times a branch was taken as opposed to the percentage of times it was taken.
Referenced by output_branch_count(), and process_args().
|
static |
Print debugging dumps.
Referenced by generate_results(), and process_args().
|
static |
Output demangled function names.
Referenced by function_info::get_name(), and process_args().
|
static |
Output progress indication if this is true. This is off by default and can be turned on by the -d option.
Referenced by main(), and process_args().
Include/exclude filters function based on matching the (de)mangled name. The default is to match the mangled name. Note that flag_demangled_names does not affect this.
Referenced by process_args(), and read_graph_file().
|
static |
Output summary info for each function.
Referenced by generate_results(), and process_args().
|
static |
Output a gcov file if this is true. This is on by default, and can be turned off by the -n option.
Referenced by generate_results(), and process_args().
|
static |
For situations when a long name can potentially hit filesystem path limit, let's calculate md5sum of the path and append it to a file name.
Referenced by get_gcov_intermediate_filename(), make_gcov_file_name(), and process_args().
|
static |
Output human readable numbers.
Referenced by format_count(), and process_args().
|
static |
Output *.gcov file in JSON intermediate format used by consumers.
Referenced by accumulate_line_counts(), generate_results(), main(), and process_args().
|
static |
For included files, make the gcov output file name include the name of the input source file. For example, if x.h is included in a.c, then the output file name is a.c##x.h.gcov instead of x.h.gcov.
Referenced by make_gcov_file_name(), and process_args().
|
static |
Preserve all pathname components. Needed when object files and source files are in subdirectories. '/' is mangled as '#', '.' is elided and '..' mangled to '^'.
Referenced by get_gcov_intermediate_filename(), mangle_name(), and process_args().
|
static |
Only show data for sources with relative pathnames. Absolute ones usually indicate a system header file, which although it may contain inline functions, is usually uninteresting.
Referenced by generate_results(), and process_args().
|
static |
Show unconditional branches too.
Referenced by output_branch_count(), and process_args().
|
static |
Print colored output.
Referenced by output_line_beginning(), output_lines(), and process_args().
|
static |
Use perf-like colors to indicate hot lines.
Referenced by output_line_beginning(), output_lines(), and process_args().
|
static |
Output to stdout instead to a gcov file.
Referenced by generate_results(), main(), and process_args().
|
static |
Print verbose informations.
Referenced by output_branch_count(), output_line_details(), and process_args().
|
static |
Vector of all functions.
Referenced by generate_results(), output_json_intermediate_file(), process_all_functions(), read_graph_file(), and release_structures().
|
static |
Function ident to function_info * map.
Referenced by read_count_file(), read_graph_file(), and release_structures().
|
static |
If there is several input files, compute and display results after reading all data files. This way if two or more gcda file refer to the same source file (eg inline subprograms in a .h file), the counts are added.
Referenced by main(), and output_lines().
|
static |
Mapping of file names to sources
Referenced by add_exit_phis(), add_to_set(), build_bitint_stmt_ssa_conflicts(), built_in_function_equal_p(), check_attribute_tables(), compile_images_for_offload_targets(), eh_data_format_name(), find_source(), fndecl_built_in_p(), generate_results(), is_ctor_dtor(), omp_maybe_offloaded(), omp_offload_device_kind_arch_isa(), output_pubnames(), process_decls(), process_excls(), process_presence_absence_names(), release_defs_bitset(), release_structures(), and size_of_pubnames().
|
static |
Data file is missing.
Referenced by output_lines(), process_all_functions(), and read_count_file().
|
static |
Object directory file prefix. This is the directory/file where the graph and data files are looked for, if nonzero.
Referenced by create_file_names(), and process_args().
|
static |
This holds data summary information.
Referenced by output_lines(), and read_count_file().
|
static |
|
static |
Record all processed files in order to warn about a file being read multiple times.
Referenced by process_file().
|
static |
Return code of the tool invocation.
Referenced by generate_results(), main(), output_gcov_file(), read_count_file(), and read_graph_file().
|
static |
Referenced by find_source(), and process_args().
|
static |
The contents of a source file. The nth SOURCE_LINES entry is the contents of the nth SOURCES, or empty if it has not or could not be read.
Referenced by output_lines(), print_source_line(), release_structures(), and slurp().
|
static |
Source directory prefix. This is removed from source pathnames that match, when generating the output file name.
Referenced by find_source(), and process_args().
|
static |
Vector of source files.
Referenced by add_line_counts(), ipcp_value< valtype >::add_source(), find_source(), generate_results(), process_all_functions(), and release_structures().
|
static |
Referenced by generate_results(), and main().
|
static |
Referenced by generate_results(), and main().