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

Issue 6489092: [google] Added new dump flag -pmu to display pmu data in pass summaries

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 8 months ago by cmang2
Modified:
11 years, 7 months ago
Reviewers:
dehao, tejohnson, davidxl
CC:
gcc-patches_gcc.gnu.org
Base URL:
svn://gcc.gnu.org/svn/gcc/branches/google/main/
Visibility:
Public.

Patch Set 1 #

Patch Set 2 : [google] Added new dump flag -pmu to display pmu data in pass summaries #

Total comments: 13
Unified diffs Side-by-side diffs Delta from patch set Stats (+470 lines, -11 lines) Patch
M gcc/common.opt View 1 chunk +2 lines, -2 lines 1 comment Download
M gcc/coverage.h View 2 chunks +9 lines, -1 line 0 comments Download
M gcc/coverage.c View 1 9 chunks +302 lines, -0 lines 7 comments Download
M gcc/doc/invoke.texi View 2 chunks +4 lines, -5 lines 0 comments Download
M gcc/gcov.c View 2 chunks +2 lines, -1 line 1 comment Download
M gcc/gcov-io.h View 1 chunk +8 lines, -0 lines 1 comment Download
M gcc/gimple-pretty-print.c View 1 5 chunks +55 lines, -0 lines 1 comment Download
M gcc/opts.c View 1 chunk +5 lines, -0 lines 0 comments Download
M gcc/tree-dump.c View 1 chunk +3 lines, -1 line 0 comments Download
M gcc/tree-pass.h View 1 chunk +1 line, -1 line 0 comments Download
M gcc/tree-pretty-print.h View 2 chunks +3 lines, -0 lines 0 comments Download
M gcc/tree-pretty-print.c View 1 5 chunks +76 lines, -0 lines 2 comments Download

Messages

Total messages: 7
cmang2
This patch adds a new dump flag that dumps PMU profile information using the -pmu ...
11 years, 8 months ago (2012-09-06 21:49:05 UTC) #1
tejohnson
On Thu, Sep 6, 2012 at 2:49 PM, Chris Manghane <cmang@google.com> wrote: > This patch ...
11 years, 8 months ago (2012-09-07 00:08:27 UTC) #2
cmang2
On Thu, Sep 6, 2012 at 5:08 PM, Teresa Johnson <tejohnson@google.com> wrote: > On Thu, ...
11 years, 8 months ago (2012-09-07 00:34:22 UTC) #3
tejohnson
On Thu, Sep 6, 2012 at 5:34 PM, Chris Manghane <cmang@google.com> wrote: > > > ...
11 years, 8 months ago (2012-09-07 00:43:21 UTC) #4
cmang2
Fixed spacing and condensed repeated code into helper. This patch should be applied to google/main. ...
11 years, 8 months ago (2012-09-07 01:18:20 UTC) #5
dehao
FYI. Dehao https://codereview.appspot.com/6489092/diff/4001/gcc/common.opt File gcc/common.opt (right): https://codereview.appspot.com/6489092/diff/4001/gcc/common.opt#newcode1688 gcc/common.opt:1688: -fpmu-profile-use=[pmuprofile.gcda] The pmu profile data file to ...
11 years, 7 months ago (2012-09-19 22:03:39 UTC) #6
tejohnson
11 years, 7 months ago (2012-09-24 19:01:35 UTC) #7
On Wed, Sep 19, 2012 at 3:03 PM,  <dehao@google.com> wrote:
> FYI.
>
> Dehao

Thanks. Responses below. New patch being uploaded shortly.

Teresa

>
>
> https://codereview.appspot.com/6489092/diff/4001/gcc/common.opt
> File gcc/common.opt (right):
>
> https://codereview.appspot.com/6489092/diff/4001/gcc/common.opt#newcode1688
> gcc/common.opt:1688: -fpmu-profile-use=[pmuprofile.gcda]  The pmu
>
> profile data file to use for pmu feedback.
> Looks like the default value is not implemented.

Fixed.

>
> https://codereview.appspot.com/6489092/diff/4001/gcc/coverage.c
> File gcc/coverage.c (right):
>
> https://codereview.appspot.com/6489092/diff/4001/gcc/coverage.c#newcode777
> gcc/coverage.c:777: +static void read_pmu_file (const char*
> da_file_name)
> This function is very large. How about splitting it into read_pmu_file
> and process_pmu_file (the second one builds the hash tables, etc.)

Done. Moved the hash table code into process_pmu_data, called by read_pmu_file.

>
> https://codereview.appspot.com/6489092/diff/4001/gcc/coverage.c#newcode781
> gcc/coverage.c:781: +  brm_infos_t* brm_infos =
> &pmu_global_summary.brm_infos;
> For consistency, please move the "*" after the space. (many places in
> this file)

Fixed.

>
> https://codereview.appspot.com/6489092/diff/4001/gcc/coverage.c#newcode846
> gcc/coverage.c:846: +      unsigned length = gcov_read_unsigned ();
> Please use gcov_unsigned_t

Fixed.

>
> https://codereview.appspot.com/6489092/diff/4001/gcc/coverage.c#newcode847
> gcc/coverage.c:847: +      unsigned long base = gcov_position ();
> Please use gcov_position_t

Fixed.

>
> https://codereview.appspot.com/6489092/diff/4001/gcc/coverage.c#newcode940
> gcc/coverage.c:940: +         there should only be one entry per
>
> filename and line number */
> add a gcc_assert in the else path?

Yes, added an assert, also added it to the branch mispredict path as
well, to verify that
the entry (now returned by a helper func) does not already have that
type of pmu data.

Actually, after testing with an example pmuprofile.gcda file I
generated, I removed these asserts. Looks like the tool is generating
pmu entries for addresses it can't attribute to a known source file to
the same source position (file:line of null:0). This should probably
be fixed in the tool that generates the gcda file, but for now rather
than assert or try to filter these out in the compiler, I am just
ignoring the fact that there may be duplicates.

>
> https://codereview.appspot.com/6489092/diff/4001/gcc/coverage.c#newcode966
> gcc/coverage.c:966: +    }
> The above two loops looks similar, can they be abstracted out?

I pulled out the hash table entry lookup/setup code into a new helper,
get_pmu_hash_entry.

>
> https://codereview.appspot.com/6489092/diff/4001/gcc/coverage.c#newcode2573
> gcc/coverage.c:2573: +  if (pmu_profile_data != 0 && TDF_PMU)
> if (pmu_profile_data != NULL && ...)
>
> or
>
> if (pmu_profile_data && ...)

This code has changed due to the new option handling I added, to deal
with the default filename.
The check essentially looks like your second option though.

>
> https://codereview.appspot.com/6489092/diff/4001/gcc/gcov-io.h
> File gcc/gcov-io.h (right):
>
> https://codereview.appspot.com/6489092/diff/4001/gcc/gcov-io.h#newcode705
> gcc/gcov-io.h:705: /* Cumulative pmu data */
> Seems this data structure should be moved into coverage.c.

Yes, done.

>
> https://codereview.appspot.com/6489092/diff/4001/gcc/gcov.c
> File gcc/gcov.c (right):
>
> https://codereview.appspot.com/6489092/diff/4001/gcc/gcov.c#newcode2353
> gcc/gcov.c:2353: +
> remove blank line

Fixed.

>
> https://codereview.appspot.com/6489092/diff/4001/gcc/gimple-pretty-print.c
> File gcc/gimple-pretty-print.c (right):
>
>
https://codereview.appspot.com/6489092/diff/4001/gcc/gimple-pretty-print.c#ne...
> gcc/gimple-pretty-print.c:1585: static void
> This function is very much like dump_pmu. Can we jus call dump_pmu here?

Agreed. Done.

>
> https://codereview.appspot.com/6489092/diff/4001/gcc/tree-pretty-print.c
> File gcc/tree-pretty-print.c (right):
>
>
https://codereview.appspot.com/6489092/diff/4001/gcc/tree-pretty-print.c#newc...
> gcc/tree-pretty-print.c:28: #include "basic-block.h"
> why need to include his header?

It defines gcov_type for the compiler.

>
>
https://codereview.appspot.com/6489092/diff/4001/gcc/tree-pretty-print.c#newc...
> gcc/tree-pretty-print.c:519: static void
> Looks to me that this function should be exported, while
> dump_load_latency_details should stay static.

Yep, fixed.



>
> https://codereview.appspot.com/6489092/



-- 
Teresa Johnson | Software Engineer | tejohnson@google.com | 408-460-2413
Sign in to reply to this message.

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