• Namhyung Kim's avatar
    perf lock contention: Add data failure stat · 954cdac7
    Namhyung Kim authored
    It's possible to fail to update the data when the lock_stat map is full.
    We should check that case and show the number at the end.
    
      $ sudo ./perf lock con -ablv -E3 -- ./perf bench sched messaging
      ...
       contended   total wait     max wait     avg wait            address   symbol
    
            6157    208.48 ms     69.29 us     33.86 us   ffff934c001c1f00    (spinlock)
            4030     72.04 ms     61.84 us     17.88 us   ffff934c000415c0    (spinlock)
            3201     50.30 ms     47.73 us     15.71 us   ffff934c2eead850    (spinlock)
    
      === output for debug ===
    
      bad: 0, total: 13388
      bad rate: 0.00 %
      histogram of failure reasons
             task: 0
            stack: 0
             time: 0
             data: 0      <----- added
    Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
    Acked-by: default avatarIan Rogers <irogers@google.com>
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Hao Luo <haoluo@google.com>
    Cc: Ingo Molnar <mingo@kernel.org>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Song Liu <song@kernel.org>
    Cc: bpf@vger.kernel.org
    Link: https://lore.kernel.org/r/20230406210611.1622492-2-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    954cdac7
lock_contention.bpf.c 9.26 KB