Re: [PATCH] perf tests: Make leader sampling test work without branch event
From: Ian Rogers
Date: Thu Jan 09 2025 - 16:44:21 EST
On Mon, Dec 23, 2024 at 1:04 AM Mi, Dapeng <dapeng1.mi@xxxxxxxxxxxxxxx> wrote:
>
>
> On 12/21/2024 3:08 PM, Ian Rogers wrote:
> > On Sat, Nov 16, 2024 at 11:28 AM Arnaldo Carvalho de Melo
> > <acme@xxxxxxxxxx> wrote:
> >> On Fri, Nov 15, 2024 at 10:54:43AM -0800, Ian Rogers wrote:
> >>> On Fri, Nov 15, 2024 at 8:16 AM James Clark <james.clark@xxxxxxxxxx> wrote:
> >>>> Arm a57 only has speculative branch events so this test fails there. The
> >>>> test doesn't depend on branch instructions so change it to instructions
> >>>> which is pretty much guaranteed to be everywhere. The
> >>>> test_branch_counter() test above already tests for the existence of the
> >>>> branches event and skips if its not present.
> >>>>
> >>>> Signed-off-by: James Clark <james.clark@xxxxxxxxxx>
> >>> Reviewed-by: Ian Rogers <irogers@xxxxxxxxxx>
> >> Thanks, applied to perf-tools-next,
> > Rebasing on perf-tools-next I see this failing on my Intel Tigerlake
> > laptop. An example script output for:
> > ```
> > perf record -o "${perfdata}" -e "{instructions,instructions}:Su"
> > ```
> > is:
> > ```
> > perf 352917 49604.160314: 3 instructions:
> > 7f155caca323 [unknown]
> > (/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2)
> > perf 352917 49604.160314: 3 instructions:
> > 7f155caca323 [unknown]
> > (/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2)
> > perf 352917 49604.160317: 18 instructions:
> > 7f155cacaf3d _dl_start+0x3d
> > (/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2)
> > perf 352917 49604.160317: 18 instructions:
> > 7f155cacaf3d _dl_start+0x3d
> > (/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2)
> > perf 352917 49604.160319: 3 instructions:
> > 7f155cacaf44 _dl_start+0x44
> > (/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2)
> > perf 352917 49604.160319: 3 instructions:
> > 7f155cacaf44 _dl_start+0x44
> > (/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2)
> > perf 352917 49604.161099: 120 instructions:
> > ffffffff8ce00080 [unknown] ([unknown])
> > perf 352917 49604.161099: 181013 instructions:
> > ffffffff8ce00080 [unknown] ([unknown])
> > perf 352917 49604.161115: 8811 instructions:
> > 7f155cad22d0 strcmp+0x8b0
> > (/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2)
> > perf 352917 49604.161115: 8811 instructions:
> > 7f155cad22d0 strcmp+0x8b0
> > (/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2)
> > perf 352917 49604.161130: 10483 instructions:
> > 7f155caba508 _dl_new_object+0x198
> > (/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2)
> > perf 352917 49604.161130: 10483 instructions:
> > 7f155caba508 _dl_new_object+0x198
> > (/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2)
> > perf 352917 49604.165156: 177355 instructions:
> > 7f155cab90a4 _dl_lookup_symbol_x+0x44
> > (/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2)
> > perf 352917 49604.165156: 13313598 instructions:
> > 7f155cab90a4 _dl_lookup_symbol_x+0x44
> > (/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2)
> > ...
> > ```
> >
> > Dapeng/Kan, any thoughts why the counts don't match for instructions
> > but did for branches?
>
>
> That looks strange, what's your kernel version and perf-tool version? I
> just tried the latest perf-tools-next branch, but I don't see this issue.
It seems to have cleared up for me. I'll speak up again if I can get a
reproduction.
Thanks,
Ian