lkml.org 
[lkml]   [2021]   [Dec]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v2] perf/core: Set event shadow time for inactive events too
    On Tue, Nov 30, 2021 at 08:58:07PM -0800, Namhyung Kim wrote:
    > From: Namhyung Kim <namhyung@google.com>
    >
    > While f79256532682 ("perf/core: fix userpage->time_enabled of inactive
    > events") fixed this problem for user rdpmc usage, bperf (perf stat
    > with BPF) still has the same problem that accessing inactive perf
    > events from BPF using bpf_perf_event_read_value().
    >
    > +static inline void group_update_event_time(struct perf_event *group_event)
    > {
    > + struct perf_event *event;
    > + struct perf_event_context *ctx = group_event->ctx;

    :-( surely you're aware of the reverse xmas tree thing by now?

    >
    > + perf_event_update_time(group_event);
    > + perf_set_shadow_time(group_event, ctx);
    >
    > + for_each_sibling_event(event, group_event) {
    > + perf_event_update_time(event);
    > + perf_set_shadow_time(event, ctx);
    > + }
    >
    > + if (likely(!atomic_read(&group_event->mmap_count)))
    > return;
    >
    > + perf_event_update_userpage(group_event);
    > +
    > for_each_sibling_event(event, group_event)
    > + perf_event_update_userpage(event);

    How does it make sense to chase those pointers twice?

    > }

    \
     
     \ /
      Last update: 2021-12-05 15:16    [W:3.150 / U:0.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site