linux-stable/tools/perf
Tommi Rantala 00bd93b3e4 perf top: Fix stdio interface input handling with glibc 2.28+
commit 29b4f5f188 upstream.

Since glibc 2.28 when running 'perf top --stdio', input handling no
longer works, but hitting any key always just prints the "Mapped keys"
help text.

To fix it, call clearerr() in the display_thread() loop to clear any EOF
sticky errors, as instructed in the glibc NEWS file
(https://sourceware.org/git/?p=glibc.git;a=blob;f=NEWS):

 * All stdio functions now treat end-of-file as a sticky condition.  If you
   read from a file until EOF, and then the file is enlarged by another
   process, you must call clearerr or another function with the same effect
   (e.g. fseek, rewind) before you can read the additional data.  This
   corrects a longstanding C99 conformance bug.  It is most likely to affect
   programs that use stdio to read interactive input from a terminal.
   (Bug #1190.)

Signed-off-by: Tommi Rantala <tommi.t.rantala@nokia.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/20200305083714.9381-2-tommi.t.rantala@nokia.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-10-14 09:51:11 +02:00
..
arch perf unwind: Fix libunwind build failure on i386 systems 2019-10-11 18:18:43 +02:00
bench perf bench mem: Always memset source before memcpy 2020-08-21 09:48:23 +02:00
Documentation perf record/stat: Explicitly call out event modifiers in the documentation 2020-09-09 19:03:06 +02:00
jvmti perf tools: Fix undefined symbol scnprintf in libperf-jvmti.so 2018-11-27 16:10:49 +01:00
pmu-events perf jevents: Fix period for Intel fixed counters 2019-11-06 12:43:04 +01:00
python License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
scripts perf script python: Fix export-to-sqlite.py sample columns 2018-10-18 09:16:23 +02:00
tests perf test: Fix test trace+probe_vfs_getname.sh on s390 2020-10-01 13:12:34 +02:00
trace perf trace beauty ioctl: Fix off-by-one error in cmd->string table 2019-10-05 12:47:56 +02:00
ui perf hists browser: Restore ESC as "Zoom out" of DSO/thread/etc 2020-03-11 18:02:54 +01:00
util perf kcore_copy: Fix module map when there are no modules loaded 2020-10-01 13:12:46 +02:00
.gitignore perf tools: Add trace/beauty/generated/ into .gitignore 2018-05-30 12:19:59 +02:00
Build
builtin-annotate.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
builtin-bench.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
builtin-buildid-cache.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
builtin-buildid-list.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
builtin-c2c.c perf c2c: Fix return type for histogram sorting comparision functions 2020-02-05 14:18:12 +00:00
builtin-config.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
builtin-data.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
builtin-diff.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
builtin-evlist.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
builtin-ftrace.c perf ftrace: Fix failure to set cpumask when only one cpu is present 2019-08-29 08:26:41 +02:00
builtin-help.c perf help: Remove needless use of strncpy() 2019-07-03 13:15:57 +02:00
builtin-inject.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
builtin-kallsyms.c
builtin-kmem.c perf kmem: Fix memory leak in compact_gfp_flags() 2019-11-10 11:25:13 +01:00
builtin-kvm.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
builtin-list.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
builtin-lock.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
builtin-mem.c perf tools: Fix leaking rec_argv in error cases 2017-12-10 13:40:43 +01:00
builtin-probe.c perf probe: Do not show the skipped events 2020-06-20 10:25:21 +02:00
builtin-record.c perf record: Synthesize features before events in pipe mode 2018-12-29 13:39:08 +01:00
builtin-report.c perf report: Fix NULL pointer dereference in hists__fprintf_nr_sample_events() 2020-06-25 15:41:58 +02:00
builtin-sched.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
builtin-script.c perf script: Fix brstackinsn for AUXTRACE 2020-01-04 13:59:52 +01:00
builtin-stat.c perf stat: Reset previous counts on repeat with interval 2019-10-11 18:18:47 +02:00
builtin-timechart.c perf tools: Fix leaking rec_argv in error cases 2017-12-10 13:40:43 +01:00
builtin-top.c perf top: Fix stdio interface input handling with glibc 2.28+ 2020-10-14 09:51:11 +02:00
builtin-trace.c perf trace: Support multiple "vfs_getname" probes 2019-03-13 14:03:21 -07:00
builtin-version.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
builtin.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
check-headers.sh tools include: Adopt linux/bits.h 2019-04-27 09:35:41 +02:00
command-list.txt
CREDITS
design.txt
Makefile tools: Let O= makes handle a relative path with -C option 2020-04-02 16:34:30 +02:00
Makefile.config perf tools: Support Python 3.8+ in Makefile 2020-04-24 08:00:44 +02:00
Makefile.perf tools: fix cross-compile var clobbering 2019-01-13 10:01:02 +01:00
MANIFEST perf tools: Get all of tools/{arch,include}/ in the MANIFEST 2017-09-25 10:39:43 -03:00
perf-archive.sh License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
perf-completion.sh License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
perf-read-vdso.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
perf-sys.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
perf-with-kcore.sh
perf.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
perf.h perf tools: Increase MAX_NR_CPUS and MAX_CACHES 2019-07-31 07:28:30 +02:00