Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1506)

Issue 8211043: [google] Add option to emit mapping between module/function id and function name

Can't Edit
Can't Publish+Mail
Start Review
Created:
6 years, 7 months ago by tejohnson
Modified:
5 years, 2 months ago
Reviewers:
davidxl
CC:
gcc-patches_gcc.gnu.org
Base URL:
svn+ssh://gcc.gnu.org/svn/gcc/branches/google/gcc-4_7/gcc/
Visibility:
Public.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+25 lines, -0 lines) Patch
M common.opt View 1 chunk +7 lines, -0 lines 0 comments Download
M coverage.h View 1 chunk +2 lines, -0 lines 0 comments Download
M coverage.c View 1 chunk +13 lines, -0 lines 0 comments Download
M tree-profile.c View 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 2
tejohnson
This patch restores part of r196176, which was subsequently reverted due to issues with the ...
6 years, 7 months ago (2013-03-31 06:44:15 UTC) #1
davidxl
6 years, 7 months ago (2013-03-31 16:18:40 UTC) #2
ok.

thanks,

David

On Sat, Mar 30, 2013 at 11:44 PM, Teresa Johnson <tejohnson@google.com> wrote:
> This patch restores part of r196176, which was subsequently reverted
> due to issues with the other part of that patch that dealt with
> module info updates. This patch restores the option -femit-function-names
> to emit to stderr the mapping from module name/function id to function
> assembler name. This enables mapping the function ids in the gcda
> dump files to the symbolic function name. This will work for LIPO builds
> without the other part of that patch, which was needed for FDO builds,
> and which needs to be revisited and fixed.
>
> Tested by bootstrap and regression testing. Ok for google-4_7?
>
> 2013-03-30  Teresa Johnson  <tejohnson@google.com>
>
>         * tree-profile.c (tree_profiling): Optionally call
>         new function emit_function_name.
>         * common.opt (flag_emit_function_names): New flag.
>         * coverage.c (emit_function_name): New function.
>         * coverage.h: Ditto.
>
> Index: tree-profile.c
> ===================================================================
> --- tree-profile.c      (revision 197266)
> +++ tree-profile.c      (working copy)
> @@ -1557,6 +1557,9 @@ tree_profiling (void)
>        /* Re-set global shared temporary variable for edge-counters.  */
>        gcov_type_tmp_var = NULL_TREE;
>
> +      if (flag_emit_function_names)
> +        emit_function_name ();
> +
>        /* Local pure-const may imply need to fixup the cfg.  */
>        if (execute_fixup_cfg () & TODO_cleanup_cfg)
>         cleanup_tree_cfg ();
> Index: common.opt
> ===================================================================
> --- common.opt  (revision 197266)
> +++ common.opt  (working copy)
> @@ -1775,6 +1775,13 @@ fprofile-generate-sampling
>  Common Var(flag_profile_generate_sampling)
>  Turn on instrumentation sampling with -fprofile-generate with rate set by
--param profile-generate-sampling-rate or environment variable
GCOV_SAMPLING_RATE
>
> +femit-function-names
> +Common Var(flag_emit_function_names)
> +Print to stderr the mapping from module name and function id to assembler
> +function name when -ftest-coverage, -fprofile-generate or -fprofile-use are
> +active, for use in correlating function ids in gcda files with the function
> +name.
> +
>  fprofile-strip=
>  Common Joined RejectNegative Var(profile_base_name_suffix_to_strip)
>  Specify a substring to be stripped from the profile base file name
> Index: coverage.c
> ===================================================================
> --- coverage.c  (revision 197266)
> +++ coverage.c  (working copy)
> @@ -2085,6 +2085,19 @@ build_cl_args_array_value (tree string_type, VEC(c
>    return;
>  }
>
> +/* Emit mapping between module name and function id to the function's
> +   assembler name, for use in correlating function idents in the gcda file
> +   with the function name.  */
> +
> +void
> +emit_function_name (void)
> +{
> +  fprintf (stderr, "Module %s FuncId %u Name %s\n",
> +           main_input_file_name,
> +           FUNC_DECL_FUNC_ID (cfun),
> +           IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME
(current_function_decl)));
> +}
> +
>  /* Returns the type of the module info associated with the
>     current source module being compiled.  */
>
> Index: coverage.h
> ===================================================================
> --- coverage.h  (revision 197266)
> +++ coverage.h  (working copy)
> @@ -75,6 +75,8 @@ extern void coverage_dc_end_function (void);
>     is present in the coverage internal data structures.  */
>  extern bool coverage_function_present (unsigned fn_ident);
>
> +extern void emit_function_name (void);
> +
>  /* True if there is PMU data present in this compilation. */
>  extern bool pmu_data_present (void);
>
>
> --
> This patch is available for review at http://codereview.appspot.com/8211043
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b