Re: [PATCH v2] perf/core: Optimize event reschedule for a PMU

From: Namhyung Kim
Date: Mon Aug 05 2024 - 02:39:45 EST


On Sat, Aug 3, 2024 at 10:08 AM Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
>
> On Sat, Aug 3, 2024 at 3:32 AM Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> >
> > On Fri, Aug 02, 2024 at 09:11:23PM +0200, Peter Zijlstra wrote:
> >
> > > But I'll have to continue staring at this later.
> >
> > OK, I have the below, which boots and seems able to do:
> >
> > perf stat -ae power/energy-pkg/ -- sleep 1
> >
> > and
> >
> > perf top
> >
> > also still works, so it must be perfect, right, right?
>
> I really hope so. :) I'll test it over the weekend.

I found a failing test about the context time - it complained about
difference in enabled vs running time of a software event.

Thanks,
Namhyung


$ perf test -v times
46: Event times:
--- start ---
test child forked, pid 325425
Using CPUID GenuineIntel-6-55-7
...
attaching to current thread as disabled
Opening: cpu-clock:u
------------------------------------------------------------
perf_event_attr:
type 1 (software)
size 136
config 0 (PERF_COUNT_SW_CPU_CLOCK)
read_format TOTAL_TIME_ENABLED|TOTAL_TIME_RUNNING
disabled 1
exclude_kernel 1
exclude_hv 1
exclude_guest 1
------------------------------------------------------------
sys_perf_event_open: pid 325425 cpu -1 group_fd -1 flags 0x8 = 3
FAILED: ena 1026, run 881

attaching to CPU 0 as enabled
Opening: cpu-clock:u
------------------------------------------------------------
perf_event_attr:
type 1 (software)
size 136
config 0 (PERF_COUNT_SW_CPU_CLOCK)
read_format TOTAL_TIME_ENABLED|TOTAL_TIME_RUNNING
disabled 1
exclude_kernel 1
exclude_hv 1
exclude_guest 1
------------------------------------------------------------
sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 3
FAILED: ena 6554, run 6079
...