iovisor / bcc

BCC - Tools for BPF-based Linux IO analysis, networking, monitoring, and more
Apache License 2.0
20.36k stars 3.86k forks source link

libbpf-tools/offcputime: Add multi process/thread support #5111

Open ekyooo opened 1 week ago

ekyooo commented 1 week ago

This is a test example.

  # ./offcputime -p 16,48
    Tracing off-CPU time (us) of PID [16, 48]... Hit Ctrl-C to end.
        bpf_prog_a42aae11c0bc18f2_sched_switch
        bpf_prog_a42aae11c0bc18f2_sched_switch
        bpf_trace_run4
        __traceiter_sched_switch
        __schedule
        schedule
        worker_thread
        kthread
        ret_from_fork
        ret_from_fork_asm
        -                kworker/2:1 (48)
            3353019

        bpf_prog_a42aae11c0bc18f2_sched_switch
        bpf_prog_a42aae11c0bc18f2_sched_switch
        bpf_trace_run4
        __traceiter_sched_switch
        __schedule
        schedule
        rcu_gp_kthread
        kthread
        ret_from_fork
        ret_from_fork_asm
        -                rcu_preempt (16)
            1720974
Bojun-Seo commented 1 week ago

I think help message should be changed together. For example, Trace this PID only doesn't explain the -p option any more after this patch merged.

ekyooo commented 6 days ago

I think help message should be changed together. For example, Trace this PID only doesn't explain the -p option any more after this patch merged.

Thank you for the review. It's fixed.