[linux] RAPL perf event scale should be determined by sysfs files
Categories
(Core :: Gecko Profiler, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox110 | --- | fixed |
People
(Reporter: dlrobertson, Assigned: rzvncj, Mentored)
References
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
We currently use the scale 0.23nJ for all RAPL perf event values, but the RAPL perf event scale for each domain (PKG, CORES, DRAM, etc) should be determined by the corresponding sysfs files. The scale value should be present in /sys/bus/event_source/devices/power/events/energy-<domain>.scale
. For example:
cat /sys/bus/event_source/devices/power/events/energy-pkg.scale
2.3283064365386962890625e-10
Reporter | ||
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
Which files are we looking at? Any specific preferences on how this is to be solved?
Reporter | ||
Comment 2•2 years ago
|
||
(In reply to Razvan Cojocaru from comment #1)
Which files are we looking at? Any specific preferences on how this is to be solved?
The class is defined in PowerCounters-linux.cpp. We currently use a constant PERF_EVENT_SCALE_NANOJOULES to scale the value we get from the perf event file descriptor here. Instead of relying on the constant we could read the scale value from /sys/bus/event_source/devices/power/events/energy-pkg.scale
and use that like we do for the event type here.
Assignee | ||
Comment 3•2 years ago
|
||
(In reply to Dan Robertson (:dlrobertson) from comment #2)
The class is defined in PowerCounters-linux.cpp. We currently use a constant PERF_EVENT_SCALE_NANOJOULES to scale the value we get from the perf event file descriptor here. Instead of relying on the constant we could read the scale value from
/sys/bus/event_source/devices/power/events/energy-pkg.scale
and use that like we do for the event type here.
Got it, thanks! Do we prefer fopen()
to std::fstream
(as per here)?
Reporter | ||
Comment 4•2 years ago
|
||
(In reply to Razvan Cojocaru from comment #3)
Got it, thanks! Do we prefer
fopen()
tostd::fstream
(as per here)?
Great question! It seems that we do use fstream
elsewhere in tools/profiler/core
. Whatever you're most comfortable with will work. I totally forgot about std::fstream
in the initial implementation, and I probably should have used it... Old habits are hard to kick :p
Assignee | ||
Comment 5•2 years ago
|
||
(In reply to Dan Robertson (:dlrobertson) from comment #4)
(In reply to Razvan Cojocaru from comment #3)
Got it, thanks! Do we prefer
fopen()
tostd::fstream
(as per here)?Great question! It seems that we do use
fstream
elsewhere intools/profiler/core
. Whatever you're most comfortable with will work. I totally forgot aboutstd::fstream
in the initial implementation, and I probably should have used it... Old habits are hard to kick :p
Thanks for the quick reply! I have no problem with either approach, was just curious. :) I just thought maybe that binary wasn't meant to link with libstdc++ or something of that sort.
I'll cook up a patch in the next couple of days.
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 6•2 years ago
|
||
Comment 8•2 years ago
|
||
bugherder |
Description
•