-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support to monitor bpf programs.
BPF is very important component for modern Linux systems, and getting more features and adoptions. This commit enables atop to monitor BPF programs. The output looks like: ATOP - kerneltest002 2020/06/16 17:01:12 -------------- 10s elapsed PRC | sys 2.72s | user 4.85s | #proc 761 | #zombie 0 | #exit 250 | CPU | sys 29% | user 50% | irq 0% | idle 7915% | wait 8% | CPL | avg1 1.68 | avg5 1.05 | avg15 0.72 | csw 160979 | intr 66341 | [...] BPF_PROG_ID NAME TOTAL_TIME_NS RUN_CNT CPU AVG_TIME_NS 894 tracepoint__sch 83882 11 0% 7625.64 893 tracepoint__sch 43231 5 0% 8646.20 892 tracepoint__tas 34818 4 0% 8704.50 PID SYSCPU USRCPU VGROW RGROW RDDSK WRDSK EXC THR S CPUNR CPU CMD 1/113 2669644 0.45s 1.08s 603.1M 23100K 0K 0K - 10 S 59 15% squashfuse_ll To build atop with BPF monitoring, we need pass in option to make as: ATOP_BPF_SUPPORT=1 make -j Atop periodically enables monitoring of BPF programs calling: bpf_enable_stats(BPF_STATS_RUN_TIME); Since monitoring of BPF program has non-trivial overhead to the bpf programs, the following options are added to only monitor BPF program less often: bpfsamplerate, default 1 bpfsampleinterval, default 1 bpf stats is enabled for bpfsampleinterval seconds every bpfsamplerate atop intervals. bpfsampleinterval must be smaller than atop interval. Changes v1 => v2: 1. Instead of using unsafe sysctl, using a safe new API to enable BPF runtime stats. 2. Change output columns: remove "TYPE", add "CPU" for cpu %.
- Loading branch information
1 parent
dd0fb8a
commit abe5f48
Showing
12 changed files
with
662 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.