• Yang Jihong's avatar
    perf kwork top: Add BPF-based statistics on hardirq event support · d2956b3a
    Yang Jihong authored
    Use BPF to collect statistics on hardirq events based on perf BPF skeletons.
    
    Example usage:
    
      # perf kwork top -k sched,irq -b
      Starting trace, Hit <Ctrl+C> to stop and report
      ^C
      Total  : 136717.945 ms, 8 cpus
      %Cpu(s):  17.10% id,   0.01% hi,   0.00% si
      %Cpu0   [|||||||||||||||||||||||||       84.26%]
      %Cpu1   [|||||||||||||||||||||||||       84.77%]
      %Cpu2   [||||||||||||||||||||||||        83.22%]
      %Cpu3   [||||||||||||||||||||||||        80.37%]
      %Cpu4   [||||||||||||||||||||||||        81.49%]
      %Cpu5   [|||||||||||||||||||||||||       84.68%]
      %Cpu6   [|||||||||||||||||||||||||       84.48%]
      %Cpu7   [||||||||||||||||||||||||        80.21%]
    
            PID     SPID    %CPU           RUNTIME  COMMMAND
        -------------------------------------------------------------
              0        0   19.78       3482.833 ms  [swapper/7]
              0        0   19.62       3454.219 ms  [swapper/3]
              0        0   18.50       3258.339 ms  [swapper/4]
              0        0   16.76       2842.749 ms  [swapper/2]
              0        0   15.71       2627.905 ms  [swapper/0]
              0        0   15.51       2598.206 ms  [swapper/6]
              0        0   15.31       2561.820 ms  [swapper/5]
              0        0   15.22       2548.708 ms  [swapper/1]
          13253    13018    2.95        513.108 ms  sched-messaging
          13092    13018    2.67        454.167 ms  sched-messaging
          13401    13018    2.66        454.790 ms  sched-messaging
          13240    13018    2.64        454.587 ms  sched-messaging
          13251    13018    2.61        442.273 ms  sched-messaging
          13075    13018    2.61        438.932 ms  sched-messaging
          13220    13018    2.60        443.245 ms  sched-messaging
          13235    13018    2.59        443.268 ms  sched-messaging
          13222    13018    2.50        426.344 ms  sched-messaging
          13410    13018    2.49        426.191 ms  sched-messaging
          13228    13018    2.46        425.121 ms  sched-messaging
          13379    13018    2.38        409.950 ms  sched-messaging
          13236    13018    2.37        413.159 ms  sched-messaging
          13095    13018    2.36        396.572 ms  sched-messaging
          13325    13018    2.35        408.089 ms  sched-messaging
          13242    13018    2.32        394.750 ms  sched-messaging
          13386    13018    2.31        396.997 ms  sched-messaging
          13046    13018    2.29        383.833 ms  sched-messaging
          13109    13018    2.28        388.482 ms  sched-messaging
          13388    13018    2.28        393.576 ms  sched-messaging
          13238    13018    2.26        388.487 ms  sched-messaging
      <SNIP>
    Reviewed-by: default avatarIan Rogers <irogers@google.com>
    Signed-off-by: default avatarYang Jihong <yangjihong1@huawei.com>
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Kan Liang <kan.liang@linux.intel.com>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Ravi Bangoria <ravi.bangoria@amd.com>
    Cc: Sandipan Das <sandipan.das@amd.com>
    Link: https://lore.kernel.org/r/20230812084917.169338-16-yangjihong1@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    d2956b3a
bpf_kwork_top.c 5.92 KB