• Namhyung Kim's avatar
    perf lock: Add -c/--combine-locks option · 0d435bf8
    Namhyung Kim authored
    The -c or --combine-locks option is to merge lock instances in the
    same class into a single entry.  It compares the name of the locks
    and marks duplicated entries using lock_stat->combined.
    
     # perf lock report
                    Name   acquired  contended   avg wait (ns) total wait (ns)   max wait (ns)   min wait (ns)
    
           rcu_read_lock     251225          0               0               0               0               0
     &(ei->i_block_re...       8731          0               0               0               0               0
     &sb->s_type->i_l...       8731          0               0               0               0               0
      hrtimer_bases.lock       5261          0               0               0               0               0
      hrtimer_bases.lock       2626          0               0               0               0               0
      hrtimer_bases.lock       1953          0               0               0               0               0
      hrtimer_bases.lock       1382          0               0               0               0               0
        cpu_hotplug_lock       1350          0               0               0               0               0
      hrtimer_bases.lock       1273          0               0               0               0               0
      hrtimer_bases.lock       1269          0               0               0               0               0
    
     # perf lock report -c
                    Name   acquired  contended   avg wait (ns) total wait (ns)   max wait (ns)   min wait (ns)
    
           rcu_read_lock     251225          0               0               0               0               0
      hrtimer_bases.lock      39450          0               0               0               0               0
     &sb->s_type->i_l...      10301          1             662             662             662             662
        ptlock_ptr(page)      10173          2             701            1402             760             642
     &(ei->i_block_re...       8732          0               0               0               0               0
            &xa->xa_lock       8088          0               0               0               0               0
             &base->lock       6705          0               0               0               0               0
             &p->pi_lock       5549          0               0               0               0               0
     &dentry->d_lockr...       5010          4            1274            5097            1844             789
               &ep->lock       3958          0               0               0               0               0
    Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
    Acked-by: default avatarJiri Olsa <jolsa@redhat.com>
    Cc: Andi Kleen <ak@linux.intel.com>
    Cc: Ian Rogers <irogers@google.com>
    Cc: Ingo Molnar <mingo@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Link: https://lore.kernel.org/r/20220127000050.3011493-6-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    0d435bf8
builtin-lock.c 24.5 KB