-
Notifications
You must be signed in to change notification settings - Fork 344
Running toplev offline
When you cannot run toplev on the target system, it is possible to do the measurement separately just using perf:
On target system (only needed once):
cat /proc/cpuinfo > toplev_cpuinfo
find /sys/devices > toplev_topology
Copy cpuinfo and topology to system running toplev.
On toplev system:
toplev --force-topology topology --force-cpuinfo cpuinfo --gen-script <toplev options> > script
should be the intended configuration, e.g. which level or additional metrics.
Copy script to target system
chmod +x script
./script sleep 1
This will measure the target system for 1s. Alternatively you can specify a command to measure (not it will still measure globally), or nothing (measure until Ctrl-C). Likely this will require root, unless --single-thread was used.
The output will be toplev_perf.csv (and also toplev_topology / toplev_cpuinfo, but these are not needed again from the earlier step). The name of the output can be overriden using OUT.
OUT=mylog ./script myprogram
Then the output will be mylog_perf.csv
Copy the output file back to the toplev system and run
toplev.py <original toplev options> --import toplev_perf.csv --force-cpuinfo toplev_cpuinfo --force-topology toplev_topology
The toplev options need to match the options used with the original --gen-script. There are some exceptions. For example it's possible to change the Output options, such as --global / --per-* / --columns / --summary and run it with the same --import input file. This is useful to slice a single measurements in multiple ways (e.g. per core, per socket, summary)