diff options
| author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2017-10-04 15:01:47 +0300 |
|---|---|---|
| committer | Len Brown <len.brown@intel.com> | 2018-06-01 12:13:05 -0400 |
| commit | 47936f944e7816296888fb4c135f40635083080b (patch) | |
| tree | 37f1a60f99190a7b19887dce26cf739ec0c0503b /tools/perf/scripts/python/bin/stackcollapse-record | |
| parent | tools/power turbostat: end current interval upon newline input (diff) | |
| download | linux-47936f944e7816296888fb4c135f40635083080b.tar.gz linux-47936f944e7816296888fb4c135f40635083080b.zip | |
tools/power turbostat: fix printing on input
The recent patch that implements table printing on a keypress introduced a
regression - turbostat prints the table almost continuously if it is run from a
daemon program.
The problem is also easy to reproduce like this:
echo | turbostat
The reason is that we cannot assume that stdin is always a TTY. It can be many
things.
This patch adds fixes the problem by limiting the new keypress functionality to
TTYs only. If stdin is not a TTY, we just sleep for the full interval time.
While on it, clean-up 'do_sleep()' to return no value, as callers do not expect
that anyway.
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'tools/perf/scripts/python/bin/stackcollapse-record')
0 files changed, 0 insertions, 0 deletions
