-
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. It is probably a good idea to use -I 1000 or similar to get a time series measurement.
Copy script to target system and run on target:
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 summarize a single measurement in multiple ways (e.g. per core, per socket, graph, global summary). In such a case it's not necessarily needed to run a script, the data file can also be generated with --perf-output from toplev.
toplev -I 1000 --perf-output foo.csv <options>
toplev --import foo.csv <options> --summary --global # generate global summary
toplev --import foo.csv <options> --summary --per-socket # generate per socket summary
toplev --import foo.csv <options> --summary --per-core # generate per core summary