Skip to content

Commit 0e022f5

Browse files
committed
perf beauty: Update copy of linux/socket.h with the kernel sources
To pick the changes in: b848b26 ("net: Kill MSG_SENDPAGE_NOTLAST") 5e2ff67 ("scm: add SO_PASSPIDFD and SCM_PIDFD") 4fe38ac ("net: Block MSG_SENDPAGE_* from being passed to sendmsg() by userspace") b841b90 ("net: Declare MSG_SPLICE_PAGES internal sendmsg() flag") That don't result in any changes in the tables generated from that header. But while updating I noticed we were not handling MSG_BATCH and MSG_ZEROCOPY in the hard coded table for the msg flags table, add them. This silences this perf build warning: Warning: Kernel ABI header differences: diff -u tools/perf/trace/beauty/include/linux/socket.h include/linux/socket.h Cc: Adrian Hunter <[email protected]> Cc: Alexander Mikhalitsyn <[email protected]> Cc: David Howells <[email protected]> Cc: David S. Miller <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Jakub Kicinski <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Link: https://lore.kernel.org/lkml/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 5b10c18 commit 0e022f5

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

tools/perf/trace/beauty/include/linux/socket.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ static inline size_t msg_data_left(struct msghdr *msg)
177177
#define SCM_RIGHTS 0x01 /* rw: access rights (array of int) */
178178
#define SCM_CREDENTIALS 0x02 /* rw: struct ucred */
179179
#define SCM_SECURITY 0x03 /* rw: security label */
180+
#define SCM_PIDFD 0x04 /* ro: pidfd (int) */
180181

181182
struct ucred {
182183
__u32 pid;
@@ -326,6 +327,7 @@ struct ucred {
326327
*/
327328

328329
#define MSG_ZEROCOPY 0x4000000 /* Use user data in kernel path */
330+
#define MSG_SPLICE_PAGES 0x8000000 /* Splice the pages from the iterator in sendmsg() */
329331
#define MSG_FASTOPEN 0x20000000 /* Send data in TCP SYN */
330332
#define MSG_CMSG_CLOEXEC 0x40000000 /* Set close_on_exec for file
331333
descriptor received through
@@ -336,6 +338,9 @@ struct ucred {
336338
#define MSG_CMSG_COMPAT 0 /* We never have 32 bit fixups */
337339
#endif
338340

341+
/* Flags to be cleared on entry by sendmsg and sendmmsg syscalls */
342+
#define MSG_INTERNAL_SENDMSG_FLAGS \
343+
(MSG_SPLICE_PAGES | MSG_SENDPAGE_NOPOLICY | MSG_SENDPAGE_DECRYPTED)
339344

340345
/* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx */
341346
#define SOL_IP 0

tools/perf/trace/beauty/msg_flags.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
#ifndef MSG_WAITFORONE
99
#define MSG_WAITFORONE 0x10000
1010
#endif
11+
#ifndef MSG_BATCH
12+
#define MSG_BATCH 0x40000
13+
#endif
14+
#ifndef MSG_ZEROCOPY
15+
#define MSG_ZEROCOPY 0x4000000
16+
#endif
1117
#ifndef MSG_SPLICE_PAGES
1218
#define MSG_SPLICE_PAGES 0x8000000
1319
#endif
@@ -50,6 +56,8 @@ static size_t syscall_arg__scnprintf_msg_flags(char *bf, size_t size,
5056
P_MSG_FLAG(NOSIGNAL);
5157
P_MSG_FLAG(MORE);
5258
P_MSG_FLAG(WAITFORONE);
59+
P_MSG_FLAG(BATCH);
60+
P_MSG_FLAG(ZEROCOPY);
5361
P_MSG_FLAG(SPLICE_PAGES);
5462
P_MSG_FLAG(FASTOPEN);
5563
P_MSG_FLAG(CMSG_CLOEXEC);

0 commit comments

Comments
 (0)