Skip to content

Commit 9350a91

Browse files
committed
tools headers UAPI: Sync files changed by new cachestat syscall with the kernel sources
To pick the changes in these csets: cf264e1 ("cachestat: implement cachestat syscall") That add support for this new syscall in tools such as 'perf trace'. For instance, this is now possible: # perf trace -e cachestat ^C[root@five ~]# # perf trace -v -e cachestat Using CPUID AuthenticAMD-25-21-0 event qualifier tracepoint filter: (common_pid != 3163687 && common_pid != 3147) && (id == 451) mmap size 528384B ^C[root@five ~] # perf trace -v -e *stat* --max-events=10 Using CPUID AuthenticAMD-25-21-0 event qualifier tracepoint filter: (common_pid != 3163713 && common_pid != 3147) && (id == 4 || id == 5 || id == 6 || id == 136 || id == 137 || id == 138 || id == 262 || id == 332 || id == 451) mmap size 528384B 0.000 ( 0.009 ms): Cache2 I/O/4544 statfs(pathname: 0x45635288, buf: 0x7f8745725b60) = 0 0.012 ( 0.003 ms): Cache2 I/O/4544 newfstatat(dfd: CWD, filename: 0x45635288, statbuf: 0x7f874569d250) = 0 0.036 ( 0.002 ms): Cache2 I/O/4544 newfstatat(dfd: 138, filename: 0x541b7093, statbuf: 0x7f87457256f0, flag: 4096) = 0 0.372 ( 0.006 ms): Cache2 I/O/4544 statfs(pathname: 0x45635288, buf: 0x7f8745725b10) = 0 0.379 ( 0.003 ms): Cache2 I/O/4544 newfstatat(dfd: CWD, filename: 0x45635288, statbuf: 0x7f874569d250) = 0 0.390 ( 0.002 ms): Cache2 I/O/4544 newfstatat(dfd: 138, filename: 0x541b7093, statbuf: 0x7f87457256a0, flag: 4096) = 0 0.609 ( 0.005 ms): Cache2 I/O/4544 statfs(pathname: 0x45635288, buf: 0x7f8745725b60) = 0 0.615 ( 0.003 ms): Cache2 I/O/4544 newfstatat(dfd: CWD, filename: 0x45635288, statbuf: 0x7f874569d250) = 0 0.625 ( 0.002 ms): Cache2 I/O/4544 newfstatat(dfd: 138, filename: 0x541b7093, statbuf: 0x7f87457256f0, flag: 4096) = 0 0.826 ( 0.005 ms): Cache2 I/O/4544 statfs(pathname: 0x45635288, buf: 0x7f8745725b10) = 0 # That is the filter expression attached to the raw_syscalls:sys_{enter,exit} tracepoints. $ find tools/perf/arch/ -name "syscall*tbl" | xargs grep -w sys_cachestat tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl:451 n64 cachestat sys_cachestat tools/perf/arch/powerpc/entry/syscalls/syscall.tbl:451 common cachestat sys_cachestat tools/perf/arch/s390/entry/syscalls/syscall.tbl:451 common cachestat sys_cachestat sys_cachestat tools/perf/arch/x86/entry/syscalls/syscall_64.tbl:451 common cachestat sys_cachestat $ $ grep -w cachestat /tmp/build/perf-tools/arch/x86/include/generated/asm/syscalls_64.c [451] = "cachestat", $ This addresses these perf build warnings: Warning: Kernel ABI header differences: diff -u tools/include/uapi/asm-generic/unistd.h include/uapi/asm-generic/unistd.h diff -u tools/include/uapi/linux/mman.h include/uapi/linux/mman.h diff -u tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl diff -u tools/perf/arch/powerpc/entry/syscalls/syscall.tbl arch/powerpc/kernel/syscalls/syscall.tbl diff -u tools/perf/arch/s390/entry/syscalls/syscall.tbl arch/s390/kernel/syscalls/syscall.tbl diff -u tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl arch/mips/kernel/syscalls/syscall_n64.tbl Cc: Adrian Hunter <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Nhat Pham <[email protected]> Link: https://lore.kernel.org/lkml/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 142256d commit 9350a91

File tree

6 files changed

+22
-1
lines changed

6 files changed

+22
-1
lines changed

tools/include/uapi/asm-generic/unistd.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,8 +817,11 @@ __SYSCALL(__NR_futex_waitv, sys_futex_waitv)
817817
#define __NR_set_mempolicy_home_node 450
818818
__SYSCALL(__NR_set_mempolicy_home_node, sys_set_mempolicy_home_node)
819819

820+
#define __NR_cachestat 451
821+
__SYSCALL(__NR_cachestat, sys_cachestat)
822+
820823
#undef __NR_syscalls
821-
#define __NR_syscalls 451
824+
#define __NR_syscalls 452
822825

823826
/*
824827
* 32 bit systems traditionally used different

tools/include/uapi/linux/mman.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include <asm/mman.h>
66
#include <asm-generic/hugetlb_encode.h>
7+
#include <linux/types.h>
78

89
#define MREMAP_MAYMOVE 1
910
#define MREMAP_FIXED 2
@@ -41,4 +42,17 @@
4142
#define MAP_HUGE_2GB HUGETLB_FLAG_ENCODE_2GB
4243
#define MAP_HUGE_16GB HUGETLB_FLAG_ENCODE_16GB
4344

45+
struct cachestat_range {
46+
__u64 off;
47+
__u64 len;
48+
};
49+
50+
struct cachestat {
51+
__u64 nr_cache;
52+
__u64 nr_dirty;
53+
__u64 nr_writeback;
54+
__u64 nr_evicted;
55+
__u64 nr_recently_evicted;
56+
};
57+
4458
#endif /* _UAPI_LINUX_MMAN_H */

tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,3 +365,4 @@
365365
448 n64 process_mrelease sys_process_mrelease
366366
449 n64 futex_waitv sys_futex_waitv
367367
450 common set_mempolicy_home_node sys_set_mempolicy_home_node
368+
451 n64 cachestat sys_cachestat

tools/perf/arch/powerpc/entry/syscalls/syscall.tbl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,3 +537,4 @@
537537
448 common process_mrelease sys_process_mrelease
538538
449 common futex_waitv sys_futex_waitv
539539
450 nospu set_mempolicy_home_node sys_set_mempolicy_home_node
540+
451 common cachestat sys_cachestat

tools/perf/arch/s390/entry/syscalls/syscall.tbl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,3 +453,4 @@
453453
448 common process_mrelease sys_process_mrelease sys_process_mrelease
454454
449 common futex_waitv sys_futex_waitv sys_futex_waitv
455455
450 common set_mempolicy_home_node sys_set_mempolicy_home_node sys_set_mempolicy_home_node
456+
451 common cachestat sys_cachestat sys_cachestat

tools/perf/arch/x86/entry/syscalls/syscall_64.tbl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,7 @@
372372
448 common process_mrelease sys_process_mrelease
373373
449 common futex_waitv sys_futex_waitv
374374
450 common set_mempolicy_home_node sys_set_mempolicy_home_node
375+
451 common cachestat sys_cachestat
375376

376377
#
377378
# Due to a historical design error, certain syscalls are numbered differently

0 commit comments

Comments
 (0)