From: Ravi Bangoria <ravi.bangoria@amd.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: acme@kernel.org, peterz@infradead.org, mingo@redhat.com,
eranian@google.com, irogers@google.com,
kan.liang@linux.intel.com, jolsa@kernel.org,
adrian.hunter@intel.com, alexander.shishkin@linux.intel.com,
bp@alien8.de, mark.rutland@arm.com, linux-kernel@vger.kernel.org,
linux-perf-users@vger.kernel.org, santosh.shukla@amd.com,
ananth.narayan@amd.com, sandipan.das@amd.com,
Ravi Bangoria <ravi.bangoria@amd.com>
Subject: Re: [RFC] perf script AMD/IBS: Add scripts to show function/instruction level granular profile
Date: Mon, 27 Jan 2025 14:26:48 +0530 [thread overview]
Message-ID: <b2fbbc6e-0d8f-472c-897e-0056b4803e36@amd.com> (raw)
In-Reply-To: <Z5PM9fNzMmaas0kC@google.com>
Hi Namhyung,
> On Fri, Jan 24, 2025 at 06:06:38AM +0000, Ravi Bangoria wrote:
>> AMD IBS (Instruction Based Sampling) PMUs provides various insights
>> about instruction execution through front-end and back-end units.
>> Various perf tools (e.g. precise-mode (:p), perf-mem, perf-c2c etc.)
>> uses portion of these information but lot of other insightful data are
>> still remains unused by perf. I could not think of any generic perf
>> tool where I can consolidate and show all these data, so thought to
>> add perf-python scripts.
>
> Thanks for doing this. I agree that there are many rooms for
> improvement in this regard. While I'm ok to add the scripts, I'm
> curious if we can add something as sort keys so that it can be used in
> the general perf-mem and perf-c2c.
>
> For example, function level data source breakdown can be shown:
>
> $ perf mem report -H -s sym,mem
> #
> # Overhead Samples Symbol / Memory access
> # ......................... ......................
> #
> 4.58% 97 [k] psi_group_change
> 2.89% 51 L1 hit
> 1.38% 35 LFB/MAB hit
> 0.19% 10 L3 hit
> 0.12% 1 RAM hit
> 4.54% 1 [k] bpf_ksym_find
> 4.54% 1 RAM hit
> ...
Interesting, I wasn't aware of this mode. I usually group them using -F.
$ perf mem report -F sample,mem,sym
Samples: 531K of event 'ibs_op//', Event count (approx.): 4359237
Samples Memory access Symbol
4922 L1 hit [k] perf_event_update_userpage
3028 N/A [k] perf_event_update_userpage
281 L2 hit [k] perf_event_update_userpage
48 LFB/MAB hit [k] perf_event_update_userpage
But, AFAIK, -F (or other options) does not allow grouping and showing all
the data at the function granularity. For ex, if I add a TLB column, the
data gets further split hierarchically in -F field order:
$ perf mem report -F sample,mem,tlb,sym
Samples: 531K of event 'ibs_op//', Event count (approx.): 4359237
Samples Memory access TLB access Symbol
4920 L1 hit L1 hit [k] perf_event_update_userpage
3028 N/A N/A [k] perf_event_update_userpage
280 L2 hit L1 hit [k] perf_event_update_userpage
48 LFB/MAB hit L1 hit [k] perf_event_update_userpage
2 L1 hit L2 hit [k] perf_event_update_userpage
1 L2 hit L2 hit [k] perf_event_update_userpage
Thanks for the feedback,
Ravi
prev parent reply other threads:[~2025-01-27 8:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-24 6:06 [RFC] perf script AMD/IBS: Add scripts to show function/instruction level granular profile Ravi Bangoria
2025-01-24 16:16 ` Ian Rogers
2025-01-27 8:59 ` Ravi Bangoria
2025-01-24 17:25 ` Namhyung Kim
2025-01-27 8:56 ` Ravi Bangoria [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b2fbbc6e-0d8f-472c-897e-0056b4803e36@amd.com \
--to=ravi.bangoria@amd.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=ananth.narayan@amd.com \
--cc=bp@alien8.de \
--cc=eranian@google.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=sandipan.das@amd.com \
--cc=santosh.shukla@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox