alistair23-linux/tools
Arnaldo Carvalho de Melo 85127775a6 perf annotate: Fix printing of unaugmented disassembled instructions from BPF
The code to disassemble BPF programs uses binutil's disassembling
routines, and those use in turn fprintf to print to a memstream FILE,
adding a newline at the end of each line, which ends up confusing the
TUI routines called from:

  annotate_browser__write()
    annotate_line__write()
      annotate_browser__printf()
        ui_browser__vprintf()
          SLsmg_vprintf()

The SLsmg_vprintf() function in the slang library gets confused with the
terminating newline, so make the disasm_line__parse() function that
parses the lines produced by the BPF specific disassembler (that uses
binutil's libopcodes) and the lines produced by the objdump based
disassembler used for everything else (and that doesn't adds this
terminating newline) trim the end of the line in addition of the
beginning.

This way when disasm_line->ops.raw, i.e. for instructions without a
special scnprintf() method, we'll not have that \n getting in the way of
filling the screen right after the instruction with spaces to avoid
leaving what was on the screen before and thus garbling the annotation
screen, breaking scrolling, etc.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Song Liu <songliubraving@fb.com>
Fixes: 6987561c9e ("perf annotate: Enable annotation of BPF programs")
Link: https://lkml.kernel.org/n/tip-unbr5a5efakobfr6rhxq99ta@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2019-08-08 15:40:56 -03:00
..
accounting
arch tools headers UAPI: Update tools's copy of mman.h headers 2019-07-29 09:02:58 -03:00
bpf tools: bpftool: add raw_tracepoint_writable prog type to header 2019-07-12 15:14:42 +02:00
build tools build: Check if gettid() is available before providing helper 2019-07-07 17:53:09 -03:00
cgroup
crypto
debugging
firewire treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
firmware Driver Core and debugfs changes for 5.3-rc1 2019-07-12 12:24:03 -07:00
gpio Bulk GPIO changes for the v5.3 kernel cycle: 2019-07-09 09:07:00 -07:00
hv treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 280 2019-06-05 17:36:36 +02:00
iio Second set of IIO device support, features, cleanups and minor fixes for 5.3. 2019-07-01 10:58:13 +02:00
include perf/urgent fixes: 2019-07-29 23:24:07 +02:00
io_uring tools/io_uring: sync with liburing 2019-05-23 10:25:26 -06:00
kvm/kvm_stat treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 499 2019-06-19 17:09:53 +02:00
laptop treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 505 2019-06-19 17:11:22 +02:00
leds
lib libbpf: fix missing __WORDSIZE definition 2019-07-29 10:18:08 -03:00
memory-model tools/memory-model: Improve data-race detection 2019-06-24 09:08:54 -07:00
nfsd
objtool objtool: Improve UACCESS coverage 2019-07-25 08:36:39 +02:00
pci pci-v5.3-changes 2019-07-15 20:44:49 -07:00
pcmcia treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 247 2019-06-19 17:09:08 +02:00
perf perf annotate: Fix printing of unaugmented disassembled instructions from BPF 2019-08-08 15:40:56 -03:00
power kbuild: create *.mod with full directory path and remove MODVERDIR 2019-07-18 02:19:31 +09:00
scripts perf build: Do not use -Wshadow on gcc < 4.8 2019-07-23 09:04:54 -03:00
spi treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 178 2019-05-30 11:29:19 -07:00
testing ktest: Fix some typos in config-bisect.pl 2019-07-24 15:37:18 -04:00
thermal/tmon treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 89 2019-05-24 17:37:52 +02:00
time treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00
usb treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
virtio treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 482 2019-06-19 17:09:52 +02:00
vm tools/vm/slabinfo: add sorting info to help menu 2019-07-12 11:05:46 -07:00
wmi treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
Makefile tools/power/x86: A tool to validate Intel Speed Select commands 2019-07-03 15:37:09 +03:00