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 "gcov-io.h"
#include <stdlib.h>
#include <stdio.h>
#include <sys/stat.h>
#include <unistd.h>
#include <getopt.h>
Functions | |
struct gcov_info * | gcov_profile_merge (struct gcov_info *, struct gcov_info *, int, int) |
struct gcov_info * | gcov_profile_merge_stream (const char *, int, int) |
int | gcov_profile_overlap (struct gcov_info *, struct gcov_info *) |
int | gcov_profile_normalize (struct gcov_info *, gcov_type) |
int | gcov_profile_scale (struct gcov_info *, float, int, int) |
struct gcov_info * | gcov_read_profile_dir (const char *, int) |
void | gcov_do_dump (struct gcov_info *, int, int) |
const char * | gcov_get_filename (struct gcov_info *list) |
void | gcov_set_verbose (void) |
static int | unlink_profile_dir (const char *path) |
static void | gcov_output_files (const char *out, struct gcov_info *profile) |
static int | profile_merge (const char *d1, const char *d2, const char *out, int w1, int w2) |
static void | print_merge_usage_message (int error_p) |
static void ATTRIBUTE_NORETURN | merge_usage (void) |
static int | do_merge (int argc, char **argv) |
static void | print_merge_stream_usage_message (int error_p) |
static void ATTRIBUTE_NORETURN | merge_stream_usage (void) |
static int | do_merge_stream (int argc, char **argv) |
static int | profile_rewrite (const char *d1, const char *out, int64_t n_val, float scale, int n, int d) |
static void | print_rewrite_usage_message (int error_p) |
static void ATTRIBUTE_NORETURN | rewrite_usage (void) |
static int | do_rewrite (int argc, char **argv) |
static int | profile_overlap (const char *d1, const char *d2) |
static void | print_overlap_usage_message (int error_p) |
static void ATTRIBUTE_NORETURN | overlap_usage (void) |
static int | do_overlap (int argc, char **argv) |
static void | print_usage (int error_p) |
static void | print_version (void) |
static int | process_args (int argc, char **argv) |
int | main (int argc, char **argv) |
Variables | |
static bool | verbose |
static const struct option | merge_options [] |
static const struct option | merge_stream_options [] |
static const struct option | rewrite_options [] |
static const struct option | overlap_options [] |
int | overlap_func_level |
int | overlap_obj_level |
int | overlap_hot_only |
int | overlap_use_fullname |
double | overlap_hot_threshold = 0.005 |
static const struct option | options [] |
|
static |
Driver for profile merge subcommand.
References fatal_error(), gcov_set_verbose(), input_location, merge_options, merge_usage(), NULL, profile_merge(), and verbose.
Referenced by main().
|
static |
Driver for profile merge-stream subcommand.
References fatal_error(), fnotice(), gcov_do_dump(), gcov_profile_merge_stream(), gcov_set_verbose(), input_location, merge_stream_options, merge_stream_usage(), NULL, and verbose.
Referenced by main().
|
static |
Driver for profile overlap subcommand.
References gcov_set_verbose(), NULL, overlap_func_level, overlap_hot_only, overlap_hot_threshold, overlap_obj_level, overlap_options, overlap_usage(), overlap_use_fullname, profile_overlap(), and verbose.
Referenced by main().
|
static |
Driver for profile rewrite subcommand.
References fatal_error(), fnotice(), gcov_set_verbose(), input_location, NULL, profile_rewrite(), rewrite_options, rewrite_usage(), and verbose.
Referenced by main().
|
extern |
Referenced by do_merge_stream(), and gcov_output_files().
|
extern |
Referenced by gcov_output_files().
|
static |
Output GCOV_INFO lists PROFILE to directory OUT. Note that we will remove all the gcda files in OUT.
References errno, F_OK, fatal_error(), free(), gcov_do_dump(), gcov_get_filename(), input_location, NULL, and unlink_profile_dir().
Referenced by profile_merge(), and profile_rewrite().
|
extern |
Gcc offline profile processing tool support.
Copyright (C) 2014-2025 Free Software Foundation, Inc. Contributed by Rong Xu <xur@google.com>. This file is part of GCC. GCC 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. GCC 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. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see <http://www.gnu.org/licenses/>.
Referenced by profile_merge().
|
extern |
Referenced by do_merge_stream().
|
extern |
Referenced by profile_rewrite().
|
extern |
Referenced by profile_overlap().
|
extern |
Referenced by profile_rewrite().
|
extern |
Referenced by profile_merge(), profile_overlap(), and profile_rewrite().
|
extern |
Referenced by do_merge(), do_merge_stream(), do_overlap(), and do_rewrite().
int main | ( | int | argc, |
char ** | argv ) |
Main function for gcov-tool.
References diagnostic_initialize(), do_merge(), do_merge_stream(), do_overlap(), do_rewrite(), gcc_init_libintl, global_dc, print_usage(), process_args(), and progname.
|
static |
Print merge-stream usage and exit.
References FATAL_EXIT_CODE, fnotice(), and print_merge_stream_usage_message().
Referenced by do_merge_stream().
|
static |
Print merge usage and exit.
References FATAL_EXIT_CODE, fnotice(), and print_merge_usage_message().
Referenced by do_merge().
|
static |
Print overlap usage and exit.
References FATAL_EXIT_CODE, fnotice(), and print_overlap_usage_message().
Referenced by do_overlap().
|
static |
Usage message for profile merge-stream.
References fnotice().
Referenced by merge_stream_usage(), and print_usage().
|
static |
Usage message for profile merge.
References fnotice().
Referenced by merge_usage(), and print_usage().
|
static |
Usage message for profile overlap.
References fnotice().
Referenced by overlap_usage(), and print_usage().
|
static |
Usage function for profile rewrite.
References fnotice().
Referenced by print_usage(), and rewrite_usage().
|
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(), print_merge_stream_usage_message(), print_merge_usage_message(), print_overlap_usage_message(), print_rewrite_usage_message(), progname, and SUCCESS_EXIT_CODE.
|
static |
Print version information and exit.
References _, fnotice(), progname, and SUCCESS_EXIT_CODE.
Referenced by process_args().
|
static |
Process args, return index to first non-arg.
References NULL, print_usage(), and print_version().
Referenced by main().
|
static |
Merging profile D1 and D2 with weight as W1 and W2, respectively. The result profile is written to directory OUT. Return 0 on success.
References d1, d2, fnotice(), gcov_output_files(), gcov_profile_merge(), gcov_read_profile_dir(), and verbose.
Referenced by do_merge().
|
static |
Driver function to computer the overlap score b/w profile D1 and D2. Return 1 on error and 0 if OK.
References d1, d2, gcov_profile_overlap(), and gcov_read_profile_dir().
Referenced by do_overlap().
|
static |
If N_VAL is no-zero, normalize the profile by setting the largest counter counter value to N_VAL and scale others counters proportionally. Otherwise, multiply the all counters by SCALE.
References d1, gcov_output_files(), gcov_profile_normalize(), gcov_profile_scale(), and gcov_read_profile_dir().
Referenced by do_rewrite().
|
static |
Print profile rewrite usage and exit.
References FATAL_EXIT_CODE, fnotice(), and print_rewrite_usage_message().
Referenced by do_rewrite().
|
static |
|
static |
Referenced by do_merge().
|
static |
Referenced by do_merge_stream().
|
static |
int overlap_func_level |
Referenced by do_overlap().
int overlap_hot_only |
Referenced by do_overlap().
double overlap_hot_threshold = 0.005 |
Referenced by do_overlap().
int overlap_obj_level |
Referenced by do_overlap().
|
static |
Referenced by do_overlap().
int overlap_use_fullname |
Referenced by do_overlap().
|
static |
Referenced by do_rewrite().
|
static |
Set to verbose output mode.