-
Notifications
You must be signed in to change notification settings - Fork 2
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
Collecting HW counters for the entire system #12
Comments
Hello, Question 1: Unfortunate linux does not provide a straightforward way to collect performance counter systemwide across all CPUs. We can only do it by a specific CPU, as you can see from the perf_event_open syscall specification:
However, some counters are not CPU specific which means you can measure the entire system by just creating an event to any CPU. The SYSTEMWIDE at the beginning of the event will measure for all processes/threads only on CPU 0, but in a case of some counters like the energy ones "SYSTEMWIDE:RAPL_ENERGY_PKG" will measure the energy of all CPUs. Measuring for all CPUs for any counter is something that I want to implement in the future but will require creating multiple events one for each CPU. Question 2: No, only when attached to a program. Thanks !! it's cool to see that are people using :D |
Hi, Thanks for the quick response. Regarding question 1: I took a look at your code and if I understand correctly, start_counters only get pid as an input? Is it possible to pass in the cpu id (instead of process id) to collect counters for a cpu (regardless of the threads running on it)? Regarding question 2: what is the default sampling rate? Thanks again for your tool! It's truly critical for the paper that I am working on publishing. |
1: 2: What kind of paper are you working on? |
1: How hard is it to modify your code to implement this? I believe you are passing -1 at the moment for cpu id but I should be extending the API to use the user passed argument instead (or it's more difficult than that)? 2: Thanks that makes sense. 3:I am working on a robotics paper but the the main focus is on the system (compute), so I'd like to use your tool to enable the data collection on the system side. Will happily reference your paper, and much appreciate it that you are helping with the tool! |
1:
3: |
Thank you very much for being very responsive! I was able to get the tool collect data for different cpus. |
Hi,
Question 1:
Is it possible to collect data for the entire system, i.e, not for a specific executable, but rather let the counters collect data regardless of what's running on the system for some duration of time?
Is it possible to simply do:
perf = Profiler(events_groups=events) # with some events that we've already defined
while (true):
perf.start_counters(0)
time.sleep(20) # sleep for some time
data = perf.read_events()
in order to do system wide data collection (for the duration of 20 sec at a time)?
PS: would prefixing the name of the event with 'SYSTEMWIDE' do the trick?
Question 2:
Is it possible to set a sampling rate for the question above?
Thank you very much for your tool!
The text was updated successfully, but these errors were encountered: