Searched hist:"47936 f94" (Results 1 – 1 of 1) sorted by relevance
/openbmc/linux/tools/power/x86/turbostat/ |
H A D | turbostat.c | 47936f94 Wed Oct 04 07:01:47 CDT 2017 Artem Bityutskiy <artem.bityutskiy@linux.intel.com> 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> 47936f94 Wed Oct 04 07:01:47 CDT 2017 Artem Bityutskiy <artem.bityutskiy@linux.intel.com> 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>
|