[PATCH 0/3] perf: Allow running without stdin

From: Igor Lubashev
Date: Tue Oct 22 2019 - 21:56:56 EST


This series allows perf to run in batch mode with stdin closed.
This is arguably a bug fix for code that runs with --stdio option and does not
check for EOF return code from getc().

This series makes the following work as expected:

$ perf top --stdio < /dev/null
$ perf kvm top --stdio < /dev/null

Patches:
01: perf top: Allow running without stdin
Make "perf top --stdio" handle EOF from stdin correctly.
There is one getc() that does not handle EOF explicitly, since its return
value is checked against a list of known characters, and the main loop in
display_thread() will handle the EOF on the next iteration.

02: perf kvm: Allow running without stdin
Make "perf kvm --stdio" handle EOF from stdin correctly.

03: perf kvm: Use evlist layer api when possible
This is a simple fix for a needless layering violation.

Igor Lubashev (3):
perf top: Allow running without stdin
perf kvm: Allow running without stdin
perf kvm: Use evlist layer api when possible

tools/perf/builtin-kvm.c | 35 +++++++++++++++++++++--------------
tools/perf/builtin-top.c | 10 ++++++++--
2 files changed, 29 insertions(+), 16 deletions(-)

--
2.7.4