[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4d7fea06-1c46-4786-ab58-657293a93488@intel.com>
Date: Mon, 13 Oct 2025 21:43:06 +0800
From: "Li, Tianyou" <tianyou.li@...el.com>
To: Ravi Bangoria <ravi.bangoria@....com>, Namhyung Kim <namhyung@...nel.org>,
Arnaldo Carvalho de Melo <acme@...nel.org>
CC: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Mark Rutland <mark.rutland@....com>, Alexander Shishkin
<alexander.shishkin@...ux.intel.com>, Jiri Olsa <jolsa@...nel.org>, "Ian
Rogers" <irogers@...gle.com>, Adrian Hunter <adrian.hunter@...el.com>, "Kan
Liang" <kan.liang@...ux.intel.com>, <wangyang.guo@...el.com>,
<pan.deng@...el.com>, <zhiguo.zhou@...el.com>, <jiebin.sun@...el.com>,
<thomas.falcon@...el.com>, <dapeng1.mi@...el.com>,
<linux-perf-users@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v7 1/2] perf tools c2c: Add annotation support to perf c2c
report
Hi Ravi,
Appreciated for your testing and the code. It works like magic. Learnt.
I compared the sample count, percentage and period by 't' in annotate
browser, all numbers in perf c2c report aligned with perf report.
I am curious if we should update the evsel_hists->stats when
perf_c2c__has_annotation return true. I will send out patch v8 soon.
Regards,
Tianyou
On 10/13/2025 4:52 PM, Ravi Bangoria wrote:
> On 11-Oct-25 1:46 PM, Tianyou Li wrote:
>> Perf c2c report currently specified the code address and source:line
>> information in the cacheline browser, while it is lack of annotation
>> support like perf report to directly show the disassembly code for
>> the particular symbol shared that same cacheline. This patches add
>> a key 'a' binding to the cacheline browser which reuse the annotation
>> browser to show the disassembly view for easier analysis of cacheline
>> contentions.
> I still see annotate browser title with samples/event count as 0.
> Something like below (lightly tested) should fix it. Can you please
> check?
>
>
> --- a/tools/perf/builtin-c2c.c
> +++ b/tools/perf/builtin-c2c.c
> @@ -299,6 +299,18 @@ static bool perf_c2c__has_annotation(struct perf_hpp_list *list)
> return !list || list->sym;
> }
>
> +static void perf_c2c__evsel_hists_inc_stats(struct evsel *evsel,
> + struct hist_entry *he,
> + struct perf_sample *sample)
> +{
> + struct hists *evsel_hists = evsel__hists(evsel);
> +
> + hists__inc_nr_samples(evsel_hists, he->filtered);
> + evsel_hists->stats.total_period += sample->period;
> + if (!he->filtered)
> + evsel_hists->stats.total_non_filtered_period += sample->period;
> +}
> +
> static int process_sample_event(const struct perf_tool *tool __maybe_unused,
> union perf_event *event,
> struct perf_sample *sample,
> @@ -363,6 +375,9 @@ static int process_sample_event(const struct perf_tool *tool __maybe_unused,
> hists__inc_nr_samples(&c2c_hists->hists, he->filtered);
> if (perf_c2c__has_annotation(NULL))
> addr_map_symbol__inc_samples(mem_info__iaddr(mi), sample, evsel);
> +
> + perf_c2c__evsel_hists_inc_stats(evsel, he, sample);
> +
> ret = hist_entry__append_callchain(he, sample);
>
> if (!ret) {
>
> Thanks,
> Ravi
>
Powered by blists - more mailing lists