Messages in this thread | | | From | Song Liu <> | Subject | Re: [PATCH] perf: fix perf_event_context->time | Date | Fri, 3 Mar 2023 01:21:51 +0000 |
| |
> On Mar 2, 2023, at 1:15 PM, Namhyung Kim <namhyung@kernel.org> wrote: > > On Wed, Mar 1, 2023 at 3:16 PM Song Liu <songliubraving@meta.com> wrote: >> >> >> >>> On Mar 1, 2023, at 2:29 PM, Namhyung Kim <namhyung@kernel.org> wrote: >>> >>> Hi Song, >>> >>> On Tue, Feb 28, 2023 at 11:22 AM Song Liu <song@kernel.org> wrote: >>>> >>>> Time readers rely on perf_event_context->[time|timestamp|timeoffset] to get >>>> accurate time_enabled and time_running for an event. The difference between >>>> ctx->timestamp and ctx->time is the among of time when the context is not >>>> enabled. For cpuctx.ctx, time and timestamp should stay the same, however, >>> >>> I'm not sure if it's correct. The timestamp can go when the context is disabled >>> for example, in ctx_resched() even if the NMI watchdog is enabled, right? >> >> I think we do not disable EVENT_TIME for per cpu ctx? > > I can see ctx_sched_out(ctx, EVENT_TIME) in some places. > Also it'd reset EVENT_TIME if both _PINNED and _FLEXIBLE is > cleared.
Yeah, you are right. I missed this part.
Hi Peter,
Does this fix look good do you?
Thanks, Song
| |