From a9a187a749f95dda24302aae5c9a0b6b9ee74c99 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Tue, 21 May 2019 21:47:07 -0300 Subject: perf trace: Beautify 'sync_file_range' arguments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use existing beautifiers for the first arg, fd, assigned using the heuristic that looks for syscall arg names and associates SCA_FD with 'fd' named argumes, and wire up the recently introduced sync_file_range flags table generator. Now it should be possible to just use: perf trace -e sync_file_range As root and see all sync_file_range syscalls with its args beautified. Doing a syscall strace like session looking for this syscall, then run postgresql's initdb command: # perf trace -e sync_file_range initdb/1332 sync_file_range(6, 0, 0, SYNC_FILE_RANGE_WRITE) = 0 initdb/1332 sync_file_range(6, 0, 0, SYNC_FILE_RANGE_WRITE) = 0 initdb/1332 sync_file_range(5, 0, 0, SYNC_FILE_RANGE_WRITE) = 0 initdb/1332 sync_file_range(5, 0, 0, SYNC_FILE_RANGE_WRITE) = 0 initdb/1332 sync_file_range(5, 0, 0, SYNC_FILE_RANGE_WRITE) = 0 initdb/1332 sync_file_range(5, 0, 0, SYNC_FILE_RANGE_WRITE) = 0 initdb/1332 sync_file_range(5, 0, 0, SYNC_FILE_RANGE_WRITE) = 0 initdb/1332 sync_file_range(5, 0, 0, SYNC_FILE_RANGE_WRITE) = 0 initdb/1332 sync_file_range(5, 0, 0, SYNC_FILE_RANGE_WRITE) = 0 initdb/1332 sync_file_range(5, 0, 0, SYNC_FILE_RANGE_WRITE) = 0 initdb/1332 sync_file_range(7, 0, 0, SYNC_FILE_RANGE_WRITE) = 0 initdb/1332 sync_file_range(6, 0, 0, SYNC_FILE_RANGE_WRITE) = 0 initdb/1332 sync_file_range(7, 0, 0, SYNC_FILE_RANGE_WRITE) = 0 initdb/1332 sync_file_range(6, 0, 0, SYNC_FILE_RANGE_WRITE) = 0 initdb/1332 sync_file_range(5, 0, 0, SYNC_FILE_RANGE_WRITE) = 0 initdb/1332 sync_file_range(5, 0, 0, SYNC_FILE_RANGE_WRITE) = 0 initdb/1332 sync_file_range(5, 0, 0, SYNC_FILE_RANGE_WRITE) = 0 initdb/1332 sync_file_range(5, 0, 0, SYNC_FILE_RANGE_WRITE) = 0 initdb/1332 sync_file_range(4, 0, 0, SYNC_FILE_RANGE_WRITE) = 0 initdb/1332 sync_file_range(4, 0, 0, SYNC_FILE_RANGE_WRITE) = 0 ^C # Cc: Adrian Hunter Cc: Amir Goldstein Cc: Brendan Gregg Cc: Jiri Olsa Cc: Linus Torvalds Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Link: https://lkml.kernel.org/n/tip-8tqy34xhpg8gwnaiv74xy93w@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-trace.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tools/perf/builtin-trace.c') diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 3a2ab68a8b85..54b2d0fd0d02 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -912,6 +912,8 @@ static struct syscall_fmt { .arg = { [0] = { .scnprintf = SCA_FILENAME, /* specialfile */ }, }, }, { .name = "symlinkat", .arg = { [0] = { .scnprintf = SCA_FDAT, /* dfd */ }, }, }, + { .name = "sync_file_range", + .arg = { [3] = { .scnprintf = SCA_SYNC_FILE_RANGE_FLAGS, /* flags */ }, }, }, { .name = "tgkill", .arg = { [2] = { .scnprintf = SCA_SIGNUM, /* sig */ }, }, }, { .name = "tkill", -- cgit v1.2.2