All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf trace beauty ioctl: fix off-by-one error in table
@ 2019-08-23  3:36 Benjamin Peterson
  2019-08-23 13:07 ` Arnaldo Carvalho de Melo
  2019-08-27  8:26 ` [tip: perf/core] perf trace beauty ioctl: Fix off-by-one error in cmd->string table tip-bot2 for Benjamin Peterson
  0 siblings, 2 replies; 3+ messages in thread
From: Benjamin Peterson @ 2019-08-23  3:36 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Alexander Shishkin, Jiri Olsa, Namhyung Kim
  Cc: linux-kernel

While tracing a program that calls isatty(3), I noticed that strace reported
TCGETS for the request argument of the underlying ioctl(2) syscall while perf
trace reported TCSETS. strace is corrrect. The bug in perf was due to the tty
ioctl beauty table starting at 0x5400 rather than 0x5401.

Fixes: 1cc47f2d46206d67285aea0ca7e8450af571da13 ("perf trace beauty ioctl: Improve 'cmd' beautifier")
Signed-off-by: Benjamin Peterson <benjamin@python.org>
---
 tools/perf/trace/beauty/ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/trace/beauty/ioctl.c b/tools/perf/trace/beauty/ioctl.c
index 52242fa4072b..e19eb6ea361d 100644
--- a/tools/perf/trace/beauty/ioctl.c
+++ b/tools/perf/trace/beauty/ioctl.c
@@ -21,7 +21,7 @@
 static size_t ioctl__scnprintf_tty_cmd(int nr, int dir, char *bf, size_t size)
 {
 	static const char *ioctl_tty_cmd[] = {
-	"TCGETS", "TCSETS", "TCSETSW", "TCSETSF", "TCGETA", "TCSETA", "TCSETAW",
+	[_IOC_NR(TCGETS)] = "TCGETS", "TCSETS", "TCSETSW", "TCSETSF", "TCGETA", "TCSETA", "TCSETAW",
 	"TCSETAF", "TCSBRK", "TCXONC", "TCFLSH", "TIOCEXCL", "TIOCNXCL", "TIOCSCTTY",
 	"TIOCGPGRP", "TIOCSPGRP", "TIOCOUTQ", "TIOCSTI", "TIOCGWINSZ", "TIOCSWINSZ",
 	"TIOCMGET", "TIOCMBIS", "TIOCMBIC", "TIOCMSET", "TIOCGSOFTCAR", "TIOCSSOFTCAR",
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-08-27  8:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-23  3:36 [PATCH] perf trace beauty ioctl: fix off-by-one error in table Benjamin Peterson
2019-08-23 13:07 ` Arnaldo Carvalho de Melo
2019-08-27  8:26 ` [tip: perf/core] perf trace beauty ioctl: Fix off-by-one error in cmd->string table tip-bot2 for Benjamin Peterson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.