Skip to content

Commit 5dde91e

Browse files
committed
perf trace beauty: Introduce syscall arg beautifier for long integers
Will be used in the fcntl arg beautifier, that nowadays formats as '%ld' because there is no explicit arg beautifier attached, but as we will have to first decide what beautifier to use (i.e. it may be a pointer, etc) then we need to have this exported as a separate beautifier to be called from there. Cc: Adrian Hunter <[email protected]> Cc: David Ahern <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Wang Nan <[email protected]> Link: http://lkml.kernel.org/n/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 2c2b162 commit 5dde91e

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

tools/perf/builtin-trace.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,11 @@ size_t syscall_arg__scnprintf_int(char *bf, size_t size, struct syscall_arg *arg
402402
return scnprintf(bf, size, "%d", arg->val);
403403
}
404404

405+
size_t syscall_arg__scnprintf_long(char *bf, size_t size, struct syscall_arg *arg)
406+
{
407+
return scnprintf(bf, size, "%ld", arg->val);
408+
}
409+
405410
static const char *bpf_cmd[] = {
406411
"MAP_CREATE", "MAP_LOOKUP_ELEM", "MAP_UPDATE_ELEM", "MAP_DELETE_ELEM",
407412
"MAP_GET_NEXT_KEY", "PROG_LOAD",

tools/perf/trace/beauty/beauty.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ size_t syscall_arg__scnprintf_hex(char *bf, size_t size, struct syscall_arg *arg
3737
size_t syscall_arg__scnprintf_int(char *bf, size_t size, struct syscall_arg *arg);
3838
#define SCA_INT syscall_arg__scnprintf_int
3939

40+
size_t syscall_arg__scnprintf_long(char *bf, size_t size, struct syscall_arg *arg);
41+
#define SCA_LONG syscall_arg__scnprintf_long
42+
4043
size_t syscall_arg__scnprintf_fcntl_cmd(char *bf, size_t size, struct syscall_arg *arg);
4144
#define SCA_FCNTL_CMD syscall_arg__scnprintf_fcntl_cmd
4245

0 commit comments

Comments
 (0)