Skip to contentSkip to conversation

perf trace: Use strtoul for the fcntl 'cmd' argument

tip: perf/core tip-bot2 for Arnaldo Carvalho de Melo 1 participant 1 message Oct 21, 2019 1 message not in the archive perf events

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

tip-bot2 for Arnaldo Carvalho de Melo

author merge bot Applied
#1 lore raw

The following commit has been merged into the perf/core branch of tip:

Commit-ID:     82c38338e0850a01057960efc94c6130f1a0fdde
Gitweb:        https://git.kernel.org/tip/82c38338e0850a01057960efc94c6130f1a0fdde
Author:        Arnaldo Carvalho de Melo <[email protected]>
AuthorDate:    Fri, 18 Oct 2019 15:44:42 -03:00
Committer:     Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Sat, 19 Oct 2019 15:35:02 -03:00

perf trace: Use strtoul for the fcntl 'cmd' argument

Since its values are in two ranges of values we ended up codifying it using a 'struct strarrays', so now hook it up with STUL_STRARRAYS so that we can do:

  # perf trace -e syscalls:*enter_fcntl --filter=cmd==SETLK||cmd==SETLKW
     0.000 sssd_kcm/19021 syscalls:sys_enter_fcntl(fd: 13</var/lib/sss/secrets/secrets.ldb>, cmd: SETLK, arg: 0x7ffcf0a4dee0)
     1.523 sssd_kcm/19021 syscalls:sys_enter_fcntl(fd: 13</var/lib/sss/secrets/secrets.ldb>, cmd: SETLK, arg: 0x7ffcf0a4de90)
     1.629 sssd_kcm/19021 syscalls:sys_enter_fcntl(fd: 13</var/lib/sss/secrets/secrets.ldb>, cmd: SETLK, arg: 0x7ffcf0a4de90)
     2.711 sssd_kcm/19021 syscalls:sys_enter_fcntl(fd: 13</var/lib/sss/secrets/secrets.ldb>, cmd: SETLK, arg: 0x7ffcf0a4de70)
  ^C#
Cc Adrian Hunter <[email protected]>
Cc Andi Kleen <[email protected]>
Cc Brendan Gregg <[email protected]>
Cc David Ahern <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Luis Cláudio Gonçalves <[email protected]>
Cc Namhyung Kim <[email protected]>
---
 tools/perf/builtin-trace.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/perf/builtin-trace.c +2 -1
index 265ea87..72ef3b3 100644
@@ -894,7 +894,8 @@ static struct syscall_fmt syscall_fmts[] = {
 	{ .name	    = "fchownat",
 	  .arg = { [0] = { .scnprintf = SCA_FDAT, /* fd */ }, }, },
 	{ .name	    = "fcntl",
-	  .arg = { [1] = { .scnprintf = SCA_FCNTL_CMD, /* cmd */
+	  .arg = { [1] = { .scnprintf = SCA_FCNTL_CMD,  /* cmd */
+			   .strtoul   = STUL_STRARRAYS,
 			   .parm      = &strarrays__fcntl_cmds_arrays,
 			   .show_zero = true, },
 		   [2] = { .scnprintf =  SCA_FCNTL_ARG, /* arg */ }, }, },