Commit 0b18e905 authored by Len Brown's avatar Len Brown Committed by Tim Gardner

tools/power turbostat: add --out option for saving output in a file

BugLink: http://bugs.launchpad.net/bugs/1591802

By default...

Turbostat --debug gconfiguration info goes to stderr.

In FORK mode, turbostat statistics go to stderr.

In PERIODIC mode, turbostat statistics go to stdout.

These defaults do not change, but an option "--out file"
will send all output above only to the specified file.
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
(cherry picked from commit b7d8c148)
Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
Acked-by: default avatarBrad Figg <brad.figg@canonical.com>
Acked-by: default avatarKamal Mostafa <kamal@canonical.com>
parent 31689294
...@@ -36,6 +36,9 @@ more than once may also enable internal turbostat debug information. ...@@ -36,6 +36,9 @@ more than once may also enable internal turbostat debug information.
.PP .PP
\fB--interval seconds\fP overrides the default 5.0 second measurement interval. \fB--interval seconds\fP overrides the default 5.0 second measurement interval.
.PP .PP
\fB--out output_file\fP turbostat output is written to the specified output_file.
The file is truncated if it already exists, and it is created if it does not exist.
.PP
\fB--help\fP displays usage for the most common parameters. \fB--help\fP displays usage for the most common parameters.
.PP .PP
\fB--Joules\fP displays energy in Joules, rather than dividing Joules by time to print power in Watts. \fB--Joules\fP displays energy in Joules, rather than dividing Joules by time to print power in Watts.
...@@ -83,10 +86,11 @@ Note that multiple CPUs per core indicate support for Intel(R) Hyper-Threading T ...@@ -83,10 +86,11 @@ Note that multiple CPUs per core indicate support for Intel(R) Hyper-Threading T
\fBRAM_%\fP percent of the interval that RAPL throttling was active on DRAM. \fBRAM_%\fP percent of the interval that RAPL throttling was active on DRAM.
.fi .fi
.PP .PP
.SH EXAMPLE .SH PERIODIC EXAMPLE
Without any parameters, turbostat displays statistics ever 5 seconds. Without any parameters, turbostat displays statistics ever 5 seconds.
(override interval with "-i sec" option, or specify a command Periodic output goes to stdout, by default, unless --out is used to specify an output file.
for turbostat to fork). The 5-second interval can be changed with th "-i sec" option.
Or a command may be specified as in "FORK EXAMPLE" below.
.nf .nf
[root@hsw]# ./turbostat [root@hsw]# ./turbostat
CPU Avg_MHz Busy% Bzy_MHz TSC_MHz CPU Avg_MHz Busy% Bzy_MHz TSC_MHz
...@@ -171,7 +175,9 @@ The --debug option adds additional columns to the measurement ouput, including C ...@@ -171,7 +175,9 @@ The --debug option adds additional columns to the measurement ouput, including C
See the field definitions above. See the field definitions above.
.SH FORK EXAMPLE .SH FORK EXAMPLE
If turbostat is invoked with a command, it will fork that command If turbostat is invoked with a command, it will fork that command
and output the statistics gathered when the command exits. and output the statistics gathered after the command exits.
In this case, turbostat output goes to stderr, by default.
Output can instead be saved to a file using the --out option.
eg. Here a cycle soaker is run on 1 CPU (see %c0) for a few seconds eg. Here a cycle soaker is run on 1 CPU (see %c0) for a few seconds
until ^C while the other CPUs are mostly idle: until ^C while the other CPUs are mostly idle:
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment