lkml.org 
[lkml]   [2022]   [Sep]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 3/3] perf lock: Print the number of lost entries for BPF
Hello,

On Mon, Sep 26, 2022 at 1:05 AM Jiri Slaby <jirislaby@kernel.org> wrote:
>
> Hi,
>
> On 02. 08. 22, 21:10, Namhyung Kim wrote:
> > Like the normal perf lock contention output, it'd print the number of
> > lost entries for BPF if exists or -v option is passed. Currently it
> > uses BROKEN_CONTENDED stat for the lost count (due to full stack maps).
> ...
> > --- a/tools/perf/util/bpf_skel/lock_contention.bpf.c
> > +++ b/tools/perf/util/bpf_skel/lock_contention.bpf.c
> ...
> > @@ -73,6 +73,9 @@ int enabled;
> > int has_cpu;
> > int has_task;
> >
> > +/* error stat */
> > +unsigned long lost;
>
> I don't know how all this is generated into lock_contention.skel.h. But
> I believe this patch breaks perf build on 32bit:
> > [ 375s] In file included from util/bpf_lock_contention.c:13:
> > [ 375s] util/bpf_skel/lock_contention.skel.h: In function 'lock_contention_bpf__assert':
> > [ 375s] util/bpf_skel/lock_contention.skel.h:537:9: error: static assertion failed: "unexpected size of \'lost\'"
> > [ 375s] 537 | _Static_assert(sizeof(s->bss->lost) == 8, "unexpected size of 'lost'");
> > [ 375s] | ^~~~~~~~~~~~~~
>
> Should the above (and below too) be __u64?

Oops, it seems BPF ABI uses 8-byte long even on 32-bit systems.
Sorry for the inconvenience. Will change.

Thanks,
Namhyung


>
> > --- a/tools/perf/util/lock-contention.h
> > +++ b/tools/perf/util/lock-contention.h
> > @@ -113,6 +113,7 @@ struct lock_contention {
> > struct machine *machine;
> > struct hlist_head *result;
> > unsigned long map_nr_entries;
> > + unsigned long lost;
>
> thanks,
> --
> js
> suse labs
>

\
 
 \ /
  Last update: 2022-09-26 23:43    [W:0.080 / U:0.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site