Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: Measure overhead of running rbperf #22

Open
javierhonduco opened this issue Jul 29, 2022 · 0 comments
Open

perf: Measure overhead of running rbperf #22

javierhonduco opened this issue Jul 29, 2022 · 0 comments
Assignees

Comments

@javierhonduco
Copy link
Owner

javierhonduco commented Jul 29, 2022

rbperf has two components that ought to be analysed, the BPF stack walker, and all the userspace facilities to process the events sent by the BPF program that will be used to build the profiles.

The overhead of the userspace part can be measured with perf or with higher-level tools such as top or htop. Understanding the performance of the BPF program would be very interesting, but unfortunately, the readily available metrics aren't representative.

For example, bpftool can show the avg runtime for BPF programs as well as how many times they've run. As the Ruby stack walker has a very fast path when the program running isn't profiled and a slower path, when it has to walk the stack, having only average biases the result and doesn't give us the complete picture

[javierhonduco@fedora rbperf]$ sudo sysctl -w kernel.bpf_stats_enabled=1
kernel.bpf_stats_enabled = 1
[javierhonduco@fedora rbperf]$ sudo bpftool prog  show id 763
763: perf_event  name on_event  tag 97fe3cd3a6716fe2  gpl run_time_ns 61692489 run_cnt 54968
        loaded_at 2022-10-30T19:05:51+0000  uid 0
        xlated 1520B  jited 1009B  memlock 4096B  map_ids 1021,1025,1018,1017,1019
        btf_id 844
        pids rbperf(532862)

Having the distribution of the run time of the BPF program would be ideal. I am planning to work on a tool to get this data to get a more accurate understanding of the actual performance impact of running rbperf

@javierhonduco javierhonduco self-assigned this Sep 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant