Compare commits
248 Commits
master
...
esyr/next-
Author | SHA1 | Date | |
---|---|---|---|
|
b083940210 | ||
|
9319e0a49c | ||
|
eaea61a93b | ||
|
e2b7a15518 | ||
|
4e854fee20 | ||
|
ca28f1d4e7 | ||
|
aa720f7306 | ||
|
f49fc80253 | ||
|
f5b54b38ee | ||
|
997ce1ad8e | ||
|
420b631687 | ||
|
a6ace08dbc | ||
|
e44ae68ae4 | ||
|
5338aecfa9 | ||
|
05de794953 | ||
|
9c26fb26e3 | ||
|
ce76cd330d | ||
|
b53717e034 | ||
|
7bfd2375ff | ||
|
57098d88c2 | ||
|
ce9d5044c8 | ||
|
7657246b59 | ||
|
76eea4699e | ||
|
a1d541c26a | ||
|
4ef7513055 | ||
|
91ab71f387 | ||
|
9e9071d615 | ||
|
d6d103b4fa | ||
|
776043f4cc | ||
|
e7b9424cac | ||
|
d20c0c7804 | ||
|
b84f967d27 | ||
|
ad40a98f06 | ||
|
8a268ad962 | ||
|
161121a3d2 | ||
|
6141608483 | ||
|
74d0cad5dd | ||
|
504b43651c | ||
|
b45562e897 | ||
|
e6e005f70c | ||
|
ce366255c5 | ||
|
826306c987 | ||
|
2f46f33384 | ||
|
1d46db4207 | ||
|
12f618552a | ||
|
606a8f39e8 | ||
|
7908a872ba | ||
|
d1f4b528cb | ||
|
48a84accf6 | ||
|
4a602e8962 | ||
|
8ff46440ff | ||
|
d998972eb5 | ||
|
2d2edb4654 | ||
|
3cfdc5da72 | ||
|
8cfc98ca99 | ||
|
e963559c13 | ||
|
cae7ddf0a3 | ||
|
3c068f860e | ||
|
53bc64c795 | ||
|
079776b9bd | ||
|
36837ede63 | ||
|
369afb0506 | ||
|
90337bbfe8 | ||
|
dd0b8073d6 | ||
|
616d4ed93c | ||
|
6b583ed1b3 | ||
|
d8e5ff352a | ||
|
231658be6b | ||
|
016178ec9b | ||
|
66aea8089d | ||
|
ed3e7e751d | ||
|
da97767c05 | ||
|
a8778adef2 | ||
|
e3068c9791 | ||
|
400c83337d | ||
|
ab353ade4e | ||
|
8d3ee7033f | ||
|
5bccbbe42b | ||
|
6888b56c80 | ||
|
fd02c5ea81 | ||
|
cd733e0454 | ||
|
21cc88963f | ||
|
7138dcec9e | ||
|
ff18af2bb4 | ||
|
a475336863 | ||
|
be048f54c5 | ||
|
2a905d1b00 | ||
|
6a44f46c7c | ||
|
9baa6bcc88 | ||
|
3a94852d43 | ||
|
323c689701 | ||
|
638b5c99b6 | ||
|
d9a5b26067 | ||
|
f6964715e3 | ||
|
2fc6a3647a | ||
|
4ebabbed7c | ||
|
b43aae36d9 | ||
|
81c9974f11 | ||
|
0e58b178e5 | ||
|
bca1b70f6b | ||
|
6d024c6336 | ||
|
1525464331 | ||
|
0fa594e3e8 | ||
|
4ed4a2ffcc | ||
|
07c1744c02 | ||
|
53ac73b04e | ||
|
c2cc305c66 | ||
|
061d0e133e | ||
|
cfc3e07033 | ||
|
a26ad5c9ad | ||
|
9ea764c377 | ||
|
a6e6d0aa1f | ||
|
1324a28cc7 | ||
|
394ba90034 | ||
|
60b094103f | ||
|
c35f9466a8 | ||
|
52981bfb48 | ||
|
8015a74269 | ||
|
78fd3aa2b8 | ||
|
4f72de66f4 | ||
|
ef330a84d9 | ||
|
1090f31204 | ||
|
1aca712d4a | ||
|
bca69f9e39 | ||
|
c3e1c57045 | ||
|
a4c8986bd7 | ||
|
c7436d45a8 | ||
|
f2f91dbe8b | ||
|
49443a8c8c | ||
|
7f3519e4d8 | ||
|
caac21a22b | ||
|
1d5a776f63 | ||
|
771a786157 | ||
|
6d4b688d38 | ||
|
342801a9dc | ||
|
56c64c0f85 | ||
|
452bb1c4b9 | ||
|
c8dc2208eb | ||
|
d7beb8d758 | ||
|
b4e5977fee | ||
|
72ecb7691a | ||
|
fc2d593d3d | ||
|
8783cd8119 | ||
|
aeb343b726 | ||
|
8a7ba35d04 | ||
|
156777f967 | ||
|
719d1f8986 | ||
|
2d89ff7096 | ||
|
06bb2018c7 | ||
|
1abb9c7b21 | ||
|
9f7da75206 | ||
|
895a68db41 | ||
|
399a2d8849 | ||
|
22ec7c5edb | ||
|
1ef81b4b74 | ||
|
b7d8794dbf | ||
|
4544b3f554 | ||
|
2df7898efb | ||
|
00c56292a1 | ||
|
25f71c5488 | ||
|
33ea6a9bb0 | ||
|
f4e7b1e740 | ||
|
bfbdf336ec | ||
|
08c045c3ac | ||
|
68d33a311a | ||
|
d055196eb4 | ||
|
dd1061290f | ||
|
1cf06bb8df | ||
|
33e9a736b1 | ||
|
e369424a58 | ||
|
cd6e2d27f8 | ||
|
90320f4ce4 | ||
|
3ef3477891 | ||
|
f0865403a2 | ||
|
69d148d233 | ||
|
059568a665 | ||
|
71404212b8 | ||
|
86899822ba | ||
|
05ae538c90 | ||
|
3305550ccc | ||
|
57a2b0fbdd | ||
|
f71663b233 | ||
|
2b70434e3e | ||
|
0685a353bf | ||
|
beece1ab43 | ||
|
8b2355f55f | ||
|
d58f4c7ee8 | ||
|
e30f3c2558 | ||
|
0a21612184 | ||
|
1a28b6dba2 | ||
|
32e987b87a | ||
|
7c7705fbc9 | ||
|
f73d6361c1 | ||
|
53faa8304c | ||
|
11c4fc6d99 | ||
|
8b58aa17fb | ||
|
861f9fd7d8 | ||
|
dea7b2d055 | ||
|
b3766e3e01 | ||
|
6ee33f6452 | ||
|
e8f456d4e1 | ||
|
15090ba907 | ||
|
aaab15665e | ||
|
398c49b48a | ||
|
2e9d851346 | ||
|
653abe7a9d | ||
|
b821526643 | ||
|
a010a633cd | ||
|
3960fea7f1 | ||
|
8de3d10e71 | ||
|
13263abd4f | ||
|
ef560cb5d7 | ||
|
ea3b724cf0 | ||
|
d961fb6936 | ||
|
e901b0cd05 | ||
|
6d4d8e4241 | ||
|
fa5d35f8f3 | ||
|
9964dc7dc4 | ||
|
849d1ea8ac | ||
|
d573499dfc | ||
|
7f232e50af | ||
|
43d076b53d | ||
|
c15ae06098 | ||
|
977d5aed13 | ||
|
5a22df3304 | ||
|
624d03085c | ||
|
98bfc2f997 | ||
|
fc9b2b76e3 | ||
|
f12b03a7c5 | ||
|
4d575e0243 | ||
|
6fa6d63bd1 | ||
|
cba303088d | ||
|
ff4b53baa8 | ||
|
741b34b3d1 | ||
|
da228c39ad | ||
|
044c1560f2 | ||
|
7e632b44d2 | ||
|
02ad183786 | ||
|
4087e34e87 | ||
|
c31ced973c | ||
|
0484e396f2 | ||
|
871c1af6c3 | ||
|
39a77ad205 | ||
|
9f25e7a911 | ||
|
f676bc701d | ||
|
e6c00226f4 | ||
|
0ab4f638cd | ||
|
d5f960204c |
34
Makefile.am
34
Makefile.am
@ -61,8 +61,9 @@ AM_CPPFLAGS_FOR_BUILD = $(AM_CPPFLAGS)
|
||||
|
||||
include xlat/Makemodule.am
|
||||
|
||||
strace_CPPFLAGS = $(AM_CPPFLAGS)
|
||||
strace_CFLAGS = $(AM_CFLAGS)
|
||||
strace_CPPFLAGS = $(AM_CPPFLAGS) -DHAVE_DEFS_H
|
||||
strace_CFLAGS = $(AM_CFLAGS) -DMPERS_WORDSIZE=PERSONALITY0_WORDSIZE \
|
||||
-DMPERS_KLONGSIZE=PERSONALITY0_KLONGSIZE
|
||||
strace_LDFLAGS =
|
||||
strace_LDADD = libstrace.a $(clock_LIBS) $(timer_LIBS)
|
||||
noinst_LIBRARIES = libstrace.a
|
||||
@ -264,6 +265,7 @@ strace_SOURCES = \
|
||||
process.c \
|
||||
process_vm.c \
|
||||
ptp.c \
|
||||
ptp_clock.h \
|
||||
ptrace.h \
|
||||
quota.c \
|
||||
readahead.c \
|
||||
@ -280,6 +282,7 @@ strace_SOURCES = \
|
||||
rtc.c \
|
||||
rtnl_addr.c \
|
||||
rtnl_addrlabel.c \
|
||||
rtnl_cachereport.c \
|
||||
rtnl_dcb.c \
|
||||
rtnl_link.c \
|
||||
rtnl_mdb.c \
|
||||
@ -289,6 +292,7 @@ strace_SOURCES = \
|
||||
rtnl_nsid.c \
|
||||
rtnl_route.c \
|
||||
rtnl_rule.c \
|
||||
rtnl_stats.c \
|
||||
rtnl_tc.c \
|
||||
rtnl_tc_action.c \
|
||||
s390.c \
|
||||
@ -326,6 +330,7 @@ strace_SOURCES = \
|
||||
sysent.h \
|
||||
sysent_shorthand_defs.h \
|
||||
sysent_shorthand_undefs.h \
|
||||
sysfs.c \
|
||||
sysinfo.c \
|
||||
syslog.c \
|
||||
sysmips.c \
|
||||
@ -348,6 +353,7 @@ strace_SOURCES = \
|
||||
utimes.c \
|
||||
v4l2.c \
|
||||
wait.c \
|
||||
wait.h \
|
||||
xattr.c \
|
||||
xfs_quota_stat.h \
|
||||
xlat.c \
|
||||
@ -358,7 +364,10 @@ strace_SOURCES = \
|
||||
$(strace_SOURCES_check) \
|
||||
# end of strace_SOURCES
|
||||
|
||||
strace_SOURCES_check = bpf_attr_check.c
|
||||
strace_SOURCES_check = \
|
||||
bpf_attr_check.c \
|
||||
ptp_clock_check.c \
|
||||
# end of strace_SOURCES_check
|
||||
|
||||
if ENABLE_STACKTRACE
|
||||
strace_SOURCES += unwind.c unwind.h
|
||||
@ -417,6 +426,7 @@ EXTRA_DIST = \
|
||||
debian/strace64.manpages \
|
||||
debian/watch \
|
||||
gen_bpf_attr_check.sh \
|
||||
gen_ptp_clock_check.sh \
|
||||
generate_sen.sh \
|
||||
ioctl_iocdef.c \
|
||||
ioctlsort.c \
|
||||
@ -578,6 +588,7 @@ EXTRA_DIST = \
|
||||
linux/ia64/rt_sigframe.h \
|
||||
linux/ia64/set_error.c \
|
||||
linux/ia64/set_scno.c \
|
||||
linux/ia64/shuffle_scno.c \
|
||||
linux/ia64/syscallent.h \
|
||||
linux/ia64/userent.h \
|
||||
linux/inet_diag.h \
|
||||
@ -960,6 +971,9 @@ $(srcdir)/.version:
|
||||
bpf_attr_check.c: $(srcdir)/bpf_attr.h $(srcdir)/gen_bpf_attr_check.sh
|
||||
$(srcdir)/gen_bpf_attr_check.sh $< > $@-t && mv $@-t $@
|
||||
|
||||
ptp_clock_check.c: $(srcdir)/ptp_clock.h $(srcdir)/gen_ptp_clock_check.sh
|
||||
$(srcdir)/gen_ptp_clock_check.sh $< > $@-t && mv $@-t $@
|
||||
|
||||
strace_SOURCES_c = \
|
||||
$(filter %.c,$(strace_SOURCES)) $(filter %.c,$(libstrace_a_SOURCES))
|
||||
|
||||
@ -1039,11 +1053,11 @@ ioctls_all%.h: $(srcdir)/$(OS)/$(ARCH)/ioctls_inc%.h $(srcdir)/$(OS)/$(ARCH)/ioc
|
||||
|
||||
BUILT_SOURCES = $(ioctl_redefs_h) $(ioctlent_h) \
|
||||
bpf_attr_check.c native_printer_decls.h native_printer_defs.h \
|
||||
printers.h sen.h sys_func.h .version
|
||||
printers.h ptp_clock_check.c sen.h sys_func.h .version
|
||||
CLEANFILES = $(ioctl_redefs_h) $(ioctlent_h) $(mpers_preproc_files) \
|
||||
ioctl_iocdef.h ioctl_iocdef.i \
|
||||
bpf_attr_check.c native_printer_decls.h native_printer_defs.h \
|
||||
printers.h sen.h sys_func.h
|
||||
printers.h ptp_clock_check.c sen.h sys_func.h
|
||||
DISTCLEANFILES = gnu/stubs-32.h gnu/stubs-x32.h linux/linux/signal.h
|
||||
|
||||
include scno.am
|
||||
@ -1073,7 +1087,7 @@ mpers-m%.stamp: $(srcdir_mpers_source_files) | printers.h
|
||||
CFLAGS="$(mpers_sh_opts) -DMPERS_IS_$(mpers_NAME)" \
|
||||
CPP="$(CPP)" \
|
||||
CPPFLAGS="$(mpers_sh_opts) -DIN_MPERS -DMPERS_IS_$(mpers_NAME)" \
|
||||
$(srcdir)/mpers.sh $(mpers_NAME) $(mpers_CC_FLAGS) $$f || exit; \
|
||||
$(srcdir)/mpers.sh "$(mpers_NAME)" "$(mpers_CC_FLAGS)" "$$f" || exit; \
|
||||
done
|
||||
> $@
|
||||
|
||||
@ -1144,7 +1158,9 @@ BUILT_SOURCES += $(mpers_m32_targets)
|
||||
CLEANFILES += $(mpers_m32_targets)
|
||||
|
||||
$(mpers_m32_targets): mpers_NAME = m32
|
||||
$(mpers_m32_targets): mpers_CC_FLAGS = @cc_flags_m32@
|
||||
$(mpers_m32_targets): mpers_CC_FLAGS = @cc_flags_m32@ \
|
||||
-DMPERS_WORDSIZE=PERSONALITY1_WORDSIZE \
|
||||
-DMPERS_KLONGSIZE=PERSONALITY1_KLONGSIZE
|
||||
|
||||
endif # HAVE_M32_MPERS
|
||||
|
||||
@ -1161,7 +1177,9 @@ BUILT_SOURCES += $(mpers_mx32_targets)
|
||||
CLEANFILES += $(mpers_mx32_targets)
|
||||
|
||||
$(mpers_mx32_targets): mpers_NAME = mx32
|
||||
$(mpers_mx32_targets): mpers_CC_FLAGS = @cc_flags_mx32@
|
||||
$(mpers_mx32_targets): mpers_CC_FLAGS = @cc_flags_mx32@ \
|
||||
-DMPERS_WORDSIZE=PERSONALITY2_WORDSIZE \
|
||||
-DMPERS_KLONGSIZE=PERSONALITY2_KLONGSIZE
|
||||
|
||||
endif # HAVE_MX32_MPERS
|
||||
|
||||
|
@ -9,6 +9,8 @@ See the file [NEWS](NEWS) for information on what has changed in recent versions
|
||||
|
||||
Please read the file [INSTALL-git](INSTALL-git.md) for installation instructions.
|
||||
|
||||
Please take a look at [the guide for new contributors](https://strace.io/wiki/NewContributorGuide) if you want to get involved in strace development.
|
||||
|
||||
The user discussion and development of strace take place on [the strace mailing list](https://lists.strace.io/mailman/listinfo/strace-devel) -- everyone is welcome to post bug reports, feature requests, comments and patches to strace-devel@lists.strace.io. The mailing list archives are available at https://lists.strace.io/pipermail/strace-devel/ and other archival sites.
|
||||
|
||||
The GIT repository of strace is available at [GitHub](https://github.com/strace/strace/) and [GitLab](https://gitlab.com/strace/strace/).
|
||||
|
57
aio.c
57
aio.c
@ -34,6 +34,13 @@
|
||||
#include <linux/aio_abi.h>
|
||||
|
||||
#include "xlat/aio_cmds.h"
|
||||
#include "xlat/aio_iocb_flags.h"
|
||||
|
||||
#ifdef HAVE_STRUCT_IOCB_AIO_RW_FLAGS
|
||||
# define AIO_RW_FLAGS_FIELD aio_rw_flags
|
||||
#else
|
||||
# define AIO_RW_FLAGS_FIELD aio_reserved1
|
||||
#endif
|
||||
|
||||
SYS_FUNC(io_setup)
|
||||
{
|
||||
@ -52,7 +59,7 @@ SYS_FUNC(io_destroy)
|
||||
}
|
||||
|
||||
enum iocb_sub {
|
||||
SUB_NONE, SUB_COMMON, SUB_VECTOR
|
||||
SUB_NONE, SUB_COMMON, SUB_VECTOR, SUB_POLL
|
||||
};
|
||||
|
||||
static enum iocb_sub
|
||||
@ -64,14 +71,13 @@ tprint_lio_opcode(unsigned int cmd)
|
||||
[IOCB_CMD_FSYNC] = SUB_NONE,
|
||||
[IOCB_CMD_FDSYNC] = SUB_NONE,
|
||||
[IOCB_CMD_PREADX] = SUB_NONE,
|
||||
[IOCB_CMD_POLL] = SUB_NONE,
|
||||
[IOCB_CMD_POLL] = SUB_POLL,
|
||||
[IOCB_CMD_NOOP] = SUB_NONE,
|
||||
[IOCB_CMD_PREADV] = SUB_VECTOR,
|
||||
[IOCB_CMD_PWRITEV] = SUB_VECTOR,
|
||||
};
|
||||
|
||||
printxval_indexn_ex(ARRSZ_PAIR(aio_cmds), cmd, "IOCB_CMD_???",
|
||||
XLAT_STYLE_FMT_U);
|
||||
printxval_ex(aio_cmds, cmd, "IOCB_CMD_???", XLAT_STYLE_FMT_U);
|
||||
|
||||
return cmd < ARRAY_SIZE(subs) ? subs[cmd] : SUB_NONE;
|
||||
}
|
||||
@ -79,14 +85,14 @@ tprint_lio_opcode(unsigned int cmd)
|
||||
static void
|
||||
print_common_flags(struct tcb *tcp, const struct iocb *cb)
|
||||
{
|
||||
/* IOCB_FLAG_RESFD is available since v2.6.22-rc1~47 */
|
||||
#ifdef IOCB_FLAG_RESFD
|
||||
if (cb->aio_flags)
|
||||
PRINT_FIELD_FLAGS(", ", *cb, aio_flags, aio_iocb_flags,
|
||||
"IOCB_FLAG_???");
|
||||
|
||||
if (cb->aio_flags & IOCB_FLAG_RESFD)
|
||||
PRINT_FIELD_FD(", ", *cb, aio_resfd, tcp);
|
||||
|
||||
if (cb->aio_flags & ~IOCB_FLAG_RESFD)
|
||||
PRINT_FIELD_X(", ", *cb, aio_flags);
|
||||
#endif
|
||||
else if (cb->aio_resfd)
|
||||
PRINT_FIELD_X(", ", *cb, aio_resfd);
|
||||
}
|
||||
|
||||
static bool
|
||||
@ -102,20 +108,25 @@ print_iocb_header(struct tcb *tcp, const struct iocb *cb)
|
||||
{
|
||||
enum iocb_sub sub;
|
||||
|
||||
if (cb->aio_data){
|
||||
PRINT_FIELD_X("", *cb, aio_data);
|
||||
tprints(", ");
|
||||
PRINT_FIELD_X("", *cb, aio_data);
|
||||
|
||||
if (cb->aio_key)
|
||||
PRINT_FIELD_U(", ", *cb, aio_key);
|
||||
|
||||
if (cb->AIO_RW_FLAGS_FIELD) {
|
||||
tprints(", aio_rw_flags=");
|
||||
printflags(rwf_flags, cb->AIO_RW_FLAGS_FIELD, "RWF_???");
|
||||
}
|
||||
|
||||
if (cb->aio_key) {
|
||||
PRINT_FIELD_U("", *cb, aio_key);
|
||||
tprints(", ");
|
||||
}
|
||||
|
||||
tprints("aio_lio_opcode=");
|
||||
tprints(", aio_lio_opcode=");
|
||||
sub = tprint_lio_opcode(cb->aio_lio_opcode);
|
||||
if (cb->aio_reqprio)
|
||||
|
||||
if (cb->aio_flags & IOCB_FLAG_IOPRIO) {
|
||||
tprints(", aio_reqprio=");
|
||||
print_ioprio(zero_extend_signed_to_ull(cb->aio_reqprio));
|
||||
} else if (cb->aio_reqprio) {
|
||||
PRINT_FIELD_D(", ", *cb, aio_reqprio);
|
||||
}
|
||||
|
||||
PRINT_FIELD_FD(", ", *cb, aio_fildes, tcp);
|
||||
|
||||
@ -155,6 +166,10 @@ print_iocb(struct tcb *tcp, const struct iocb *cb)
|
||||
PRINT_FIELD_D(", ", *cb, aio_offset);
|
||||
print_common_flags(tcp, cb);
|
||||
break;
|
||||
case SUB_POLL:
|
||||
PRINT_FIELD_FLAGS(", ", *cb, aio_buf, pollflags, "POLL???");
|
||||
print_common_flags(tcp, cb);
|
||||
break;
|
||||
case SUB_NONE:
|
||||
break;
|
||||
}
|
||||
@ -255,7 +270,7 @@ print_io_getevents(struct tcb *tcp, bool has_usig)
|
||||
* whether the syscall has failed or not.
|
||||
*/
|
||||
temporarily_clear_syserror(tcp);
|
||||
print_timespec(tcp, tcp->u_arg[4]);
|
||||
print_timespec(tcp, tcp->u_arg[4], false);
|
||||
if (has_usig) {
|
||||
tprints(", ");
|
||||
print_aio_sigset(tcp, tcp->u_arg[5]);
|
||||
|
@ -174,6 +174,7 @@ lookup_class(const char *s)
|
||||
{ "%process", TRACE_PROCESS },
|
||||
{ "%signal", TRACE_SIGNAL },
|
||||
{ "%ipc", TRACE_IPC },
|
||||
{ "%net", TRACE_NETWORK },
|
||||
{ "%network", TRACE_NETWORK },
|
||||
{ "%stat", TRACE_STAT },
|
||||
{ "%lstat", TRACE_LSTAT },
|
||||
|
57
block.c
57
block.c
@ -65,60 +65,15 @@ typedef struct blk_user_trace_setup {
|
||||
uint32_t pid;
|
||||
} struct_blk_user_trace_setup;
|
||||
|
||||
/* Provide fall-back definitions for BLK* ioctls */
|
||||
#define XLAT_MACROS_ONLY
|
||||
# include "xlat/block_ioctl_cmds.h"
|
||||
#undef XLAT_MACROS_ONLY
|
||||
|
||||
#include MPERS_DEFS
|
||||
|
||||
#include "print_fields.h"
|
||||
|
||||
#ifndef BLKPG
|
||||
# define BLKPG _IO(0x12, 105)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* ioctl numbers <= 114 are present in Linux 2.4. The following ones have been
|
||||
* added since then and headers containing them may not be available on every
|
||||
* system.
|
||||
*/
|
||||
|
||||
#ifndef BLKTRACESETUP
|
||||
# define BLKTRACESETUP _IOWR(0x12, 115, struct_blk_user_trace_setup)
|
||||
#endif
|
||||
#ifndef BLKTRACESTART
|
||||
# define BLKTRACESTART _IO(0x12, 116)
|
||||
#endif
|
||||
#ifndef BLKTRACESTOP
|
||||
# define BLKTRACESTOP _IO(0x12, 117)
|
||||
#endif
|
||||
#ifndef BLKTRACETEARDOWN
|
||||
# define BLKTRACETEARDOWN _IO(0x12, 118)
|
||||
#endif
|
||||
#ifndef BLKDISCARD
|
||||
# define BLKDISCARD _IO(0x12, 119)
|
||||
#endif
|
||||
#ifndef BLKIOMIN
|
||||
# define BLKIOMIN _IO(0x12, 120)
|
||||
#endif
|
||||
#ifndef BLKIOOPT
|
||||
# define BLKIOOPT _IO(0x12, 121)
|
||||
#endif
|
||||
#ifndef BLKALIGNOFF
|
||||
# define BLKALIGNOFF _IO(0x12, 122)
|
||||
#endif
|
||||
#ifndef BLKPBSZGET
|
||||
# define BLKPBSZGET _IO(0x12, 123)
|
||||
#endif
|
||||
#ifndef BLKDISCARDZEROES
|
||||
# define BLKDISCARDZEROES _IO(0x12, 124)
|
||||
#endif
|
||||
#ifndef BLKSECDISCARD
|
||||
# define BLKSECDISCARD _IO(0x12, 125)
|
||||
#endif
|
||||
#ifndef BLKROTATIONAL
|
||||
# define BLKROTATIONAL _IO(0x12, 126)
|
||||
#endif
|
||||
#ifndef BLKZEROOUT
|
||||
# define BLKZEROOUT _IO(0x12, 127)
|
||||
#endif
|
||||
|
||||
#include "xlat/blkpg_ops.h"
|
||||
|
||||
static void
|
||||
@ -204,7 +159,6 @@ MPERS_PRINTER_DECL(int, block_ioctl, struct tcb *const tcp,
|
||||
printnum_ulong(tcp, arg);
|
||||
break;
|
||||
|
||||
#ifdef HAVE_BLKGETSIZE64
|
||||
/* returns an uint64_t */
|
||||
case BLKGETSIZE64:
|
||||
if (entering(tcp))
|
||||
@ -212,7 +166,6 @@ MPERS_PRINTER_DECL(int, block_ioctl, struct tcb *const tcp,
|
||||
tprints(", ");
|
||||
printnum_int64(tcp, arg, "%" PRIu64);
|
||||
break;
|
||||
#endif
|
||||
|
||||
/* takes a pair of uint64_t */
|
||||
case BLKDISCARD:
|
||||
|
@ -1,6 +1,9 @@
|
||||
#!/bin/sh -eu
|
||||
|
||||
export LANG=C
|
||||
|
||||
./m4/gen_bpf_attr_m4.sh
|
||||
./m4/gen_ptp_clock_m4.sh
|
||||
./generate_mpers_am.sh
|
||||
./xlat/gen.sh
|
||||
./tests/gen_pure_executables.sh
|
||||
|
28
bpf.c
28
bpf.c
@ -150,9 +150,9 @@ print_ebpf_insn(struct tcb * const tcp, void * const elem_buf,
|
||||
|
||||
/* We can't use PRINT_FIELD_XVAL on bit fields */
|
||||
tprints(", dst_reg=");
|
||||
printxval_index(ebpf_regs, insn->dst_reg, "BPF_REG_???");
|
||||
printxval(ebpf_regs, insn->dst_reg, "BPF_REG_???");
|
||||
tprints(", src_reg=");
|
||||
printxval_index(ebpf_regs, insn->src_reg, "BPF_REG_???");
|
||||
printxval(ebpf_regs, insn->src_reg, "BPF_REG_???");
|
||||
|
||||
PRINT_FIELD_D(", ", *insn, off);
|
||||
PRINT_FIELD_X(", ", *insn, imm);
|
||||
@ -178,8 +178,8 @@ print_ebpf_prog(struct tcb *const tcp, const uint64_t addr, const uint32_t len)
|
||||
|
||||
BEGIN_BPF_CMD_DECODER(BPF_MAP_CREATE)
|
||||
{
|
||||
PRINT_FIELD_XVAL_INDEX("{", attr, map_type, bpf_map_types,
|
||||
"BPF_MAP_TYPE_???");
|
||||
PRINT_FIELD_XVAL("{", attr, map_type, bpf_map_types,
|
||||
"BPF_MAP_TYPE_???");
|
||||
PRINT_FIELD_U(", ", attr, key_size);
|
||||
PRINT_FIELD_U(", ", attr, value_size);
|
||||
PRINT_FIELD_U(", ", attr, max_entries);
|
||||
@ -248,8 +248,8 @@ BEGIN_BPF_CMD_DECODER(BPF_MAP_UPDATE_ELEM)
|
||||
PRINT_FIELD_FD("{", attr, map_fd, tcp);
|
||||
PRINT_FIELD_ADDR64(", ", attr, key);
|
||||
PRINT_FIELD_ADDR64(", ", attr, value);
|
||||
PRINT_FIELD_XVAL_INDEX(", ", attr, flags, bpf_map_update_elem_flags,
|
||||
"BPF_???");
|
||||
PRINT_FIELD_XVAL(", ", attr, flags, bpf_map_update_elem_flags,
|
||||
"BPF_???");
|
||||
}
|
||||
END_BPF_CMD_DECODER(RVAL_DECODED)
|
||||
|
||||
@ -270,8 +270,8 @@ END_BPF_CMD_DECODER(RVAL_DECODED)
|
||||
|
||||
BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)
|
||||
{
|
||||
PRINT_FIELD_XVAL_INDEX("{", attr, prog_type, bpf_prog_types,
|
||||
"BPF_PROG_TYPE_???");
|
||||
PRINT_FIELD_XVAL("{", attr, prog_type, bpf_prog_types,
|
||||
"BPF_PROG_TYPE_???");
|
||||
PRINT_FIELD_U(", ", attr, insn_cnt);
|
||||
tprints(", insns=");
|
||||
print_ebpf_prog(tcp, attr.insns, attr.insn_cnt);
|
||||
@ -352,8 +352,7 @@ BEGIN_BPF_CMD_DECODER(BPF_PROG_ATTACH)
|
||||
{
|
||||
PRINT_FIELD_FD("{", attr, target_fd, tcp);
|
||||
PRINT_FIELD_FD(", ", attr, attach_bpf_fd, tcp);
|
||||
PRINT_FIELD_XVAL_INDEX(", ", attr, attach_type, bpf_attach_type,
|
||||
"BPF_???");
|
||||
PRINT_FIELD_XVAL(", ", attr, attach_type, bpf_attach_type, "BPF_???");
|
||||
PRINT_FIELD_FLAGS(", ", attr, attach_flags, bpf_attach_flags,
|
||||
"BPF_F_???");
|
||||
}
|
||||
@ -362,8 +361,7 @@ END_BPF_CMD_DECODER(RVAL_DECODED)
|
||||
BEGIN_BPF_CMD_DECODER(BPF_PROG_DETACH)
|
||||
{
|
||||
PRINT_FIELD_FD("{", attr, target_fd, tcp);
|
||||
PRINT_FIELD_XVAL_INDEX(", ", attr, attach_type, bpf_attach_type,
|
||||
"BPF_???");
|
||||
PRINT_FIELD_XVAL(", ", attr, attach_type, bpf_attach_type, "BPF_???");
|
||||
}
|
||||
END_BPF_CMD_DECODER(RVAL_DECODED)
|
||||
|
||||
@ -665,8 +663,8 @@ BEGIN_BPF_CMD_DECODER(BPF_PROG_QUERY)
|
||||
|
||||
if (entering(tcp)) {
|
||||
PRINT_FIELD_FD("{query={", attr, target_fd, tcp);
|
||||
PRINT_FIELD_XVAL_INDEX(", ", attr, attach_type, bpf_attach_type,
|
||||
"BPF_???");
|
||||
PRINT_FIELD_XVAL(", ", attr, attach_type, bpf_attach_type,
|
||||
"BPF_???");
|
||||
PRINT_FIELD_FLAGS(", ", attr, query_flags, bpf_query_flags,
|
||||
"BPF_F_QUERY_???");
|
||||
PRINT_FIELD_FLAGS(", ", attr, attach_flags, bpf_attach_flags,
|
||||
@ -736,7 +734,7 @@ SYS_FUNC(bpf)
|
||||
int rc = RVAL_DECODED;
|
||||
|
||||
if (entering(tcp)) {
|
||||
printxval_index(bpf_commands, cmd, "BPF_???");
|
||||
printxval(bpf_commands, cmd, "BPF_???");
|
||||
tprints(", ");
|
||||
}
|
||||
|
||||
|
@ -56,10 +56,8 @@ print_bpf_filter_code(const uint16_t code, bool extended)
|
||||
const struct xlat *mode = extended ? ebpf_mode : bpf_mode;
|
||||
uint16_t i = code & ~BPF_CLASS(code);
|
||||
|
||||
if (extended)
|
||||
printxval_index(ebpf_class, BPF_CLASS(code), "BPF_???");
|
||||
else
|
||||
printxval_index(bpf_class, BPF_CLASS(code), "BPF_???");
|
||||
printxval(extended ? ebpf_class : bpf_class, BPF_CLASS(code),
|
||||
"BPF_???");
|
||||
switch (BPF_CLASS(code)) {
|
||||
case BPF_ST:
|
||||
case BPF_STX:
|
||||
|
6
clone.c
6
clone.c
@ -111,8 +111,10 @@ SYS_FUNC(clone)
|
||||
tprints("flags=");
|
||||
if (!printflags64(clone_flags, flags & ~CSIGNAL, NULL))
|
||||
sep = "";
|
||||
if ((flags & CSIGNAL) != 0)
|
||||
tprintf("%s%s", sep, signame(flags & CSIGNAL));
|
||||
if ((flags & CSIGNAL) != 0) {
|
||||
tprints(sep);
|
||||
printsignal(flags & CSIGNAL);
|
||||
}
|
||||
if ((flags & (CLONE_PARENT_SETTID|CLONE_CHILD_SETTID
|
||||
|CLONE_CHILD_CLEARTID|CLONE_SETTLS)) == 0)
|
||||
return 0;
|
||||
|
41
configure.ac
41
configure.ac
@ -355,7 +355,8 @@ AC_CHECK_MEMBERS([struct utsname.domainname],,, [#include <sys/utsname.h>])
|
||||
AC_CHECK_MEMBERS(m4_normalize([
|
||||
siginfo_t.si_syscall,
|
||||
siginfo_t.si_timerid,
|
||||
siginfo_t.si_overrun
|
||||
siginfo_t.si_overrun,
|
||||
siginfo_t.si_trapno
|
||||
]),,, [#include <signal.h>])
|
||||
|
||||
AC_CHECK_MEMBERS(m4_normalize([
|
||||
@ -397,7 +398,6 @@ AC_CHECK_HEADERS(m4_normalize([
|
||||
linux/falloc.h
|
||||
linux/fib_rules.h
|
||||
linux/fiemap.h
|
||||
linux/genetlink.h
|
||||
linux/hiddev.h
|
||||
linux/if_addr.h
|
||||
linux/if_link.h
|
||||
@ -477,6 +477,10 @@ AC_CHECK_HEADERS([linux/bpf.h], [
|
||||
st_BPF_ATTR
|
||||
])
|
||||
|
||||
AC_CHECK_HEADERS([linux/ptp_clock.h], [
|
||||
st_PTP_CLOCK
|
||||
])
|
||||
|
||||
AC_CHECK_HEADERS([bluetooth/bluetooth.h], [
|
||||
AC_CHECK_MEMBERS([struct sockaddr_l2.l2_bdaddr_type],,,
|
||||
[#include <bluetooth/bluetooth.h>
|
||||
@ -494,6 +498,7 @@ AC_CHECK_MEMBERS(m4_normalize([
|
||||
|
||||
AC_CHECK_TYPES([struct dcbmsg],,, [#include <linux/dcbnl.h>])
|
||||
AC_CHECK_TYPES([struct ifaddrlblmsg],,, [#include <linux/if_addrlabel.h>])
|
||||
AC_CHECK_TYPES([struct if_stats_msg],,, [#include <linux/if_link.h>])
|
||||
AC_CHECK_TYPES([struct netconfmsg],,, [#include <linux/netconf.h>])
|
||||
|
||||
AC_CHECK_TYPES(m4_normalize([
|
||||
@ -571,11 +576,10 @@ AC_CHECK_TYPES([struct blk_user_trace_setup],,, [#include <linux/blktrace_api.h>
|
||||
|
||||
AC_CHECK_TYPES([struct mtd_write_req],,, [#include <mtd/mtd-abi.h>])
|
||||
|
||||
AC_CHECK_MEMBERS([struct ubi_attach_req.max_beb_per1024],,, [#include <mtd/ubi-user.h>])
|
||||
|
||||
AC_CHECK_TYPES(m4_normalize([
|
||||
struct ptp_sys_offset
|
||||
]),,, [#include <linux/ptp_clock.h>])
|
||||
AC_CHECK_MEMBERS(m4_normalize([
|
||||
struct ubi_attach_req.max_beb_per1024
|
||||
struct ubi_mkvol_req.flags
|
||||
]),,, [#include <mtd/ubi-user.h>])
|
||||
|
||||
AC_CHECK_TYPES(m4_normalize([
|
||||
struct kvm_cpuid2,
|
||||
@ -601,6 +605,8 @@ fi
|
||||
|
||||
AC_CHECK_TYPES([struct __aio_sigset],,, [#include <linux/aio_abi.h>])
|
||||
|
||||
AC_CHECK_MEMBERS([struct iocb.aio_rw_flags],,, [#include <linux/aio_abi.h>])
|
||||
|
||||
CPPFLAGS="$saved_CPPFLAGS"
|
||||
|
||||
AC_CHECK_HEADERS([linux/btrfs.h], [
|
||||
@ -788,15 +794,6 @@ AC_CHECK_MEMBERS(m4_normalize([
|
||||
#include <linux/types.h>
|
||||
#include <linux/videodev2.h>])
|
||||
|
||||
AC_CACHE_CHECK([for BLKGETSIZE64], [ac_cv_have_blkgetsize64],
|
||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
|
||||
#include <stdlib.h>
|
||||
#include <linux/fs.h>], [return !BLKGETSIZE64;])],
|
||||
[ac_cv_have_blkgetsize64=yes], [ac_cv_have_blkgetsize64=no])]
|
||||
if test $ac_cv_have_blkgetsize64 = yes; then
|
||||
AC_DEFINE([HAVE_BLKGETSIZE64], [1], [Define to 1 if you have BLKGETSIZE64.])
|
||||
fi)
|
||||
|
||||
AC_CHECK_SIZEOF([long])
|
||||
SIZEOF_LONG="$ac_cv_sizeof_long"
|
||||
AC_SUBST(SIZEOF_LONG)
|
||||
@ -938,8 +935,16 @@ AC_ARG_ENABLE([mpers],
|
||||
esac],
|
||||
[enable_mpers=yes])
|
||||
|
||||
st_MPERS([m32], [aarch64|powerpc64|riscv|s390x|sparc64|tile|x32|x86_64])
|
||||
st_MPERS([mx32], [x86_64])
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(, [[#include "linux/]]$arch[[/arch_defs_.h"
|
||||
#include "linux/arch_defs_.h"
|
||||
int i[SUPPORTED_PERSONALITIES > 1 ? 1 : -1];]])],
|
||||
[st_MPERS([m32], ["$arch"])])
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(, [[#include "linux/]]$arch[[/arch_defs_.h"
|
||||
#include "linux/arch_defs_.h"
|
||||
int i[SUPPORTED_PERSONALITIES > 2 ? 1 : -1];]])],
|
||||
[st_MPERS([mx32], ["$arch"])])
|
||||
|
||||
AX_VALGRIND_DFLT([sgcheck], [off])
|
||||
AX_VALGRIND_CHECK
|
||||
|
442
count.c
442
count.c
@ -36,155 +36,441 @@
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
/* Per-syscall stats structure */
|
||||
struct call_counts {
|
||||
/* time may be total latency or system time */
|
||||
struct timespec time;
|
||||
struct timespec time_min;
|
||||
struct timespec time_max;
|
||||
double time_avg;
|
||||
unsigned int calls, errors;
|
||||
};
|
||||
|
||||
static struct call_counts *countv[SUPPORTED_PERSONALITIES];
|
||||
#define counts (countv[current_personality])
|
||||
|
||||
static const struct timespec zero_ts;
|
||||
static const struct timespec max_ts = {
|
||||
(time_t) (long long) (zero_extend_signed_to_ull(~(((time_t) 0))) >> 1),
|
||||
LONG_MAX };
|
||||
|
||||
static struct timespec overhead;
|
||||
|
||||
|
||||
enum count_summary_columns {
|
||||
CSC_NONE,
|
||||
CSC_TIME_100S,
|
||||
CSC_TIME_TOTAL,
|
||||
CSC_TIME_MIN,
|
||||
CSC_TIME_MAX,
|
||||
CSC_TIME_AVG,
|
||||
CSC_CALLS,
|
||||
CSC_ERRORS,
|
||||
CSC_SC_NAME,
|
||||
|
||||
CSC_MAX,
|
||||
};
|
||||
|
||||
#define DEF_COLUMNS \
|
||||
_(CSC_TIME_100S), \
|
||||
_(CSC_TIME_TOTAL), \
|
||||
_(CSC_TIME_AVG), \
|
||||
_(CSC_CALLS), \
|
||||
_(CSC_ERRORS), \
|
||||
_(CSC_SC_NAME), \
|
||||
/* End of DEF_COLUMNS definition */
|
||||
|
||||
#define _(x) x
|
||||
static uint8_t columns[CSC_MAX] = { DEF_COLUMNS };
|
||||
#undef _
|
||||
#define _(x) [x] = 1
|
||||
static uint8_t visible[CSC_MAX] = { DEF_COLUMNS };
|
||||
#undef _
|
||||
|
||||
void
|
||||
count_syscall(struct tcb *tcp, const struct timespec *syscall_exiting_ts)
|
||||
{
|
||||
if (!scno_in_range(tcp->scno))
|
||||
return;
|
||||
|
||||
if (!counts)
|
||||
if (!counts) {
|
||||
counts = xcalloc(nsyscalls, sizeof(*counts));
|
||||
|
||||
for (size_t i = 0; i < nsyscalls; i++)
|
||||
counts[i].time_min = max_ts;
|
||||
}
|
||||
struct call_counts *cc = &counts[tcp->scno];
|
||||
|
||||
cc->calls++;
|
||||
if (syserror(tcp))
|
||||
cc->errors++;
|
||||
|
||||
struct timespec wts;
|
||||
if (count_wallclock) {
|
||||
/* wall clock time spent while in syscall */
|
||||
struct timespec wts;
|
||||
ts_sub(&wts, syscall_exiting_ts, &tcp->etime);
|
||||
|
||||
ts_add(&cc->time, &cc->time, &wts);
|
||||
} else {
|
||||
/* system CPU time spent while in syscall */
|
||||
ts_add(&cc->time, &cc->time, &tcp->dtime);
|
||||
ts_sub(&wts, &tcp->stime, &tcp->ltime);
|
||||
}
|
||||
|
||||
ts_sub(&wts, &wts, &overhead);
|
||||
ts_max(&wts, &wts, &zero_ts);
|
||||
|
||||
if (ts_cmp(&wts, &cc->time_min) < 0)
|
||||
cc->time_min = wts;
|
||||
if (ts_cmp(&wts, &cc->time_max) > 0)
|
||||
cc->time_max = wts;
|
||||
|
||||
ts_add(&cc->time, &cc->time, &wts);
|
||||
}
|
||||
|
||||
static int
|
||||
time_cmp(void *a, void *b)
|
||||
time_cmp(const void *a, const void *b)
|
||||
{
|
||||
return -ts_cmp(&counts[*((int *) a)].time,
|
||||
&counts[*((int *) b)].time);
|
||||
return -ts_cmp(&counts[*((unsigned int *) a)].time,
|
||||
&counts[*((unsigned int *) b)].time);
|
||||
}
|
||||
|
||||
static int
|
||||
syscall_cmp(void *a, void *b)
|
||||
min_time_cmp(const void *a, const void *b)
|
||||
{
|
||||
const char *a_name = sysent[*((int *) a)].sys_name;
|
||||
const char *b_name = sysent[*((int *) b)].sys_name;
|
||||
return strcmp(a_name ? a_name : "", b_name ? b_name : "");
|
||||
return -ts_cmp(&counts[*((unsigned int *) a)].time_min,
|
||||
&counts[*((unsigned int *) b)].time_min);
|
||||
}
|
||||
|
||||
static int
|
||||
count_cmp(void *a, void *b)
|
||||
max_time_cmp(const void *a, const void *b)
|
||||
{
|
||||
int m = counts[*((int *) a)].calls;
|
||||
int n = counts[*((int *) b)].calls;
|
||||
return -ts_cmp(&counts[*((unsigned int *) a)].time_max,
|
||||
&counts[*((unsigned int *) b)].time_max);
|
||||
}
|
||||
|
||||
static int
|
||||
avg_time_cmp(const void *a, const void *b)
|
||||
{
|
||||
double m = counts[*((unsigned int *) a)].time_avg;
|
||||
double n = counts[*((unsigned int *) b)].time_avg;
|
||||
|
||||
return (m < n) ? 1 : (m > n) ? -1 : 0;
|
||||
}
|
||||
|
||||
static int (*sortfun)();
|
||||
static int
|
||||
syscall_cmp(const void *a, const void *b)
|
||||
{
|
||||
const char *a_name = sysent[*((unsigned int *) a)].sys_name;
|
||||
const char *b_name = sysent[*((unsigned int *) b)].sys_name;
|
||||
return strcmp(a_name ? a_name : "", b_name ? b_name : "");
|
||||
}
|
||||
|
||||
static int
|
||||
count_cmp(const void *a, const void *b)
|
||||
{
|
||||
unsigned int m = counts[*((unsigned int *) a)].calls;
|
||||
unsigned int n = counts[*((unsigned int *) b)].calls;
|
||||
|
||||
return (m < n) ? 1 : (m > n) ? -1 : 0;
|
||||
}
|
||||
|
||||
static int
|
||||
error_cmp(const void *a, const void *b)
|
||||
{
|
||||
unsigned int m = counts[*((unsigned int *) a)].errors;
|
||||
unsigned int n = counts[*((unsigned int *) b)].errors;
|
||||
|
||||
return (m < n) ? 1 : (m > n) ? -1 : 0;
|
||||
}
|
||||
|
||||
static int (*sortfun)(const void *a, const void *b);
|
||||
|
||||
void
|
||||
set_sortby(const char *sortby)
|
||||
{
|
||||
if (strcmp(sortby, "time") == 0)
|
||||
sortfun = time_cmp;
|
||||
else if (strcmp(sortby, "calls") == 0)
|
||||
sortfun = count_cmp;
|
||||
else if (strcmp(sortby, "name") == 0)
|
||||
sortfun = syscall_cmp;
|
||||
else if (strcmp(sortby, "nothing") == 0)
|
||||
sortfun = NULL;
|
||||
else {
|
||||
error_msg_and_help("invalid sortby: '%s'", sortby);
|
||||
static const struct {
|
||||
int (*fn)(const void *a, const void *b);
|
||||
const char *name;
|
||||
} sort_fns[] = {
|
||||
{ time_cmp, "time" },
|
||||
{ time_cmp, "time_total" },
|
||||
{ time_cmp, "total_time" },
|
||||
{ min_time_cmp, "min_time" },
|
||||
{ min_time_cmp, "time_min" },
|
||||
{ max_time_cmp, "max_time" },
|
||||
{ max_time_cmp, "time_max" },
|
||||
{ avg_time_cmp, "avg_time" },
|
||||
{ avg_time_cmp, "time_avg" },
|
||||
{ count_cmp, "count" },
|
||||
{ count_cmp, "calls" },
|
||||
{ error_cmp, "errors" },
|
||||
{ error_cmp, "error" },
|
||||
{ syscall_cmp, "name" },
|
||||
{ syscall_cmp, "syscall_name" },
|
||||
{ syscall_cmp, "syscall" },
|
||||
{ NULL, "nothing" },
|
||||
{ NULL, "none" },
|
||||
};
|
||||
|
||||
for (size_t i = 0; i < ARRAY_SIZE(sort_fns); i++) {
|
||||
if (strcmp(sort_fns[i].name, sortby))
|
||||
continue;
|
||||
|
||||
sortfun = sort_fns[i].fn;
|
||||
return;
|
||||
}
|
||||
|
||||
error_msg_and_help("invalid sortby: '%s'", sortby);
|
||||
}
|
||||
|
||||
void set_overhead(int n)
|
||||
void
|
||||
set_count_summary_columns(const char *s)
|
||||
{
|
||||
overhead.tv_sec = n / 1000000;
|
||||
overhead.tv_nsec = n % 1000000 * 1000;
|
||||
static const char *cnames[] = {
|
||||
[CSC_TIME_100S] = "time_percent",
|
||||
[CSC_TIME_TOTAL] = "total_time",
|
||||
[CSC_TIME_MIN] = "min_time",
|
||||
[CSC_TIME_MAX] = "max_time",
|
||||
[CSC_TIME_AVG] = "avg_time",
|
||||
[CSC_CALLS] = "calls",
|
||||
[CSC_ERRORS] = "errors",
|
||||
[CSC_SC_NAME] = "syscall",
|
||||
};
|
||||
|
||||
const char *pos = s;
|
||||
const char *prev = s;
|
||||
size_t cur = 0;
|
||||
|
||||
memset(columns, 0, sizeof(columns));
|
||||
memset(visible, 0, sizeof(visible));
|
||||
|
||||
do {
|
||||
bool found = false;
|
||||
|
||||
pos = strchr(prev, ',');
|
||||
|
||||
for (size_t i = 0; i < ARRAY_SIZE(cnames); i++) {
|
||||
if (!cnames[i] || (pos
|
||||
? ((size_t) (pos - prev) != strlen(cnames[i]))
|
||||
|| strncmp(prev, cnames[i], pos - prev)
|
||||
: strcmp(prev, cnames[i]))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (visible[i])
|
||||
error_msg_and_help("call summary column "
|
||||
"has been provided more "
|
||||
"than once: '%s' (-U option "
|
||||
"residual: '%s')",
|
||||
cnames[i], prev);
|
||||
|
||||
columns[cur++] = i;
|
||||
visible[i] = 1;
|
||||
found = true;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (!found)
|
||||
error_msg_and_help("unknown column name: '%.*s'",
|
||||
(int) (pos ? pos - prev : INT_MAX),
|
||||
prev);
|
||||
|
||||
prev = pos + 1;
|
||||
} while (pos);
|
||||
}
|
||||
|
||||
void
|
||||
set_overhead(const char *str)
|
||||
{
|
||||
if (parse_ts(str, &overhead) < 0)
|
||||
error_msg_and_help("invalid -O argument: '%s'", str);
|
||||
}
|
||||
|
||||
static size_t ATTRIBUTE_FORMAT((printf, 1, 2))
|
||||
num_chars(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
int ret = vsnprintf(NULL, 0, fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
return (unsigned int) MAX(ret, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
call_summary_pers(FILE *outf)
|
||||
{
|
||||
static const char dashes[] = "----------------";
|
||||
static const char header[] = "%6.6s %11.11s %11.11s %9.9s %9.9s %s\n";
|
||||
static const char data[] = "%6.2f %11.6f %11lu %9u %9.u %s\n";
|
||||
static const char summary[] = "%6.6s %11.6f %11.11s %9u %9.u %s\n";
|
||||
enum column_flags {
|
||||
CF_L = 1 << 0, /* Left-aligned column */
|
||||
};
|
||||
static const struct {
|
||||
const char *s;
|
||||
size_t sz;
|
||||
const char *fmt;
|
||||
uint32_t flags;
|
||||
} cdesc[] = {
|
||||
[CSC_TIME_100S] = { ARRSZ_PAIR("% time"), "%*.2f" },
|
||||
[CSC_TIME_TOTAL] = { ARRSZ_PAIR("seconds"), "%*.6f" },
|
||||
[CSC_TIME_MIN] = { ARRSZ_PAIR("shortest"), "%*.6f" },
|
||||
[CSC_TIME_MAX] = { ARRSZ_PAIR("longest"), "%*.6f" },
|
||||
[CSC_TIME_AVG] = { ARRSZ_PAIR("usecs/call"), "%*lu" },
|
||||
[CSC_CALLS] = { ARRSZ_PAIR("calls"), "%*" PRIu64 },
|
||||
[CSC_ERRORS] = { ARRSZ_PAIR("errors"), "%*" PRIu64 },
|
||||
[CSC_SC_NAME] = { ARRSZ_PAIR("syscall"), "%-*s", CF_L },
|
||||
};
|
||||
|
||||
unsigned int i;
|
||||
unsigned int call_cum, error_cum;
|
||||
struct timespec tv_cum, dtv;
|
||||
double float_tv_cum;
|
||||
double percent;
|
||||
unsigned int *sorted_count;
|
||||
unsigned int *indices;
|
||||
|
||||
fprintf(outf, header,
|
||||
"% time", "seconds", "usecs/call",
|
||||
"calls", "errors", "syscall");
|
||||
fprintf(outf, header, dashes, dashes, dashes, dashes, dashes, dashes);
|
||||
struct timespec tv_cum = zero_ts;
|
||||
struct timespec tv_min = max_ts;
|
||||
struct timespec tv_max = zero_ts;
|
||||
uint64_t call_cum = 0;
|
||||
uint64_t error_cum = 0;
|
||||
|
||||
sorted_count = xcalloc(sizeof(sorted_count[0]), nsyscalls);
|
||||
call_cum = error_cum = tv_cum.tv_sec = tv_cum.tv_nsec = 0;
|
||||
for (i = 0; i < nsyscalls; i++) {
|
||||
sorted_count[i] = i;
|
||||
if (counts == NULL || counts[i].calls == 0)
|
||||
double float_tv_cum;
|
||||
double percent;
|
||||
|
||||
double ts_avg_max = 0;
|
||||
size_t sc_name_max = 0;
|
||||
|
||||
|
||||
/* sort, calculate statistics */
|
||||
indices = xcalloc(sizeof(indices[0]), nsyscalls);
|
||||
for (size_t i = 0; i < nsyscalls; i++) {
|
||||
struct timespec dtv;
|
||||
|
||||
indices[i] = i;
|
||||
if (counts[i].calls == 0)
|
||||
continue;
|
||||
ts_mul(&dtv, &overhead, counts[i].calls);
|
||||
ts_sub(&counts[i].time, &counts[i].time, &dtv);
|
||||
if (counts[i].time.tv_sec < 0 || counts[i].time.tv_nsec < 0)
|
||||
counts[i].time.tv_sec = counts[i].time.tv_nsec = 0;
|
||||
|
||||
ts_add(&tv_cum, &tv_cum, &counts[i].time);
|
||||
ts_min(&tv_min, &tv_min, &counts[i].time_min);
|
||||
ts_max(&tv_max, &tv_max, &counts[i].time_max);
|
||||
call_cum += counts[i].calls;
|
||||
error_cum += counts[i].errors;
|
||||
ts_add(&tv_cum, &tv_cum, &counts[i].time);
|
||||
|
||||
ts_div(&dtv, &counts[i].time, counts[i].calls);
|
||||
counts[i].time_avg = ts_float(&dtv);
|
||||
|
||||
ts_avg_max = MAX(ts_avg_max, counts[i].time_avg);
|
||||
sc_name_max = MAX(sc_name_max, strlen(sysent[i].sys_name));
|
||||
}
|
||||
float_tv_cum = ts_float(&tv_cum);
|
||||
if (counts) {
|
||||
if (sortfun)
|
||||
qsort((void *) sorted_count, nsyscalls,
|
||||
sizeof(sorted_count[0]), sortfun);
|
||||
for (i = 0; i < nsyscalls; i++) {
|
||||
double float_syscall_time;
|
||||
unsigned int idx = sorted_count[i];
|
||||
struct call_counts *cc = &counts[idx];
|
||||
if (cc->calls == 0)
|
||||
continue;
|
||||
ts_div(&dtv, &cc->time, cc->calls);
|
||||
float_syscall_time = ts_float(&cc->time);
|
||||
percent = (100.0 * float_syscall_time);
|
||||
if (percent != 0.0)
|
||||
percent /= float_tv_cum;
|
||||
/* else: float_tv_cum can be 0.0 too and we get 0/0 = NAN */
|
||||
fprintf(outf, data,
|
||||
percent, float_syscall_time,
|
||||
(long) (1000000 * dtv.tv_sec + dtv.tv_nsec / 1000),
|
||||
cc->calls, cc->errors, sysent[idx].sys_name);
|
||||
|
||||
if (sortfun)
|
||||
qsort((void *) indices, nsyscalls, sizeof(indices[0]), sortfun);
|
||||
|
||||
/* calculate column widths */
|
||||
#define W_(c_, v_) [c_] = MAX((cdesc[c_].sz - 1), (v_))
|
||||
unsigned int cwidths[CSC_MAX] = {
|
||||
W_(CSC_TIME_100S, sizeof("100.00") - 1),
|
||||
W_(CSC_TIME_TOTAL, num_chars("%.6f", float_tv_cum)),
|
||||
W_(CSC_TIME_MIN, num_chars("%ld.000000", tv_min.tv_sec)),
|
||||
W_(CSC_TIME_MAX, num_chars("%ld.000000", tv_max.tv_sec)),
|
||||
W_(CSC_TIME_AVG, num_chars("%lu", (unsigned long)
|
||||
(ts_avg_max * 1e6))),
|
||||
W_(CSC_CALLS, num_chars("%" PRIu64, call_cum)),
|
||||
W_(CSC_ERRORS, num_chars("%" PRIu64, error_cum)),
|
||||
W_(CSC_SC_NAME, sc_name_max + 1),
|
||||
};
|
||||
#undef W_
|
||||
|
||||
/* header */
|
||||
for (size_t i = 0; columns[i] && i < ARRAY_SIZE(columns); i++) {
|
||||
const char *fmt = cdesc[columns[i]].flags & CF_L
|
||||
? "%s%-*s" : "%s%*s";
|
||||
fprintf(outf, fmt, i ? " " : "", cwidths[columns[i]],
|
||||
cdesc[columns[i]].s);
|
||||
}
|
||||
fputc('\n', outf);
|
||||
|
||||
for (size_t i = 0; columns[i] && i < ARRAY_SIZE(columns); i++) {
|
||||
if (i)
|
||||
fputc(' ', outf);
|
||||
|
||||
for (size_t j = 0; j < cwidths[columns[i]]; j++)
|
||||
fputc('-', outf);
|
||||
}
|
||||
fputc('\n', outf);
|
||||
|
||||
/* data output */
|
||||
for (size_t i = 0; i < nsyscalls; i++) {
|
||||
unsigned int idx = indices[i];
|
||||
struct call_counts *cc = &counts[idx];
|
||||
double float_syscall_time;
|
||||
|
||||
if (cc->calls == 0)
|
||||
continue;
|
||||
|
||||
float_syscall_time = ts_float(&cc->time);
|
||||
percent = (100.0 * float_syscall_time);
|
||||
/* else: float_tv_cum can be 0.0 too and we get 0/0 = NAN */
|
||||
if (percent != 0.0)
|
||||
percent /= float_tv_cum;
|
||||
|
||||
for (size_t i = 0; columns[i] && i < ARRAY_SIZE(columns); i++) {
|
||||
const size_t c = columns[i];
|
||||
if (i)
|
||||
fputc(' ', outf);
|
||||
|
||||
#define PC_(c_, val_) \
|
||||
case (c_): fprintf(outf, cdesc[c].fmt, cwidths[c], (val_)); break;
|
||||
|
||||
switch (c) {
|
||||
PC_(CSC_TIME_100S, percent)
|
||||
PC_(CSC_TIME_TOTAL, float_syscall_time)
|
||||
PC_(CSC_TIME_MIN, ts_float(&cc->time_min))
|
||||
PC_(CSC_TIME_MAX, ts_float(&cc->time_max))
|
||||
PC_(CSC_TIME_AVG, (long) (cc->time_avg * 1e6))
|
||||
PC_(CSC_CALLS, cc->calls)
|
||||
case CSC_ERRORS:
|
||||
if (cc->errors)
|
||||
fprintf(outf, cdesc[c].fmt,
|
||||
cwidths[c], cc->errors);
|
||||
else
|
||||
fprintf(outf, "%*s", cwidths[c], "");
|
||||
break;
|
||||
PC_(CSC_SC_NAME, sysent[idx].sys_name)
|
||||
}
|
||||
}
|
||||
fputc('\n', outf);
|
||||
}
|
||||
|
||||
free(indices);
|
||||
|
||||
/* footer */
|
||||
for (size_t i = 0; columns[i] && i < ARRAY_SIZE(columns); i++) {
|
||||
if (i)
|
||||
fputc(' ', outf);
|
||||
|
||||
for (size_t j = 0; j < cwidths[columns[i]]; j++)
|
||||
fputc('-', outf);
|
||||
}
|
||||
fputc('\n', outf);
|
||||
|
||||
/* totals */
|
||||
for (size_t i = 0; columns[i] && i < ARRAY_SIZE(columns); i++) {
|
||||
const size_t c = columns[i];
|
||||
if (i)
|
||||
fputc(' ', outf);
|
||||
|
||||
switch (c) {
|
||||
PC_(CSC_TIME_100S, 100.0)
|
||||
PC_(CSC_TIME_TOTAL, float_tv_cum)
|
||||
PC_(CSC_TIME_MIN, ts_float(&tv_min))
|
||||
PC_(CSC_TIME_MAX, ts_float(&tv_max))
|
||||
PC_(CSC_TIME_AVG,
|
||||
(unsigned long) (float_tv_cum / call_cum * 1e6))
|
||||
PC_(CSC_CALLS, call_cum)
|
||||
PC_(CSC_ERRORS, error_cum)
|
||||
PC_(CSC_SC_NAME, "total")
|
||||
}
|
||||
}
|
||||
free(sorted_count);
|
||||
fputc('\n', outf);
|
||||
|
||||
fprintf(outf, header, dashes, dashes, dashes, dashes, dashes, dashes);
|
||||
fprintf(outf, summary,
|
||||
"100.00", float_tv_cum, "",
|
||||
call_cum, error_cum, "total");
|
||||
#undef PC_
|
||||
}
|
||||
|
||||
void
|
||||
|
224
defs.h
224
defs.h
@ -53,6 +53,8 @@
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#define HAVE_FINISH_LINE
|
||||
|
||||
#include "arch_defs.h"
|
||||
#include "error_prints.h"
|
||||
#include "gcc_compat.h"
|
||||
@ -230,8 +232,9 @@ struct tcb {
|
||||
const struct_sysent *s_prev_ent; /* for "resuming interrupted SYSCALL" msg */
|
||||
struct inject_opts *inject_vec[SUPPORTED_PERSONALITIES];
|
||||
struct timespec stime; /* System time usage as of last process wait */
|
||||
struct timespec dtime; /* Delta for system time usage */
|
||||
struct timespec etime; /* Syscall entry time */
|
||||
struct timespec ltime; /* System time usage as of last syscall entry */
|
||||
struct timespec atime; /* System time right after attach */
|
||||
struct timespec etime; /* Syscall entry time (CLOCK_MONOTONIC) */
|
||||
struct timespec delay_expiration_time; /* When does the delay end */
|
||||
|
||||
struct mmap_cache_t *mmap_cache;
|
||||
@ -277,6 +280,8 @@ struct tcb {
|
||||
#define TCB_DELAYED 0x1000 /* Current syscall has been delayed */
|
||||
#define TCB_TAMPERED_NO_FAIL 0x2000 /* We tamper tcb with syscall
|
||||
that should not fail. */
|
||||
#define TCB_PTRACEOPTS_APPLIED 0x40000 /* Our PTRACE_SETOPTIONS have taken
|
||||
their effect. */
|
||||
|
||||
/* qualifier flags */
|
||||
#define QUAL_TRACE 0x001 /* this system call should be traced */
|
||||
@ -302,34 +307,18 @@ struct tcb {
|
||||
#define inject_delay_exit(tcp) ((tcp)->flags & TCB_INJECT_DELAY_EXIT)
|
||||
#define syscall_delayed(tcp) ((tcp)->flags & TCB_DELAYED)
|
||||
#define syscall_tampered_nofail(tcp) ((tcp)->flags & TCB_TAMPERED_NO_FAIL)
|
||||
#define ptraceopts_applied(tcp) ((tcp)->flags & TCB_PTRACEOPTS_APPLIED)
|
||||
|
||||
#include "xlat.h"
|
||||
|
||||
extern const struct xlat addrfams[];
|
||||
|
||||
/** Protocol hardware identifiers array, sorted, defined in sockaddr.c. */
|
||||
extern const struct xlat arp_hardware_types[];
|
||||
/** Protocol hardware identifiers array size without terminating record. */
|
||||
extern const size_t arp_hardware_types_size;
|
||||
|
||||
extern const struct xlat at_flags[];
|
||||
extern const struct xlat clocknames[];
|
||||
extern const struct xlat dirent_types[];
|
||||
|
||||
/** Ethernet protocols list, sorted, defined in sockaddr.c. */
|
||||
extern const struct xlat ethernet_protocols[];
|
||||
/** Ethernet protocols array size without terminating record. */
|
||||
extern const size_t ethernet_protocols_size;
|
||||
|
||||
/** IP protocols list, sorted, defined in net.c. */
|
||||
extern const struct xlat inet_protocols[];
|
||||
/** IP protocols array size without terminating record. */
|
||||
extern const size_t inet_protocols_size;
|
||||
|
||||
extern const struct xlat evdev_abs[];
|
||||
/** Number of elements in evdev_abs array without the terminating record. */
|
||||
extern const size_t evdev_abs_size;
|
||||
|
||||
extern const struct xlat evdev_ev[];
|
||||
extern const struct xlat iffflags[];
|
||||
extern const struct xlat ip_type_of_services[];
|
||||
@ -340,10 +329,13 @@ extern const struct xlat nl_netfilter_msg_types[];
|
||||
extern const struct xlat nl_route_types[];
|
||||
extern const struct xlat open_access_modes[];
|
||||
extern const struct xlat open_mode_flags[];
|
||||
extern const struct xlat pollflags[];
|
||||
extern const struct xlat resource_flags[];
|
||||
extern const struct xlat route_nexthop_flags[];
|
||||
extern const struct xlat routing_scopes[];
|
||||
extern const struct xlat routing_table_ids[];
|
||||
extern const struct xlat routing_types[];
|
||||
extern const struct xlat rwf_flags[];
|
||||
extern const struct xlat seccomp_filter_flags[];
|
||||
extern const struct xlat seccomp_ret_action[];
|
||||
extern const struct xlat setns_types[];
|
||||
@ -359,6 +351,8 @@ extern const struct xlat whence_codes[];
|
||||
#define RVAL_HEX 001 /* hex format */
|
||||
#define RVAL_OCTAL 002 /* octal format */
|
||||
#define RVAL_FD 010 /* file descriptor */
|
||||
#define RVAL_UID 011 /* UID */
|
||||
#define RVAL_GID 012 /* GID */
|
||||
#define RVAL_MASK 013 /* mask for these values */
|
||||
|
||||
#define RVAL_STR 020 /* Print `auxstr' field after return val */
|
||||
@ -374,16 +368,61 @@ extern const struct xlat whence_codes[];
|
||||
|
||||
#define indirect_ipccall(tcp) (tcp->s_ent->sys_flags & TRACE_INDIRECT_SUBCALL)
|
||||
|
||||
|
||||
extern void socket_exiting_cb(struct tcb *tcp);
|
||||
|
||||
extern void set_netlink_family_cache_entry(uint64_t inode, uint8_t family);
|
||||
extern int get_netlink_family_cache_entry(uint64_t inode);
|
||||
extern void invalidate_netlink_family_cache_entry(uint64_t inode);
|
||||
|
||||
enum sock_proto {
|
||||
SOCK_PROTO_UNKNOWN,
|
||||
SOCK_PROTO_UNIX,
|
||||
SOCK_PROTO_TCP,
|
||||
SOCK_PROTO_UDP,
|
||||
SOCK_PROTO_UDPLITE,
|
||||
SOCK_PROTO_DCCP,
|
||||
SOCK_PROTO_SCTP,
|
||||
SOCK_PROTO_L2TP_IP,
|
||||
SOCK_PROTO_PING,
|
||||
SOCK_PROTO_RAW,
|
||||
SOCK_PROTO_TCPv6,
|
||||
SOCK_PROTO_UDPv6,
|
||||
SOCK_PROTO_NETLINK
|
||||
SOCK_PROTO_UDPLITEv6,
|
||||
SOCK_PROTO_DCCPv6,
|
||||
SOCK_PROTO_L2TP_IPv6,
|
||||
SOCK_PROTO_SCTPv6,
|
||||
SOCK_PROTO_PINGv6,
|
||||
SOCK_PROTO_RAWv6,
|
||||
SOCK_PROTO_NETLINK,
|
||||
SOCK_PROTO_AX25,
|
||||
SOCK_PROTO_DDP,
|
||||
SOCK_PROTO_NETROM,
|
||||
SOCK_PROTO_PACKET,
|
||||
SOCK_PROTO_ROSE,
|
||||
SOCK_PROTO_X25,
|
||||
};
|
||||
extern enum sock_proto get_proto_by_name(const char *);
|
||||
extern int get_family_by_proto(enum sock_proto proto);
|
||||
|
||||
enum fileops {
|
||||
FILEOP_READ,
|
||||
FILEOP_WRITE,
|
||||
};
|
||||
|
||||
typedef bool (*filebuf_decoder_fn)(struct tcb *tcp, int fd, const char *fdpath,
|
||||
enum fileops op, kernel_ulong_t addr,
|
||||
kernel_ulong_t addrlen);
|
||||
|
||||
extern bool decode_fanotify_read(struct tcb *tcp, int fd, const char *fdpath,
|
||||
enum fileops op, kernel_ulong_t addr,
|
||||
kernel_ulong_t addrlen);
|
||||
extern bool decode_fanotify_write(struct tcb *tcp, int fd, const char *fdpath,
|
||||
enum fileops op, kernel_ulong_t addr,
|
||||
kernel_ulong_t addrlen);
|
||||
extern bool decode_inotify_read(struct tcb *tcp, int fd, const char *fdpath,
|
||||
enum fileops op, kernel_ulong_t addr,
|
||||
kernel_ulong_t addrlen);
|
||||
|
||||
enum iov_decode {
|
||||
IOV_DECODE_ADDR,
|
||||
@ -425,7 +464,8 @@ extern unsigned os_release;
|
||||
extern int read_int_from_file(struct tcb *, const char *, int *);
|
||||
|
||||
extern void set_sortby(const char *);
|
||||
extern void set_overhead(int);
|
||||
extern void set_overhead(const char *);
|
||||
extern void set_count_summary_columns(const char *columns);
|
||||
extern void print_pc(struct tcb *);
|
||||
|
||||
extern int syscall_entering_decode(struct tcb *);
|
||||
@ -441,6 +481,7 @@ extern void call_summary(FILE *);
|
||||
|
||||
extern void clear_regs(struct tcb *tcp);
|
||||
extern int get_scno(struct tcb *);
|
||||
extern int get_syscall_result(struct tcb *, bool);
|
||||
extern kernel_ulong_t get_rt_sigframe_addr(struct tcb *);
|
||||
|
||||
/**
|
||||
@ -471,6 +512,14 @@ extern kernel_long_t scno_by_name(const char *s, unsigned p,
|
||||
*/
|
||||
extern kernel_ulong_t shuffle_scno(kernel_ulong_t scno);
|
||||
extern const char *err_name(unsigned long err);
|
||||
/**
|
||||
* Print error name in accordance with current xlat style setting.
|
||||
*
|
||||
* @param err Error value.
|
||||
* @param negated If set to true, negative values of the err parameter indicate
|
||||
* error condition, otherwise positive.
|
||||
*/
|
||||
extern void print_err(long err, bool negated);
|
||||
|
||||
extern bool is_erestart(struct tcb *);
|
||||
extern void temporarily_clear_syserror(struct tcb *);
|
||||
@ -600,8 +649,7 @@ extern unsigned long getfdinode(struct tcb *, int);
|
||||
extern enum sock_proto getfdproto(struct tcb *, int);
|
||||
|
||||
extern const char *xlookup(const struct xlat *, const uint64_t);
|
||||
extern const char *xlat_search(const struct xlat *, const size_t, const uint64_t);
|
||||
extern const char *xlat_idx(const struct xlat *xlat, size_t nmemb, uint64_t val);
|
||||
extern const char *xlookup_le(const struct xlat *, uint64_t *);
|
||||
|
||||
struct dyxlat;
|
||||
struct dyxlat *dyxlat_alloc(size_t nmemb);
|
||||
@ -609,7 +657,7 @@ void dyxlat_free(struct dyxlat *);
|
||||
const struct xlat *dyxlat_get(const struct dyxlat *);
|
||||
void dyxlat_add_pair(struct dyxlat *, uint64_t val, const char *str, size_t len);
|
||||
|
||||
const struct xlat *genl_families_xlat(struct tcb *tcp);
|
||||
const char *genl_get_family_name(struct tcb *tcp, uint16_t id);
|
||||
|
||||
extern unsigned long get_pagesize(void);
|
||||
extern int next_set_bit(const void *bit_array, unsigned cur_bit, unsigned size_bits);
|
||||
@ -673,46 +721,8 @@ extern int printxvals_ex(uint64_t val, const char *dflt,
|
||||
ATTRIBUTE_SENTINEL;
|
||||
#define printxvals(val_, dflt_, ...) \
|
||||
printxvals_ex((val_), (dflt_), XLAT_STYLE_DEFAULT, __VA_ARGS__)
|
||||
|
||||
extern int printxval_searchn_ex(const struct xlat *, size_t xlat_size,
|
||||
uint64_t val, const char *dflt,
|
||||
enum xlat_style);
|
||||
|
||||
static inline int
|
||||
printxval_searchn(const struct xlat *xlat, size_t xlat_size, uint64_t val,
|
||||
const char *dflt)
|
||||
{
|
||||
return printxval_searchn_ex(xlat, xlat_size, val, dflt,
|
||||
XLAT_STYLE_DEFAULT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper around printxval_searchn that passes ARRAY_SIZE - 1
|
||||
* as the array size, as all arrays are XLAT_END-terminated and
|
||||
* printxval_searchn expects a size without the terminating record.
|
||||
*/
|
||||
#define printxval_search(xlat__, val__, dflt__) \
|
||||
printxval_searchn(xlat__, ARRAY_SIZE(xlat__) - 1, val__, dflt__)
|
||||
#define printxval_search_ex(xlat__, val__, dflt__, style__) \
|
||||
printxval_searchn_ex((xlat__), ARRAY_SIZE(xlat__) - 1, (val__), \
|
||||
(dflt__), (style__))
|
||||
|
||||
extern int printxval_indexn_ex(const struct xlat *, size_t xlat_size,
|
||||
uint64_t val, const char *dflt, enum xlat_style);
|
||||
|
||||
static inline int
|
||||
printxval_indexn(const struct xlat *xlat, size_t xlat_size, uint64_t val,
|
||||
const char *dflt)
|
||||
{
|
||||
return printxval_indexn_ex(xlat, xlat_size, val, dflt,
|
||||
XLAT_STYLE_DEFAULT);
|
||||
}
|
||||
|
||||
#define printxval_index(xlat__, val__, dflt__) \
|
||||
printxval_indexn(xlat__, ARRAY_SIZE(xlat__) - 1, val__, dflt__)
|
||||
#define printxval_index_ex(xlat__, val__, dflt__) \
|
||||
printxval_indexn_ex((xlat__), ARRAY_SIZE(xlat__) - 1, (val__), \
|
||||
(dflt__), XLAT_STYLE_DEFAULT)
|
||||
#define printxval_ex(xlat_, val_, dflt_, style_) \
|
||||
printxvals_ex((val_), (dflt_), (style_), (xlat_), NULL)
|
||||
|
||||
extern int sprintxval_ex(char *buf, size_t size, const struct xlat *,
|
||||
unsigned int val, const char *dflt, enum xlat_style);
|
||||
@ -724,16 +734,25 @@ sprintxval(char *buf, size_t size, const struct xlat *xlat, unsigned int val,
|
||||
return sprintxval_ex(buf, size, xlat, val, dflt, XLAT_STYLE_DEFAULT);
|
||||
}
|
||||
|
||||
extern void printxval_dispatch_ex(const struct xlat *, size_t xlat_size,
|
||||
uint64_t val, const char *dflt,
|
||||
enum xlat_type, enum xlat_style);
|
||||
static inline void
|
||||
printxval_dispatch(const struct xlat *xlat, size_t xlat_size, uint64_t val,
|
||||
const char *dflt, enum xlat_type xt)
|
||||
{
|
||||
return printxval_dispatch_ex(xlat, xlat_size, val, dflt, xt,
|
||||
XLAT_STYLE_DEFAULT);
|
||||
}
|
||||
enum xlat_style_private_flag_bits {
|
||||
/* print_array */
|
||||
PAF_PRINT_INDICES_BIT = XLAT_STYLE_SPEC_BITS + 1,
|
||||
|
||||
/* print_xlat */
|
||||
PXF_DEFAULT_STR_BIT,
|
||||
};
|
||||
|
||||
#define FLAG_(name_) name_ = 1 << name_##_BIT
|
||||
|
||||
enum xlat_style_private_flags {
|
||||
/* print_array */
|
||||
FLAG_(PAF_PRINT_INDICES),
|
||||
|
||||
/* print_xlat */
|
||||
FLAG_(PXF_DEFAULT_STR),
|
||||
};
|
||||
|
||||
#undef FLAG_
|
||||
|
||||
/** Print a value in accordance with xlat formatting settings. */
|
||||
extern void print_xlat_ex(uint64_t val, const char *str, enum xlat_style style);
|
||||
@ -754,25 +773,32 @@ extern int printflags_ex(uint64_t flags, const char *dflt,
|
||||
enum xlat_style, const struct xlat *, ...)
|
||||
ATTRIBUTE_SENTINEL;
|
||||
extern const char *sprintflags_ex(const char *prefix, const struct xlat *,
|
||||
uint64_t flags, enum xlat_style);
|
||||
uint64_t flags, char sep, enum xlat_style);
|
||||
|
||||
static inline const char *
|
||||
sprintflags(const char *prefix, const struct xlat *xlat, uint64_t flags)
|
||||
{
|
||||
return sprintflags_ex(prefix, xlat, flags, XLAT_STYLE_DEFAULT);
|
||||
return sprintflags_ex(prefix, xlat, flags, '\0', XLAT_STYLE_DEFAULT);
|
||||
}
|
||||
|
||||
extern const char *sprinttime(long long sec);
|
||||
extern const char *sprinttime_nsec(long long sec, unsigned long long nsec);
|
||||
extern const char *sprinttime_usec(long long sec, unsigned long long usec);
|
||||
|
||||
#ifndef MAX_ADDR_LEN
|
||||
# define MAX_ADDR_LEN 32
|
||||
#endif
|
||||
|
||||
extern const char *sprint_mac_addr(const uint8_t addr[], size_t size);
|
||||
extern const char *sprint_hwaddr(const uint8_t addr[], size_t size,
|
||||
uint32_t devtype);
|
||||
|
||||
extern void print_symbolic_mode_t(unsigned int);
|
||||
extern void print_numeric_umode_t(unsigned short);
|
||||
extern void print_numeric_long_umask(unsigned long);
|
||||
extern void print_dev_t(unsigned long long dev);
|
||||
extern void print_abnormal_hi(kernel_ulong_t);
|
||||
extern void print_ioprio(unsigned int ioprio);
|
||||
|
||||
extern bool print_int32_array_member(struct tcb *, void *elem_buf,
|
||||
size_t elem_size, void *data);
|
||||
@ -786,21 +812,6 @@ typedef bool (*tfetch_mem_fn)(struct tcb *, kernel_ulong_t addr,
|
||||
typedef bool (*print_fn)(struct tcb *, void *elem_buf,
|
||||
size_t elem_size, void *opaque_data);
|
||||
|
||||
enum print_array_flag_bits {
|
||||
PAF_PRINT_INDICES_BIT = XLAT_STYLE_SPEC_BITS + 1,
|
||||
PAF_INDEX_XLAT_SORTED_BIT,
|
||||
PAF_INDEX_XLAT_VALUE_INDEXED_BIT,
|
||||
};
|
||||
|
||||
#define FLAG_(name_) name_ = 1 << name_##_BIT
|
||||
|
||||
enum print_array_flags {
|
||||
FLAG_(PAF_PRINT_INDICES),
|
||||
FLAG_(PAF_INDEX_XLAT_SORTED),
|
||||
FLAG_(PAF_INDEX_XLAT_VALUE_INDEXED),
|
||||
};
|
||||
|
||||
#undef FLAG_
|
||||
|
||||
/**
|
||||
* @param flags Combination of xlat style settings and additional flags from
|
||||
@ -817,7 +828,6 @@ print_array_ex(struct tcb *,
|
||||
void *opaque_data,
|
||||
unsigned int flags,
|
||||
const struct xlat *index_xlat,
|
||||
size_t index_xlat_size,
|
||||
const char *index_dflt);
|
||||
|
||||
static inline bool
|
||||
@ -832,7 +842,7 @@ print_array(struct tcb *const tcp,
|
||||
{
|
||||
return print_array_ex(tcp, start_addr, nmemb, elem_buf, elem_size,
|
||||
tfetch_mem_func, print_func, opaque_data,
|
||||
0, NULL, 0, NULL);
|
||||
0, NULL, NULL);
|
||||
}
|
||||
|
||||
extern kernel_ulong_t *
|
||||
@ -869,7 +879,11 @@ print_inet_addr(int af, const void *addr, unsigned int len, const char *var_name
|
||||
extern bool
|
||||
decode_inet_addr(struct tcb *, kernel_ulong_t addr,
|
||||
unsigned int len, int family, const char *var_name);
|
||||
extern void print_ax25_addr(const void /* ax25_address */ *addr);
|
||||
extern void print_x25_addr(const void /* struct x25_address */ *addr);
|
||||
extern void print_rose_addr(const void /* rose_address */ *addr);
|
||||
extern const char *get_sockaddr_by_inode(struct tcb *, int fd, unsigned long inode);
|
||||
extern const char *get_sockdata_by_inode(struct tcb *, int fd, unsigned long inode);
|
||||
extern bool print_sockaddr_by_inode(struct tcb *, int fd, unsigned long inode);
|
||||
extern void print_dirfd(struct tcb *, int);
|
||||
|
||||
@ -877,6 +891,7 @@ extern int
|
||||
decode_sockaddr(struct tcb *, kernel_ulong_t addr, int addrlen);
|
||||
|
||||
extern void printuid(const char *, const unsigned int);
|
||||
extern void printgid(const char *, const unsigned int);
|
||||
|
||||
extern void
|
||||
print_sigset_addr_len(struct tcb *, kernel_ulong_t addr, kernel_ulong_t len);
|
||||
@ -927,6 +942,7 @@ fetch_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr);
|
||||
extern void
|
||||
print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr);
|
||||
|
||||
extern const char *get_ifname(const unsigned int ifindex);
|
||||
extern void print_ifindex(unsigned int);
|
||||
|
||||
extern void print_bpf_filter_code(const uint16_t code, bool extended);
|
||||
@ -984,6 +1000,9 @@ extern void ts_add(struct timespec *, const struct timespec *, const struct time
|
||||
extern void ts_sub(struct timespec *, const struct timespec *, const struct timespec *);
|
||||
extern void ts_mul(struct timespec *, const struct timespec *, int);
|
||||
extern void ts_div(struct timespec *, const struct timespec *, int);
|
||||
extern void ts_min(struct timespec *, const struct timespec *, const struct timespec *);
|
||||
extern void ts_max(struct timespec *, const struct timespec *, const struct timespec *);
|
||||
extern int parse_ts(const char *s, struct timespec *t);
|
||||
|
||||
#ifdef ENABLE_STACKTRACE
|
||||
extern void unwind_init(void);
|
||||
@ -1070,12 +1089,12 @@ typedef struct {
|
||||
int tv_sec, tv_usec;
|
||||
} timeval32_t;
|
||||
|
||||
extern void print_timeval32_t(const timeval32_t *);
|
||||
extern void print_timeval32_t(const timeval32_t *, bool rtc);
|
||||
extern void printrusage32(struct tcb *, kernel_ulong_t);
|
||||
extern const char *sprint_timeval32(struct tcb *, kernel_ulong_t addr);
|
||||
extern void print_timeval32(struct tcb *, kernel_ulong_t addr);
|
||||
extern void print_timeval32(struct tcb *, kernel_ulong_t addr, bool rtc);
|
||||
extern void print_timeval32_utimes(struct tcb *, kernel_ulong_t addr);
|
||||
extern void print_itimerval32(struct tcb *, kernel_ulong_t addr);
|
||||
extern void print_itimerval32(struct tcb *, kernel_ulong_t addr, bool rtc);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRUCT_USER_DESC
|
||||
@ -1135,6 +1154,14 @@ print_mac_addr(const char *prefix, const uint8_t addr[], size_t size)
|
||||
tprints(sprint_mac_addr(addr, size));
|
||||
}
|
||||
|
||||
static inline void
|
||||
print_hwaddr(const char *prefix, const uint8_t addr[], size_t size,
|
||||
uint32_t devtype)
|
||||
{
|
||||
tprints(prefix);
|
||||
tprints(sprint_hwaddr(addr, size, devtype));
|
||||
}
|
||||
|
||||
#if SUPPORTED_PERSONALITIES > 1
|
||||
extern void set_personality(unsigned int personality);
|
||||
extern unsigned current_personality;
|
||||
@ -1196,6 +1223,10 @@ print_big_u64_addr(const uint64_t addr)
|
||||
|
||||
#define DECL_PRINTNUM(name) \
|
||||
extern bool \
|
||||
printnum_ ## name ## _ex(struct tcb *, kernel_ulong_t addr, \
|
||||
bool addr_cmnt, const char *fmt) \
|
||||
ATTRIBUTE_FORMAT((printf, 4, 0)); \
|
||||
extern bool \
|
||||
printnum_ ## name(struct tcb *, kernel_ulong_t addr, const char *fmt) \
|
||||
ATTRIBUTE_FORMAT((printf, 3, 0)) \
|
||||
/* End of DECL_PRINTNUM definition. */
|
||||
@ -1375,6 +1406,7 @@ extern const char *const errnoent[];
|
||||
extern const char *const signalent[];
|
||||
extern const unsigned int nerrnos;
|
||||
extern const unsigned int nsignals;
|
||||
extern const unsigned int nsig;
|
||||
|
||||
extern const struct_sysent sysent0[];
|
||||
extern const struct_ioctlent ioctlent0[];
|
||||
|
5
delay.c
5
delay.c
@ -66,7 +66,7 @@ alloc_delay_data(void)
|
||||
}
|
||||
|
||||
void
|
||||
fill_delay_data(uint16_t delay_idx, int intval, bool isenter)
|
||||
fill_delay_data(uint16_t delay_idx, struct timespec *val, bool isenter)
|
||||
{
|
||||
if (delay_idx >= delay_data_vec_size)
|
||||
error_func_msg_and_die("delay_idx >= delay_data_vec_size");
|
||||
@ -77,8 +77,7 @@ fill_delay_data(uint16_t delay_idx, int intval, bool isenter)
|
||||
else
|
||||
ts = &(delay_data_vec[delay_idx].ts_exit);
|
||||
|
||||
ts->tv_sec = intval / 1000000;
|
||||
ts->tv_nsec = intval % 1000000 * 1000;
|
||||
*ts = *val;
|
||||
}
|
||||
|
||||
static bool
|
||||
|
2
delay.h
2
delay.h
@ -29,7 +29,7 @@
|
||||
#define STRACE_DELAY_H
|
||||
|
||||
uint16_t alloc_delay_data(void);
|
||||
void fill_delay_data(uint16_t delay_idx, int intval, bool isenter);
|
||||
void fill_delay_data(uint16_t delay_idx, struct timespec *val, bool isenter);
|
||||
bool is_delay_timer_armed(void);
|
||||
void delay_timer_expired(void);
|
||||
void arm_delay_timer(const struct tcb *);
|
||||
|
7
desc.c
7
desc.c
@ -36,6 +36,9 @@ SYS_FUNC(close)
|
||||
{
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
|
||||
uint64_t inode = getfdinode(tcp, tcp->u_arg[0]);
|
||||
invalidate_netlink_family_cache_entry(inode);
|
||||
|
||||
return RVAL_DECODED;
|
||||
}
|
||||
|
||||
@ -72,7 +75,7 @@ SYS_FUNC(dup3)
|
||||
|
||||
static int
|
||||
decode_select(struct tcb *const tcp, const kernel_ulong_t *const args,
|
||||
void (*const print_tv_ts) (struct tcb *, kernel_ulong_t),
|
||||
void (*const print_tv_ts) (struct tcb *, kernel_ulong_t, bool),
|
||||
const char * (*const sprint_tv_ts) (struct tcb *, kernel_ulong_t))
|
||||
{
|
||||
int i, j;
|
||||
@ -125,7 +128,7 @@ decode_select(struct tcb *const tcp, const kernel_ulong_t *const args,
|
||||
}
|
||||
free(fds);
|
||||
tprints(", ");
|
||||
print_tv_ts(tcp, args[4]);
|
||||
print_tv_ts(tcp, args[4], false);
|
||||
} else {
|
||||
static char outstr[1024];
|
||||
char *outptr;
|
||||
|
8
dist/README
vendored
8
dist/README
vendored
@ -10,13 +10,21 @@ of Paul Kranenburg; see the file COPYING for details.
|
||||
See the file CREDITS for a list of authors and other contributors.
|
||||
See the file INSTALL for compilation and installation instructions.
|
||||
See the file NEWS for information on what has changed in recent versions.
|
||||
See the file README-hacking for information related to strace development.
|
||||
|
||||
The project's homepage is at
|
||||
https://strace.io
|
||||
|
||||
The GIT repository of strace is available at
|
||||
https://github.com/strace/strace/ and https://gitlab.com/strace/strace/
|
||||
|
||||
strace has a mailing list:
|
||||
strace-devel@lists.strace.io
|
||||
|
||||
Everyone is welcome to post bug reports, feature requests, comments
|
||||
and patches to the list. The mailing list archives are available at
|
||||
https://lists.strace.io/pipermail/strace-devel/
|
||||
|
||||
System requirements:
|
||||
* Linux kernel >= 2.6.18 is recommended. Older versions might still work
|
||||
but they haven't been thoroughly tested with this release.
|
||||
|
55
dyxlat.c
55
dyxlat.c
@ -27,26 +27,21 @@
|
||||
#include "defs.h"
|
||||
|
||||
struct dyxlat {
|
||||
size_t used;
|
||||
size_t allocated;
|
||||
struct xlat *xlat;
|
||||
struct xlat xlat;
|
||||
struct xlat_data *data;
|
||||
};
|
||||
|
||||
#define MARK_END(xlat) \
|
||||
do { \
|
||||
(xlat).val = 0; \
|
||||
(xlat).str = 0; \
|
||||
} while (0)
|
||||
|
||||
struct dyxlat *
|
||||
dyxlat_alloc(const size_t nmemb)
|
||||
{
|
||||
struct dyxlat *const dyxlat = xmalloc(sizeof(*dyxlat));
|
||||
|
||||
dyxlat->used = 1;
|
||||
dyxlat->xlat.type = XT_NORMAL;
|
||||
dyxlat->xlat.size = 0;
|
||||
dyxlat->allocated = nmemb;
|
||||
dyxlat->xlat = xgrowarray(NULL, &dyxlat->allocated, sizeof(struct xlat));
|
||||
MARK_END(dyxlat->xlat[0]);
|
||||
dyxlat->xlat.data = dyxlat->data = xgrowarray(NULL, &dyxlat->allocated,
|
||||
sizeof(struct xlat_data));
|
||||
|
||||
return dyxlat;
|
||||
}
|
||||
@ -56,20 +51,20 @@ dyxlat_free(struct dyxlat *const dyxlat)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < dyxlat->used - 1; ++i) {
|
||||
free((void *) dyxlat->xlat[i].str);
|
||||
dyxlat->xlat[i].str = NULL;
|
||||
for (i = 0; i < dyxlat->xlat.size; ++i) {
|
||||
free((void *) dyxlat->data[i].str);
|
||||
dyxlat->data[i].str = NULL;
|
||||
}
|
||||
|
||||
free(dyxlat->xlat);
|
||||
dyxlat->xlat = NULL;
|
||||
free(dyxlat->data);
|
||||
dyxlat->xlat.data = NULL;
|
||||
free(dyxlat);
|
||||
}
|
||||
|
||||
const struct xlat *
|
||||
dyxlat_get(const struct dyxlat *const dyxlat)
|
||||
{
|
||||
return dyxlat->xlat;
|
||||
return &dyxlat->xlat;
|
||||
}
|
||||
|
||||
void
|
||||
@ -78,24 +73,24 @@ dyxlat_add_pair(struct dyxlat *const dyxlat, const uint64_t val,
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < dyxlat->used - 1; ++i) {
|
||||
if (dyxlat->xlat[i].val == val) {
|
||||
if (strncmp(dyxlat->xlat[i].str, str, len) == 0
|
||||
&& dyxlat->xlat[i].str[len] == '\0')
|
||||
for (i = 0; i < dyxlat->xlat.size; ++i) {
|
||||
if (dyxlat->data[i].val == val) {
|
||||
if (strncmp(dyxlat->data[i].str, str, len) == 0
|
||||
&& dyxlat->data[i].str[len] == '\0')
|
||||
return;
|
||||
|
||||
free((void *) dyxlat->xlat[i].str);
|
||||
dyxlat->xlat[i].str = xstrndup(str, len);
|
||||
free((void *) dyxlat->data[i].str);
|
||||
dyxlat->data[i].str = xstrndup(str, len);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (dyxlat->used >= dyxlat->allocated)
|
||||
dyxlat->xlat = xgrowarray(dyxlat->xlat, &dyxlat->allocated,
|
||||
sizeof(struct xlat));
|
||||
if (dyxlat->xlat.size >= dyxlat->allocated)
|
||||
dyxlat->xlat.data = dyxlat->data =
|
||||
xgrowarray(dyxlat->data, &dyxlat->allocated,
|
||||
sizeof(struct xlat_data));
|
||||
|
||||
dyxlat->xlat[dyxlat->used - 1].val = val;
|
||||
dyxlat->xlat[dyxlat->used - 1].str = xstrndup(str, len);
|
||||
MARK_END(dyxlat->xlat[dyxlat->used]);
|
||||
dyxlat->used++;
|
||||
dyxlat->data[dyxlat->xlat.size].val = val;
|
||||
dyxlat->data[dyxlat->xlat.size].str = xstrndup(str, len);
|
||||
dyxlat->xlat.size++;
|
||||
}
|
||||
|
@ -25,7 +25,9 @@
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if defined(HAVE_DEFS_H)
|
||||
# include "defs.h"
|
||||
#elif defined(HAVE_CONFIG_H)
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
@ -46,6 +48,7 @@ verror_msg(int err_no, const char *fmt, va_list p)
|
||||
{
|
||||
char *msg;
|
||||
|
||||
finish_line();
|
||||
fflush(NULL);
|
||||
|
||||
/* We want to print entire message with single fprintf to ensure
|
||||
|
@ -40,6 +40,11 @@
|
||||
extern bool debug_flag;
|
||||
|
||||
void die(void) ATTRIBUTE_NORETURN;
|
||||
#ifdef HAVE_FINISH_LINE
|
||||
extern void finish_line(void);
|
||||
#else
|
||||
static inline void finish_line(void) {}
|
||||
#endif
|
||||
|
||||
void error_msg(const char *fmt, ...) ATTRIBUTE_FORMAT((printf, 1, 2));
|
||||
void perror_msg(const char *fmt, ...) ATTRIBUTE_FORMAT((printf, 1, 2));
|
||||
|
55
evdev.c
55
evdev.c
@ -53,8 +53,6 @@
|
||||
# define SYN_MAX 0xf
|
||||
# endif
|
||||
|
||||
const size_t evdev_abs_size = ARRAY_SIZE(evdev_abs) - 1;
|
||||
|
||||
static int
|
||||
abs_ioctl(struct tcb *const tcp, const kernel_ulong_t arg)
|
||||
{
|
||||
@ -98,7 +96,7 @@ keycode_ioctl(struct tcb *const tcp, const kernel_ulong_t arg)
|
||||
|
||||
if (!umove_or_printaddr(tcp, arg, &keycode)) {
|
||||
tprintf("[%u, ", keycode[0]);
|
||||
printxval_index(evdev_keycode, keycode[1], "KEY_???");
|
||||
printxval(evdev_keycode, keycode[1], "KEY_???");
|
||||
tprints("]");
|
||||
}
|
||||
|
||||
@ -125,7 +123,7 @@ keycode_V2_ioctl(struct tcb *const tcp, const kernel_ulong_t arg)
|
||||
unsigned int i;
|
||||
|
||||
tprintf("index=%" PRIu16 ", keycode=", ike.index);
|
||||
printxval_index(evdev_keycode, ike.keycode, "KEY_???");
|
||||
printxval(evdev_keycode, ike.keycode, "KEY_???");
|
||||
tprints(", scancode=[");
|
||||
for (i = 0; i < ARRAY_SIZE(ike.scancode); i++) {
|
||||
if (i > 0)
|
||||
@ -164,9 +162,9 @@ getid_ioctl(struct tcb *const tcp, const kernel_ulong_t arg)
|
||||
}
|
||||
|
||||
static int
|
||||
decode_bitset_(struct tcb *const tcp, const kernel_ulong_t arg,
|
||||
const struct xlat decode_nr[], const unsigned int max_nr,
|
||||
const char *const dflt, size_t decode_nr_size, enum xlat_type xt)
|
||||
decode_bitset(struct tcb *const tcp, const kernel_ulong_t arg,
|
||||
const struct xlat *decode_nr, const unsigned int max_nr,
|
||||
const char *const dflt)
|
||||
{
|
||||
tprints(", ");
|
||||
|
||||
@ -187,7 +185,7 @@ decode_bitset_(struct tcb *const tcp, const kernel_ulong_t arg,
|
||||
if (i < 0) {
|
||||
tprints(" 0 ");
|
||||
} else {
|
||||
printxval_dispatch(decode_nr, decode_nr_size, i, dflt, xt);
|
||||
printxval(decode_nr, i, dflt);
|
||||
|
||||
while ((i = next_set_bit(decoded_arg, i + 1, size)) > 0) {
|
||||
if (abbrev(tcp) && bit_displayed >= 3) {
|
||||
@ -195,8 +193,7 @@ decode_bitset_(struct tcb *const tcp, const kernel_ulong_t arg,
|
||||
break;
|
||||
}
|
||||
tprints(", ");
|
||||
printxval_dispatch(decode_nr, decode_nr_size, i, dflt,
|
||||
xt);
|
||||
printxval(decode_nr, i, dflt);
|
||||
bit_displayed++;
|
||||
}
|
||||
}
|
||||
@ -206,10 +203,6 @@ decode_bitset_(struct tcb *const tcp, const kernel_ulong_t arg,
|
||||
return RVAL_IOCTL_DECODED;
|
||||
}
|
||||
|
||||
#define decode_bitset(tcp_, arg_, decode_nr_, max_nr_, dflt_, xt_) \
|
||||
decode_bitset_((tcp_), (arg_), (decode_nr_), (max_nr_), \
|
||||
(dflt_), ARRAY_SIZE(decode_nr_), (xt_))
|
||||
|
||||
# ifdef EVIOCGMTSLOTS
|
||||
static int
|
||||
mtslots_ioctl(struct tcb *const tcp, const unsigned int code,
|
||||
@ -260,42 +253,41 @@ bit_ioctl(struct tcb *const tcp, const unsigned int ev_nr,
|
||||
switch (ev_nr) {
|
||||
case 0:
|
||||
return decode_bitset(tcp, arg, evdev_ev,
|
||||
EV_MAX, "EV_???", XT_SORTED);
|
||||
EV_MAX, "EV_???");
|
||||
case EV_KEY:
|
||||
return decode_bitset(tcp, arg, evdev_keycode,
|
||||
KEY_MAX, "KEY_???", XT_INDEXED);
|
||||
KEY_MAX, "KEY_???");
|
||||
case EV_REL:
|
||||
return decode_bitset(tcp, arg, evdev_relative_axes,
|
||||
REL_MAX, "REL_???", XT_INDEXED);
|
||||
REL_MAX, "REL_???");
|
||||
case EV_ABS:
|
||||
return decode_bitset(tcp, arg, evdev_abs,
|
||||
ABS_MAX, "ABS_???", XT_INDEXED);
|
||||
ABS_MAX, "ABS_???");
|
||||
case EV_MSC:
|
||||
return decode_bitset(tcp, arg, evdev_misc,
|
||||
MSC_MAX, "MSC_???", XT_INDEXED);
|
||||
MSC_MAX, "MSC_???");
|
||||
case EV_SW:
|
||||
return decode_bitset(tcp, arg, evdev_switch,
|
||||
SW_MAX, "SW_???", XT_INDEXED);
|
||||
SW_MAX, "SW_???");
|
||||
case EV_LED:
|
||||
return decode_bitset(tcp, arg, evdev_leds,
|
||||
LED_MAX, "LED_???", XT_INDEXED);
|
||||
LED_MAX, "LED_???");
|
||||
case EV_SND:
|
||||
return decode_bitset(tcp, arg, evdev_snd,
|
||||
SND_MAX, "SND_???", XT_INDEXED);
|
||||
SND_MAX, "SND_???");
|
||||
case EV_REP:
|
||||
return decode_bitset(tcp, arg, evdev_autorepeat,
|
||||
REP_MAX, "REP_???", XT_INDEXED);
|
||||
REP_MAX, "REP_???");
|
||||
case EV_FF:
|
||||
return decode_bitset(tcp, arg, evdev_ff_types,
|
||||
FF_MAX, "FF_???", XT_SORTED);
|
||||
FF_MAX, "FF_???");
|
||||
case EV_PWR:
|
||||
tprints(", ");
|
||||
printnum_int(tcp, arg, "%d");
|
||||
return RVAL_IOCTL_DECODED;
|
||||
case EV_FF_STATUS:
|
||||
return decode_bitset(tcp, arg, evdev_ff_status,
|
||||
FF_STATUS_MAX, "FF_STATUS_???",
|
||||
XT_INDEXED);
|
||||
FF_STATUS_MAX, "FF_STATUS_???");
|
||||
default:
|
||||
tprints(", ");
|
||||
printaddr(arg);
|
||||
@ -349,23 +341,22 @@ evdev_read_ioctl(struct tcb *const tcp, const unsigned int code,
|
||||
# ifdef EVIOCGPROP
|
||||
case _IOC_NR(EVIOCGPROP(0)):
|
||||
return decode_bitset(tcp, arg, evdev_prop,
|
||||
INPUT_PROP_MAX, "PROP_???",
|
||||
XT_INDEXED);
|
||||
INPUT_PROP_MAX, "PROP_???");
|
||||
# endif
|
||||
case _IOC_NR(EVIOCGSND(0)):
|
||||
return decode_bitset(tcp, arg, evdev_snd,
|
||||
SND_MAX, "SND_???", XT_INDEXED);
|
||||
SND_MAX, "SND_???");
|
||||
# ifdef EVIOCGSW
|
||||
case _IOC_NR(EVIOCGSW(0)):
|
||||
return decode_bitset(tcp, arg, evdev_switch,
|
||||
SW_MAX, "SW_???", XT_INDEXED);
|
||||
SW_MAX, "SW_???");
|
||||
# endif
|
||||
case _IOC_NR(EVIOCGKEY(0)):
|
||||
return decode_bitset(tcp, arg, evdev_keycode,
|
||||
KEY_MAX, "KEY_???", XT_INDEXED);
|
||||
KEY_MAX, "KEY_???");
|
||||
case _IOC_NR(EVIOCGLED(0)):
|
||||
return decode_bitset(tcp, arg, evdev_leds,
|
||||
LED_MAX, "LED_???", XT_INDEXED);
|
||||
LED_MAX, "LED_???");
|
||||
}
|
||||
|
||||
/* multi-number fixed-length commands */
|
||||
|
234
fanotify.c
234
fanotify.c
@ -27,6 +27,7 @@
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
#include "print_fields.h"
|
||||
|
||||
#include "xlat/fan_classes.h"
|
||||
#include "xlat/fan_init_flags.h"
|
||||
@ -37,6 +38,236 @@
|
||||
#ifndef FAN_NOFD
|
||||
# define FAN_NOFD -1
|
||||
#endif
|
||||
#ifndef FAN_AUDIT
|
||||
# define FAN_AUDIT 0x10
|
||||
#endif
|
||||
|
||||
#include "xlat/fan_mark_flags.h"
|
||||
#include "xlat/fan_event_flags.h"
|
||||
#include "xlat/fan_responses.h"
|
||||
|
||||
static void
|
||||
print_fanfd(struct tcb *tcp, int fd)
|
||||
{
|
||||
if (fd == FAN_NOFD)
|
||||
print_xlat_d(FAN_NOFD);
|
||||
else
|
||||
printfd(tcp, fd);
|
||||
}
|
||||
|
||||
#define PRINT_FIELD_FANFD(prefix_, where_, field_, tcp_) \
|
||||
do { \
|
||||
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
|
||||
print_fanfd((tcp_), (where_).field_); \
|
||||
} while (0)
|
||||
|
||||
bool
|
||||
decode_fanotify_read(struct tcb *tcp, int fd, const char *fdpath,
|
||||
enum fileops op, kernel_ulong_t addr,
|
||||
kernel_ulong_t addrlen)
|
||||
{
|
||||
struct fev_hdr {
|
||||
uint32_t event_len;
|
||||
union {
|
||||
struct {
|
||||
uint8_t vers;
|
||||
uint8_t reserved;
|
||||
uint16_t metadata_len;
|
||||
};
|
||||
uint32_t vers_v2;
|
||||
};
|
||||
} fev_hdr;
|
||||
uint32_t fev_ver = 0;
|
||||
|
||||
union fev_md {
|
||||
struct fev_md_v2 {
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) mask;
|
||||
int32_t fd;
|
||||
int32_t pid;
|
||||
} v2;
|
||||
struct fev_md_v1 {
|
||||
int32_t fd;
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) mask;
|
||||
int64_t pid;
|
||||
} ATTRIBUTE_PACKED v1;
|
||||
} fev_md;
|
||||
|
||||
enum {
|
||||
FEV_V1_SIZE = sizeof(struct fev_hdr) + sizeof(struct fev_md_v1),
|
||||
FEV_V2_SIZE = sizeof(struct fev_hdr) + sizeof(struct fev_md_v2),
|
||||
FEV_MIN_SIZE = MIN(FEV_V1_SIZE, FEV_V2_SIZE),
|
||||
};
|
||||
|
||||
kernel_ulong_t pos = 0;
|
||||
|
||||
if (addrlen < sizeof(fev_hdr))
|
||||
return false;
|
||||
|
||||
tprints("[");
|
||||
|
||||
do {
|
||||
if (pos)
|
||||
tprints(", ");
|
||||
|
||||
if (umove(tcp, addr + pos, &fev_hdr)) {
|
||||
printaddr_comment(addr + pos);
|
||||
break;
|
||||
}
|
||||
|
||||
PRINT_FIELD_U("{", fev_hdr, event_len);
|
||||
|
||||
if (fev_hdr.event_len < FEV_MIN_SIZE) {
|
||||
tprints(", ... /* invalid event_len */}");
|
||||
|
||||
if (!fev_hdr.event_len)
|
||||
goto end_decoded;
|
||||
|
||||
goto end_fev_decoded;
|
||||
}
|
||||
|
||||
switch (fev_hdr.vers) {
|
||||
case 0: case 1: case 2:
|
||||
switch (fev_hdr.vers_v2) {
|
||||
case 1: case 2:
|
||||
PRINT_FIELD_U(", ", fev_hdr, vers_v2);
|
||||
fev_ver = fev_hdr.vers;
|
||||
break;
|
||||
|
||||
default:
|
||||
tprints("}");
|
||||
pos += offsetof(struct fev_hdr, vers_v2);
|
||||
goto end_decoded;
|
||||
}
|
||||
break;
|
||||
|
||||
case 3: default:
|
||||
PRINT_FIELD_U(", ", fev_hdr, vers);
|
||||
fev_ver = fev_hdr.vers;
|
||||
if (fev_hdr.reserved)
|
||||
PRINT_FIELD_U(", ", fev_hdr, reserved);
|
||||
PRINT_FIELD_U(", ", fev_hdr, metadata_len);
|
||||
|
||||
if (fev_hdr.metadata_len < FEV_V2_SIZE) {
|
||||
tprints(", ... /* invalid metadata_len */}");
|
||||
goto end_fev_decoded;
|
||||
}
|
||||
}
|
||||
|
||||
if (fev_ver < 1 || fev_ver > 3) {
|
||||
tprints(", ... /* invalid vers */}");
|
||||
goto end_fev_decoded;
|
||||
}
|
||||
|
||||
switch (fev_ver) {
|
||||
case 1:
|
||||
if (umove(tcp, addr + pos + sizeof(fev_hdr),
|
||||
&fev_md.v1)) {
|
||||
printf(", ...}");
|
||||
pos += sizeof(fev_hdr);
|
||||
goto end_decoded;
|
||||
}
|
||||
|
||||
PRINT_FIELD_FANFD(", ", fev_md.v1, fd, tcp);
|
||||
PRINT_FIELD_FLAGS(", ", fev_md.v1, mask,
|
||||
fan_event_flags, "FAN_???");
|
||||
PRINT_FIELD_D(", ", fev_md.v1, pid);
|
||||
|
||||
if (FEV_V1_SIZE < fev_hdr.event_len) {
|
||||
tprints(", ");
|
||||
printstrn(tcp, addr + pos,
|
||||
fev_hdr.event_len - FEV_V1_SIZE);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 2: case 3:
|
||||
if (umove(tcp, addr + pos + sizeof(fev_hdr),
|
||||
&fev_md.v2)) {
|
||||
printf(", ...}");
|
||||
pos += sizeof(fev_hdr);
|
||||
goto end_decoded;
|
||||
}
|
||||
|
||||
PRINT_FIELD_FLAGS(", ", fev_md.v2, mask,
|
||||
fan_event_flags, "FAN_???");
|
||||
PRINT_FIELD_FANFD(", ", fev_md.v2, fd, tcp);
|
||||
PRINT_FIELD_D(", ", fev_md.v2, pid);
|
||||
|
||||
if (FEV_V2_SIZE < fev_hdr.event_len) {
|
||||
tprints(", ");
|
||||
printstrn(tcp, addr + pos,
|
||||
fev_hdr.event_len - FEV_V2_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
tprints("}");
|
||||
|
||||
end_fev_decoded:
|
||||
pos += fev_hdr.event_len;
|
||||
} while (pos <= addrlen - sizeof(fev_hdr));
|
||||
|
||||
end_decoded:
|
||||
if (pos < addrlen) {
|
||||
if (pos)
|
||||
tprints(", ");
|
||||
|
||||
printstrn(tcp, addr + pos, addrlen - pos);
|
||||
}
|
||||
|
||||
tprints("]");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
decode_fanotify_write(struct tcb *tcp, int fd, const char *fdpath,
|
||||
enum fileops op, kernel_ulong_t addr,
|
||||
kernel_ulong_t addrlen)
|
||||
{
|
||||
struct fresp {
|
||||
int32_t fd;
|
||||
uint32_t response;
|
||||
} fresp;
|
||||
kernel_ulong_t pos = 0;
|
||||
|
||||
if (addrlen < sizeof(fresp))
|
||||
return false;
|
||||
|
||||
tprints("[");
|
||||
|
||||
do {
|
||||
if (pos)
|
||||
tprints(", ");
|
||||
|
||||
if (umove(tcp, addr + pos, &fresp)) {
|
||||
printaddr_comment(addr + pos);
|
||||
break;
|
||||
}
|
||||
|
||||
PRINT_FIELD_FD("{", fresp, fd, tcp);
|
||||
|
||||
tprints(", response=");
|
||||
if (fresp.response | FAN_AUDIT) {
|
||||
print_xlat(FAN_AUDIT);
|
||||
tprints("|");
|
||||
}
|
||||
printxval(fan_responses, fresp.response, "FAN_???");
|
||||
tprints("}");
|
||||
|
||||
pos += sizeof(fresp);
|
||||
} while (pos <= addrlen - sizeof(fresp));
|
||||
|
||||
if (pos < addrlen) {
|
||||
if (pos)
|
||||
tprints(", ");
|
||||
|
||||
printstrn(tcp, addr + pos, addrlen - pos);
|
||||
}
|
||||
|
||||
tprints("]");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
SYS_FUNC(fanotify_init)
|
||||
{
|
||||
@ -54,9 +285,6 @@ SYS_FUNC(fanotify_init)
|
||||
return RVAL_DECODED | RVAL_FD;
|
||||
}
|
||||
|
||||
#include "xlat/fan_mark_flags.h"
|
||||
#include "xlat/fan_event_flags.h"
|
||||
|
||||
SYS_FUNC(fanotify_mark)
|
||||
{
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
|
49
fcntl.c
49
fcntl.c
@ -34,6 +34,7 @@
|
||||
|
||||
#include "xlat/f_owner_types.h"
|
||||
#include "xlat/f_seals.h"
|
||||
#include "xlat/fcntl_rw_hints.h"
|
||||
#include "xlat/fcntlcmds.h"
|
||||
#include "xlat/fdflags.h"
|
||||
#include "xlat/lockfcmds.h"
|
||||
@ -84,6 +85,32 @@ print_f_owner_ex(struct tcb *const tcp, const kernel_ulong_t addr)
|
||||
tprintf(", pid=%d}", owner.pid);
|
||||
}
|
||||
|
||||
static void
|
||||
print_rwhint(struct tcb *const tcp, const kernel_ulong_t addr)
|
||||
{
|
||||
uint64_t hint;
|
||||
|
||||
if (umove_or_printaddr(tcp, addr, &hint))
|
||||
return;
|
||||
|
||||
tprints("[");
|
||||
printxval(fcntl_rw_hints, hint, "RWH_WRITE_LIFE_???");
|
||||
tprints("]");
|
||||
}
|
||||
|
||||
static void
|
||||
print_owner_uids(struct tcb *const tcp, const kernel_ulong_t addr)
|
||||
{
|
||||
uint32_t uids[2];
|
||||
|
||||
if (umove_or_printaddr(tcp, addr, uids))
|
||||
return;
|
||||
|
||||
printuid("[", uids[0]); /* Real */
|
||||
printuid(", ", uids[1]); /* Effective */
|
||||
tprints("]");
|
||||
}
|
||||
|
||||
static int
|
||||
print_fcntl(struct tcb *tcp)
|
||||
{
|
||||
@ -134,7 +161,12 @@ print_fcntl(struct tcb *tcp)
|
||||
break;
|
||||
case F_SETSIG:
|
||||
tprints(", ");
|
||||
tprints(signame(tcp->u_arg[2]));
|
||||
printsignal(tcp->u_arg[2]);
|
||||
break;
|
||||
case F_SET_RW_HINT:
|
||||
case F_SET_FILE_RW_HINT:
|
||||
tprints(", ");
|
||||
print_rwhint(tcp, tcp->u_arg[2]);
|
||||
break;
|
||||
case F_GETOWN:
|
||||
case F_GETPIPE_SZ:
|
||||
@ -179,11 +211,26 @@ print_fcntl(struct tcb *tcp)
|
||||
tcp->auxstr = sprintflags("seals ", f_seals,
|
||||
(kernel_ulong_t) tcp->u_rval);
|
||||
return RVAL_HEX | RVAL_STR;
|
||||
case F_GET_RW_HINT:
|
||||
case F_GET_FILE_RW_HINT:
|
||||
if (entering(tcp)) {
|
||||
tprints(", ");
|
||||
return 0;
|
||||
}
|
||||
print_rwhint(tcp, tcp->u_arg[2]);
|
||||
break;
|
||||
case F_GETSIG:
|
||||
if (entering(tcp) || syserror(tcp) || tcp->u_rval == 0)
|
||||
return 0;
|
||||
tcp->auxstr = signame(tcp->u_rval);
|
||||
return RVAL_STR;
|
||||
case F_GETOWNER_UIDS:
|
||||
if (entering(tcp)) {
|
||||
tprints(", ");
|
||||
return 0;
|
||||
}
|
||||
print_owner_uids(tcp, tcp->u_arg[2]);
|
||||
break;
|
||||
default:
|
||||
tprintf(", %#" PRI_klx, tcp->u_arg[2]);
|
||||
break;
|
||||
|
@ -48,27 +48,55 @@ struct inject_personality_data {
|
||||
uint16_t scno;
|
||||
};
|
||||
|
||||
struct alt_name {
|
||||
const char *syn;
|
||||
const char *orig;
|
||||
};
|
||||
|
||||
#define _(a_, b_) { (a_), (b_) }
|
||||
static const struct alt_name alt_signames[] = {
|
||||
#include "linux/alt_signalent.h"
|
||||
};
|
||||
|
||||
static const struct alt_name alt_errnames[] = {
|
||||
#include "linux/alt_signalent.h"
|
||||
};
|
||||
#undef _
|
||||
|
||||
static bool
|
||||
signame_eq(const char *needle, const char *straw)
|
||||
{
|
||||
if (strncasecmp(straw, "SIG", 3) != 0)
|
||||
return false;
|
||||
|
||||
straw += 3;
|
||||
|
||||
if (strncasecmp(needle, "SIG", 3) == 0)
|
||||
needle += 3;
|
||||
|
||||
return (strcasecmp(needle, straw) == 0);
|
||||
}
|
||||
|
||||
static int
|
||||
sigstr_to_uint(const char *s)
|
||||
{
|
||||
for (size_t i = 0; i < ARRAY_SIZE(alt_signames); i++) {
|
||||
if (!signame_eq(s, alt_signames[i].syn)) {
|
||||
error_msg("Signal name \"%s\" is selected instead of "
|
||||
"synonymous \"%s\"",
|
||||
alt_signames[i].orig, s);
|
||||
s = alt_signames[i].orig;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (*s >= '0' && *s <= '9')
|
||||
return string_to_uint_upto(s, 255);
|
||||
return string_to_uint_upto(s, nsig);
|
||||
|
||||
if (strncasecmp(s, "SIG", 3) == 0)
|
||||
s += 3;
|
||||
|
||||
for (int i = 0; i <= 255; ++i) {
|
||||
const char *name = signame(i);
|
||||
|
||||
if (strncasecmp(name, "SIG", 3) != 0)
|
||||
continue;
|
||||
|
||||
name += 3;
|
||||
|
||||
if (strcasecmp(name, s) != 0)
|
||||
continue;
|
||||
|
||||
return i;
|
||||
for (size_t i = 1; i <= nsig; i++) {
|
||||
if (signame_eq(s, signame(i)))
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
@ -77,6 +105,16 @@ sigstr_to_uint(const char *s)
|
||||
static int
|
||||
find_errno_by_name(const char *name)
|
||||
{
|
||||
for (unsigned int i = 0; i < ARRAY_SIZE(alt_errnames); ++i) {
|
||||
if (!strcasecmp(name, alt_errnames[i].syn)) {
|
||||
error_msg("Error name \"%s\" is selected instead of "
|
||||
"synonymous \"%s\"",
|
||||
alt_errnames[i].orig, name);
|
||||
name = alt_errnames[i].orig;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (unsigned int i = 1; i < nerrnos; ++i) {
|
||||
if (errnoent[i] && (strcasecmp(name, errnoent[i]) == 0))
|
||||
return i;
|
||||
@ -92,14 +130,15 @@ parse_delay_token(const char *input, struct inject_opts *fopts, bool isenter)
|
||||
|
||||
if (fopts->data.flags & flag) /* duplicate */
|
||||
return false;
|
||||
long long intval = string_to_ulonglong(input);
|
||||
if (intval < 0) /* couldn't parse */
|
||||
struct timespec tsval;
|
||||
|
||||
if (parse_ts(input, &tsval) < 0) /* couldn't parse */
|
||||
return false;
|
||||
|
||||
if (fopts->data.delay_idx == (uint16_t) -1)
|
||||
fopts->data.delay_idx = alloc_delay_data();
|
||||
/* populate .ts_enter or .ts_exit */
|
||||
fill_delay_data(fopts->data.delay_idx, intval, isenter);
|
||||
fill_delay_data(fopts->data.delay_idx, &tsval, isenter);
|
||||
fopts->data.flags |= flag;
|
||||
|
||||
return true;
|
||||
|
66
futex.c
66
futex.c
@ -40,16 +40,45 @@
|
||||
#ifndef FUTEX_OP_OPARG_SHIFT
|
||||
# define FUTEX_OP_OPARG_SHIFT 8
|
||||
#endif
|
||||
#ifndef FUTEX_TID_MASK
|
||||
# define FUTEX_TID_MASK 0x3fffffffU
|
||||
#endif
|
||||
|
||||
#include "xlat/futexbitset.h"
|
||||
#include "xlat/futexops.h"
|
||||
#include "xlat/futexpiflags.h"
|
||||
#include "xlat/futexwakeops.h"
|
||||
#include "xlat/futexwakecmps.h"
|
||||
|
||||
static void
|
||||
printaddrnum(struct tcb *tcp, kernel_ulong_t addr)
|
||||
{
|
||||
printnum_int_ex(tcp, addr, true, "%#x");
|
||||
}
|
||||
|
||||
static void
|
||||
printaddrpival(struct tcb *tcp, kernel_ulong_t addr)
|
||||
{
|
||||
uint32_t tid;
|
||||
|
||||
if (umove_or_printaddr(tcp, addr, &tid))
|
||||
return;
|
||||
|
||||
tprints("[");
|
||||
if (tid & ~FUTEX_TID_MASK) {
|
||||
printflags(futexpiflags, tid & ~FUTEX_TID_MASK, NULL);
|
||||
tprints("|");
|
||||
}
|
||||
tprintf("%u]", tid & FUTEX_TID_MASK);
|
||||
printaddr_comment(addr);
|
||||
}
|
||||
|
||||
SYS_FUNC(futex)
|
||||
{
|
||||
const kernel_ulong_t uaddr = tcp->u_arg[0];
|
||||
const int op = tcp->u_arg[1];
|
||||
const int cmd = op & 127;
|
||||
const bool is_rt = op & FUTEX_CLOCK_REALTIME;
|
||||
const kernel_ulong_t timeout = tcp->u_arg[3];
|
||||
const kernel_ulong_t uaddr2 = tcp->u_arg[4];
|
||||
const unsigned int val = tcp->u_arg[2];
|
||||
@ -57,45 +86,58 @@ SYS_FUNC(futex)
|
||||
const unsigned int val3 = tcp->u_arg[5];
|
||||
const char *comment;
|
||||
|
||||
printaddr(uaddr);
|
||||
switch (cmd) {
|
||||
case FUTEX_LOCK_PI:
|
||||
case FUTEX_UNLOCK_PI:
|
||||
case FUTEX_TRYLOCK_PI:
|
||||
printaddrpival(tcp, uaddr);
|
||||
break;
|
||||
default:
|
||||
printaddrnum(tcp, uaddr);
|
||||
}
|
||||
|
||||
tprints(", ");
|
||||
printxval(futexops, op, "FUTEX_???");
|
||||
switch (cmd) {
|
||||
case FUTEX_WAIT:
|
||||
tprintf(", %u", val);
|
||||
tprints(", ");
|
||||
print_timespec(tcp, timeout);
|
||||
/* timeout in FUTEX_WAIT is relative, contrary to other ops */
|
||||
print_timespec(tcp, timeout, false);
|
||||
break;
|
||||
case FUTEX_LOCK_PI:
|
||||
tprints(", ");
|
||||
print_timespec(tcp, timeout);
|
||||
print_timespec(tcp, timeout, true);
|
||||
break;
|
||||
case FUTEX_WAIT_BITSET:
|
||||
tprintf(", %u", val);
|
||||
tprints(", ");
|
||||
print_timespec(tcp, timeout);
|
||||
tprintf(", %#x", val3);
|
||||
print_timespec(tcp, timeout, is_rt);
|
||||
tprints(", ");
|
||||
printxval(futexbitset, val3, NULL);
|
||||
break;
|
||||
case FUTEX_WAKE_BITSET:
|
||||
tprintf(", %u", val);
|
||||
tprintf(", %#x", val3);
|
||||
tprints(", ");
|
||||
printxval(futexbitset, val3, NULL);
|
||||
break;
|
||||
case FUTEX_REQUEUE:
|
||||
tprintf(", %u", val);
|
||||
tprintf(", %u, ", val2);
|
||||
printaddr(uaddr2);
|
||||
printaddrnum(tcp, uaddr2);
|
||||
break;
|
||||
case FUTEX_CMP_REQUEUE:
|
||||
case FUTEX_CMP_REQUEUE_PI:
|
||||
tprintf(", %u", val);
|
||||
tprintf(", %u, ", val2);
|
||||
printaddr(uaddr2);
|
||||
(cmd == FUTEX_CMP_REQUEUE ? printaddrnum
|
||||
: printaddrpival)(tcp, uaddr2);
|
||||
tprintf(", %u", val3);
|
||||
break;
|
||||
case FUTEX_WAKE_OP:
|
||||
tprintf(", %u", val);
|
||||
tprintf(", %u, ", val2);
|
||||
printaddr(uaddr2);
|
||||
printaddrnum(tcp, uaddr2);
|
||||
tprints(", ");
|
||||
if ((val3 >> 28) & FUTEX_OP_OPARG_SHIFT) {
|
||||
print_xlat(FUTEX_OP_OPARG_SHIFT);
|
||||
@ -115,11 +157,13 @@ SYS_FUNC(futex)
|
||||
case FUTEX_WAIT_REQUEUE_PI:
|
||||
tprintf(", %u", val);
|
||||
tprints(", ");
|
||||
print_timespec(tcp, timeout);
|
||||
print_timespec(tcp, timeout, is_rt);
|
||||
tprints(", ");
|
||||
printaddr(uaddr2);
|
||||
printaddrpival(tcp, uaddr2);
|
||||
break;
|
||||
case FUTEX_FD:
|
||||
tprintf(", %u", val);
|
||||
return RVAL_DECODED | RVAL_FD;
|
||||
case FUTEX_WAKE:
|
||||
tprintf(", %u", val);
|
||||
break;
|
||||
|
@ -87,6 +87,14 @@
|
||||
# define ALIGNOF(t_) (sizeof(struct { char x_; t_ y_; }) - sizeof(t_))
|
||||
#endif
|
||||
|
||||
#if GNUC_PREREQ(4, 1)
|
||||
# define CMPXCHG(val_, old_, new_) \
|
||||
__sync_bool_compare_and_swap((val_), (old_), (new_))
|
||||
#else
|
||||
# define CMPXCHG(val_, old_, new_) \
|
||||
((val_) == (old_) ? (val_) = (new_), true : false)
|
||||
#endif
|
||||
|
||||
#if GNUC_PREREQ(4, 3)
|
||||
# define ATTRIBUTE_ALLOC_SIZE(args) __attribute__((__alloc_size__ args))
|
||||
#else
|
||||
|
82
gen_ptp_clock_check.sh
Executable file
82
gen_ptp_clock_check.sh
Executable file
@ -0,0 +1,82 @@
|
||||
#!/bin/sh -efu
|
||||
# Copyright (c) 2018 Dmitry V. Levin <ldv@altlinux.org>
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. The name of the author may not be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
input="$1"
|
||||
shift
|
||||
|
||||
cat <<EOF
|
||||
/* Generated by $0 from $input; do not edit. */
|
||||
#include "defs.h"
|
||||
#ifdef HAVE_LINUX_PTP_CLOCK_H
|
||||
# include <linux/ptp_clock.h>
|
||||
# include "ptp_clock.h"
|
||||
# include "static_assert.h"
|
||||
|
||||
# define SoM(type_, member_) (sizeof(((type_ *)0)->member_))
|
||||
EOF
|
||||
|
||||
for struct in $(sed -n 's/^struct \(strace_ptp_[^[:space:]]\+\) .*/\1/p' < "$input"); do
|
||||
type_name="struct ${struct#strace_}"
|
||||
TYPE_NAME="$(printf %s "$type_name" |tr '[:lower:] ' '[:upper:]_')"
|
||||
|
||||
sed -n '/^'"struct $struct"' [^{]*{$/,/^};$/p' < "$input" |
|
||||
sed -n 's/^[[:space:]]\+[^][;]*[[:space:]]\([^][[:space:];]\+\)\(\[[^;]*\]\)\?;$/\1/p' |
|
||||
while read field; do
|
||||
FIELD="$(printf %s "$field" |tr '[:lower:]' '[:upper:]')"
|
||||
|
||||
if [ "rsv" = "$field" ]; then
|
||||
cat <<EOF
|
||||
|
||||
# ifdef HAVE_${TYPE_NAME}_$FIELD
|
||||
static_assert(SoM(struct $struct, $field) <= SoM($type_name, $field),
|
||||
"$struct.$field is bigger than in system headers");
|
||||
# endif /* HAVE_${TYPE_NAME}_$FIELD */
|
||||
EOF
|
||||
continue;
|
||||
fi
|
||||
|
||||
cat <<EOF
|
||||
|
||||
# ifdef HAVE_${TYPE_NAME}_$FIELD
|
||||
static_assert(SoM(struct $struct, $field) == SoM($type_name, $field),
|
||||
"$struct.$field size mismatch");
|
||||
static_assert(offsetof(struct $struct, $field) == offsetof($type_name, $field),
|
||||
"$struct.$field offset mismatch");
|
||||
# endif /* HAVE_${TYPE_NAME}_$FIELD */
|
||||
EOF
|
||||
done
|
||||
cat <<EOF
|
||||
|
||||
static_assert(${struct}_size == expected_${struct}_size,
|
||||
"${struct}_size mismatch");
|
||||
EOF
|
||||
|
||||
done
|
||||
|
||||
cat <<'EOF'
|
||||
|
||||
#endif /* HAVE_LINUX_BPF_H */
|
||||
EOF
|
@ -27,12 +27,63 @@
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
#include DEF_MPERS_TYPE(struct_robust_list_head)
|
||||
|
||||
#include <linux/futex.h>
|
||||
|
||||
typedef struct robust_list_head struct_robust_list_head;
|
||||
|
||||
#include MPERS_DEFS
|
||||
|
||||
#include "print_fields.h"
|
||||
|
||||
static void
|
||||
decode_robust_list(struct tcb *tcp, kernel_ulong_t addr, kernel_ulong_t len)
|
||||
{
|
||||
struct_robust_list_head rl;
|
||||
|
||||
if (len < sizeof(rl)) {
|
||||
printaddr(addr);
|
||||
return;
|
||||
}
|
||||
if (umove_or_printaddr(tcp, addr, &rl))
|
||||
return;
|
||||
|
||||
PRINT_FIELD_PTR("{list={", rl.list, next);
|
||||
PRINT_FIELD_D("}, ", rl, futex_offset);
|
||||
PRINT_FIELD_PTR(", ", rl, list_op_pending);
|
||||
|
||||
if (len > sizeof(rl))
|
||||
tprints(", /* ??? */");
|
||||
|
||||
tprints("}");
|
||||
|
||||
printaddr_comment(addr);
|
||||
}
|
||||
|
||||
SYS_FUNC(set_robust_list)
|
||||
{
|
||||
decode_robust_list(tcp, tcp->u_arg[0], tcp->u_arg[1]);
|
||||
tprintf(", %lu", (unsigned long) tcp->u_arg[1]);
|
||||
|
||||
return RVAL_DECODED;
|
||||
}
|
||||
|
||||
SYS_FUNC(get_robust_list)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
tprintf("%d, ", (int) tcp->u_arg[0]);
|
||||
} else {
|
||||
printnum_ptr(tcp, tcp->u_arg[1]);
|
||||
mpers_ptr_t rl_ptr;
|
||||
mpers_ptr_t len = 0;
|
||||
if (!umove_or_printaddr(tcp, tcp->u_arg[1], &rl_ptr)) {
|
||||
tprints("[");
|
||||
if (!umove(tcp, tcp->u_arg[2], &len))
|
||||
decode_robust_list(tcp, rl_ptr, len);
|
||||
else
|
||||
printaddr(tcp->u_arg[1]);
|
||||
tprints("]");
|
||||
}
|
||||
tprints(", ");
|
||||
printnum_ulong(tcp, tcp->u_arg[2]);
|
||||
}
|
||||
|
23
glibc_compat.h
Normal file
23
glibc_compat.h
Normal file
@ -0,0 +1,23 @@
|
||||
#ifndef STRACE_GLIBC_COMPAT_H
|
||||
#define STRACE_GLIBC_COMPAT_H
|
||||
|
||||
#if defined __GLIBC__
|
||||
# ifndef __GLIBC_MINOR__
|
||||
# warning "__GLIBC__ is defined, but __GLIBC_MINOR__ isn't"
|
||||
# define __GLIBC_MINOR__ 0
|
||||
# endif /* __GLIBC_MINOR__ */
|
||||
|
||||
# ifdef __GLIBC_PREREQ
|
||||
# define GLIBC_PREREQ __GLIBC_PREREQ
|
||||
# else
|
||||
# define GLIBC_PREREQ(maj, min) \
|
||||
((((__GLIBC__) << 16) + (__GLIBC_MINOR__)) >= (((maj) << 16) + (min)))
|
||||
# endif /* __GLIBC_PREREQ */
|
||||
|
||||
# define GLIBC_OLDER(maj, min) (!GLIBC_PREREQ((maj), (min)))
|
||||
#else /* !__GLIBC__ */
|
||||
# define GLIBC_PREREQ(maj, min) 0
|
||||
# define GLIBC_OLDER(maj, min) 0
|
||||
#endif
|
||||
|
||||
#endif /* STRACE_GLIBC_COMPAT_H */
|
63
inotify.c
63
inotify.c
@ -29,9 +29,67 @@
|
||||
#include "defs.h"
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "print_fields.h"
|
||||
|
||||
#include "xlat/inotify_flags.h"
|
||||
#include "xlat/inotify_init_flags.h"
|
||||
|
||||
bool
|
||||
decode_inotify_read(struct tcb *tcp, int fd, const char *fdpath,
|
||||
enum fileops op, kernel_ulong_t addr,
|
||||
kernel_ulong_t addrlen)
|
||||
{
|
||||
struct iev_hdr {
|
||||
int32_t wd;
|
||||
uint32_t mask;
|
||||
uint32_t cookie;
|
||||
uint32_t len;
|
||||
} iev_hdr;
|
||||
kernel_ulong_t pos = 0;
|
||||
|
||||
if (addrlen < sizeof(iev_hdr))
|
||||
return false;
|
||||
|
||||
tprints("[");
|
||||
|
||||
do {
|
||||
if (pos)
|
||||
tprints(", ");
|
||||
|
||||
if (umove(tcp, addr + pos, &iev_hdr)) {
|
||||
printaddr_comment(addr + pos);
|
||||
break;
|
||||
}
|
||||
|
||||
PRINT_FIELD_D("{", iev_hdr, wd);
|
||||
PRINT_FIELD_FLAGS(", ", iev_hdr, mask, inotify_flags, "IN_???");
|
||||
PRINT_FIELD_U(", ", iev_hdr, cookie);
|
||||
PRINT_FIELD_U(", ", iev_hdr, len);
|
||||
|
||||
pos += sizeof(iev_hdr);
|
||||
|
||||
if (iev_hdr.len) {
|
||||
tprints(", name=");
|
||||
printstrn(tcp, addr + pos, iev_hdr.len);
|
||||
|
||||
pos += iev_hdr.len;
|
||||
}
|
||||
|
||||
tprints("}");
|
||||
} while (pos <= addrlen - sizeof(iev_hdr));
|
||||
|
||||
if (pos < addrlen) {
|
||||
if (pos)
|
||||
tprints(", ");
|
||||
|
||||
printstrn(tcp, addr + pos, addrlen - pos);
|
||||
}
|
||||
|
||||
tprints("]");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
SYS_FUNC(inotify_add_watch)
|
||||
{
|
||||
/* file descriptor */
|
||||
@ -56,6 +114,11 @@ SYS_FUNC(inotify_rm_watch)
|
||||
return RVAL_DECODED;
|
||||
}
|
||||
|
||||
SYS_FUNC(inotify_init)
|
||||
{
|
||||
return RVAL_DECODED | RVAL_FD;
|
||||
}
|
||||
|
||||
SYS_FUNC(inotify_init1)
|
||||
{
|
||||
printflags(inotify_init_flags, tcp->u_arg[0], "IN_???");
|
||||
|
70
io.c
70
io.c
@ -30,9 +30,69 @@
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <fnmatch.h>
|
||||
#include <sys/uio.h>
|
||||
|
||||
struct filebuf_decoder_desc {
|
||||
const char *fname;
|
||||
filebuf_decoder_fn decoder;
|
||||
};
|
||||
|
||||
static void
|
||||
decode_filebuf(struct tcb *const tcp, const int fd, const kernel_ulong_t addr,
|
||||
const kernel_ulong_t addrlen,
|
||||
const struct filebuf_decoder_desc *decoders, size_t decoders_cnt,
|
||||
enum fileops op)
|
||||
{
|
||||
if (!verbose(tcp))
|
||||
goto no_match;
|
||||
|
||||
char fdpath[PATH_MAX + 1];
|
||||
|
||||
if (getfdpath(tcp, fd, ARRSZ_PAIR(fdpath)) < 0)
|
||||
goto no_match;
|
||||
|
||||
/* We don't support any "regular" files so far */
|
||||
if (fdpath[0] == '/')
|
||||
goto no_match;
|
||||
|
||||
for (size_t i = 0; i < decoders_cnt; i++) {
|
||||
if (!fnmatch(decoders[i].fname, fdpath, 0) &&
|
||||
decoders[i].decoder(tcp, fd, fdpath, op, addr, addrlen))
|
||||
return;
|
||||
}
|
||||
|
||||
no_match:
|
||||
printstrn(tcp, addr, addrlen);
|
||||
}
|
||||
|
||||
static void
|
||||
decode_readbuf(struct tcb *const tcp, const int fd, const kernel_ulong_t addr,
|
||||
const kernel_ulong_t addrlen)
|
||||
{
|
||||
static const struct filebuf_decoder_desc decoders[] = {
|
||||
{ "anon_inode:\\[fanotify\\]", decode_fanotify_read },
|
||||
{ "anon_inode:inotify", decode_inotify_read },
|
||||
};
|
||||
|
||||
decode_filebuf(tcp, fd, addr, addrlen, ARRSZ_PAIR(decoders),
|
||||
FILEOP_READ);
|
||||
}
|
||||
|
||||
static void
|
||||
decode_writebuf(struct tcb *const tcp, const int fd, const kernel_ulong_t addr,
|
||||
const kernel_ulong_t addrlen)
|
||||
{
|
||||
static const struct filebuf_decoder_desc decoders[] = {
|
||||
{ "anon_inode:\\[fanotify\\]", decode_fanotify_write },
|
||||
};
|
||||
|
||||
decode_filebuf(tcp, fd, addr, addrlen, ARRSZ_PAIR(decoders),
|
||||
FILEOP_WRITE);
|
||||
}
|
||||
|
||||
SYS_FUNC(read)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
@ -42,7 +102,8 @@ SYS_FUNC(read)
|
||||
if (syserror(tcp))
|
||||
printaddr(tcp->u_arg[1]);
|
||||
else
|
||||
printstrn(tcp, tcp->u_arg[1], tcp->u_rval);
|
||||
decode_readbuf(tcp, tcp->u_arg[0], tcp->u_arg[1],
|
||||
tcp->u_rval);
|
||||
tprintf(", %" PRI_klu, tcp->u_arg[2]);
|
||||
}
|
||||
return 0;
|
||||
@ -52,7 +113,7 @@ SYS_FUNC(write)
|
||||
{
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprints(", ");
|
||||
printstrn(tcp, tcp->u_arg[1], tcp->u_arg[2]);
|
||||
decode_writebuf(tcp, tcp->u_arg[0], tcp->u_arg[1], tcp->u_arg[2]);
|
||||
tprintf(", %" PRI_klu, tcp->u_arg[2]);
|
||||
|
||||
return RVAL_DECODED;
|
||||
@ -159,7 +220,8 @@ SYS_FUNC(pread)
|
||||
if (syserror(tcp))
|
||||
printaddr(tcp->u_arg[1]);
|
||||
else
|
||||
printstrn(tcp, tcp->u_arg[1], tcp->u_rval);
|
||||
decode_readbuf(tcp, tcp->u_arg[0], tcp->u_arg[1],
|
||||
tcp->u_rval);
|
||||
tprintf(", %" PRI_klu ", ", tcp->u_arg[2]);
|
||||
printllval(tcp, "%lld", 3);
|
||||
}
|
||||
@ -170,7 +232,7 @@ SYS_FUNC(pwrite)
|
||||
{
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprints(", ");
|
||||
printstrn(tcp, tcp->u_arg[1], tcp->u_arg[2]);
|
||||
decode_writebuf(tcp, tcp->u_arg[0], tcp->u_arg[1], tcp->u_arg[2]);
|
||||
tprintf(", %" PRI_klu ", ", tcp->u_arg[2]);
|
||||
printllval(tcp, "%lld", 3);
|
||||
|
||||
|
317
ioctl.c
317
ioctl.c
@ -31,6 +31,7 @@
|
||||
|
||||
#include "defs.h"
|
||||
#include <linux/ioctl.h>
|
||||
#include "xlat/ioc_types.h"
|
||||
#include "xlat/ioctl_dirs.h"
|
||||
|
||||
static int
|
||||
@ -68,13 +69,39 @@ ioctl_next_match(const struct_ioctlent *iop)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static const char *
|
||||
ioctl_type_str(uint8_t ioc_type)
|
||||
{
|
||||
static char buf[] = { '\'', '\\', '\'', '\'', '\0' };
|
||||
|
||||
const char *ret = xlookup(ioc_types, ioc_type);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (ioc_type == '\\' || ioc_type == '\'') {
|
||||
buf[1] = '\\';
|
||||
buf[2] = ioc_type;
|
||||
return buf;
|
||||
}
|
||||
|
||||
if (ioc_type >= ' ' && ioc_type < 0x7F) {
|
||||
buf[1] = '\'';
|
||||
buf[2] = ioc_type;
|
||||
return buf + 1;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
ioctl_print_code(const unsigned int code)
|
||||
{
|
||||
tprints("_IOC(");
|
||||
printflags(ioctl_dirs, _IOC_DIR(code), "_IOC_???");
|
||||
tprintf(", %#x, %#x, %#x)",
|
||||
_IOC_TYPE(code), _IOC_NR(code), _IOC_SIZE(code));
|
||||
tprints(", ");
|
||||
print_xlat_ex(_IOC_TYPE(code), ioctl_type_str(_IOC_TYPE(code)),
|
||||
XLAT_STYLE_DEFAULT);
|
||||
tprintf(", %#x, %#x)", _IOC_NR(code), _IOC_SIZE(code));
|
||||
}
|
||||
|
||||
static int
|
||||
@ -85,8 +112,7 @@ evdev_decode_number(const unsigned int code)
|
||||
if (_IOC_DIR(code) == _IOC_WRITE) {
|
||||
if (nr >= 0xc0 && nr <= 0xc0 + 0x3f) {
|
||||
tprints("EVIOCSABS(");
|
||||
printxval_indexn(evdev_abs, evdev_abs_size, nr - 0xc0,
|
||||
"ABS_???");
|
||||
printxval(evdev_abs, nr - 0xc0, "ABS_???");
|
||||
tprints(")");
|
||||
return 1;
|
||||
}
|
||||
@ -105,42 +131,41 @@ evdev_decode_number(const unsigned int code)
|
||||
return 1;
|
||||
} else if (nr >= 0x40 && nr <= 0x40 + 0x3f) {
|
||||
tprints("EVIOCGABS(");
|
||||
printxval_indexn(evdev_abs, evdev_abs_size, nr - 0x40,
|
||||
"ABS_???");
|
||||
printxval(evdev_abs, nr - 0x40, "ABS_???");
|
||||
tprints(")");
|
||||
return 1;
|
||||
}
|
||||
|
||||
switch (_IOC_NR(nr)) {
|
||||
case 0x06:
|
||||
tprintf("EVIOCGNAME(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
case 0x07:
|
||||
tprintf("EVIOCGPHYS(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
case 0x08:
|
||||
tprintf("EVIOCGUNIQ(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
case 0x09:
|
||||
tprintf("EVIOCGPROP(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
case 0x0a:
|
||||
tprintf("EVIOCGMTSLOTS(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
case 0x18:
|
||||
tprintf("EVIOCGKEY(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
case 0x19:
|
||||
tprintf("EVIOCGLED(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
case 0x1a:
|
||||
tprintf("EVIOCGSND(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
case 0x1b:
|
||||
tprintf("EVIOCGSW(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
case 0x06:
|
||||
tprintf("EVIOCGNAME(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
case 0x07:
|
||||
tprintf("EVIOCGPHYS(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
case 0x08:
|
||||
tprintf("EVIOCGUNIQ(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
case 0x09:
|
||||
tprintf("EVIOCGPROP(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
case 0x0a:
|
||||
tprintf("EVIOCGMTSLOTS(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
case 0x18:
|
||||
tprintf("EVIOCGKEY(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
case 0x19:
|
||||
tprintf("EVIOCGLED(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
case 0x1a:
|
||||
tprintf("EVIOCGSND(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
case 0x1b:
|
||||
tprintf("EVIOCGSW(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -149,76 +174,105 @@ hiddev_decode_number(const unsigned int code)
|
||||
{
|
||||
if (_IOC_DIR(code) == _IOC_READ) {
|
||||
switch (_IOC_NR(code)) {
|
||||
case 0x04:
|
||||
tprintf("HIDIOCGRAWNAME(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
case 0x05:
|
||||
tprintf("HIDIOCGRAWPHYS(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
case 0x06:
|
||||
tprintf("HIDIOCSFEATURE(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
case 0x12:
|
||||
tprintf("HIDIOCGPHYS(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
case 0x04:
|
||||
tprintf("HIDIOCGRAWNAME(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
case 0x05:
|
||||
tprintf("HIDIOCGRAWPHYS(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
case 0x06:
|
||||
tprintf("HIDIOCSFEATURE(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
case 0x12:
|
||||
tprintf("HIDIOCGPHYS(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
} else if (_IOC_DIR(code) == (_IOC_READ | _IOC_WRITE)) {
|
||||
switch (_IOC_NR(code)) {
|
||||
case 0x06:
|
||||
tprintf("HIDIOCSFEATURE(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
case 0x07:
|
||||
tprintf("HIDIOCGFEATURE(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
case 0x06:
|
||||
tprintf("HIDIOCSFEATURE(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
case 0x07:
|
||||
tprintf("HIDIOCGFEATURE(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef SIOCPROTOPRIVATE
|
||||
# define SIOCPROTOPRIVATE 0x89E0
|
||||
#endif
|
||||
#ifndef SIOCDEVPRIVATE
|
||||
# define SIOCDEVPRIVATE 0x89F0
|
||||
#endif
|
||||
#ifndef SIOCIWFIRSTPRIV
|
||||
# define SIOCIWFIRSTPRIV 0x8BE0
|
||||
#endif
|
||||
#ifndef SIOCIWLASTPRIV
|
||||
# define SIOCIWLASTPRIV 0x8BFF
|
||||
#endif
|
||||
|
||||
static int
|
||||
ioctl_decode_command_number(struct tcb *tcp)
|
||||
{
|
||||
const unsigned int code = tcp->u_arg[1];
|
||||
|
||||
switch (_IOC_TYPE(code)) {
|
||||
case 'E':
|
||||
return evdev_decode_number(code);
|
||||
case 'H':
|
||||
return hiddev_decode_number(code);
|
||||
case 'M':
|
||||
if (_IOC_DIR(code) == _IOC_WRITE) {
|
||||
tprintf("MIXER_WRITE(%u)", _IOC_NR(code));
|
||||
return 1;
|
||||
} else if (_IOC_DIR(code) == _IOC_READ) {
|
||||
tprintf("MIXER_READ(%u)", _IOC_NR(code));
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
case 'U':
|
||||
if (_IOC_DIR(code) == _IOC_READ && _IOC_NR(code) == 0x2c) {
|
||||
tprintf("UI_GET_SYSNAME(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
case 'j':
|
||||
if (_IOC_DIR(code) == _IOC_READ && _IOC_NR(code) == 0x13) {
|
||||
tprintf("JSIOCGNAME(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
case 'k':
|
||||
if (_IOC_DIR(code) == _IOC_WRITE && _IOC_NR(code) == 0) {
|
||||
tprintf("SPI_IOC_MESSAGE(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
default:
|
||||
return 0;
|
||||
case 'E':
|
||||
return evdev_decode_number(code);
|
||||
case 'H':
|
||||
return hiddev_decode_number(code);
|
||||
case 'M':
|
||||
if (_IOC_DIR(code) == _IOC_WRITE) {
|
||||
tprintf("MIXER_WRITE(%u)", _IOC_NR(code));
|
||||
return 1;
|
||||
} else if (_IOC_DIR(code) == _IOC_READ) {
|
||||
tprintf("MIXER_READ(%u)", _IOC_NR(code));
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
case 'U':
|
||||
if (_IOC_DIR(code) == _IOC_READ && _IOC_NR(code) == 0x2c) {
|
||||
tprintf("UI_GET_SYSNAME(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
case 'j':
|
||||
if (_IOC_DIR(code) == _IOC_READ && _IOC_NR(code) == 0x13) {
|
||||
tprintf("JSIOCGNAME(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
case 'k':
|
||||
if (_IOC_DIR(code) == _IOC_WRITE && _IOC_NR(code) == 0) {
|
||||
tprintf("SPI_IOC_MESSAGE(%u)", _IOC_SIZE(code));
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
case SOCK_IOC_TYPE:
|
||||
if (code > SIOCPROTOPRIVATE && code <= SIOCPROTOPRIVATE + 15) {
|
||||
tprintf("SIOCPROTOPRIVATE+%u", code - SIOCPROTOPRIVATE);
|
||||
return 1;
|
||||
}
|
||||
if (code > SIOCDEVPRIVATE && code <= SIOCDEVPRIVATE + 15) {
|
||||
tprintf("SIOCDEVPRIVATE+%u", code - SIOCDEVPRIVATE);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
case 0x8B: /* 802.11 */
|
||||
if (code > SIOCIWFIRSTPRIV && code < SIOCIWLASTPRIV) {
|
||||
tprintf("SIOCIWFIRSTPRIV+%u", code - SIOCIWFIRSTPRIV);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -256,36 +310,22 @@ ioctl_decode(struct tcb *tcp)
|
||||
const kernel_ulong_t arg = tcp->u_arg[2];
|
||||
|
||||
switch (_IOC_TYPE(code)) {
|
||||
case '$':
|
||||
return perf_ioctl(tcp, code, arg);
|
||||
#if defined(ALPHA) || defined(POWERPC)
|
||||
case 'f': {
|
||||
int ret = file_ioctl(tcp, code, arg);
|
||||
if (ret != RVAL_DECODED)
|
||||
return ret;
|
||||
ATTRIBUTE_FALLTHROUGH;
|
||||
}
|
||||
case 't':
|
||||
case 'T':
|
||||
return term_ioctl(tcp, code, arg);
|
||||
#else /* !ALPHA */
|
||||
case 'f':
|
||||
return file_ioctl(tcp, code, arg);
|
||||
case 0x54:
|
||||
#endif /* !ALPHA */
|
||||
return term_ioctl(tcp, code, arg);
|
||||
case 0x89:
|
||||
return sock_ioctl(tcp, code, arg);
|
||||
case 'p':
|
||||
return rtc_ioctl(tcp, code, arg);
|
||||
case 0x03:
|
||||
return hdio_ioctl(tcp, code, arg);
|
||||
case 0x12:
|
||||
return block_ioctl(tcp, code, arg);
|
||||
case 'X':
|
||||
return fs_x_ioctl(tcp, code, arg);
|
||||
case 0x22:
|
||||
case '"': /* 0x22 */
|
||||
return scsi_ioctl(tcp, code, arg);
|
||||
case '$': /* 0x24 */
|
||||
return perf_ioctl(tcp, code, arg);
|
||||
case '=': /* 0x3d */
|
||||
return ptp_ioctl(tcp, code, arg);
|
||||
#ifdef HAVE_LINUX_INPUT_H
|
||||
case 'E':
|
||||
return evdev_ioctl(tcp, code, arg);
|
||||
#endif
|
||||
case 'I':
|
||||
return inotify_ioctl(tcp, code, arg);
|
||||
case 'L':
|
||||
return loop_ioctl(tcp, code, arg);
|
||||
#ifdef HAVE_STRUCT_MTD_WRITE_REQ
|
||||
@ -293,27 +333,48 @@ ioctl_decode(struct tcb *tcp)
|
||||
return mtd_ioctl(tcp, code, arg);
|
||||
#endif
|
||||
#ifdef HAVE_STRUCT_UBI_ATTACH_REQ_MAX_BEB_PER1024
|
||||
case 'o':
|
||||
case 'O':
|
||||
return ubi_ioctl(tcp, code, arg);
|
||||
#endif
|
||||
case 'T':
|
||||
return term_ioctl(tcp, code, arg);
|
||||
case 'V':
|
||||
return v4l2_ioctl(tcp, code, arg);
|
||||
#ifdef HAVE_STRUCT_PTP_SYS_OFFSET
|
||||
case '=':
|
||||
return ptp_ioctl(tcp, code, arg);
|
||||
case 'X':
|
||||
return fs_x_ioctl(tcp, code, arg);
|
||||
case 'f': {
|
||||
#if defined(ALPHA) || defined(POWERPC)
|
||||
int ret = file_ioctl(tcp, code, arg);
|
||||
if (ret != RVAL_DECODED)
|
||||
return ret;
|
||||
return term_ioctl(tcp, code, arg);
|
||||
#else /* !(ALPHA || POWERPC) */
|
||||
return file_ioctl(tcp, code, arg);
|
||||
#endif /* (ALPHA || POWERPC) */
|
||||
}
|
||||
#ifdef HAVE_STRUCT_UBI_ATTACH_REQ_MAX_BEB_PER1024
|
||||
case 'o':
|
||||
return ubi_ioctl(tcp, code, arg);
|
||||
#endif
|
||||
#ifdef HAVE_LINUX_INPUT_H
|
||||
case 'E':
|
||||
return evdev_ioctl(tcp, code, arg);
|
||||
case 'p':
|
||||
return rtc_ioctl(tcp, code, arg);
|
||||
#if defined(ALPHA) || defined(POWERPC)
|
||||
case 't':
|
||||
return term_ioctl(tcp, code, arg);
|
||||
#endif /* !ALPHA */
|
||||
case 0x89:
|
||||
return sock_ioctl(tcp, code, arg);
|
||||
#ifdef HAVE_LINUX_BTRFS_H
|
||||
case 0x94:
|
||||
return btrfs_ioctl(tcp, code, arg);
|
||||
#endif
|
||||
#ifdef HAVE_LINUX_USERFAULTFD_H
|
||||
case 0xaa:
|
||||
return uffdio_ioctl(tcp, code, arg);
|
||||
#endif
|
||||
#ifdef HAVE_LINUX_BTRFS_H
|
||||
case 0x94:
|
||||
return btrfs_ioctl(tcp, code, arg);
|
||||
#ifdef HAVE_LINUX_KVM_H
|
||||
case 0xae:
|
||||
return kvm_ioctl(tcp, code, arg);
|
||||
#endif
|
||||
case 0xb7:
|
||||
return nsfs_ioctl(tcp, code, arg);
|
||||
@ -321,12 +382,6 @@ ioctl_decode(struct tcb *tcp)
|
||||
case 0xfd:
|
||||
return dm_ioctl(tcp, code, arg);
|
||||
#endif
|
||||
#ifdef HAVE_LINUX_KVM_H
|
||||
case 0xae:
|
||||
return kvm_ioctl(tcp, code, arg);
|
||||
#endif
|
||||
case 'I':
|
||||
return inotify_ioctl(tcp, code, arg);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
48
ioprio.c
48
ioprio.c
@ -29,21 +29,7 @@
|
||||
#include "defs.h"
|
||||
#include "xstring.h"
|
||||
|
||||
enum {
|
||||
IOPRIO_WHO_PROCESS = 1,
|
||||
IOPRIO_WHO_PGRP,
|
||||
IOPRIO_WHO_USER
|
||||
};
|
||||
|
||||
#include "xlat/ioprio_who.h"
|
||||
|
||||
enum {
|
||||
IOPRIO_CLASS_NONE,
|
||||
IOPRIO_CLASS_RT,
|
||||
IOPRIO_CLASS_BE,
|
||||
IOPRIO_CLASS_IDLE
|
||||
};
|
||||
|
||||
#include "xlat/ioprio_class.h"
|
||||
|
||||
#define IOPRIO_CLASS_SHIFT (13)
|
||||
@ -68,13 +54,42 @@ sprint_ioprio(unsigned int ioprio)
|
||||
return outstr;
|
||||
}
|
||||
|
||||
void
|
||||
print_ioprio(unsigned int ioprio)
|
||||
{
|
||||
if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV)
|
||||
tprintf("%#x", ioprio);
|
||||
|
||||
if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
|
||||
return;
|
||||
|
||||
const char *str = sprint_ioprio(ioprio);
|
||||
|
||||
(xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE
|
||||
? tprints_comment : tprints)(str);
|
||||
}
|
||||
|
||||
static void
|
||||
print_ioprio_who(const char * prefix, int which, int who)
|
||||
{
|
||||
switch (which) {
|
||||
case IOPRIO_WHO_USER:
|
||||
printuid(prefix, who);
|
||||
break;
|
||||
case IOPRIO_WHO_PROCESS:
|
||||
case IOPRIO_WHO_PGRP:
|
||||
default:
|
||||
tprintf("%s%d", prefix, who);
|
||||
}
|
||||
}
|
||||
|
||||
SYS_FUNC(ioprio_get)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
/* int which */
|
||||
printxval(ioprio_who, tcp->u_arg[0], "IOPRIO_WHO_???");
|
||||
/* int who */
|
||||
tprintf(", %d", (int) tcp->u_arg[1]);
|
||||
print_ioprio_who(", ", tcp->u_arg[0], tcp->u_arg[1]);
|
||||
return 0;
|
||||
} else {
|
||||
if (syserror(tcp))
|
||||
@ -90,8 +105,9 @@ SYS_FUNC(ioprio_set)
|
||||
/* int which */
|
||||
printxval(ioprio_who, tcp->u_arg[0], "IOPRIO_WHO_???");
|
||||
/* int who */
|
||||
tprintf(", %d, ", (int) tcp->u_arg[1]);
|
||||
print_ioprio_who(", ", tcp->u_arg[0], tcp->u_arg[1]);
|
||||
/* int ioprio */
|
||||
tprints(", ");
|
||||
tprints(sprint_ioprio(tcp->u_arg[2]));
|
||||
|
||||
return RVAL_DECODED;
|
||||
|
@ -66,7 +66,7 @@ print_msqid_ds(struct tcb *const tcp, const kernel_ulong_t addr, int cmd)
|
||||
|
||||
tprints("{msg_perm={");
|
||||
printuid("uid=", msqid_ds.msg_perm.uid);
|
||||
printuid(", gid=", msqid_ds.msg_perm.gid);
|
||||
printgid(", gid=", msqid_ds.msg_perm.gid);
|
||||
tprints(", mode=");
|
||||
print_numeric_umode_t(msqid_ds.msg_perm.mode);
|
||||
|
||||
@ -77,7 +77,7 @@ print_msqid_ds(struct tcb *const tcp, const kernel_ulong_t addr, int cmd)
|
||||
|
||||
tprintf(", key=%u", (unsigned) msqid_ds.msg_perm.__key);
|
||||
printuid(", cuid=", msqid_ds.msg_perm.cuid);
|
||||
printuid(", cgid=", msqid_ds.msg_perm.cgid);
|
||||
printgid(", cgid=", msqid_ds.msg_perm.cgid);
|
||||
tprints("}");
|
||||
tprintf(", msg_stime=%u", (unsigned) msqid_ds.msg_stime);
|
||||
tprintf(", msg_rtime=%u", (unsigned) msqid_ds.msg_rtime);
|
||||
|
@ -89,14 +89,14 @@ SYS_FUNC(semtimedop)
|
||||
tprint_sembuf_array(tcp, tcp->u_arg[3], tcp->u_arg[1]);
|
||||
tprints(", ");
|
||||
#if defined(S390) || defined(S390X)
|
||||
print_timespec(tcp, tcp->u_arg[2]);
|
||||
print_timespec(tcp, tcp->u_arg[2], false);
|
||||
#else
|
||||
print_timespec(tcp, tcp->u_arg[4]);
|
||||
print_timespec(tcp, tcp->u_arg[4], false);
|
||||
#endif
|
||||
} else {
|
||||
tprint_sembuf_array(tcp, tcp->u_arg[1], tcp->u_arg[2]);
|
||||
tprints(", ");
|
||||
print_timespec(tcp, tcp->u_arg[3]);
|
||||
print_timespec(tcp, tcp->u_arg[3], false);
|
||||
}
|
||||
return RVAL_DECODED;
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ print_shmid_ds(struct tcb *const tcp, const kernel_ulong_t addr, int cmd)
|
||||
|
||||
tprints("{shm_perm={");
|
||||
printuid("uid=", shmid_ds.shm_perm.uid);
|
||||
printuid(", gid=", shmid_ds.shm_perm.gid);
|
||||
printgid(", gid=", shmid_ds.shm_perm.gid);
|
||||
tprints(", mode=");
|
||||
print_numeric_umode_t(shmid_ds.shm_perm.mode);
|
||||
|
||||
@ -77,7 +77,7 @@ print_shmid_ds(struct tcb *const tcp, const kernel_ulong_t addr, int cmd)
|
||||
|
||||
tprintf(", key=%u", (unsigned) shmid_ds.shm_perm.__key);
|
||||
printuid(", cuid=", shmid_ds.shm_perm.cuid);
|
||||
printuid(", cgid=", shmid_ds.shm_perm.cgid);
|
||||
printgid(", cgid=", shmid_ds.shm_perm.cgid);
|
||||
tprints("}");
|
||||
tprintf(", shm_segsz=%u", (unsigned) shmid_ds.shm_segsz);
|
||||
tprintf(", shm_cpid=%u", (unsigned) shmid_ds.shm_cpid);
|
||||
|
6
keyctl.c
6
keyctl.c
@ -147,7 +147,7 @@ keyctl_chown_key(struct tcb *tcp, key_serial_t id, unsigned user,
|
||||
{
|
||||
print_keyring_serial_number(id);
|
||||
printuid(", ", user);
|
||||
printuid(", ", group);
|
||||
printgid(", ", group);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -186,11 +186,9 @@ static void
|
||||
keyctl_reject_key(struct tcb *tcp, key_serial_t id1, unsigned timeout,
|
||||
unsigned error, key_serial_t id2)
|
||||
{
|
||||
const char *err_str = err_name(error);
|
||||
|
||||
print_keyring_serial_number(id1);
|
||||
tprintf(", %u, ", timeout);
|
||||
print_xlat_ex(error, err_str, XLAT_STYLE_FMT_U);
|
||||
print_err(error, false);
|
||||
tprints(", ");
|
||||
print_keyring_serial_number(id2);
|
||||
}
|
||||
|
14
kvm.c
14
kvm.c
@ -96,10 +96,9 @@ vcpu_register(struct tcb *const tcp, int fd, int cpuid)
|
||||
|
||||
struct vcpu_info *vcpu_info = vcpu_find(tcp, fd);
|
||||
|
||||
if (!vcpu_info)
|
||||
vcpu_info = vcpu_alloc(tcp, fd, cpuid);
|
||||
else if (vcpu_info->cpuid != cpuid)
|
||||
{
|
||||
if (!vcpu_info) {
|
||||
vcpu_alloc(tcp, fd, cpuid);
|
||||
} else if (vcpu_info->cpuid != cpuid) {
|
||||
vcpu_info->cpuid = cpuid;
|
||||
vcpu_info->resolved = false;
|
||||
}
|
||||
@ -137,7 +136,7 @@ vcpu_get_info(struct tcb *const tcp, int fd)
|
||||
const char *cpuid_str;
|
||||
|
||||
enum mmap_cache_rebuild_result mc_stat =
|
||||
mmap_cache_rebuild_if_invalid(tcp, __func__);
|
||||
mmap_cache_rebuild_if_invalid(tcp);
|
||||
if (mc_stat == MMAP_CACHE_REBUILD_NOCACHE)
|
||||
return NULL;
|
||||
|
||||
@ -329,7 +328,7 @@ kvm_ioctl_decode_check_extension(struct tcb *const tcp, const unsigned int code,
|
||||
const kernel_ulong_t arg)
|
||||
{
|
||||
tprints(", ");
|
||||
printxval_index(kvm_cap, arg, "KVM_CAP_???");
|
||||
printxval(kvm_cap, arg, "KVM_CAP_???");
|
||||
return RVAL_IOCTL_DECODED;
|
||||
}
|
||||
|
||||
@ -347,8 +346,7 @@ kvm_ioctl_run_attach_auxstr(struct tcb *const tcp,
|
||||
if (umove(tcp, info->mmap_addr, &vcpu_run_struct) < 0)
|
||||
return;
|
||||
|
||||
tcp->auxstr = xlat_idx(kvm_exit_reason, ARRAY_SIZE(kvm_exit_reason) - 1,
|
||||
vcpu_run_struct.exit_reason);
|
||||
tcp->auxstr = xlookup(kvm_exit_reason, vcpu_run_struct.exit_reason);
|
||||
if (!tcp->auxstr)
|
||||
tcp->auxstr = "KVM_EXIT_???";
|
||||
}
|
||||
|
2
linux/alpha/alt_errnoent.h
Normal file
2
linux/alpha/alt_errnoent.h
Normal file
@ -0,0 +1,2 @@
|
||||
_("EWOULDBLOCK", "EAGAIN"),
|
||||
_("EDEADLOCK", "EDEADLK" ),
|
4
linux/alpha/alt_signalent.h
Normal file
4
linux/alpha/alt_signalent.h
Normal file
@ -0,0 +1,4 @@
|
||||
_("SIGPOLL", "SIGIO"),
|
||||
_("SIGUNUSED", "31"),
|
||||
_("SIGPWR", "SIGINFO"),
|
||||
_("SIGIOT", "SIGABRT"),
|
@ -1,2 +1,3 @@
|
||||
#define HAVE_ARCH_GETRVAL2 1
|
||||
#define HAVE_ARCH_DEDICATED_ERR_REG 1
|
||||
#define HAVE_ARCH_UNALIGNED_ACCESS 0
|
||||
|
3
linux/alt_errnoent.h
Normal file
3
linux/alt_errnoent.h
Normal file
@ -0,0 +1,3 @@
|
||||
_("EWOULDBLOCK", "EAGAIN" ),
|
||||
_("ENOTSUP", "EOPNOTSUPP"),
|
||||
_("EDEADLOCK", "EDEADLK"),
|
4
linux/alt_signalent.h
Normal file
4
linux/alt_signalent.h
Normal file
@ -0,0 +1,4 @@
|
||||
_("SIGPOLL", "SIGIO"),
|
||||
_("SIGUNUSED", "31"),
|
||||
_("SIGINFO", "SIGPWR"),
|
||||
_("SIGIOT", "SIGABRT"),
|
@ -35,3 +35,7 @@
|
||||
#ifndef CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL
|
||||
# define CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL 0
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_ARCH_UNALIGNED_ACCESS
|
||||
# define HAVE_ARCH_UNALIGNED_ACCESS 1
|
||||
#endif
|
||||
|
@ -2,3 +2,4 @@
|
||||
#define HAVE_ARCH_OLD_SELECT 1
|
||||
#define HAVE_ARCH_UID16_SYSCALLS 1
|
||||
#define CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL 1
|
||||
#define HAVE_ARCH_UNALIGNED_ACCESS 0
|
||||
|
@ -249,7 +249,8 @@
|
||||
[219] = { 3, TM, SEN(mincore), "mincore" },
|
||||
[220] = { 3, TM, SEN(madvise), "madvise" },
|
||||
[221] = { 3, TD, SEN(fcntl64), "fcntl64" },
|
||||
[222 ... 223] = { },
|
||||
/* [222] - tux */
|
||||
/* [223] - unused */
|
||||
[224] = { 0, PU|NF, SEN(gettid), "gettid" },
|
||||
[225] = { 5, TD, SEN(readahead), "readahead" },
|
||||
[226] = { 5, TF, SEN(setxattr), "setxattr" },
|
||||
@ -280,7 +281,8 @@
|
||||
[251] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" },
|
||||
[252] = { 4, TD, SEN(epoll_wait), "epoll_wait" },
|
||||
[253] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" },
|
||||
[254 ... 255] = { },
|
||||
/* [254] - set_thread_area */
|
||||
/* [255] - get_thread_area */
|
||||
[256] = { 1, 0, SEN(set_tid_address), "set_tid_address" },
|
||||
[257] = { 3, 0, SEN(timer_create), "timer_create" },
|
||||
[258] = { 4, 0, SEN(timer_settime), "timer_settime" },
|
||||
@ -424,6 +426,7 @@
|
||||
[396] = { 1, 0, SEN(pkey_free), "pkey_free" },
|
||||
[397] = { 5, TD|TF|TSTA, SEN(statx), "statx" },
|
||||
[398] = { 4, 0, SEN(rseq), "rseq" },
|
||||
[399] = { 6, 0, SEN(io_pgetevents), "io_pgetevents" },
|
||||
|
||||
#ifdef __ARM_EABI__
|
||||
# define ARM_FIRST_SHUFFLED_SYSCALL 400
|
||||
@ -437,6 +440,7 @@
|
||||
* __ARM_NR_cmpxchg (0x000ffff0).
|
||||
* Remapped by shuffle_scno() to be directly after ordinary syscalls
|
||||
* in this table.
|
||||
* Removed in v4.4-rc1~163^2^3~13
|
||||
*/
|
||||
[ARM_FIRST_SHUFFLED_SYSCALL ] = { 5, 0, SEN(printargs), "cmpxchg" },
|
||||
|
||||
|
@ -60,20 +60,15 @@
|
||||
/* like another call */
|
||||
#define sys_acct sys_chdir
|
||||
#define sys_chroot sys_chdir
|
||||
#define sys_clock_getres sys_clock_gettime
|
||||
#define sys_connect sys_bind
|
||||
#define sys_fchdir sys_close
|
||||
#define sys_fdatasync sys_close
|
||||
#define sys_fsync sys_close
|
||||
#define sys_getegid sys_getuid
|
||||
#define sys_getegid16 sys_geteuid16
|
||||
#define sys_getegid sys_getgid
|
||||
#define sys_getegid16 sys_getgid16
|
||||
#define sys_geteuid sys_getuid
|
||||
#define sys_geteuid16 sys_getuid16
|
||||
#define sys_getgid sys_getuid
|
||||
#define sys_getgid16 sys_getuid16
|
||||
#define sys_getpeername sys_getsockname
|
||||
#define sys_getresgid sys_getresuid
|
||||
#define sys_getresgid16 sys_getresuid16
|
||||
#define sys_lstat sys_stat
|
||||
#define sys_lstat64 sys_stat64
|
||||
#define sys_mkdir sys_chmod
|
||||
@ -86,17 +81,7 @@
|
||||
#define sys_rename sys_link
|
||||
#define sys_rmdir sys_chdir
|
||||
#define sys_sched_get_priority_max sys_sched_get_priority_min
|
||||
#define sys_set_robust_list sys_munmap
|
||||
#define sys_setdomainname sys_sethostname
|
||||
#define sys_setfsgid sys_setfsuid
|
||||
#define sys_setfsgid16 sys_setfsuid16
|
||||
#define sys_setgid sys_setuid
|
||||
#define sys_setgid16 sys_setuid16
|
||||
#define sys_setregid sys_setreuid
|
||||
#define sys_setregid16 sys_setreuid16
|
||||
#define sys_setresgid sys_setresuid
|
||||
#define sys_setresgid16 sys_setresuid16
|
||||
#define sys_stime sys_time
|
||||
#define sys_swapoff sys_chdir
|
||||
#define sys_symlink sys_link
|
||||
#define sys_syncfs sys_close
|
||||
@ -111,7 +96,6 @@
|
||||
#define sys_getppid printargs
|
||||
#define sys_gettid printargs
|
||||
#define sys_idle printargs
|
||||
#define sys_inotify_init printargs
|
||||
#define sys_munlockall printargs
|
||||
#define sys_pause printargs
|
||||
#define sys_printargs printargs
|
||||
@ -147,7 +131,6 @@
|
||||
#define sys_lock printargs
|
||||
#define sys_mpx printargs
|
||||
#define sys_nfsservctl printargs
|
||||
#define sys_phys printargs
|
||||
#define sys_prof printargs
|
||||
#define sys_profil printargs
|
||||
#define sys_putpmsg printargs
|
||||
@ -161,8 +144,5 @@
|
||||
|
||||
/* deprecated */
|
||||
#define sys_bdflush printargs
|
||||
#define sys_oldolduname printargs
|
||||
#define sys_olduname printargs
|
||||
#define sys_sysfs printargs
|
||||
|
||||
#endif /* !STRACE_LINUX_DUMMY_H */
|
||||
|
5
linux/hppa/alt_errnoent.h
Normal file
5
linux/hppa/alt_errnoent.h
Normal file
@ -0,0 +1,5 @@
|
||||
_("EWOULDBLOCK", "EAGAIN"),
|
||||
_("EDEADLOCK", "EDEADLK"),
|
||||
_("EREFUSED", "ECONNREFUSED"),
|
||||
_("ECANCELED", "ECANCELLED"),
|
||||
|
@ -105,7 +105,7 @@
|
||||
[ 99] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" },
|
||||
[100] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" },
|
||||
[101] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" },
|
||||
[102] = { },
|
||||
/* [102] - was socketcall */
|
||||
[103] = { 3, 0, SEN(syslog), "syslog" },
|
||||
[104] = { 3, 0, SEN(setitimer), "setitimer" },
|
||||
[105] = { 2, 0, SEN(getitimer), "getitimer" },
|
||||
|
@ -103,7 +103,7 @@
|
||||
[ 73] = { 1, TS, SEN(sigpending), "sigpending" },
|
||||
[ 74] = { 2, 0, SEN(sethostname), "sethostname" },
|
||||
[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" },
|
||||
[ 76] = { 2, 0, SEN(getrlimit), "getrlimit" },
|
||||
[ 76] = { 2, 0, SEN(old_getrlimit), "getrlimit" },
|
||||
[ 77] = { 2, 0, SEN(getrusage), "getrusage" },
|
||||
[ 78] = { 2, 0, SEN(gettimeofday), "gettimeofday" },
|
||||
[ 79] = { 2, 0, SEN(settimeofday), "settimeofday" },
|
||||
|
@ -1,2 +1,4 @@
|
||||
#include <asm/ptrace_offsets.h>
|
||||
extern unsigned long *const ia64_frame_ptr;
|
||||
|
||||
#define IA64_SCNO_BASE (1 << 10)
|
||||
|
11
linux/ia64/shuffle_scno.c
Normal file
11
linux/ia64/shuffle_scno.c
Normal file
@ -0,0 +1,11 @@
|
||||
static_assert(!(IA64_SCNO_BASE & (IA64_SCNO_BASE - 1)),
|
||||
"IA64_SCNO_BASE is not a power of 2 (or zero)");
|
||||
static_assert(IA64_SCNO_BASE > nsyscalls0,
|
||||
"syscall table is too big, shuffling will only make everything "
|
||||
"worse");
|
||||
|
||||
kernel_ulong_t
|
||||
shuffle_scno(kernel_ulong_t scno)
|
||||
{
|
||||
return scno ^ IA64_SCNO_BASE;
|
||||
}
|
@ -27,329 +27,329 @@
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
[1024] = { 0, 0, SEN(printargs), "ni_syscall" },
|
||||
[1025] = { 1, TP|SE, SEN(exit), "exit" },
|
||||
[1026] = { 3, TD, SEN(read), "read" },
|
||||
[1027] = { 3, TD, SEN(write), "write" },
|
||||
[1028] = { 3, TD|TF, SEN(open), "open" },
|
||||
[1029] = { 1, TD, SEN(close), "close" },
|
||||
[1030] = { 2, TD|TF, SEN(creat), "creat" },
|
||||
[1031] = { 2, TF, SEN(link), "link" },
|
||||
[1032] = { 1, TF, SEN(unlink), "unlink" },
|
||||
[1033] = { 3, TF|TP|SE|SI, SEN(execve), "execve" },
|
||||
[1034] = { 1, TF, SEN(chdir), "chdir" },
|
||||
[1035] = { 1, TD, SEN(fchdir), "fchdir" },
|
||||
[1036] = { 2, TF, SEN(utimes), "utimes" },
|
||||
[1037] = { 3, TF, SEN(mknod), "mknod" },
|
||||
[1038] = { 2, TF, SEN(chmod), "chmod" },
|
||||
[1039] = { 3, TF, SEN(chown), "chown" },
|
||||
[1040] = { 3, TD, SEN(lseek), "lseek" },
|
||||
[1041] = { 0, PU|NF, SEN(getpid), "getpid" },
|
||||
[1042] = { 0, PU|NF, SEN(getppid), "getppid" },
|
||||
[1043] = { 5, TF, SEN(mount), "mount" },
|
||||
[1044] = { 2, TF, SEN(umount2), "umount" },
|
||||
[1045] = { 1, 0, SEN(setuid), "setuid" },
|
||||
[1046] = { 0, PU|NF, SEN(getuid), "getuid" },
|
||||
[1047] = { 0, PU|NF, SEN(geteuid), "geteuid" },
|
||||
[1048] = { 4, 0, SEN(ptrace), "ptrace" },
|
||||
[1049] = { 2, TF, SEN(access), "access" },
|
||||
[1050] = { 0, 0, SEN(sync), "sync" },
|
||||
[1051] = { 1, TD, SEN(fsync), "fsync" },
|
||||
[1052] = { 1, TD, SEN(fdatasync), "fdatasync" },
|
||||
[1053] = { 2, TS, SEN(kill), "kill" },
|
||||
[1054] = { 2, TF, SEN(rename), "rename" },
|
||||
[1055] = { 2, TF, SEN(mkdir), "mkdir" },
|
||||
[1056] = { 1, TF, SEN(rmdir), "rmdir" },
|
||||
[1057] = { 1, TD, SEN(dup), "dup" },
|
||||
[1058] = { 0, TD, SEN(pipe), "pipe" },
|
||||
[1059] = { 1, 0, SEN(times), "times" },
|
||||
[1060] = { 1, TM|SI, SEN(brk), "brk" },
|
||||
[1061] = { 1, 0, SEN(setgid), "setgid" },
|
||||
[1062] = { 0, PU|NF, SEN(getgid), "getgid" },
|
||||
[1063] = { 0, PU|NF, SEN(getegid), "getegid" },
|
||||
[1064] = { 1, TF, SEN(acct), "acct" },
|
||||
[1065] = { 3, TD, SEN(ioctl), "ioctl" },
|
||||
[1066] = { 3, TD, SEN(fcntl), "fcntl" },
|
||||
[1067] = { 1, NF, SEN(umask), "umask" },
|
||||
[1068] = { 1, TF, SEN(chroot), "chroot" },
|
||||
[1069] = { 2, TSFA, SEN(ustat), "ustat" },
|
||||
[1070] = { 2, TD, SEN(dup2), "dup2" },
|
||||
[1071] = { 2, 0, SEN(setreuid), "setreuid" },
|
||||
[1072] = { 2, 0, SEN(setregid), "setregid" },
|
||||
[1073] = { 3, 0, SEN(getresuid), "getresuid" },
|
||||
[1074] = { 3, 0, SEN(setresuid), "setresuid" },
|
||||
[1075] = { 3, 0, SEN(getresgid), "getresgid" },
|
||||
[1076] = { 3, 0, SEN(setresgid), "setresgid" },
|
||||
[1077] = { 2, 0, SEN(getgroups), "getgroups" },
|
||||
[1078] = { 2, 0, SEN(setgroups), "setgroups" },
|
||||
[1079] = { 1, 0, SEN(getpgid), "getpgid" },
|
||||
[1080] = { 2, 0, SEN(setpgid), "setpgid" },
|
||||
[1081] = { 0, 0, SEN(setsid), "setsid" },
|
||||
[1082] = { 1, 0, SEN(getsid), "getsid" },
|
||||
[1083] = { 2, 0, SEN(sethostname), "sethostname" },
|
||||
[1084] = { 2, 0, SEN(setrlimit), "setrlimit" },
|
||||
[1085] = { 2, 0, SEN(getrlimit), "getrlimit" },
|
||||
[1086] = { 2, 0, SEN(getrusage), "getrusage" },
|
||||
[1087] = { 2, 0, SEN(gettimeofday), "gettimeofday" },
|
||||
[1088] = { 2, 0, SEN(settimeofday), "settimeofday" },
|
||||
[1089] = { 5, TD, SEN(select), "select" },
|
||||
[1090] = { 3, TD, SEN(poll), "poll" },
|
||||
[1091] = { 2, TF, SEN(symlink), "symlink" },
|
||||
[1092] = { 3, TF, SEN(readlink), "readlink" },
|
||||
[1093] = { 1, TF, SEN(uselib), "uselib" },
|
||||
[1094] = { 2, TF, SEN(swapon), "swapon" },
|
||||
[1095] = { 1, TF, SEN(swapoff), "swapoff" },
|
||||
[1096] = { 4, 0, SEN(reboot), "reboot" },
|
||||
[1097] = { 2, TF, SEN(truncate), "truncate" },
|
||||
[1098] = { 2, TD, SEN(ftruncate), "ftruncate" },
|
||||
[1099] = { 2, TD, SEN(fchmod), "fchmod" },
|
||||
[1100] = { 3, TD, SEN(fchown), "fchown" },
|
||||
[1101] = { 2, 0, SEN(getpriority), "getpriority" },
|
||||
[1102] = { 3, 0, SEN(setpriority), "setpriority" },
|
||||
[1103] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" },
|
||||
[1104] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" },
|
||||
[1105] = { 0, PU|NF, SEN(gettid), "gettid" },
|
||||
[1106] = { 3, TI, SEN(semget), "semget" },
|
||||
[1107] = { 3, TI, SEN(semop), "semop" },
|
||||
[1108] = { 4, TI, SEN(semctl), "semctl" },
|
||||
[1109] = { 2, TI, SEN(msgget), "msgget" },
|
||||
[1110] = { 4, TI, SEN(msgsnd), "msgsnd" },
|
||||
[1111] = { 5, TI, SEN(msgrcv), "msgrcv" },
|
||||
[1112] = { 3, TI, SEN(msgctl), "msgctl" },
|
||||
[1113] = { 3, TI, SEN(shmget), "shmget" },
|
||||
[1114] = { 3, TI|TM|SI, SEN(shmat), "shmat" },
|
||||
[1115] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" },
|
||||
[1116] = { 3, TI, SEN(shmctl), "shmctl" },
|
||||
[1117] = { 3, 0, SEN(syslog), "syslog" },
|
||||
[1118] = { 3, 0, SEN(setitimer), "setitimer" },
|
||||
[1119] = { 2, 0, SEN(getitimer), "getitimer" },
|
||||
[1120] = { 2, TF|TST|TSTA, SEN(stat), "stat" },
|
||||
[1121] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" },
|
||||
[1122] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" },
|
||||
[1123] = { 0, 0, SEN(vhangup), "vhangup" },
|
||||
[1124] = { 3, TF, SEN(chown), "lchown" },
|
||||
[1125] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" },
|
||||
[1126] = { 4, TP, SEN(wait4), "wait4" },
|
||||
[1127] = { 1, 0, SEN(sysinfo), "sysinfo" },
|
||||
[1128] = { 5, TP, SEN(clone), "clone" },
|
||||
[1129] = { 2, 0, SEN(setdomainname), "setdomainname" },
|
||||
[1130] = { 1, 0, SEN(uname), "uname" },
|
||||
[1131] = { 1, 0, SEN(adjtimex), "adjtimex" },
|
||||
[1132] = { 2, 0, SEN(create_module), "create_module" },
|
||||
[1133] = { 3, 0, SEN(init_module), "init_module" },
|
||||
[1134] = { 2, 0, SEN(delete_module), "delete_module" },
|
||||
[1135] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" },
|
||||
[1136] = { 5, 0, SEN(query_module), "query_module" },
|
||||
[1137] = { 4, TF, SEN(quotactl), "quotactl" },
|
||||
[1138] = { 2, 0, SEN(bdflush), "bdflush" },
|
||||
[1139] = { 3, 0, SEN(sysfs), "sysfs" },
|
||||
[1140] = { 1, NF, SEN(personality), "personality" },
|
||||
[1141] = { 5, 0, SEN(afs_syscall), "afs_syscall" },
|
||||
[1142] = { 1, NF, SEN(setfsuid), "setfsuid" },
|
||||
[1143] = { 1, NF, SEN(setfsgid), "setfsgid" },
|
||||
[1144] = { 3, TD, SEN(getdents), "getdents" },
|
||||
[1145] = { 2, TD, SEN(flock), "flock" },
|
||||
[1146] = { 3, TD, SEN(readv), "readv" },
|
||||
[1147] = { 3, TD, SEN(writev), "writev" },
|
||||
[1148] = { 4, TD, SEN(pread), "pread64" },
|
||||
[1149] = { 4, TD, SEN(pwrite), "pwrite64" },
|
||||
[1150] = { 1, 0, SEN(printargs), "_sysctl" },
|
||||
[1151] = { 6, TD|TM|SI, SEN(mmap), "mmap" },
|
||||
[1152] = { 2, TM|SI, SEN(munmap), "munmap" },
|
||||
[1153] = { 2, TM, SEN(mlock), "mlock" },
|
||||
[1154] = { 1, TM, SEN(mlockall), "mlockall" },
|
||||
[1155] = { 3, TM|SI, SEN(mprotect), "mprotect" },
|
||||
[1156] = { 5, TM|SI, SEN(mremap), "mremap" },
|
||||
[1157] = { 3, TM, SEN(msync), "msync" },
|
||||
[1158] = { 2, TM, SEN(munlock), "munlock" },
|
||||
[1159] = { 0, TM, SEN(munlockall), "munlockall" },
|
||||
[1160] = { 2, 0, SEN(sched_getparam), "sched_getparam" },
|
||||
[1161] = { 2, 0, SEN(sched_setparam), "sched_setparam" },
|
||||
[1162] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" },
|
||||
[1163] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" },
|
||||
[1164] = { 0, 0, SEN(sched_yield), "sched_yield" },
|
||||
[1165] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"},
|
||||
[1166] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"},
|
||||
[1167] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" },
|
||||
[1168] = { 2, 0, SEN(nanosleep), "nanosleep" },
|
||||
[1169] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
|
||||
[1170] = { 5, 0, SEN(prctl), "prctl" },
|
||||
[1171] = { 0, PU|NF, SEN(getpagesize), "getpagesize" },
|
||||
[1172] = { 6, TD|TM|SI, SEN(mmap_pgoff), "mmap2" },
|
||||
[1173] = { 5, 0, SEN(printargs), "pciconfig_read" },
|
||||
[1174] = { 5, 0, SEN(printargs), "pciconfig_write" },
|
||||
[1175] = { MA, 0, SEN(printargs), "perfmonctl" },
|
||||
[1176] = { 2, TS, SEN(sigaltstack), "sigaltstack" },
|
||||
[1177] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
|
||||
[1178] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" },
|
||||
[1179] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
|
||||
[1180] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" },
|
||||
[1181] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
|
||||
[1182] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" },
|
||||
[1183] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" },
|
||||
[1184] = { 2, TF, SEN(getcwd), "getcwd" },
|
||||
[1185] = { 2, 0, SEN(capget), "capget" },
|
||||
[1186] = { 2, 0, SEN(capset), "capset" },
|
||||
[1187] = { 4, TD|TN, SEN(sendfile), "sendfile" },
|
||||
[1188] = { 5, TN, SEN(getpmsg), "getpmsg" },
|
||||
[1189] = { 5, TN, SEN(putpmsg), "putpmsg" },
|
||||
[1190] = { 3, TN, SEN(socket), "socket" },
|
||||
[1191] = { 3, TN, SEN(bind), "bind" },
|
||||
[1192] = { 3, TN, SEN(connect), "connect" },
|
||||
[1193] = { 2, TN, SEN(listen), "listen" },
|
||||
[1194] = { 3, TN, SEN(accept), "accept" },
|
||||
[1195] = { 3, TN, SEN(getsockname), "getsockname" },
|
||||
[1196] = { 3, TN, SEN(getpeername), "getpeername" },
|
||||
[1197] = { 4, TN, SEN(socketpair), "socketpair" },
|
||||
[1198] = { 4, TN, SEN(send), "send" },
|
||||
[1199] = { 6, TN, SEN(sendto), "sendto" },
|
||||
[1200] = { 4, TN, SEN(recv), "recv" },
|
||||
[1201] = { 6, TN, SEN(recvfrom), "recvfrom" },
|
||||
[1202] = { 2, TN, SEN(shutdown), "shutdown" },
|
||||
[1203] = { 5, TN, SEN(setsockopt), "setsockopt" },
|
||||
[1204] = { 5, TN, SEN(getsockopt), "getsockopt" },
|
||||
[1205] = { 3, TN, SEN(sendmsg), "sendmsg" },
|
||||
[1206] = { 3, TN, SEN(recvmsg), "recvmsg" },
|
||||
[1207] = { 2, TF, SEN(pivotroot), "pivot_root" },
|
||||
[1208] = { 3, TM, SEN(mincore), "mincore" },
|
||||
[1209] = { 3, TM, SEN(madvise), "madvise" },
|
||||
[1210] = { 2, TF|TST|TSTA, SEN(stat), "stat" },
|
||||
[1211] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" },
|
||||
[1212] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" },
|
||||
[1213] = { 6, TP, SEN(clone), "clone2" },
|
||||
[1214] = { 3, TD, SEN(getdents64), "getdents64" },
|
||||
[1215] = { 2, 0, SEN(printargs), "getunwind" },
|
||||
[1216] = { 3, TD, SEN(readahead), "readahead" },
|
||||
[1217] = { 5, TF, SEN(setxattr), "setxattr" },
|
||||
[1218] = { 5, TF, SEN(setxattr), "lsetxattr" },
|
||||
[1219] = { 5, TD, SEN(fsetxattr), "fsetxattr" },
|
||||
[1220] = { 4, TF, SEN(getxattr), "getxattr" },
|
||||
[1221] = { 4, TF, SEN(getxattr), "lgetxattr" },
|
||||
[1222] = { 4, TD, SEN(fgetxattr), "fgetxattr" },
|
||||
[1223] = { 3, TF, SEN(listxattr), "listxattr" },
|
||||
[1224] = { 3, TF, SEN(listxattr), "llistxattr" },
|
||||
[1225] = { 3, TD, SEN(flistxattr), "flistxattr" },
|
||||
[1226] = { 2, TF, SEN(removexattr), "removexattr" },
|
||||
[1227] = { 2, TF, SEN(removexattr), "lremovexattr" },
|
||||
[1228] = { 2, TD, SEN(fremovexattr), "fremovexattr" },
|
||||
[1229] = { 2, TS, SEN(kill), "tkill" },
|
||||
[1230] = { 6, 0, SEN(futex), "futex" },
|
||||
[1231] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" },
|
||||
[1232] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
|
||||
[1233] = { 1, 0, SEN(set_tid_address), "set_tid_address" },
|
||||
[1234] = { 4, TD, SEN(fadvise64), "fadvise64" },
|
||||
[1235] = { 3, TS, SEN(tgkill), "tgkill" },
|
||||
[1236] = { 1, TP|SE, SEN(exit), "exit_group" },
|
||||
[1237] = { 3, 0, SEN(lookup_dcookie), "lookup_dcookie" },
|
||||
[1238] = { 2, TM, SEN(io_setup), "io_setup" },
|
||||
[1239] = { 1, TM, SEN(io_destroy), "io_destroy" },
|
||||
[1240] = { 5, 0, SEN(io_getevents), "io_getevents" },
|
||||
[1241] = { 3, 0, SEN(io_submit), "io_submit" },
|
||||
[1242] = { 3, 0, SEN(io_cancel), "io_cancel" },
|
||||
[1243] = { 1, TD, SEN(epoll_create), "epoll_create" },
|
||||
[1244] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" },
|
||||
[1245] = { 4, TD, SEN(epoll_wait), "epoll_wait" },
|
||||
[1246] = { 0, 0, SEN(restart_syscall), "restart_syscall" },
|
||||
[1247] = { 4, TI, SEN(semtimedop), "semtimedop" },
|
||||
[1248] = { 3, 0, SEN(timer_create), "timer_create" },
|
||||
[1249] = { 4, 0, SEN(timer_settime), "timer_settime" },
|
||||
[1250] = { 2, 0, SEN(timer_gettime), "timer_gettime" },
|
||||
[1251] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" },
|
||||
[1252] = { 1, 0, SEN(timer_delete), "timer_delete" },
|
||||
[1253] = { 2, 0, SEN(clock_settime), "clock_settime" },
|
||||
[1254] = { 2, 0, SEN(clock_gettime), "clock_gettime" },
|
||||
[1255] = { 2, 0, SEN(clock_getres), "clock_getres" },
|
||||
[1256] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" },
|
||||
[1257] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" },
|
||||
[1258] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" },
|
||||
[1259] = { 6, TM, SEN(mbind), "mbind" },
|
||||
[1260] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" },
|
||||
[1261] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" },
|
||||
[1262] = { 4, TD, SEN(mq_open), "mq_open" },
|
||||
[1263] = { 1, 0, SEN(mq_unlink), "mq_unlink" },
|
||||
[1264] = { 5, TD, SEN(mq_timedsend), "mq_timedsend" },
|
||||
[1265] = { 5, TD, SEN(mq_timedreceive), "mq_timedreceive" },
|
||||
[1266] = { 2, TD, SEN(mq_notify), "mq_notify" },
|
||||
[1267] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" },
|
||||
[1268] = { 4, 0, SEN(kexec_load), "kexec_load" },
|
||||
[1269] = { 5, 0, SEN(vserver), "vserver" },
|
||||
[1270] = { 5, TP, SEN(waitid), "waitid" },
|
||||
[1271] = { 5, 0, SEN(add_key), "add_key" },
|
||||
[1272] = { 4, 0, SEN(request_key), "request_key" },
|
||||
[1273] = { 5, 0, SEN(keyctl), "keyctl" },
|
||||
[1274] = { 3, 0, SEN(ioprio_set), "ioprio_set" },
|
||||
[1275] = { 2, 0, SEN(ioprio_get), "ioprio_get" },
|
||||
[1276] = { 6, TM, SEN(move_pages), "move_pages" },
|
||||
[1277] = { 0, TD, SEN(inotify_init), "inotify_init" },
|
||||
[1278] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" },
|
||||
[1279] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" },
|
||||
[1280] = { 4, TM, SEN(migrate_pages), "migrate_pages" },
|
||||
[1281] = { 4, TD|TF, SEN(openat), "openat" },
|
||||
[1282] = { 3, TD|TF, SEN(mkdirat), "mkdirat" },
|
||||
[1283] = { 4, TD|TF, SEN(mknodat), "mknodat" },
|
||||
[1284] = { 5, TD|TF, SEN(fchownat), "fchownat" },
|
||||
[1285] = { 3, TD|TF, SEN(futimesat), "futimesat" },
|
||||
[1286] = { 4, TD|TF|TFST|TSTA,SEN(newfstatat), "newfstatat" },
|
||||
[1287] = { 3, TD|TF, SEN(unlinkat), "unlinkat" },
|
||||
[1288] = { 4, TD|TF, SEN(renameat), "renameat" },
|
||||
[1289] = { 5, TD|TF, SEN(linkat), "linkat" },
|
||||
[1290] = { 3, TD|TF, SEN(symlinkat), "symlinkat" },
|
||||
[1291] = { 4, TD|TF, SEN(readlinkat), "readlinkat" },
|
||||
[1292] = { 3, TD|TF, SEN(fchmodat), "fchmodat" },
|
||||
[1293] = { 3, TD|TF, SEN(faccessat), "faccessat" },
|
||||
[1294] = { 6, TD, SEN(pselect6), "pselect6" },
|
||||
[1295] = { 5, TD, SEN(ppoll), "ppoll" },
|
||||
[1296] = { 1, TP, SEN(unshare), "unshare" },
|
||||
[1297] = { 6, TD, SEN(splice), "splice" },
|
||||
[1298] = { 2, 0, SEN(set_robust_list), "set_robust_list" },
|
||||
[1299] = { 3, 0, SEN(get_robust_list), "get_robust_list" },
|
||||
[1300] = { 4, TD, SEN(sync_file_range), "sync_file_range" },
|
||||
[1301] = { 4, TD, SEN(tee), "tee" },
|
||||
[1302] = { 4, TD, SEN(vmsplice), "vmsplice" },
|
||||
[1303] = { 4, TD, SEN(fallocate), "fallocate" },
|
||||
[1304] = { 3, 0, SEN(getcpu), "getcpu" },
|
||||
[1305] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" },
|
||||
[1306] = { 4, TD|TF, SEN(utimensat), "utimensat" },
|
||||
[1307] = { 3, TD|TS, SEN(signalfd), "signalfd" },
|
||||
[1308] = { 4, TD, SEN(timerfd), "timerfd" },
|
||||
[1309] = { 1, TD, SEN(eventfd), "eventfd" },
|
||||
[1310] = { 2, TD, SEN(timerfd_create), "timerfd_create" },
|
||||
[1311] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" },
|
||||
[1312] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" },
|
||||
[1313] = { 4, TD|TS, SEN(signalfd4), "signalfd4" },
|
||||
[1314] = { 2, TD, SEN(eventfd2), "eventfd2" },
|
||||
[1315] = { 1, TD, SEN(epoll_create1), "epoll_create1" },
|
||||
[1316] = { 3, TD, SEN(dup3), "dup3" },
|
||||
[1317] = { 2, TD, SEN(pipe2), "pipe2" },
|
||||
[1318] = { 1, TD, SEN(inotify_init1), "inotify_init1" },
|
||||
[1319] = { 4, TD, SEN(preadv), "preadv" },
|
||||
[1320] = { 4, TD, SEN(pwritev), "pwritev" },
|
||||
[1321] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" },
|
||||
[1322] = { 5, TN, SEN(recvmmsg), "recvmmsg" },
|
||||
[1323] = { 2, TD, SEN(fanotify_init), "fanotify_init" },
|
||||
[1324] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" },
|
||||
[1325] = { 4, 0, SEN(prlimit64), "prlimit64" },
|
||||
[1326] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" },
|
||||
[1327] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" },
|
||||
[1328] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" },
|
||||
[1329] = { 1, TD, SEN(syncfs), "syncfs" },
|
||||
[1330] = { 2, TD, SEN(setns), "setns" },
|
||||
[1331] = { 4, TN, SEN(sendmmsg), "sendmmsg" },
|
||||
[1332] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" },
|
||||
[1333] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" },
|
||||
[1334] = { 4, TN, SEN(accept4), "accept4" },
|
||||
[1335] = { 3, TD, SEN(finit_module), "finit_module" },
|
||||
[1336] = { 3, 0, SEN(sched_setattr), "sched_setattr" },
|
||||
[1337] = { 4, 0, SEN(sched_getattr), "sched_getattr" },
|
||||
[1338] = { 5, TD|TF, SEN(renameat2), "renameat2" },
|
||||
[1339] = { 3, 0, SEN(getrandom), "getrandom" },
|
||||
[1340] = { 2, TD, SEN(memfd_create), "memfd_create" },
|
||||
[1341] = { 3, TD, SEN(bpf), "bpf" },
|
||||
[1342] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" },
|
||||
[1343] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
|
||||
[1344] = { 2, 0, SEN(membarrier), "membarrier" },
|
||||
[1345] = { 5, 0, SEN(kcmp), "kcmp" },
|
||||
[1346] = { 3, TM, SEN(mlock2), "mlock2" },
|
||||
[1347] = { 6, TD, SEN(copy_file_range), "copy_file_range" },
|
||||
[1348] = { 6, TD, SEN(preadv2), "preadv2" },
|
||||
[1349] = { 6, TD, SEN(pwritev2), "pwritev2" },
|
||||
[1024 - IA64_SCNO_BASE] = { 0, 0, SEN(printargs), "ni_syscall" },
|
||||
[1025 - IA64_SCNO_BASE] = { 1, TP|SE, SEN(exit), "exit" },
|
||||
[1026 - IA64_SCNO_BASE] = { 3, TD, SEN(read), "read" },
|
||||
[1027 - IA64_SCNO_BASE] = { 3, TD, SEN(write), "write" },
|
||||
[1028 - IA64_SCNO_BASE] = { 3, TD|TF, SEN(open), "open" },
|
||||
[1029 - IA64_SCNO_BASE] = { 1, TD, SEN(close), "close" },
|
||||
[1030 - IA64_SCNO_BASE] = { 2, TD|TF, SEN(creat), "creat" },
|
||||
[1031 - IA64_SCNO_BASE] = { 2, TF, SEN(link), "link" },
|
||||
[1032 - IA64_SCNO_BASE] = { 1, TF, SEN(unlink), "unlink" },
|
||||
[1033 - IA64_SCNO_BASE] = { 3, TF|TP|SE|SI, SEN(execve), "execve" },
|
||||
[1034 - IA64_SCNO_BASE] = { 1, TF, SEN(chdir), "chdir" },
|
||||
[1035 - IA64_SCNO_BASE] = { 1, TD, SEN(fchdir), "fchdir" },
|
||||
[1036 - IA64_SCNO_BASE] = { 2, TF, SEN(utimes), "utimes" },
|
||||
[1037 - IA64_SCNO_BASE] = { 3, TF, SEN(mknod), "mknod" },
|
||||
[1038 - IA64_SCNO_BASE] = { 2, TF, SEN(chmod), "chmod" },
|
||||
[1039 - IA64_SCNO_BASE] = { 3, TF, SEN(chown), "chown" },
|
||||
[1040 - IA64_SCNO_BASE] = { 3, TD, SEN(lseek), "lseek" },
|
||||
[1041 - IA64_SCNO_BASE] = { 0, PU|NF, SEN(getpid), "getpid" },
|
||||
[1042 - IA64_SCNO_BASE] = { 0, PU|NF, SEN(getppid), "getppid" },
|
||||
[1043 - IA64_SCNO_BASE] = { 5, TF, SEN(mount), "mount" },
|
||||
[1044 - IA64_SCNO_BASE] = { 2, TF, SEN(umount2), "umount" },
|
||||
[1045 - IA64_SCNO_BASE] = { 1, 0, SEN(setuid), "setuid" },
|
||||
[1046 - IA64_SCNO_BASE] = { 0, PU|NF, SEN(getuid), "getuid" },
|
||||
[1047 - IA64_SCNO_BASE] = { 0, PU|NF, SEN(geteuid), "geteuid" },
|
||||
[1048 - IA64_SCNO_BASE] = { 4, 0, SEN(ptrace), "ptrace" },
|
||||
[1049 - IA64_SCNO_BASE] = { 2, TF, SEN(access), "access" },
|
||||
[1050 - IA64_SCNO_BASE] = { 0, 0, SEN(sync), "sync" },
|
||||
[1051 - IA64_SCNO_BASE] = { 1, TD, SEN(fsync), "fsync" },
|
||||
[1052 - IA64_SCNO_BASE] = { 1, TD, SEN(fdatasync), "fdatasync" },
|
||||
[1053 - IA64_SCNO_BASE] = { 2, TS, SEN(kill), "kill" },
|
||||
[1054 - IA64_SCNO_BASE] = { 2, TF, SEN(rename), "rename" },
|
||||
[1055 - IA64_SCNO_BASE] = { 2, TF, SEN(mkdir), "mkdir" },
|
||||
[1056 - IA64_SCNO_BASE] = { 1, TF, SEN(rmdir), "rmdir" },
|
||||
[1057 - IA64_SCNO_BASE] = { 1, TD, SEN(dup), "dup" },
|
||||
[1058 - IA64_SCNO_BASE] = { 0, TD, SEN(pipe), "pipe" },
|
||||
[1059 - IA64_SCNO_BASE] = { 1, 0, SEN(times), "times" },
|
||||
[1060 - IA64_SCNO_BASE] = { 1, TM|SI, SEN(brk), "brk" },
|
||||
[1061 - IA64_SCNO_BASE] = { 1, 0, SEN(setgid), "setgid" },
|
||||
[1062 - IA64_SCNO_BASE] = { 0, PU|NF, SEN(getgid), "getgid" },
|
||||
[1063 - IA64_SCNO_BASE] = { 0, PU|NF, SEN(getegid), "getegid" },
|
||||
[1064 - IA64_SCNO_BASE] = { 1, TF, SEN(acct), "acct" },
|
||||
[1065 - IA64_SCNO_BASE] = { 3, TD, SEN(ioctl), "ioctl" },
|
||||
[1066 - IA64_SCNO_BASE] = { 3, TD, SEN(fcntl), "fcntl" },
|
||||
[1067 - IA64_SCNO_BASE] = { 1, NF, SEN(umask), "umask" },
|
||||
[1068 - IA64_SCNO_BASE] = { 1, TF, SEN(chroot), "chroot" },
|
||||
[1069 - IA64_SCNO_BASE] = { 2, TSFA, SEN(ustat), "ustat" },
|
||||
[1070 - IA64_SCNO_BASE] = { 2, TD, SEN(dup2), "dup2" },
|
||||
[1071 - IA64_SCNO_BASE] = { 2, 0, SEN(setreuid), "setreuid" },
|
||||
[1072 - IA64_SCNO_BASE] = { 2, 0, SEN(setregid), "setregid" },
|
||||
[1073 - IA64_SCNO_BASE] = { 3, 0, SEN(getresuid), "getresuid" },
|
||||
[1074 - IA64_SCNO_BASE] = { 3, 0, SEN(setresuid), "setresuid" },
|
||||
[1075 - IA64_SCNO_BASE] = { 3, 0, SEN(getresgid), "getresgid" },
|
||||
[1076 - IA64_SCNO_BASE] = { 3, 0, SEN(setresgid), "setresgid" },
|
||||
[1077 - IA64_SCNO_BASE] = { 2, 0, SEN(getgroups), "getgroups" },
|
||||
[1078 - IA64_SCNO_BASE] = { 2, 0, SEN(setgroups), "setgroups" },
|
||||
[1079 - IA64_SCNO_BASE] = { 1, 0, SEN(getpgid), "getpgid" },
|
||||
[1080 - IA64_SCNO_BASE] = { 2, 0, SEN(setpgid), "setpgid" },
|
||||
[1081 - IA64_SCNO_BASE] = { 0, 0, SEN(setsid), "setsid" },
|
||||
[1082 - IA64_SCNO_BASE] = { 1, 0, SEN(getsid), "getsid" },
|
||||
[1083 - IA64_SCNO_BASE] = { 2, 0, SEN(sethostname), "sethostname" },
|
||||
[1084 - IA64_SCNO_BASE] = { 2, 0, SEN(setrlimit), "setrlimit" },
|
||||
[1085 - IA64_SCNO_BASE] = { 2, 0, SEN(getrlimit), "getrlimit" },
|
||||
[1086 - IA64_SCNO_BASE] = { 2, 0, SEN(getrusage), "getrusage" },
|
||||
[1087 - IA64_SCNO_BASE] = { 2, 0, SEN(gettimeofday), "gettimeofday" },
|
||||
[1088 - IA64_SCNO_BASE] = { 2, 0, SEN(settimeofday), "settimeofday" },
|
||||
[1089 - IA64_SCNO_BASE] = { 5, TD, SEN(select), "select" },
|
||||
[1090 - IA64_SCNO_BASE] = { 3, TD, SEN(poll), "poll" },
|
||||
[1091 - IA64_SCNO_BASE] = { 2, TF, SEN(symlink), "symlink" },
|
||||
[1092 - IA64_SCNO_BASE] = { 3, TF, SEN(readlink), "readlink" },
|
||||
[1093 - IA64_SCNO_BASE] = { 1, TF, SEN(uselib), "uselib" },
|
||||
[1094 - IA64_SCNO_BASE] = { 2, TF, SEN(swapon), "swapon" },
|
||||
[1095 - IA64_SCNO_BASE] = { 1, TF, SEN(swapoff), "swapoff" },
|
||||
[1096 - IA64_SCNO_BASE] = { 4, 0, SEN(reboot), "reboot" },
|
||||
[1097 - IA64_SCNO_BASE] = { 2, TF, SEN(truncate), "truncate" },
|
||||
[1098 - IA64_SCNO_BASE] = { 2, TD, SEN(ftruncate), "ftruncate" },
|
||||
[1099 - IA64_SCNO_BASE] = { 2, TD, SEN(fchmod), "fchmod" },
|
||||
[1100 - IA64_SCNO_BASE] = { 3, TD, SEN(fchown), "fchown" },
|
||||
[1101 - IA64_SCNO_BASE] = { 2, 0, SEN(getpriority), "getpriority" },
|
||||
[1102 - IA64_SCNO_BASE] = { 3, 0, SEN(setpriority), "setpriority" },
|
||||
[1103 - IA64_SCNO_BASE] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" },
|
||||
[1104 - IA64_SCNO_BASE] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" },
|
||||
[1105 - IA64_SCNO_BASE] = { 0, PU|NF, SEN(gettid), "gettid" },
|
||||
[1106 - IA64_SCNO_BASE] = { 3, TI, SEN(semget), "semget" },
|
||||
[1107 - IA64_SCNO_BASE] = { 3, TI, SEN(semop), "semop" },
|
||||
[1108 - IA64_SCNO_BASE] = { 4, TI, SEN(semctl), "semctl" },
|
||||
[1109 - IA64_SCNO_BASE] = { 2, TI, SEN(msgget), "msgget" },
|
||||
[1110 - IA64_SCNO_BASE] = { 4, TI, SEN(msgsnd), "msgsnd" },
|
||||
[1111 - IA64_SCNO_BASE] = { 5, TI, SEN(msgrcv), "msgrcv" },
|
||||
[1112 - IA64_SCNO_BASE] = { 3, TI, SEN(msgctl), "msgctl" },
|
||||
[1113 - IA64_SCNO_BASE] = { 3, TI, SEN(shmget), "shmget" },
|
||||
[1114 - IA64_SCNO_BASE] = { 3, TI|TM|SI, SEN(shmat), "shmat" },
|
||||
[1115 - IA64_SCNO_BASE] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" },
|
||||
[1116 - IA64_SCNO_BASE] = { 3, TI, SEN(shmctl), "shmctl" },
|
||||
[1117 - IA64_SCNO_BASE] = { 3, 0, SEN(syslog), "syslog" },
|
||||
[1118 - IA64_SCNO_BASE] = { 3, 0, SEN(setitimer), "setitimer" },
|
||||
[1119 - IA64_SCNO_BASE] = { 2, 0, SEN(getitimer), "getitimer" },
|
||||
[1120 - IA64_SCNO_BASE] = { 2, TF|TST|TSTA, SEN(stat), "stat" },
|
||||
[1121 - IA64_SCNO_BASE] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" },
|
||||
[1122 - IA64_SCNO_BASE] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" },
|
||||
[1123 - IA64_SCNO_BASE] = { 0, 0, SEN(vhangup), "vhangup" },
|
||||
[1124 - IA64_SCNO_BASE] = { 3, TF, SEN(chown), "lchown" },
|
||||
[1125 - IA64_SCNO_BASE] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" },
|
||||
[1126 - IA64_SCNO_BASE] = { 4, TP, SEN(wait4), "wait4" },
|
||||
[1127 - IA64_SCNO_BASE] = { 1, 0, SEN(sysinfo), "sysinfo" },
|
||||
[1128 - IA64_SCNO_BASE] = { 5, TP, SEN(clone), "clone" },
|
||||
[1129 - IA64_SCNO_BASE] = { 2, 0, SEN(setdomainname), "setdomainname" },
|
||||
[1130 - IA64_SCNO_BASE] = { 1, 0, SEN(uname), "uname" },
|
||||
[1131 - IA64_SCNO_BASE] = { 1, 0, SEN(adjtimex), "adjtimex" },
|
||||
[1132 - IA64_SCNO_BASE] = { 2, 0, SEN(create_module), "create_module" },
|
||||
[1133 - IA64_SCNO_BASE] = { 3, 0, SEN(init_module), "init_module" },
|
||||
[1134 - IA64_SCNO_BASE] = { 2, 0, SEN(delete_module), "delete_module" },
|
||||
[1135 - IA64_SCNO_BASE] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" },
|
||||
[1136 - IA64_SCNO_BASE] = { 5, 0, SEN(query_module), "query_module" },
|
||||
[1137 - IA64_SCNO_BASE] = { 4, TF, SEN(quotactl), "quotactl" },
|
||||
[1138 - IA64_SCNO_BASE] = { 2, 0, SEN(bdflush), "bdflush" },
|
||||
[1139 - IA64_SCNO_BASE] = { 3, 0, SEN(sysfs), "sysfs" },
|
||||
[1140 - IA64_SCNO_BASE] = { 1, NF, SEN(personality), "personality" },
|
||||
[1141 - IA64_SCNO_BASE] = { 5, 0, SEN(afs_syscall), "afs_syscall" },
|
||||
[1142 - IA64_SCNO_BASE] = { 1, NF, SEN(setfsuid), "setfsuid" },
|
||||
[1143 - IA64_SCNO_BASE] = { 1, NF, SEN(setfsgid), "setfsgid" },
|
||||
[1144 - IA64_SCNO_BASE] = { 3, TD, SEN(getdents), "getdents" },
|
||||
[1145 - IA64_SCNO_BASE] = { 2, TD, SEN(flock), "flock" },
|
||||
[1146 - IA64_SCNO_BASE] = { 3, TD, SEN(readv), "readv" },
|
||||
[1147 - IA64_SCNO_BASE] = { 3, TD, SEN(writev), "writev" },
|
||||
[1148 - IA64_SCNO_BASE] = { 4, TD, SEN(pread), "pread64" },
|
||||
[1149 - IA64_SCNO_BASE] = { 4, TD, SEN(pwrite), "pwrite64" },
|
||||
[1150 - IA64_SCNO_BASE] = { 1, 0, SEN(printargs), "_sysctl" },
|
||||
[1151 - IA64_SCNO_BASE] = { 6, TD|TM|SI, SEN(mmap), "mmap" },
|
||||
[1152 - IA64_SCNO_BASE] = { 2, TM|SI, SEN(munmap), "munmap" },
|
||||
[1153 - IA64_SCNO_BASE] = { 2, TM, SEN(mlock), "mlock" },
|
||||
[1154 - IA64_SCNO_BASE] = { 1, TM, SEN(mlockall), "mlockall" },
|
||||
[1155 - IA64_SCNO_BASE] = { 3, TM|SI, SEN(mprotect), "mprotect" },
|
||||
[1156 - IA64_SCNO_BASE] = { 5, TM|SI, SEN(mremap), "mremap" },
|
||||
[1157 - IA64_SCNO_BASE] = { 3, TM, SEN(msync), "msync" },
|
||||
[1158 - IA64_SCNO_BASE] = { 2, TM, SEN(munlock), "munlock" },
|
||||
[1159 - IA64_SCNO_BASE] = { 0, TM, SEN(munlockall), "munlockall" },
|
||||
[1160 - IA64_SCNO_BASE] = { 2, 0, SEN(sched_getparam), "sched_getparam" },
|
||||
[1161 - IA64_SCNO_BASE] = { 2, 0, SEN(sched_setparam), "sched_setparam" },
|
||||
[1162 - IA64_SCNO_BASE] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" },
|
||||
[1163 - IA64_SCNO_BASE] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" },
|
||||
[1164 - IA64_SCNO_BASE] = { 0, 0, SEN(sched_yield), "sched_yield" },
|
||||
[1165 - IA64_SCNO_BASE] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"},
|
||||
[1166 - IA64_SCNO_BASE] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"},
|
||||
[1167 - IA64_SCNO_BASE] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" },
|
||||
[1168 - IA64_SCNO_BASE] = { 2, 0, SEN(nanosleep), "nanosleep" },
|
||||
[1169 - IA64_SCNO_BASE] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
|
||||
[1170 - IA64_SCNO_BASE] = { 5, 0, SEN(prctl), "prctl" },
|
||||
[1171 - IA64_SCNO_BASE] = { 0, PU|NF, SEN(getpagesize), "getpagesize" },
|
||||
[1172 - IA64_SCNO_BASE] = { 6, TD|TM|SI, SEN(mmap_pgoff), "mmap2" },
|
||||
[1173 - IA64_SCNO_BASE] = { 5, 0, SEN(printargs), "pciconfig_read" },
|
||||
[1174 - IA64_SCNO_BASE] = { 5, 0, SEN(printargs), "pciconfig_write" },
|
||||
[1175 - IA64_SCNO_BASE] = { MA, 0, SEN(printargs), "perfmonctl" },
|
||||
[1176 - IA64_SCNO_BASE] = { 2, TS, SEN(sigaltstack), "sigaltstack" },
|
||||
[1177 - IA64_SCNO_BASE] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
|
||||
[1178 - IA64_SCNO_BASE] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" },
|
||||
[1179 - IA64_SCNO_BASE] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
|
||||
[1180 - IA64_SCNO_BASE] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" },
|
||||
[1181 - IA64_SCNO_BASE] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
|
||||
[1182 - IA64_SCNO_BASE] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" },
|
||||
[1183 - IA64_SCNO_BASE] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" },
|
||||
[1184 - IA64_SCNO_BASE] = { 2, TF, SEN(getcwd), "getcwd" },
|
||||
[1185 - IA64_SCNO_BASE] = { 2, 0, SEN(capget), "capget" },
|
||||
[1186 - IA64_SCNO_BASE] = { 2, 0, SEN(capset), "capset" },
|
||||
[1187 - IA64_SCNO_BASE] = { 4, TD|TN, SEN(sendfile), "sendfile" },
|
||||
[1188 - IA64_SCNO_BASE] = { 5, TN, SEN(getpmsg), "getpmsg" },
|
||||
[1189 - IA64_SCNO_BASE] = { 5, TN, SEN(putpmsg), "putpmsg" },
|
||||
[1190 - IA64_SCNO_BASE] = { 3, TN, SEN(socket), "socket" },
|
||||
[1191 - IA64_SCNO_BASE] = { 3, TN, SEN(bind), "bind" },
|
||||
[1192 - IA64_SCNO_BASE] = { 3, TN, SEN(connect), "connect" },
|
||||
[1193 - IA64_SCNO_BASE] = { 2, TN, SEN(listen), "listen" },
|
||||
[1194 - IA64_SCNO_BASE] = { 3, TN, SEN(accept), "accept" },
|
||||
[1195 - IA64_SCNO_BASE] = { 3, TN, SEN(getsockname), "getsockname" },
|
||||
[1196 - IA64_SCNO_BASE] = { 3, TN, SEN(getpeername), "getpeername" },
|
||||
[1197 - IA64_SCNO_BASE] = { 4, TN, SEN(socketpair), "socketpair" },
|
||||
[1198 - IA64_SCNO_BASE] = { 4, TN, SEN(send), "send" },
|
||||
[1199 - IA64_SCNO_BASE] = { 6, TN, SEN(sendto), "sendto" },
|
||||
[1200 - IA64_SCNO_BASE] = { 4, TN, SEN(recv), "recv" },
|
||||
[1201 - IA64_SCNO_BASE] = { 6, TN, SEN(recvfrom), "recvfrom" },
|
||||
[1202 - IA64_SCNO_BASE] = { 2, TN, SEN(shutdown), "shutdown" },
|
||||
[1203 - IA64_SCNO_BASE] = { 5, TN, SEN(setsockopt), "setsockopt" },
|
||||
[1204 - IA64_SCNO_BASE] = { 5, TN, SEN(getsockopt), "getsockopt" },
|
||||
[1205 - IA64_SCNO_BASE] = { 3, TN, SEN(sendmsg), "sendmsg" },
|
||||
[1206 - IA64_SCNO_BASE] = { 3, TN, SEN(recvmsg), "recvmsg" },
|
||||
[1207 - IA64_SCNO_BASE] = { 2, TF, SEN(pivotroot), "pivot_root" },
|
||||
[1208 - IA64_SCNO_BASE] = { 3, TM, SEN(mincore), "mincore" },
|
||||
[1209 - IA64_SCNO_BASE] = { 3, TM, SEN(madvise), "madvise" },
|
||||
[1210 - IA64_SCNO_BASE] = { 2, TF|TST|TSTA, SEN(stat), "stat" },
|
||||
[1211 - IA64_SCNO_BASE] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" },
|
||||
[1212 - IA64_SCNO_BASE] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" },
|
||||
[1213 - IA64_SCNO_BASE] = { 6, TP, SEN(clone), "clone2" },
|
||||
[1214 - IA64_SCNO_BASE] = { 3, TD, SEN(getdents64), "getdents64" },
|
||||
[1215 - IA64_SCNO_BASE] = { 2, 0, SEN(printargs), "getunwind" },
|
||||
[1216 - IA64_SCNO_BASE] = { 3, TD, SEN(readahead), "readahead" },
|
||||
[1217 - IA64_SCNO_BASE] = { 5, TF, SEN(setxattr), "setxattr" },
|
||||
[1218 - IA64_SCNO_BASE] = { 5, TF, SEN(setxattr), "lsetxattr" },
|
||||
[1219 - IA64_SCNO_BASE] = { 5, TD, SEN(fsetxattr), "fsetxattr" },
|
||||
[1220 - IA64_SCNO_BASE] = { 4, TF, SEN(getxattr), "getxattr" },
|
||||
[1221 - IA64_SCNO_BASE] = { 4, TF, SEN(getxattr), "lgetxattr" },
|
||||
[1222 - IA64_SCNO_BASE] = { 4, TD, SEN(fgetxattr), "fgetxattr" },
|
||||
[1223 - IA64_SCNO_BASE] = { 3, TF, SEN(listxattr), "listxattr" },
|
||||
[1224 - IA64_SCNO_BASE] = { 3, TF, SEN(listxattr), "llistxattr" },
|
||||
[1225 - IA64_SCNO_BASE] = { 3, TD, SEN(flistxattr), "flistxattr" },
|
||||
[1226 - IA64_SCNO_BASE] = { 2, TF, SEN(removexattr), "removexattr" },
|
||||
[1227 - IA64_SCNO_BASE] = { 2, TF, SEN(removexattr), "lremovexattr" },
|
||||
[1228 - IA64_SCNO_BASE] = { 2, TD, SEN(fremovexattr), "fremovexattr" },
|
||||
[1229 - IA64_SCNO_BASE] = { 2, TS, SEN(kill), "tkill" },
|
||||
[1230 - IA64_SCNO_BASE] = { 6, 0, SEN(futex), "futex" },
|
||||
[1231 - IA64_SCNO_BASE] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" },
|
||||
[1232 - IA64_SCNO_BASE] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
|
||||
[1233 - IA64_SCNO_BASE] = { 1, 0, SEN(set_tid_address), "set_tid_address" },
|
||||
[1234 - IA64_SCNO_BASE] = { 4, TD, SEN(fadvise64), "fadvise64" },
|
||||
[1235 - IA64_SCNO_BASE] = { 3, TS, SEN(tgkill), "tgkill" },
|
||||
[1236 - IA64_SCNO_BASE] = { 1, TP|SE, SEN(exit), "exit_group" },
|
||||
[1237 - IA64_SCNO_BASE] = { 3, 0, SEN(lookup_dcookie), "lookup_dcookie" },
|
||||
[1238 - IA64_SCNO_BASE] = { 2, TM, SEN(io_setup), "io_setup" },
|
||||
[1239 - IA64_SCNO_BASE] = { 1, TM, SEN(io_destroy), "io_destroy" },
|
||||
[1240 - IA64_SCNO_BASE] = { 5, 0, SEN(io_getevents), "io_getevents" },
|
||||
[1241 - IA64_SCNO_BASE] = { 3, 0, SEN(io_submit), "io_submit" },
|
||||
[1242 - IA64_SCNO_BASE] = { 3, 0, SEN(io_cancel), "io_cancel" },
|
||||
[1243 - IA64_SCNO_BASE] = { 1, TD, SEN(epoll_create), "epoll_create" },
|
||||
[1244 - IA64_SCNO_BASE] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" },
|
||||
[1245 - IA64_SCNO_BASE] = { 4, TD, SEN(epoll_wait), "epoll_wait" },
|
||||
[1246 - IA64_SCNO_BASE] = { 0, 0, SEN(restart_syscall), "restart_syscall" },
|
||||
[1247 - IA64_SCNO_BASE] = { 4, TI, SEN(semtimedop), "semtimedop" },
|
||||
[1248 - IA64_SCNO_BASE] = { 3, 0, SEN(timer_create), "timer_create" },
|
||||
[1249 - IA64_SCNO_BASE] = { 4, 0, SEN(timer_settime), "timer_settime" },
|
||||
[1250 - IA64_SCNO_BASE] = { 2, 0, SEN(timer_gettime), "timer_gettime" },
|
||||
[1251 - IA64_SCNO_BASE] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" },
|
||||
[1252 - IA64_SCNO_BASE] = { 1, 0, SEN(timer_delete), "timer_delete" },
|
||||
[1253 - IA64_SCNO_BASE] = { 2, 0, SEN(clock_settime), "clock_settime" },
|
||||
[1254 - IA64_SCNO_BASE] = { 2, 0, SEN(clock_gettime), "clock_gettime" },
|
||||
[1255 - IA64_SCNO_BASE] = { 2, 0, SEN(clock_getres), "clock_getres" },
|
||||
[1256 - IA64_SCNO_BASE] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" },
|
||||
[1257 - IA64_SCNO_BASE] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" },
|
||||
[1258 - IA64_SCNO_BASE] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" },
|
||||
[1259 - IA64_SCNO_BASE] = { 6, TM, SEN(mbind), "mbind" },
|
||||
[1260 - IA64_SCNO_BASE] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" },
|
||||
[1261 - IA64_SCNO_BASE] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" },
|
||||
[1262 - IA64_SCNO_BASE] = { 4, TD, SEN(mq_open), "mq_open" },
|
||||
[1263 - IA64_SCNO_BASE] = { 1, 0, SEN(mq_unlink), "mq_unlink" },
|
||||
[1264 - IA64_SCNO_BASE] = { 5, TD, SEN(mq_timedsend), "mq_timedsend" },
|
||||
[1265 - IA64_SCNO_BASE] = { 5, TD, SEN(mq_timedreceive), "mq_timedreceive" },
|
||||
[1266 - IA64_SCNO_BASE] = { 2, TD, SEN(mq_notify), "mq_notify" },
|
||||
[1267 - IA64_SCNO_BASE] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" },
|
||||
[1268 - IA64_SCNO_BASE] = { 4, 0, SEN(kexec_load), "kexec_load" },
|
||||
[1269 - IA64_SCNO_BASE] = { 5, 0, SEN(vserver), "vserver" },
|
||||
[1270 - IA64_SCNO_BASE] = { 5, TP, SEN(waitid), "waitid" },
|
||||
[1271 - IA64_SCNO_BASE] = { 5, 0, SEN(add_key), "add_key" },
|
||||
[1272 - IA64_SCNO_BASE] = { 4, 0, SEN(request_key), "request_key" },
|
||||
[1273 - IA64_SCNO_BASE] = { 5, 0, SEN(keyctl), "keyctl" },
|
||||
[1274 - IA64_SCNO_BASE] = { 3, 0, SEN(ioprio_set), "ioprio_set" },
|
||||
[1275 - IA64_SCNO_BASE] = { 2, 0, SEN(ioprio_get), "ioprio_get" },
|
||||
[1276 - IA64_SCNO_BASE] = { 6, TM, SEN(move_pages), "move_pages" },
|
||||
[1277 - IA64_SCNO_BASE] = { 0, TD, SEN(inotify_init), "inotify_init" },
|
||||
[1278 - IA64_SCNO_BASE] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" },
|
||||
[1279 - IA64_SCNO_BASE] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" },
|
||||
[1280 - IA64_SCNO_BASE] = { 4, TM, SEN(migrate_pages), "migrate_pages" },
|
||||
[1281 - IA64_SCNO_BASE] = { 4, TD|TF, SEN(openat), "openat" },
|
||||
[1282 - IA64_SCNO_BASE] = { 3, TD|TF, SEN(mkdirat), "mkdirat" },
|
||||
[1283 - IA64_SCNO_BASE] = { 4, TD|TF, SEN(mknodat), "mknodat" },
|
||||
[1284 - IA64_SCNO_BASE] = { 5, TD|TF, SEN(fchownat), "fchownat" },
|
||||
[1285 - IA64_SCNO_BASE] = { 3, TD|TF, SEN(futimesat), "futimesat" },
|
||||
[1286 - IA64_SCNO_BASE] = { 4, TD|TF|TFST|TSTA,SEN(newfstatat), "newfstatat" },
|
||||
[1287 - IA64_SCNO_BASE] = { 3, TD|TF, SEN(unlinkat), "unlinkat" },
|
||||
[1288 - IA64_SCNO_BASE] = { 4, TD|TF, SEN(renameat), "renameat" },
|
||||
[1289 - IA64_SCNO_BASE] = { 5, TD|TF, SEN(linkat), "linkat" },
|
||||
[1290 - IA64_SCNO_BASE] = { 3, TD|TF, SEN(symlinkat), "symlinkat" },
|
||||
[1291 - IA64_SCNO_BASE] = { 4, TD|TF, SEN(readlinkat), "readlinkat" },
|
||||
[1292 - IA64_SCNO_BASE] = { 3, TD|TF, SEN(fchmodat), "fchmodat" },
|
||||
[1293 - IA64_SCNO_BASE] = { 3, TD|TF, SEN(faccessat), "faccessat" },
|
||||
[1294 - IA64_SCNO_BASE] = { 6, TD, SEN(pselect6), "pselect6" },
|
||||
[1295 - IA64_SCNO_BASE] = { 5, TD, SEN(ppoll), "ppoll" },
|
||||
[1296 - IA64_SCNO_BASE] = { 1, TP, SEN(unshare), "unshare" },
|
||||
[1297 - IA64_SCNO_BASE] = { 6, TD, SEN(splice), "splice" },
|
||||
[1298 - IA64_SCNO_BASE] = { 2, 0, SEN(set_robust_list), "set_robust_list" },
|
||||
[1299 - IA64_SCNO_BASE] = { 3, 0, SEN(get_robust_list), "get_robust_list" },
|
||||
[1300 - IA64_SCNO_BASE] = { 4, TD, SEN(sync_file_range), "sync_file_range" },
|
||||
[1301 - IA64_SCNO_BASE] = { 4, TD, SEN(tee), "tee" },
|
||||
[1302 - IA64_SCNO_BASE] = { 4, TD, SEN(vmsplice), "vmsplice" },
|
||||
[1303 - IA64_SCNO_BASE] = { 4, TD, SEN(fallocate), "fallocate" },
|
||||
[1304 - IA64_SCNO_BASE] = { 3, 0, SEN(getcpu), "getcpu" },
|
||||
[1305 - IA64_SCNO_BASE] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" },
|
||||
[1306 - IA64_SCNO_BASE] = { 4, TD|TF, SEN(utimensat), "utimensat" },
|
||||
[1307 - IA64_SCNO_BASE] = { 3, TD|TS, SEN(signalfd), "signalfd" },
|
||||
[1308 - IA64_SCNO_BASE] = { 4, TD, SEN(timerfd), "timerfd" },
|
||||
[1309 - IA64_SCNO_BASE] = { 1, TD, SEN(eventfd), "eventfd" },
|
||||
[1310 - IA64_SCNO_BASE] = { 2, TD, SEN(timerfd_create), "timerfd_create" },
|
||||
[1311 - IA64_SCNO_BASE] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" },
|
||||
[1312 - IA64_SCNO_BASE] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" },
|
||||
[1313 - IA64_SCNO_BASE] = { 4, TD|TS, SEN(signalfd4), "signalfd4" },
|
||||
[1314 - IA64_SCNO_BASE] = { 2, TD, SEN(eventfd2), "eventfd2" },
|
||||
[1315 - IA64_SCNO_BASE] = { 1, TD, SEN(epoll_create1), "epoll_create1" },
|
||||
[1316 - IA64_SCNO_BASE] = { 3, TD, SEN(dup3), "dup3" },
|
||||
[1317 - IA64_SCNO_BASE] = { 2, TD, SEN(pipe2), "pipe2" },
|
||||
[1318 - IA64_SCNO_BASE] = { 1, TD, SEN(inotify_init1), "inotify_init1" },
|
||||
[1319 - IA64_SCNO_BASE] = { 4, TD, SEN(preadv), "preadv" },
|
||||
[1320 - IA64_SCNO_BASE] = { 4, TD, SEN(pwritev), "pwritev" },
|
||||
[1321 - IA64_SCNO_BASE] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" },
|
||||
[1322 - IA64_SCNO_BASE] = { 5, TN, SEN(recvmmsg), "recvmmsg" },
|
||||
[1323 - IA64_SCNO_BASE] = { 2, TD, SEN(fanotify_init), "fanotify_init" },
|
||||
[1324 - IA64_SCNO_BASE] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" },
|
||||
[1325 - IA64_SCNO_BASE] = { 4, 0, SEN(prlimit64), "prlimit64" },
|
||||
[1326 - IA64_SCNO_BASE] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" },
|
||||
[1327 - IA64_SCNO_BASE] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" },
|
||||
[1328 - IA64_SCNO_BASE] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" },
|
||||
[1329 - IA64_SCNO_BASE] = { 1, TD, SEN(syncfs), "syncfs" },
|
||||
[1330 - IA64_SCNO_BASE] = { 2, TD, SEN(setns), "setns" },
|
||||
[1331 - IA64_SCNO_BASE] = { 4, TN, SEN(sendmmsg), "sendmmsg" },
|
||||
[1332 - IA64_SCNO_BASE] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" },
|
||||
[1333 - IA64_SCNO_BASE] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" },
|
||||
[1334 - IA64_SCNO_BASE] = { 4, TN, SEN(accept4), "accept4" },
|
||||
[1335 - IA64_SCNO_BASE] = { 3, TD, SEN(finit_module), "finit_module" },
|
||||
[1336 - IA64_SCNO_BASE] = { 3, 0, SEN(sched_setattr), "sched_setattr" },
|
||||
[1337 - IA64_SCNO_BASE] = { 4, 0, SEN(sched_getattr), "sched_getattr" },
|
||||
[1338 - IA64_SCNO_BASE] = { 5, TD|TF, SEN(renameat2), "renameat2" },
|
||||
[1339 - IA64_SCNO_BASE] = { 3, 0, SEN(getrandom), "getrandom" },
|
||||
[1340 - IA64_SCNO_BASE] = { 2, TD, SEN(memfd_create), "memfd_create" },
|
||||
[1341 - IA64_SCNO_BASE] = { 3, TD, SEN(bpf), "bpf" },
|
||||
[1342 - IA64_SCNO_BASE] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" },
|
||||
[1343 - IA64_SCNO_BASE] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
|
||||
[1344 - IA64_SCNO_BASE] = { 2, 0, SEN(membarrier), "membarrier" },
|
||||
[1345 - IA64_SCNO_BASE] = { 5, 0, SEN(kcmp), "kcmp" },
|
||||
[1346 - IA64_SCNO_BASE] = { 3, TM, SEN(mlock2), "mlock2" },
|
||||
[1347 - IA64_SCNO_BASE] = { 6, TD, SEN(copy_file_range), "copy_file_range" },
|
||||
[1348 - IA64_SCNO_BASE] = { 6, TD, SEN(preadv2), "preadv2" },
|
||||
[1349 - IA64_SCNO_BASE] = { 6, TD, SEN(pwritev2), "pwritev2" },
|
||||
|
@ -109,6 +109,7 @@ enum {
|
||||
INET_DIAG_MARK,
|
||||
INET_DIAG_BBRINFO,
|
||||
INET_DIAG_CLASS_ID,
|
||||
INET_DIAG_MD5SIG,
|
||||
};
|
||||
|
||||
/* INET_DIAG_MEM */
|
||||
@ -145,4 +146,15 @@ struct tcp_bbr_info {
|
||||
uint32_t bbr_cwnd_gain;
|
||||
};
|
||||
|
||||
/* INET_DIAG_MD5SIG */
|
||||
#define TCP_MD5SIG_MAXKEYLEN 80
|
||||
|
||||
struct tcp_diag_md5sig {
|
||||
uint8_t tcpm_family;
|
||||
uint8_t tcpm_prefixlen;
|
||||
uint16_t tcpm_keylen;
|
||||
uint32_t tcpm_addr[4]; /* big endian */
|
||||
uint8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN];
|
||||
};
|
||||
|
||||
#endif /* !STRACE_LINUX_INET_DIAG_H */
|
||||
|
@ -103,7 +103,7 @@
|
||||
[ 73] = { 1, TS, SEN(sigpending), "sigpending" },
|
||||
[ 74] = { 2, 0, SEN(sethostname), "sethostname" },
|
||||
[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" },
|
||||
[ 76] = { 2, 0, SEN(getrlimit), "getrlimit" },
|
||||
[ 76] = { 2, 0, SEN(old_getrlimit), "getrlimit" },
|
||||
[ 77] = { 2, 0, SEN(getrusage), "getrusage" },
|
||||
[ 78] = { 2, 0, SEN(gettimeofday), "gettimeofday" },
|
||||
[ 79] = { 2, 0, SEN(settimeofday), "settimeofday" },
|
||||
|
@ -103,7 +103,7 @@
|
||||
[ 73] = { 1, TS, SEN(sigpending), "sigpending" },
|
||||
[ 74] = { 2, 0, SEN(sethostname), "sethostname" },
|
||||
[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" },
|
||||
[ 76] = { 2, 0, SEN(getrlimit), "getrlimit" },
|
||||
[ 76] = { 2, 0, SEN(old_getrlimit), "getrlimit" },
|
||||
[ 77] = { 2, 0, SEN(getrusage), "getrusage" },
|
||||
[ 78] = { 2, 0, SEN(gettimeofday), "gettimeofday" },
|
||||
[ 79] = { 2, 0, SEN(settimeofday), "settimeofday" },
|
||||
|
1
linux/mips/alt_errnoent.h
Normal file
1
linux/mips/alt_errnoent.h
Normal file
@ -0,0 +1 @@
|
||||
_("EWOULDBLOCK", "EAGAIN"),
|
4
linux/mips/alt_signalent.h
Normal file
4
linux/mips/alt_signalent.h
Normal file
@ -0,0 +1,4 @@
|
||||
_("SIGPOLL", "SIGIO"),
|
||||
_("SIGUNUSED", "31"),
|
||||
_("SIGINFO", "SIGPWR"),
|
||||
_("SIGABRT, ""SIGIOT"),
|
@ -18,6 +18,9 @@ get_syscall_args(struct tcb *tcp)
|
||||
&& umoven(tcp, mips_REG_SP + 4 * sizeof(tcp->u_arg[0]),
|
||||
(tcp->s_ent->nargs - 4) * sizeof(tcp->u_arg[0]),
|
||||
&tcp->u_arg[4]) < 0) {
|
||||
error_msg("pid %d: can't fetch syscall arguments 5 and 6 from "
|
||||
"tracee's memory", tcp->pid);
|
||||
|
||||
/*
|
||||
* Let's proceed with the first 4 arguments
|
||||
* instead of reporting the failure.
|
||||
|
@ -222,7 +222,7 @@
|
||||
[4218] = { 3, TM, SEN(madvise), "madvise" },
|
||||
[4219] = { 3, TD, SEN(getdents64), "getdents64" },
|
||||
[4220] = { 3, TD, SEN(fcntl64), "fcntl64" },
|
||||
[4221] = { },
|
||||
[4221] = { 0, 0, SEN(printargs), "reserved221" },
|
||||
[4222] = { 0, PU|NF, SEN(gettid), "gettid" },
|
||||
[4223] = { 5, TD, SEN(readahead), "readahead" },
|
||||
[4224] = { 5, TF, SEN(setxattr), "setxattr" },
|
||||
|
2
linux/powerpc/alt_errnoent.h
Normal file
2
linux/powerpc/alt_errnoent.h
Normal file
@ -0,0 +1,2 @@
|
||||
_("EWOULDBLOCK", "EAGAIN"),
|
||||
_("ENOTSUP", "EOPNOTSUPP"),
|
@ -1,3 +1,4 @@
|
||||
#define HAVE_ARCH_OLD_SELECT 1
|
||||
#define HAVE_ARCH_DEDICATED_ERR_REG 1
|
||||
#define CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL 1
|
||||
#define HAVE_ARCH_UNALIGNED_ACCESS 0
|
||||
|
@ -103,7 +103,7 @@
|
||||
[ 73] = { 1, TS, SEN(sigpending), "sigpending" },
|
||||
[ 74] = { 2, 0, SEN(sethostname), "sethostname" },
|
||||
[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" },
|
||||
[ 76] = { 2, 0, SEN(getrlimit), "getrlimit" },
|
||||
[ 76] = { 2, 0, SEN(old_getrlimit), "getrlimit" },
|
||||
[ 77] = { 2, 0, SEN(getrusage), "getrusage" },
|
||||
[ 78] = { 2, 0, SEN(gettimeofday), "gettimeofday" },
|
||||
[ 79] = { 2, 0, SEN(settimeofday), "settimeofday" },
|
||||
|
1
linux/powerpc64/alt_errnoent.h
Normal file
1
linux/powerpc64/alt_errnoent.h
Normal file
@ -0,0 +1 @@
|
||||
#include "powerpc/alt_errnoent.h"
|
@ -1,3 +1,4 @@
|
||||
#define HAVE_ARCH_OLD_SELECT 1
|
||||
#define SUPPORTED_PERSONALITIES 2
|
||||
#define HAVE_ARCH_DEDICATED_ERR_REG 1
|
||||
#define HAVE_ARCH_UNALIGNED_ACCESS 0
|
||||
|
@ -105,7 +105,7 @@
|
||||
[ 73] = { 1, TS, SEN(sigpending), "sigpending" },
|
||||
[ 74] = { 2, 0, SEN(sethostname), "sethostname" },
|
||||
[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" },
|
||||
[ 76] = { 2, 0, SEN(getrlimit), "getrlimit" },
|
||||
[ 76] = { 2, 0, SEN(old_getrlimit), "getrlimit" },
|
||||
[ 77] = { 2, 0, SEN(getrusage), "getrusage" },
|
||||
[ 78] = { 2, 0, SEN(gettimeofday), "gettimeofday" },
|
||||
[ 79] = { 2, 0, SEN(settimeofday), "settimeofday" },
|
||||
|
@ -105,7 +105,7 @@
|
||||
[ 73] = { 1, TS, SEN(sigpending), "sigpending" },
|
||||
[ 74] = { 2, 0, SEN(sethostname), "sethostname" },
|
||||
[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" },
|
||||
[ 76] = { 2, 0, SEN(getrlimit), "getrlimit" },
|
||||
[ 76] = { 2, 0, SEN(old_getrlimit), "getrlimit" },
|
||||
[ 77] = { 2, 0, SEN(getrusage), "getrusage" },
|
||||
[ 78] = { 2, 0, SEN(gettimeofday), "gettimeofday" },
|
||||
[ 79] = { 2, 0, SEN(settimeofday), "settimeofday" },
|
||||
|
@ -103,7 +103,7 @@
|
||||
[ 73] = { 1, TS, SEN(sigpending), "sigpending" },
|
||||
[ 74] = { 2, 0, SEN(sethostname), "sethostname" },
|
||||
[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" },
|
||||
[ 76] = { 2, 0, SEN(getrlimit), "getrlimit" },
|
||||
[ 76] = { 2, 0, SEN(old_getrlimit), "getrlimit" },
|
||||
[ 77] = { 2, 0, SEN(getrusage), "getrusage" },
|
||||
[ 78] = { 2, 0, SEN(gettimeofday), "gettimeofday" },
|
||||
[ 79] = { 2, 0, SEN(settimeofday), "settimeofday" },
|
||||
|
@ -16,7 +16,10 @@ struct smc_diag_req {
|
||||
struct smc_diag_msg {
|
||||
uint8_t diag_family;
|
||||
uint8_t diag_state;
|
||||
uint8_t diag_fallback;
|
||||
union {
|
||||
uint8_t diag_fallback;
|
||||
uint8_t diag_mode;
|
||||
};
|
||||
uint8_t diag_shutdown;
|
||||
struct inet_diag_sockid id;
|
||||
|
||||
|
1
linux/sparc/alt_errnoent.h
Normal file
1
linux/sparc/alt_errnoent.h
Normal file
@ -0,0 +1 @@
|
||||
_("EWOULDBLOCK", "EAGAIN"),
|
4
linux/sparc/alt_signalent.h
Normal file
4
linux/sparc/alt_signalent.h
Normal file
@ -0,0 +1,4 @@
|
||||
_("SIGPOLL", "SIGIO"),
|
||||
_("SIGUNUSED", "31"),
|
||||
_("SIGPWR", "SIGLOST"),
|
||||
_("SIGIOT", "SIGABRT"),
|
@ -3,3 +3,4 @@
|
||||
#define HAVE_ARCH_SA_RESTORER 1
|
||||
#define HAVE_ARCH_DEDICATED_ERR_REG 1
|
||||
#define CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL 1
|
||||
#define HAVE_ARCH_UNALIGNED_ACCESS 0
|
||||
|
1
linux/sparc64/alt_signalent.h
Normal file
1
linux/sparc64/alt_signalent.h
Normal file
@ -0,0 +1 @@
|
||||
#include "sparc/alt_signalent.h"
|
@ -38,12 +38,18 @@
|
||||
extern SYS_FUNC(chown16);
|
||||
extern SYS_FUNC(fchown16);
|
||||
extern SYS_FUNC(getgroups16);
|
||||
extern SYS_FUNC(getresgid16);
|
||||
extern SYS_FUNC(getresuid16);
|
||||
extern SYS_FUNC(getgid16);
|
||||
extern SYS_FUNC(getuid16);
|
||||
extern SYS_FUNC(setfsgid16);
|
||||
extern SYS_FUNC(setfsuid16);
|
||||
extern SYS_FUNC(setgroups16);
|
||||
extern SYS_FUNC(setresgid16);
|
||||
extern SYS_FUNC(setresuid16);
|
||||
extern SYS_FUNC(setregid16);
|
||||
extern SYS_FUNC(setreuid16);
|
||||
extern SYS_FUNC(setgid16);
|
||||
extern SYS_FUNC(setuid16);
|
||||
#endif /* HAVE_ARCH_UID16_SYSCALLS */
|
||||
|
||||
|
6
loop.c
6
loop.c
@ -37,7 +37,11 @@ typedef struct loop_info struct_loop_info;
|
||||
#include MPERS_DEFS
|
||||
|
||||
#include "print_fields.h"
|
||||
#include "xlat/loop_cmds.h"
|
||||
|
||||
#define XLAT_MACROS_ONLY
|
||||
# include "xlat/loop_cmds.h"
|
||||
#undef XLAT_MACROS_ONLY
|
||||
|
||||
#include "xlat/loop_flags_options.h"
|
||||
#include "xlat/loop_crypt_type_options.h"
|
||||
|
||||
|
21
m4/gen_ptp_clock_m4.awk
Normal file
21
m4/gen_ptp_clock_m4.awk
Normal file
@ -0,0 +1,21 @@
|
||||
/^struct (strace_ptp_[^[:space:]]+)[[:space:]]+{/ {
|
||||
match($0, /^struct strace_(ptp_[^[:space:]]+)[[:space:]]+{/, a)
|
||||
|
||||
struct_name = a[1]
|
||||
prefix = "struct " struct_name
|
||||
|
||||
in_struct = 1
|
||||
next
|
||||
}
|
||||
|
||||
/^};/ {
|
||||
in_struct = 0
|
||||
next
|
||||
}
|
||||
|
||||
(in_struct == 1) {
|
||||
if (match($0, /^[[:space:]]+([^;\[\]]+[[:space:]]+)+([^[:space:]\[\];]+)(\[[^;]*\])?;$/, a)) {
|
||||
print "\t\t" prefix "." a[2] ","
|
||||
}
|
||||
}
|
||||
|
43
m4/gen_ptp_clock_m4.sh
Executable file
43
m4/gen_ptp_clock_m4.sh
Executable file
@ -0,0 +1,43 @@
|
||||
#!/bin/sh -efu
|
||||
# Copyright (c) 2018 Dmitry V. Levin <ldv@altlinux.org>
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. The name of the author may not be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
input=ptp_clock.h
|
||||
output="${0%/*}"/ptp_clock.m4
|
||||
exec > "$output"
|
||||
|
||||
cat <<EOF
|
||||
dnl Generated by $0 from $input; do not edit.
|
||||
AC_DEFUN([st_PTP_CLOCK], [dnl
|
||||
AC_CHECK_MEMBERS(m4_normalize([
|
||||
EOF
|
||||
|
||||
gawk -f "${0%/*}"/gen_ptp_clock_m4.awk < "$input" | sort -u
|
||||
|
||||
cat <<'EOF'
|
||||
struct ptp_clock_dummy.dummy
|
||||
]),,, [#include <linux/ptp_clock.h>])
|
||||
])
|
||||
EOF
|
4
macros.h
4
macros.h
@ -48,6 +48,10 @@
|
||||
#endif
|
||||
#define CLAMP(val, min, max) MIN(MAX(min, val), max)
|
||||
|
||||
#ifndef ROUNDUP
|
||||
# define ROUNDUP(val_, div_) ((((val_) + (div_) - 1) / (div_)) * (div_))
|
||||
#endif
|
||||
|
||||
#ifndef offsetofend
|
||||
# define offsetofend(type_, member_) \
|
||||
(offsetof(type_, member_) + sizeof(((type_ *)0)->member_))
|
||||
|
@ -129,7 +129,7 @@ while read name_ rest; do
|
||||
printf '%s\n' "$name_ $rest"
|
||||
continue ;;
|
||||
esac
|
||||
sed -rn 's/#define[[:space:]]+('"$name_"')[[:space:]]+([x[:xdigit:]]+).*$/\2\t\1/p' \
|
||||
sed -rn 's/#[[:space:]]*define[[:space:]]+('"$name_"')[[:space:]]+([x[:xdigit:]]+).*$/\2\t\1/p' \
|
||||
$LINUX_SRC/include/uapi/$COMMON_DEFS_GLOB_PATTERN |
|
||||
sort -n | {
|
||||
def=
|
||||
@ -143,7 +143,7 @@ while read name_ rest; do
|
||||
name="$name_"
|
||||
fi
|
||||
|
||||
grep -oEH '#define[[:space:]]+'"$name"'[[:space:]]+(0x[[:xdigit:]]+|[[:digit:]]+)' \
|
||||
grep -oEH '#[[:space:]]*define[[:space:]]+'"$name"'[[:space:]]+(0x[[:xdigit:]]+|[[:digit:]]+)' \
|
||||
$LINUX_SRC/arch/*/include/uapi/$ARCH_DEFS_FILE |
|
||||
sed -rn 's|^[^#]*/arch/([^/]+)/include/uapi/'"$ARCH_DEFS_FILE"':#define[[:space:]]+'"$name"'[[:space:]]+([^[:space:]]+)([[:space:]].*)?$|\1\t\2|p' |
|
||||
sed s/parisc/hppa/ |
|
||||
|
17
mmap_cache.c
17
mmap_cache.c
@ -94,7 +94,7 @@ delete_mmap_cache(struct tcb *tcp, const char *caller)
|
||||
* e.g. mmap, mprotect, munmap, execve.
|
||||
*/
|
||||
extern enum mmap_cache_rebuild_result
|
||||
mmap_cache_rebuild_if_invalid(struct tcb *tcp, const char *caller)
|
||||
mmap_cache_rebuild_if_invalid_(struct tcb *tcp, const char *caller)
|
||||
{
|
||||
if (tcp->mmap_cache
|
||||
&& tcp->mmap_cache->generation != mmap_cache_generation)
|
||||
@ -245,3 +245,18 @@ mmap_cache_search_custom(struct tcb *tcp, mmap_cache_search_fn fn, void *data)
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
mmap_cache_free_(struct tcb *tcp, const char *caller)
|
||||
{
|
||||
if (!tcp->mmap_cache)
|
||||
return;
|
||||
|
||||
if (!tcp->mmap_cache->free_fn) {
|
||||
error_func_msg("pid %d: mmap_cache has NULL free_fn "
|
||||
"(called from %s)", tcp->pid, caller);
|
||||
return;
|
||||
}
|
||||
|
||||
tcp->mmap_cache->free_fn(tcp, caller);
|
||||
}
|
||||
|
@ -79,7 +79,9 @@ extern void
|
||||
mmap_cache_enable(void);
|
||||
|
||||
extern enum mmap_cache_rebuild_result
|
||||
mmap_cache_rebuild_if_invalid(struct tcb *, const char *caller);
|
||||
mmap_cache_rebuild_if_invalid_(struct tcb *, const char *caller);
|
||||
#define mmap_cache_rebuild_if_invalid(tcp_) \
|
||||
mmap_cache_rebuild_if_invalid_((tcp_), __func__)
|
||||
|
||||
extern struct mmap_cache_entry_t *
|
||||
mmap_cache_search(struct tcb *, unsigned long ip);
|
||||
@ -87,4 +89,8 @@ mmap_cache_search(struct tcb *, unsigned long ip);
|
||||
extern struct mmap_cache_entry_t *
|
||||
mmap_cache_search_custom(struct tcb *, mmap_cache_search_fn, void *);
|
||||
|
||||
extern void
|
||||
mmap_cache_free_(struct tcb *tcp, const char *caller);
|
||||
#define mmap_cache_free(tcp_) mmap_cache_free_((tcp_), __func__)
|
||||
|
||||
#endif /* !STRACE_MMAP_CACHE_H */
|
||||
|
@ -211,7 +211,7 @@ SYS_FUNC(recvmmsg)
|
||||
/* flags */
|
||||
printflags(msg_flags, tcp->u_arg[3], "MSG_???");
|
||||
tprints(", ");
|
||||
print_timespec(tcp, tcp->u_arg[4]);
|
||||
print_timespec(tcp, tcp->u_arg[4], false);
|
||||
}
|
||||
return 0;
|
||||
} else {
|
||||
|
4
mq.c
4
mq.c
@ -53,7 +53,7 @@ SYS_FUNC(mq_timedsend)
|
||||
printstrn(tcp, tcp->u_arg[1], tcp->u_arg[2]);
|
||||
tprintf(", %" PRI_klu ", %u, ", tcp->u_arg[2],
|
||||
(unsigned int) tcp->u_arg[3]);
|
||||
print_timespec(tcp, tcp->u_arg[4]);
|
||||
print_timespec(tcp, tcp->u_arg[4], true);
|
||||
return RVAL_DECODED;
|
||||
}
|
||||
|
||||
@ -76,7 +76,7 @@ SYS_FUNC(mq_timedreceive)
|
||||
* whether the syscall has failed or not.
|
||||
*/
|
||||
temporarily_clear_syserror(tcp);
|
||||
print_timespec(tcp, tcp->u_arg[4]);
|
||||
print_timespec(tcp, tcp->u_arg[4], true);
|
||||
restore_cleared_syserror(tcp);
|
||||
}
|
||||
return 0;
|
||||
|
21
msghdr.c
21
msghdr.c
@ -88,7 +88,7 @@ print_scm_creds(struct tcb *tcp, const void *cmsg_data,
|
||||
|
||||
PRINT_FIELD_U("{", *uc, pid);
|
||||
PRINT_FIELD_UID(", ", *uc, uid);
|
||||
PRINT_FIELD_UID(", ", *uc, gid);
|
||||
PRINT_FIELD_GID(", ", *uc, gid);
|
||||
tprints("}");
|
||||
}
|
||||
|
||||
@ -103,21 +103,21 @@ static void
|
||||
print_scm_timestamp(struct tcb *tcp, const void *cmsg_data,
|
||||
const unsigned int data_len)
|
||||
{
|
||||
print_struct_timeval_data_size(cmsg_data, data_len);
|
||||
print_struct_timeval_data_size(cmsg_data, data_len, true);
|
||||
}
|
||||
|
||||
static void
|
||||
print_scm_timestampns(struct tcb *tcp, const void *cmsg_data,
|
||||
const unsigned int data_len)
|
||||
{
|
||||
print_struct_timespec_data_size(cmsg_data, data_len);
|
||||
print_struct_timespec_data_size(cmsg_data, data_len, true);
|
||||
}
|
||||
|
||||
static void
|
||||
print_scm_timestamping(struct tcb *tcp, const void *cmsg_data,
|
||||
const unsigned int data_len)
|
||||
{
|
||||
print_struct_timespec_array_data_size(cmsg_data, 3, data_len);
|
||||
print_struct_timespec_array_data_size(cmsg_data, 3, data_len, true);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -132,6 +132,15 @@ print_cmsg_ip_pktinfo(struct tcb *tcp, const void *cmsg_data,
|
||||
tprints("}");
|
||||
}
|
||||
|
||||
static void
|
||||
print_cmsg_int(struct tcb *tcp, const void *cmsg_data,
|
||||
const unsigned int data_len)
|
||||
{
|
||||
const int *p = cmsg_data;
|
||||
|
||||
tprintf("[%d]", *p);
|
||||
}
|
||||
|
||||
static void
|
||||
print_cmsg_uint(struct tcb *tcp, const void *cmsg_data,
|
||||
const unsigned int data_len)
|
||||
@ -219,7 +228,8 @@ static const struct {
|
||||
[SCM_SECURITY] = { print_scm_security, 1 },
|
||||
[SCM_TIMESTAMP] = { print_scm_timestamp, 1 },
|
||||
[SCM_TIMESTAMPNS] = { print_scm_timestampns, 1 },
|
||||
[SCM_TIMESTAMPING] = { print_scm_timestamping, 1 }
|
||||
[SCM_TIMESTAMPING] = { print_scm_timestamping, 1 },
|
||||
[SO_RXQ_OVFL] = { print_cmsg_uint, sizeof(unsigned int) },
|
||||
}, cmsg_ip_printers[] = {
|
||||
[IP_PKTINFO] = { print_cmsg_ip_pktinfo, sizeof(struct in_pktinfo) },
|
||||
[IP_TTL] = { print_cmsg_uint, sizeof(unsigned int) },
|
||||
@ -229,6 +239,7 @@ static const struct {
|
||||
[IP_RECVERR] = { print_cmsg_ip_recverr, sizeof(struct sock_ee) },
|
||||
[IP_ORIGDSTADDR] = { print_cmsg_ip_origdstaddr, sizeof(struct sockaddr_in) },
|
||||
[IP_CHECKSUM] = { print_cmsg_uint, sizeof(unsigned int) },
|
||||
[IP_RECVFRAGSIZE] = { print_cmsg_int, sizeof(int) },
|
||||
[SCM_SECURITY] = { print_scm_security, 1 }
|
||||
};
|
||||
|
||||
|
92
net.c
92
net.c
@ -86,7 +86,9 @@
|
||||
|
||||
#define XLAT_MACROS_ONLY
|
||||
# include "xlat/addrfams.h"
|
||||
# include "xlat/ethernet_protocols.h"
|
||||
#undef XLAT_MACROS_ONLY
|
||||
#include "xlat/ax25_protocols.h"
|
||||
#include "xlat/irda_protocols.h"
|
||||
#include "xlat/can_protocols.h"
|
||||
#include "xlat/bt_protocols.h"
|
||||
@ -132,6 +134,18 @@ tprint_sock_type(unsigned int flags)
|
||||
printflags(sock_type_flags, flags, "SOCK_???");
|
||||
}
|
||||
|
||||
void
|
||||
socket_exiting_cb(struct tcb *tcp)
|
||||
{
|
||||
if (syserror(tcp) || syscall_tampered_nofail(tcp)
|
||||
|| tcp->u_arg[0] != AF_NETLINK)
|
||||
return;
|
||||
|
||||
uint64_t inode = getfdinode(tcp, tcp->u_rval);
|
||||
|
||||
set_netlink_family_cache_entry(inode, tcp->u_arg[2]);
|
||||
}
|
||||
|
||||
SYS_FUNC(socket)
|
||||
{
|
||||
printxval(addrfams, tcp->u_arg[0], "AF_???");
|
||||
@ -141,23 +155,36 @@ SYS_FUNC(socket)
|
||||
switch (tcp->u_arg[0]) {
|
||||
case AF_INET:
|
||||
case AF_INET6:
|
||||
printxval_search(inet_protocols, tcp->u_arg[2], "IPPROTO_???");
|
||||
printxval(inet_protocols, tcp->u_arg[2], "IPPROTO_???");
|
||||
break;
|
||||
|
||||
case AF_AX25:
|
||||
/* Those are not available in a public header */
|
||||
printxval_ex(ax25_protocols, tcp->u_arg[2], "AX25_P_???",
|
||||
XLAT_STYLE_VERBOSE);
|
||||
break;
|
||||
|
||||
case AF_NETLINK:
|
||||
printxval(netlink_protocols, tcp->u_arg[2], "NETLINK_???");
|
||||
break;
|
||||
|
||||
case AF_PACKET:
|
||||
tprints("htons(");
|
||||
printxval(ethernet_protocols, ntohs(tcp->u_arg[2]),
|
||||
"ETH_P_???");
|
||||
tprints(")");
|
||||
break;
|
||||
|
||||
case AF_IRDA:
|
||||
printxval_index(can_protocols, tcp->u_arg[2], "IRDAPROTO_???");
|
||||
printxval(can_protocols, tcp->u_arg[2], "IRDAPROTO_???");
|
||||
break;
|
||||
|
||||
case AF_CAN:
|
||||
printxval_index(can_protocols, tcp->u_arg[2], "CAN_???");
|
||||
printxval(can_protocols, tcp->u_arg[2], "CAN_???");
|
||||
break;
|
||||
|
||||
case AF_BLUETOOTH:
|
||||
printxval_index(bt_protocols, tcp->u_arg[2], "BTPROTO_???");
|
||||
printxval(bt_protocols, tcp->u_arg[2], "BTPROTO_???");
|
||||
break;
|
||||
|
||||
case AF_RXRPC:
|
||||
@ -169,24 +196,23 @@ SYS_FUNC(socket)
|
||||
break;
|
||||
|
||||
case AF_PHONET:
|
||||
printxval_index(phonet_protocols, tcp->u_arg[2], "PN_PROTO_???");
|
||||
printxval(phonet_protocols, tcp->u_arg[2], "PN_PROTO_???");
|
||||
break;
|
||||
|
||||
case AF_CAIF:
|
||||
printxval_index(caif_protocols, tcp->u_arg[2], "CAIFPROTO_???");
|
||||
printxval(caif_protocols, tcp->u_arg[2], "CAIFPROTO_???");
|
||||
break;
|
||||
|
||||
case AF_NFC:
|
||||
printxval_index(nfc_protocols, tcp->u_arg[2],
|
||||
"NFC_SOCKPROTO_???");
|
||||
printxval(nfc_protocols, tcp->u_arg[2], "NFC_SOCKPROTO_???");
|
||||
break;
|
||||
|
||||
case AF_KCM:
|
||||
printxval_index(kcm_protocols, tcp->u_arg[2], "KCMPROTO_???");
|
||||
printxval(kcm_protocols, tcp->u_arg[2], "KCMPROTO_???");
|
||||
break;
|
||||
|
||||
case AF_SMC:
|
||||
printxval_index(smc_protocols, tcp->u_arg[2], "SMCPROTO_???");
|
||||
printxval(smc_protocols, tcp->u_arg[2], "SMCPROTO_???");
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -437,12 +463,14 @@ SYS_FUNC(socketpair)
|
||||
#include "xlat/getsock_ipv6_options.h"
|
||||
#include "xlat/setsock_ipv6_options.h"
|
||||
#include "xlat/sock_ipx_options.h"
|
||||
#include "xlat/sock_ax25_options.h"
|
||||
#include "xlat/sock_netlink_options.h"
|
||||
#include "xlat/sock_packet_options.h"
|
||||
#include "xlat/sock_raw_options.h"
|
||||
#include "xlat/sock_sctp_options.h"
|
||||
#include "xlat/sock_tcp_options.h"
|
||||
#include "xlat/sock_udp_options.h"
|
||||
#include "xlat/sock_can_raw_options.h"
|
||||
#include "xlat/sock_irda_options.h"
|
||||
#include "xlat/sock_llc_options.h"
|
||||
#include "xlat/sock_dccp_options.h"
|
||||
@ -466,7 +494,7 @@ print_sockopt_fd_level_name(struct tcb *tcp, int fd, unsigned int level,
|
||||
{
|
||||
printfd(tcp, fd);
|
||||
tprints(", ");
|
||||
printxval_search(socketlayers, level, "SOL_??");
|
||||
printxval(socketlayers, level, "SOL_??");
|
||||
tprints(", ");
|
||||
|
||||
switch (level) {
|
||||
@ -488,11 +516,17 @@ print_sockopt_fd_level_name(struct tcb *tcp, int fd, unsigned int level,
|
||||
case SOL_IPX:
|
||||
printxval(sock_ipx_options, name, "IPX_???");
|
||||
break;
|
||||
case SOL_AX25:
|
||||
printxval(sock_ax25_options, name, "AX25_???");
|
||||
break;
|
||||
case SOL_PACKET:
|
||||
printxval(sock_packet_options, name, "PACKET_???");
|
||||
break;
|
||||
case SOL_TCP:
|
||||
printxval_index(sock_tcp_options, name, "TCP_???");
|
||||
printxval(sock_tcp_options, name, "TCP_???");
|
||||
break;
|
||||
case SOL_CAN_RAW:
|
||||
printxval(sock_can_raw_options, name, "CAN_RAW_???");
|
||||
break;
|
||||
case SOL_SCTP:
|
||||
printxval(sock_sctp_options, name, "SCTP_???");
|
||||
@ -507,31 +541,31 @@ print_sockopt_fd_level_name(struct tcb *tcp, int fd, unsigned int level,
|
||||
printxval(sock_udp_options, name, "UDP_???");
|
||||
break;
|
||||
case SOL_IRDA:
|
||||
printxval_index(sock_irda_options, name, "IRLMP_???");
|
||||
printxval(sock_irda_options, name, "IRLMP_???");
|
||||
break;
|
||||
case SOL_LLC:
|
||||
printxval_index(sock_llc_options, name, "LLC_OPT_???");
|
||||
printxval(sock_llc_options, name, "LLC_OPT_???");
|
||||
break;
|
||||
case SOL_DCCP:
|
||||
printxval_search(sock_dccp_options, name, "DCCP_SOCKOPT_???");
|
||||
printxval(sock_dccp_options, name, "DCCP_SOCKOPT_???");
|
||||
break;
|
||||
case SOL_TIPC:
|
||||
printxval_search(sock_tipc_options, name, "TIPC_???");
|
||||
printxval(sock_tipc_options, name, "TIPC_???");
|
||||
break;
|
||||
case SOL_RXRPC:
|
||||
printxval_index(sock_rxrpc_options, name, "RXRPC_???");
|
||||
printxval(sock_rxrpc_options, name, "RXRPC_???");
|
||||
break;
|
||||
case SOL_PPPOL2TP:
|
||||
printxval_index(sock_pppol2tp_options, name, "PPPOL2TP_SO_???");
|
||||
printxval(sock_pppol2tp_options, name, "PPPOL2TP_SO_???");
|
||||
break;
|
||||
case SOL_BLUETOOTH:
|
||||
printxval_search(sock_bluetooth_options, name, "BT_???");
|
||||
printxval(sock_bluetooth_options, name, "BT_???");
|
||||
break;
|
||||
case SOL_PNPIPE:
|
||||
printxval(sock_pnp_options, name, "PNPIPE_???");
|
||||
break;
|
||||
case SOL_RDS:
|
||||
printxval_search(sock_rds_options, name, "RDS_???");
|
||||
printxval(sock_rds_options, name, "RDS_???");
|
||||
break;
|
||||
case SOL_IUCV:
|
||||
printxval(sock_iucv_options, name, "SO_???");
|
||||
@ -540,10 +574,10 @@ print_sockopt_fd_level_name(struct tcb *tcp, int fd, unsigned int level,
|
||||
printxval(sock_caif_options, name, "CAIFSO_???");
|
||||
break;
|
||||
case SOL_ALG:
|
||||
printxval_index(sock_alg_options, name, "ALG_???");
|
||||
printxval(sock_alg_options, name, "ALG_???");
|
||||
break;
|
||||
case SOL_NFC:
|
||||
printxval_index(sock_nfcllcp_options, name, "NFC_LLCP_???");
|
||||
printxval(sock_nfcllcp_options, name, "NFC_LLCP_???");
|
||||
break;
|
||||
case SOL_KCM:
|
||||
printxval(sock_kcm_options, name, "KCM_???");
|
||||
@ -552,7 +586,7 @@ print_sockopt_fd_level_name(struct tcb *tcp, int fd, unsigned int level,
|
||||
printxval(sock_tls_options, name, "TLS_???");
|
||||
break;
|
||||
case SOL_XDP:
|
||||
printxval_index(sock_xdp_options, name, "XDP_???");
|
||||
printxval(sock_xdp_options, name, "XDP_???");
|
||||
break;
|
||||
|
||||
/* Other SOL_* protocol levels still need work. */
|
||||
@ -643,7 +677,7 @@ print_get_ucred(struct tcb *const tcp, const kernel_ulong_t addr,
|
||||
len,
|
||||
QUOTE_FORCE_HEX);
|
||||
} else {
|
||||
PRINT_FIELD_UID(", ", uc, gid);
|
||||
PRINT_FIELD_GID(", ", uc, gid);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -729,14 +763,6 @@ print_icmp_filter(struct tcb *const tcp, const kernel_ulong_t addr, int len)
|
||||
tprints(")");
|
||||
}
|
||||
|
||||
static bool
|
||||
print_uint32(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
|
||||
{
|
||||
tprintf("%u", *(uint32_t *) elem_buf);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
print_getsockopt(struct tcb *const tcp, const unsigned int level,
|
||||
const unsigned int name, const kernel_ulong_t addr,
|
||||
@ -802,7 +828,7 @@ print_getsockopt(struct tcb *const tcp, const unsigned int level,
|
||||
uint32_t buf;
|
||||
print_array(tcp, addr, MIN(ulen, rlen) / sizeof(buf),
|
||||
&buf, sizeof(buf),
|
||||
tfetch_mem, print_uint32, 0);
|
||||
tfetch_mem, print_uint32_array_member, 0);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
32
netlink.c
32
netlink.c
@ -92,25 +92,11 @@ get_fd_nl_family(struct tcb *const tcp, const int fd)
|
||||
if (!inode)
|
||||
return -1;
|
||||
|
||||
const char *const details = get_sockaddr_by_inode(tcp, fd, inode);
|
||||
if (!details)
|
||||
const char *const data = get_sockdata_by_inode(tcp, fd, inode);
|
||||
if (!data)
|
||||
return -1;
|
||||
|
||||
const char *const nl_details = STR_STRIP_PREFIX(details, "NETLINK:[");
|
||||
if (nl_details == details)
|
||||
return -1;
|
||||
|
||||
const struct xlat *xlats = netlink_protocols;
|
||||
for (; xlats->str; ++xlats) {
|
||||
const char *name = STR_STRIP_PREFIX(xlats->str, "NETLINK_");
|
||||
if (!strncmp(nl_details, name, strlen(name)))
|
||||
return xlats->val;
|
||||
}
|
||||
|
||||
if (*nl_details >= '0' && *nl_details <= '9')
|
||||
return atoi(nl_details);
|
||||
|
||||
return -1;
|
||||
return data[0];
|
||||
}
|
||||
|
||||
static void
|
||||
@ -126,7 +112,9 @@ decode_nlmsg_type_generic(struct tcb *tcp, const struct xlat *const xlat,
|
||||
const uint16_t type,
|
||||
const char *const dflt)
|
||||
{
|
||||
printxval(genl_families_xlat(tcp), type, dflt);
|
||||
/* As genl family numbers are allocated dynamically */
|
||||
print_xlat_ex(type, genl_get_family_name(tcp, type),
|
||||
XLAT_STYLE_VERBOSE);
|
||||
}
|
||||
|
||||
static const struct {
|
||||
@ -438,7 +426,7 @@ decode_nlmsg_flags(const uint16_t flags, const uint16_t type,
|
||||
} else if (family < ARRAY_SIZE(nlmsg_flags) && nlmsg_flags[family])
|
||||
table = nlmsg_flags[family](type);
|
||||
|
||||
printflags_ex(flags, "NLM_F_???", XLAT_STYLE_ABBREV,
|
||||
printflags_ex(flags, "NLM_F_???", XLAT_STYLE_DEFAULT,
|
||||
netlink_flags, table, NULL);
|
||||
}
|
||||
|
||||
@ -519,11 +507,7 @@ decode_nlmsgerr(struct tcb *const tcp,
|
||||
return;
|
||||
|
||||
tprints("{error=");
|
||||
if (err.error < 0 && (unsigned) -err.error < nerrnos) {
|
||||
tprintf("-%s", errnoent[-err.error]);
|
||||
} else {
|
||||
tprintf("%d", err.error);
|
||||
}
|
||||
print_err(err.error, true);
|
||||
|
||||
addr += offsetof(struct nlmsgerr, msg);
|
||||
len -= offsetof(struct nlmsgerr, msg);
|
||||
|
@ -370,6 +370,51 @@ decode_tcp_bbr_info(struct tcb *const tcp,
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
decode_tcp_md5sig(struct tcb *const tcp,
|
||||
const kernel_ulong_t addr,
|
||||
const unsigned int len,
|
||||
const void *const opaque_data)
|
||||
{
|
||||
struct tcp_diag_md5sig sig;
|
||||
|
||||
if (len < sizeof(sig))
|
||||
return false;
|
||||
|
||||
kernel_ulong_t l = len;
|
||||
kernel_ulong_t a = addr;
|
||||
|
||||
for (; len >= sizeof(sig); l -= sizeof(sig), a += sizeof(sig)) {
|
||||
if (a != addr)
|
||||
tprints(", ");
|
||||
|
||||
if (umove(tcp, a, &sig)) {
|
||||
tprints("/* ");
|
||||
printaddr(a);
|
||||
tprints(" */");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
PRINT_FIELD_XVAL("{", sig, tcpm_family, addrfams, "AF_???");
|
||||
PRINT_FIELD_U(", ", sig, tcpm_prefixlen);
|
||||
PRINT_FIELD_U(", ", sig, tcpm_keylen);
|
||||
PRINT_FIELD_INET_ADDR(", ", sig, tcpm_addr, sig.tcpm_family);
|
||||
tprints(", ");
|
||||
print_quoted_string((char *) sig.tcpm_key,
|
||||
MIN(sizeof(sig.tcpm_key), sig.tcpm_keylen),
|
||||
QUOTE_FORCE_HEX);
|
||||
tprints("}");
|
||||
}
|
||||
|
||||
if (l) {
|
||||
tprints(",");
|
||||
tprintf_comment("%" PRI_klu " bytes of unexpected data", l);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static const nla_decoder_t inet_diag_msg_nla_decoders[] = {
|
||||
[INET_DIAG_MEMINFO] = decode_inet_diag_meminfo,
|
||||
[INET_DIAG_INFO] = NULL, /* unimplemented */
|
||||
@ -387,7 +432,8 @@ static const nla_decoder_t inet_diag_msg_nla_decoders[] = {
|
||||
[INET_DIAG_PAD] = NULL,
|
||||
[INET_DIAG_MARK] = decode_nla_u32,
|
||||
[INET_DIAG_BBRINFO] = decode_tcp_bbr_info,
|
||||
[INET_DIAG_CLASS_ID] = decode_nla_u32
|
||||
[INET_DIAG_CLASS_ID] = decode_nla_u32,
|
||||
[INET_DIAG_MD5SIG] = decode_tcp_md5sig,
|
||||
};
|
||||
|
||||
DECL_NETLINK_DIAG_DECODER(decode_inet_diag_msg)
|
||||
@ -411,7 +457,7 @@ DECL_NETLINK_DIAG_DECODER(decode_inet_diag_msg)
|
||||
PRINT_FIELD_U(", ", msg, idiag_expires);
|
||||
PRINT_FIELD_U(", ", msg, idiag_rqueue);
|
||||
PRINT_FIELD_U(", ", msg, idiag_wqueue);
|
||||
PRINT_FIELD_U(", ", msg, idiag_uid);
|
||||
PRINT_FIELD_UID(", ", msg, idiag_uid);
|
||||
PRINT_FIELD_U(", ", msg, idiag_inode);
|
||||
decode_nla = true;
|
||||
}
|
||||
|
@ -38,10 +38,501 @@
|
||||
# include "netlink.h"
|
||||
# include <linux/netfilter/nfnetlink.h>
|
||||
|
||||
# include "xlat/icmp_codes_redirect.h"
|
||||
# include "xlat/icmp_codes_time_exceeded.h"
|
||||
# include "xlat/icmp_codes_unreach.h"
|
||||
# include "xlat/icmp_types.h"
|
||||
# include "xlat/icmpv6_codes_parameter.h"
|
||||
# include "xlat/icmpv6_codes_time_exceeded.h"
|
||||
# include "xlat/icmpv6_codes_unreach.h"
|
||||
# include "xlat/icmpv6_types.h"
|
||||
# include "xlat/netfilter_versions.h"
|
||||
# include "xlat/nf_acct_attr_names.h"
|
||||
# include "xlat/nf_cthelper_attr_names.h"
|
||||
# include "xlat/nf_ctnetlink_attr_names.h"
|
||||
# include "xlat/nf_ctnetlink_exp_attr_names.h"
|
||||
# include "xlat/nf_ctnetlink_to_attr_names.h"
|
||||
# include "xlat/nf_ipset_attr_names.h"
|
||||
# include "xlat/nf_nft_compat_attr_names.h"
|
||||
# include "xlat/nf_osf_attr_names.h"
|
||||
# include "xlat/nf_queue_attr_names.h"
|
||||
# include "xlat/nf_ulog_attr_names.h"
|
||||
# include "xlat/nfnl_ct_ip_attrs.h"
|
||||
# include "xlat/nfnl_ct_proto_attrs.h"
|
||||
# include "xlat/nfnl_ct_protoinfo_attrs.h"
|
||||
# include "xlat/nfnl_ct_protoinfo_dccp_attrs.h"
|
||||
# include "xlat/nfnl_ct_protoinfo_sctp_attrs.h"
|
||||
# include "xlat/nfnl_ct_protoinfo_tcp_attrs.h"
|
||||
# include "xlat/nfnl_ct_status.h"
|
||||
# include "xlat/nfnl_ct_tcp_flags.h"
|
||||
# include "xlat/nfnl_ct_tcp_states.h"
|
||||
# include "xlat/nfnl_ct_tuple_attrs.h"
|
||||
# include "xlat/nfnl_zones.h"
|
||||
# include "xlat/nft_chain_attr_names.h"
|
||||
# include "xlat/nft_flow_attr_names.h"
|
||||
# include "xlat/nft_gen_attr_names.h"
|
||||
# include "xlat/nft_obj_attr_names.h"
|
||||
# include "xlat/nft_rule_attr_names.h"
|
||||
# include "xlat/nft_set_attr_names.h"
|
||||
# include "xlat/nft_setelem_attr_names.h"
|
||||
# include "xlat/nft_table_attr_names.h"
|
||||
# include "xlat/nft_trace_attr_names.h"
|
||||
# include "xlat/nl_netfilter_msg_types.h"
|
||||
# include "xlat/nl_netfilter_subsys_ids.h"
|
||||
|
||||
|
||||
# define XLAT_MACROS_ONLY
|
||||
# include "xlat/nl_netfilter_subsys_ids.h"
|
||||
# include "xlat/nf_nftables_msg_types.h"
|
||||
# undef XLAT_MACROS_ONLY
|
||||
|
||||
struct nfnl_decoder {
|
||||
const struct xlat *name_xlat;
|
||||
const char *dflt;
|
||||
|
||||
const nla_decoder_t *decoders;
|
||||
size_t decoders_sz;
|
||||
|
||||
const struct nfnl_decoder *subdecoder;
|
||||
size_t subdecoder_sz;
|
||||
};
|
||||
|
||||
static const struct nfnl_decoder nft_subsystem_decoders[] = {
|
||||
[NFT_MSG_NEWTABLE] =
|
||||
{ nft_table_attr_names, "NFTA_TABLE_???", },
|
||||
[NFT_MSG_GETTABLE] =
|
||||
{ nft_table_attr_names, "NFTA_TABLE_???", },
|
||||
[NFT_MSG_DELTABLE] =
|
||||
{ nft_table_attr_names, "NFTA_TABLE_???", },
|
||||
[NFT_MSG_NEWCHAIN] =
|
||||
{ nft_chain_attr_names, "NFTA_CHAIN_???", },
|
||||
[NFT_MSG_GETCHAIN] =
|
||||
{ nft_chain_attr_names, "NFTA_CHAIN_???", },
|
||||
[NFT_MSG_DELCHAIN] =
|
||||
{ nft_chain_attr_names, "NFTA_CHAIN_???", },
|
||||
[NFT_MSG_NEWRULE] =
|
||||
{ nft_rule_attr_names, "NFTA_RULE_???", },
|
||||
[NFT_MSG_GETRULE] =
|
||||
{ nft_rule_attr_names, "NFTA_RULE_???", },
|
||||
[NFT_MSG_DELRULE] =
|
||||
{ nft_rule_attr_names, "NFTA_RULE_???", },
|
||||
[NFT_MSG_NEWSET] =
|
||||
{ nft_set_attr_names, "NFTA_SET_???", },
|
||||
[NFT_MSG_GETSET] =
|
||||
{ nft_set_attr_names, "NFTA_SET_???", },
|
||||
[NFT_MSG_DELSET] =
|
||||
{ nft_set_attr_names, "NFTA_SET_???", },
|
||||
[NFT_MSG_NEWSETELEM] =
|
||||
{ nft_setelem_attr_names, "NFTA_SET_ELEM_???", },
|
||||
[NFT_MSG_GETSETELEM] =
|
||||
{ nft_setelem_attr_names, "NFTA_SET_ELEM_???", },
|
||||
[NFT_MSG_DELSETELEM] =
|
||||
{ nft_setelem_attr_names, "NFTA_SET_ELEM_???", },
|
||||
[NFT_MSG_NEWGEN] =
|
||||
{ nft_gen_attr_names, "NFTA_GEN_???", },
|
||||
[NFT_MSG_GETGEN] =
|
||||
{ nft_gen_attr_names, "NFTA_GEN_???", },
|
||||
[NFT_MSG_TRACE] =
|
||||
{ nft_trace_attr_names, "NFTA_TRACE_???", },
|
||||
[NFT_MSG_NEWOBJ] =
|
||||
{ nft_obj_attr_names, "NFTA_OBJ_???", },
|
||||
[NFT_MSG_GETOBJ] =
|
||||
{ nft_obj_attr_names, "NFTA_OBJ_???", },
|
||||
[NFT_MSG_DELOBJ] =
|
||||
{ nft_obj_attr_names, "NFTA_OBJ_???", },
|
||||
[NFT_MSG_GETOBJ_RESET] =
|
||||
{ nft_obj_attr_names, "NFTA_OBJ_???", },
|
||||
[NFT_MSG_NEWFLOWTABLE] =
|
||||
{ nft_flow_attr_names, "NFTA_FLOW_???", },
|
||||
[NFT_MSG_GETFLOWTABLE] =
|
||||
{ nft_flow_attr_names, "NFTA_FLOW_???", },
|
||||
[NFT_MSG_DELFLOWTABLE] =
|
||||
{ nft_flow_attr_names, "NFTA_FLOW_???", },
|
||||
};
|
||||
|
||||
static const nla_decoder_t nfnl_ct_ip_decoders[] = {
|
||||
[CTA_IP_V4_SRC] = decode_nla_in_addr,
|
||||
[CTA_IP_V4_DST] = decode_nla_in_addr,
|
||||
[CTA_IP_V6_SRC] = decode_nla_in6_addr,
|
||||
[CTA_IP_V6_DST] = decode_nla_in6_addr,
|
||||
};
|
||||
|
||||
static bool
|
||||
decode_cta_ip(struct tcb *const tcp,
|
||||
const kernel_ulong_t addr,
|
||||
const unsigned int len,
|
||||
const void *const opaque_data)
|
||||
{
|
||||
decode_nlattr(tcp, addr, len, nfnl_ct_ip_attrs, "CTA_IP_???",
|
||||
ARRSZ_PAIR(nfnl_ct_ip_decoders), opaque_data);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
struct cta_proto_ctx {
|
||||
uint8_t icmp_type_seen :1,
|
||||
icmpv6_type_seen :1;
|
||||
|
||||
uint8_t icmp_type;
|
||||
uint8_t icmpv6_type;
|
||||
};
|
||||
|
||||
static bool
|
||||
decode_cta_icmp_type(struct tcb *const tcp,
|
||||
const kernel_ulong_t addr,
|
||||
const unsigned int len,
|
||||
const void *const opaque_data)
|
||||
{
|
||||
struct cta_proto_ctx *ctx = (void *) opaque_data;
|
||||
uint8_t type;
|
||||
|
||||
if (len < sizeof(type))
|
||||
return false;
|
||||
if (!umove_or_printaddr(tcp, addr, &type))
|
||||
printxval(icmp_types, type, "ICMP_???");
|
||||
|
||||
if (ctx) {
|
||||
ctx->icmp_type_seen = 1;
|
||||
ctx->icmp_type = type;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
decode_cta_icmp_code(struct tcb *const tcp,
|
||||
const kernel_ulong_t addr,
|
||||
const unsigned int len,
|
||||
const void *const opaque_data)
|
||||
{
|
||||
static const struct {
|
||||
uint16_t type;
|
||||
const struct xlat *xlat;
|
||||
const char *dflt;
|
||||
} codes[] = {
|
||||
{ ICMP_DEST_UNREACH, icmp_codes_unreach,
|
||||
"ICMP_???" },
|
||||
{ ICMP_REDIRECT, icmp_codes_redirect,
|
||||
"ICMP_REDIR_???" },
|
||||
{ ICMP_TIME_EXCEEDED, icmp_codes_time_exceeded,
|
||||
"ICMP_EXC_???" },
|
||||
};
|
||||
|
||||
struct cta_proto_ctx *ctx = (void *) opaque_data;
|
||||
uint8_t code;
|
||||
|
||||
if (len < sizeof(code))
|
||||
return false;
|
||||
if (umove_or_printaddr(tcp, addr, &code))
|
||||
return true;
|
||||
|
||||
if (!ctx || !ctx->icmp_type_seen)
|
||||
goto type_not_found;
|
||||
|
||||
for (size_t i = 0; i < ARRAY_SIZE(codes); i++) {
|
||||
if (codes[i].type == ctx->icmp_type) {
|
||||
printxval(codes[i].xlat, code, codes[i].dflt);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
type_not_found:
|
||||
tprintf("%#hhx", code);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
decode_cta_icmpv6_type(struct tcb *const tcp,
|
||||
const kernel_ulong_t addr,
|
||||
const unsigned int len,
|
||||
const void *const opaque_data)
|
||||
{
|
||||
struct cta_proto_ctx *ctx = (void *) opaque_data;
|
||||
uint8_t type;
|
||||
|
||||
if (len < sizeof(type))
|
||||
return false;
|
||||
if (!umove_or_printaddr(tcp, addr, &type))
|
||||
printxval(icmpv6_types, type, "ICMPV6_???");
|
||||
|
||||
if (ctx) {
|
||||
ctx->icmpv6_type_seen = 1;
|
||||
ctx->icmpv6_type = type;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
decode_cta_icmpv6_code(struct tcb *const tcp,
|
||||
const kernel_ulong_t addr,
|
||||
const unsigned int len,
|
||||
const void *const opaque_data)
|
||||
{
|
||||
static const struct code_data {
|
||||
const struct xlat *xlat;
|
||||
const char *dflt;
|
||||
} codes[] = {
|
||||
[ICMPV6_DEST_UNREACH] =
|
||||
{ icmpv6_codes_unreach, "ICMPV6_???" },
|
||||
[ICMPV6_TIME_EXCEED] =
|
||||
{ icmpv6_codes_time_exceeded, "ICMPV6_EXC_???" },
|
||||
[ICMPV6_PARAMPROB] =
|
||||
{ icmpv6_codes_parameter, "ICMPV6_???" },
|
||||
};
|
||||
|
||||
struct cta_proto_ctx *ctx = (void *) opaque_data;
|
||||
uint8_t code;
|
||||
|
||||
if (len < sizeof(code))
|
||||
return false;
|
||||
if (umove_or_printaddr(tcp, addr, &code))
|
||||
return true;
|
||||
|
||||
if (!ctx || !ctx->icmpv6_type_seen
|
||||
|| ctx->icmpv6_type >= ARRAY_SIZE(codes)
|
||||
|| !codes[ctx->icmpv6_type].xlat) {
|
||||
tprintf("%#hhx", code);
|
||||
return true;
|
||||
}
|
||||
|
||||
const struct code_data *c = codes + ctx->icmpv6_type;
|
||||
printxval(c->xlat, code, c->dflt);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static const nla_decoder_t nfnl_ct_proto_decoders[] = {
|
||||
[CTA_PROTO_NUM] = decode_nla_ip_proto,
|
||||
[CTA_PROTO_SRC_PORT] = decode_nla_be16,
|
||||
[CTA_PROTO_DST_PORT] = decode_nla_be16,
|
||||
[CTA_PROTO_ICMP_ID] = decode_nla_be16,
|
||||
[CTA_PROTO_ICMP_TYPE] = decode_cta_icmp_type,
|
||||
[CTA_PROTO_ICMP_CODE] = decode_cta_icmp_code,
|
||||
[CTA_PROTO_ICMPV6_ID] = decode_nla_be16,
|
||||
[CTA_PROTO_ICMPV6_TYPE] = decode_cta_icmpv6_type,
|
||||
[CTA_PROTO_ICMPV6_CODE] = decode_cta_icmpv6_code,
|
||||
};
|
||||
|
||||
static bool
|
||||
decode_cta_proto(struct tcb *const tcp,
|
||||
const kernel_ulong_t addr,
|
||||
const unsigned int len,
|
||||
const void *const opaque_data)
|
||||
{
|
||||
struct cta_proto_ctx ctx = { 0 };
|
||||
|
||||
decode_nlattr(tcp, addr, len, nfnl_ct_proto_attrs, "CTA_PROTO_???",
|
||||
ARRSZ_PAIR(nfnl_ct_proto_decoders), &ctx);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
static const nla_decoder_t nfnl_ct_tuple_decoders[] = {
|
||||
[CTA_TUPLE_IP] = decode_cta_ip,
|
||||
[CTA_TUPLE_PROTO] = decode_cta_proto,
|
||||
[CTA_TUPLE_ZONE] = decode_nla_be16,
|
||||
};
|
||||
|
||||
static bool
|
||||
decode_cta_tuple(struct tcb *const tcp,
|
||||
const kernel_ulong_t addr,
|
||||
const unsigned int len,
|
||||
const void *const opaque_data)
|
||||
{
|
||||
decode_nlattr(tcp, addr, len, nfnl_ct_tuple_attrs, "CTA_TUPLE_???",
|
||||
ARRSZ_PAIR(nfnl_ct_tuple_decoders), opaque_data);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
decode_cta_status(struct tcb *const tcp,
|
||||
const kernel_ulong_t addr,
|
||||
const unsigned int len,
|
||||
const void *const opaque_data)
|
||||
{
|
||||
uint32_t status;
|
||||
|
||||
if (len < sizeof(status))
|
||||
return false;
|
||||
if (umove_or_printaddr(tcp, addr, &status))
|
||||
return true;
|
||||
|
||||
status = ntohs(status);
|
||||
tprints("htons(");
|
||||
printflags(nfnl_ct_status, status, "IPS_???");
|
||||
tprints(")");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
decode_cta_tcp_state(struct tcb *const tcp,
|
||||
const kernel_ulong_t addr,
|
||||
const unsigned int len,
|
||||
const void *const opaque_data)
|
||||
{
|
||||
uint32_t state;
|
||||
|
||||
if (len < sizeof(state))
|
||||
return false;
|
||||
if (!umove_or_printaddr(tcp, addr, &state))
|
||||
printxval(nfnl_ct_tcp_states, state, "TCP_CONNTRACK_???");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
decode_cta_tcp_flags(struct tcb *const tcp,
|
||||
const kernel_ulong_t addr,
|
||||
const unsigned int len,
|
||||
const void *const opaque_data)
|
||||
{
|
||||
uint8_t flags[2];
|
||||
|
||||
if (len < sizeof(flags))
|
||||
return false;
|
||||
if (umove_or_printaddr(tcp, addr, &flags))
|
||||
return true;
|
||||
|
||||
tprints("{flags=");
|
||||
printflags(nfnl_ct_tcp_flags, flags[0], "IP_CT_???");
|
||||
tprints(", mask=");
|
||||
printflags(nfnl_ct_tcp_flags, flags[1], "IP_CT_???");
|
||||
tprints("}");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static const nla_decoder_t nfnl_ct_protoinfo_tcp_decoders[] = {
|
||||
[CTA_PROTOINFO_TCP_STATE] = decode_cta_tcp_state,
|
||||
[CTA_PROTOINFO_TCP_WSCALE_ORIGINAL] = decode_nla_u8,
|
||||
[CTA_PROTOINFO_TCP_WSCALE_REPLY] = decode_nla_u8,
|
||||
[CTA_PROTOINFO_TCP_FLAGS_ORIGINAL] = decode_cta_tcp_flags,
|
||||
[CTA_PROTOINFO_TCP_FLAGS_REPLY] = decode_cta_tcp_flags,
|
||||
};
|
||||
|
||||
static bool
|
||||
decode_cta_protoinfo_tcp(struct tcb *const tcp,
|
||||
const kernel_ulong_t addr,
|
||||
const unsigned int len,
|
||||
const void *const opaque_data)
|
||||
{
|
||||
decode_nlattr(tcp, addr, len, nfnl_ct_protoinfo_tcp_attrs,
|
||||
"CTA_PROTOINFO_TCP_???",
|
||||
ARRSZ_PAIR(nfnl_ct_protoinfo_tcp_decoders), opaque_data);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static const nla_decoder_t nfnl_ct_protoinfo_dccp_decoders[] = {
|
||||
};
|
||||
|
||||
static bool
|
||||
decode_cta_protoinfo_dccp(struct tcb *const tcp,
|
||||
const kernel_ulong_t addr,
|
||||
const unsigned int len,
|
||||
const void *const opaque_data)
|
||||
{
|
||||
decode_nlattr(tcp, addr, len, nfnl_ct_protoinfo_dccp_attrs,
|
||||
"CTA_PROTOINFO_DCCP_???",
|
||||
ARRSZ_PAIR(nfnl_ct_protoinfo_dccp_decoders), opaque_data);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static const nla_decoder_t nfnl_ct_protoinfo_sctp_decoders[] = {
|
||||
};
|
||||
|
||||
static bool
|
||||
decode_cta_protoinfo_sctp(struct tcb *const tcp,
|
||||
const kernel_ulong_t addr,
|
||||
const unsigned int len,
|
||||
const void *const opaque_data)
|
||||
{
|
||||
decode_nlattr(tcp, addr, len, nfnl_ct_protoinfo_sctp_attrs,
|
||||
"CTA_PROTOINFO_SCTP_???",
|
||||
ARRSZ_PAIR(nfnl_ct_protoinfo_sctp_decoders), opaque_data);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static const nla_decoder_t nfnl_ct_protoinfo_decoders[] = {
|
||||
[CTA_PROTOINFO_TCP] = decode_cta_protoinfo_tcp,
|
||||
[CTA_PROTOINFO_DCCP] = decode_cta_protoinfo_dccp,
|
||||
[CTA_PROTOINFO_SCTP] = decode_cta_protoinfo_sctp,
|
||||
};
|
||||
|
||||
static bool
|
||||
decode_cta_protoinfo(struct tcb *const tcp,
|
||||
const kernel_ulong_t addr,
|
||||
const unsigned int len,
|
||||
const void *const opaque_data)
|
||||
{
|
||||
decode_nlattr(tcp, addr, len, nfnl_ct_protoinfo_attrs,
|
||||
"CTA_PROTOINFO_???",
|
||||
ARRSZ_PAIR(nfnl_ct_protoinfo_decoders), opaque_data);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static const nla_decoder_t nf_ctnetlink_decoders[] = {
|
||||
[CTA_TUPLE_ORIG] = decode_cta_tuple,
|
||||
[CTA_TUPLE_REPLY] = decode_cta_tuple,
|
||||
[CTA_STATUS] = decode_cta_status,
|
||||
[CTA_PROTOINFO] = decode_cta_protoinfo,
|
||||
[CTA_HELP] = decode_nla_u32,
|
||||
[CTA_NAT_SRC] = decode_nla_u32,
|
||||
[CTA_TIMEOUT] = decode_nla_u32,
|
||||
[CTA_MARK] = decode_nla_u32,
|
||||
[CTA_COUNTERS_ORIG] = decode_nla_u32,
|
||||
[CTA_COUNTERS_REPLY] = decode_nla_u32,
|
||||
[CTA_USE] = decode_nla_u32,
|
||||
[CTA_ID] = decode_nla_u32,
|
||||
[CTA_NAT_DST] = decode_nla_u32,
|
||||
[CTA_TUPLE_MASTER] = decode_nla_u32,
|
||||
[CTA_SEQ_ADJ_ORIG] = decode_nla_u32,
|
||||
[CTA_SEQ_ADJ_REPLY] = decode_nla_u32,
|
||||
[CTA_SECMARK] = decode_nla_u32,
|
||||
[CTA_ZONE] = decode_nla_u32,
|
||||
[CTA_SECCTX] = decode_nla_u32,
|
||||
[CTA_TIMESTAMP] = decode_nla_u32,
|
||||
[CTA_MARK_MASK] = decode_nla_u32,
|
||||
[CTA_LABELS] = decode_nla_u32,
|
||||
[CTA_LABELS_MASK] = decode_nla_u32,
|
||||
[CTA_SYNPROXY] = decode_nla_u32,
|
||||
};
|
||||
|
||||
static const struct nfnl_decoder nfnl_subsystems[] = {
|
||||
[NFNL_SUBSYS_CTNETLINK] =
|
||||
{ nf_ctnetlink_attr_names, "CTA_???",
|
||||
ARRSZ_PAIR(nf_ctnetlink_decoders) },
|
||||
[NFNL_SUBSYS_CTNETLINK_EXP] =
|
||||
{ nf_ctnetlink_exp_attr_names, "CTA_EXPECT_???", },
|
||||
[NFNL_SUBSYS_QUEUE] =
|
||||
{ nf_queue_attr_names, "NFQA_???", },
|
||||
[NFNL_SUBSYS_ULOG] =
|
||||
{ nf_ulog_attr_names, "NFULA_???", },
|
||||
[NFNL_SUBSYS_OSF] =
|
||||
{ nf_osf_attr_names, "OSF_???", },
|
||||
[NFNL_SUBSYS_IPSET] =
|
||||
{ nf_ipset_attr_names, "IPSET_ATTR_???", },
|
||||
[NFNL_SUBSYS_ACCT] =
|
||||
{ nf_acct_attr_names, "NFACCT_???", },
|
||||
[NFNL_SUBSYS_CTNETLINK_TIMEOUT] =
|
||||
{ nf_ctnetlink_to_attr_names, "CTA_TIMEOUT_???", },
|
||||
[NFNL_SUBSYS_CTHELPER] =
|
||||
{ nf_cthelper_attr_names, "NFCTH_???" },
|
||||
[NFNL_SUBSYS_NFTABLES] =
|
||||
{ NULL, "NFT_???", NULL, 0,
|
||||
ARRSZ_PAIR(nft_subsystem_decoders) },
|
||||
[NFNL_SUBSYS_NFT_COMPAT] =
|
||||
{ nf_nft_compat_attr_names, "NFTA_COMPAT_???" },
|
||||
};
|
||||
|
||||
bool
|
||||
decode_netlink_netfilter(struct tcb *const tcp,
|
||||
const struct nlmsghdr *const nlmsghdr,
|
||||
@ -56,7 +547,8 @@ decode_netlink_netfilter(struct tcb *const tcp,
|
||||
if (len < sizeof(nfmsg))
|
||||
printstr_ex(tcp, addr, len, QUOTE_FORCE_HEX);
|
||||
else if (!umove_or_printaddr(tcp, addr, &nfmsg)) {
|
||||
const uint8_t subsys_id = (uint8_t) (nlmsghdr->nlmsg_type >> 8);
|
||||
const uint8_t subsys_id = nlmsghdr->nlmsg_type >> 8;
|
||||
const uint8_t msg_type = nlmsghdr->nlmsg_type;
|
||||
uint16_t res_id = ntohs(nfmsg.res_id);
|
||||
|
||||
PRINT_FIELD_XVAL("{", nfmsg, nfgen_family, addrfams, "AF_???");
|
||||
@ -70,10 +562,13 @@ decode_netlink_netfilter(struct tcb *const tcp,
|
||||
tprints(", res_id=");
|
||||
if (subsys_id == NFNL_SUBSYS_NFTABLES
|
||||
&& res_id == NFNL_SUBSYS_NFTABLES) {
|
||||
tprints("htons(NFNL_SUBSYS_NFTABLES)");
|
||||
print_xlat_ex(nfmsg.res_id,
|
||||
"htons(NFNL_SUBSYS_NFTABLES)",
|
||||
XLAT_STYLE_DEFAULT);
|
||||
} else if (subsys_id == NFNL_SUBSYS_NFTABLES
|
||||
&& nfmsg.res_id == NFNL_SUBSYS_NFTABLES) {
|
||||
tprints("NFNL_SUBSYS_NFTABLES");
|
||||
print_xlat_ex(nfmsg.res_id, "NFNL_SUBSYS_NFTABLES",
|
||||
XLAT_STYLE_DEFAULT);
|
||||
} else {
|
||||
tprintf("htons(%d)", res_id);
|
||||
}
|
||||
@ -83,12 +578,24 @@ decode_netlink_netfilter(struct tcb *const tcp,
|
||||
tprints(", ");
|
||||
if ((nlmsghdr->nlmsg_type >= NFNL_MSG_BATCH_BEGIN
|
||||
&& nlmsghdr->nlmsg_type <= NFNL_MSG_BATCH_END)
|
||||
|| nlmsghdr->nlmsg_type < NLMSG_MIN_TYPE)
|
||||
|| nlmsghdr->nlmsg_type < NLMSG_MIN_TYPE) {
|
||||
printstr_ex(tcp, addr + offset,
|
||||
len - offset, QUOTE_FORCE_HEX);
|
||||
else
|
||||
} else {
|
||||
static const struct nfnl_decoder def;
|
||||
const struct nfnl_decoder *subsys = &def;
|
||||
|
||||
if (subsys_id < ARRAY_SIZE(nfnl_subsystems))
|
||||
subsys = nfnl_subsystems + subsys_id;
|
||||
if (subsys->subdecoder
|
||||
&& (msg_type < subsys->subdecoder_sz))
|
||||
subsys = subsys->subdecoder + msg_type;
|
||||
|
||||
decode_nlattr(tcp, addr + offset, len - offset,
|
||||
NULL, NULL, NULL, 0, NULL);
|
||||
subsys->name_xlat, subsys->dflt,
|
||||
subsys->decoders,
|
||||
subsys->decoders_sz, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include <linux/sock_diag.h>
|
||||
#include <linux/packet_diag.h>
|
||||
|
||||
#include "xlat/af_packet_versions.h"
|
||||
#include "xlat/packet_diag_attrs.h"
|
||||
#include "xlat/packet_diag_info_flags.h"
|
||||
#include "xlat/packet_diag_show.h"
|
||||
@ -52,10 +53,11 @@ DECL_NETLINK_DIAG_DECODER(decode_packet_diag_req)
|
||||
if (!umoven_or_printaddr(tcp, addr + offset,
|
||||
sizeof(req) - offset,
|
||||
(char *) &req + offset)) {
|
||||
tprints("sdiag_protocol=");
|
||||
printxval_searchn(ethernet_protocols,
|
||||
ethernet_protocols_size,
|
||||
req.sdiag_protocol, "ETH_P_???");
|
||||
/*
|
||||
* AF_PACKET currently doesn't support protocol values
|
||||
* other than 0.
|
||||
*/
|
||||
PRINT_FIELD_X("", req, sdiag_protocol);
|
||||
PRINT_FIELD_U(", ", req, pdiag_ino);
|
||||
PRINT_FIELD_FLAGS(", ", req, pdiag_show,
|
||||
packet_diag_show, "PACKET_SHOW_???");
|
||||
@ -79,8 +81,9 @@ decode_packet_diag_info(struct tcb *const tcp,
|
||||
if (umove_or_printaddr(tcp, addr, &pinfo))
|
||||
return true;
|
||||
|
||||
PRINT_FIELD_U("{", pinfo, pdi_index);
|
||||
PRINT_FIELD_U(", ", pinfo, pdi_version);
|
||||
PRINT_FIELD_IFINDEX("{", pinfo, pdi_index);
|
||||
PRINT_FIELD_XVAL(", ", pinfo, pdi_version, af_packet_versions,
|
||||
"TPACKET_???");
|
||||
PRINT_FIELD_U(", ", pinfo, pdi_reserve);
|
||||
PRINT_FIELD_U(", ", pinfo, pdi_copy_thresh);
|
||||
PRINT_FIELD_U(", ", pinfo, pdi_tstamp);
|
||||
@ -172,7 +175,7 @@ static const nla_decoder_t packet_diag_msg_nla_decoders[] = {
|
||||
[PACKET_DIAG_RX_RING] = decode_packet_diag_ring,
|
||||
[PACKET_DIAG_TX_RING] = decode_packet_diag_ring,
|
||||
[PACKET_DIAG_FANOUT] = decode_nla_u32,
|
||||
[PACKET_DIAG_UID] = decode_nla_u32,
|
||||
[PACKET_DIAG_UID] = decode_nla_uid,
|
||||
[PACKET_DIAG_MEMINFO] = decode_nla_meminfo,
|
||||
[PACKET_DIAG_FILTER] = decode_packet_diag_filter
|
||||
};
|
||||
@ -191,7 +194,8 @@ DECL_NETLINK_DIAG_DECODER(decode_packet_diag_msg)
|
||||
(char *) &msg + offset)) {
|
||||
PRINT_FIELD_XVAL("", msg, pdiag_type,
|
||||
socktypes, "SOCK_???");
|
||||
PRINT_FIELD_U(", ", msg, pdiag_num);
|
||||
PRINT_FIELD_XVAL(", ", msg, pdiag_num,
|
||||
ethernet_protocols, "ETH_P_???");
|
||||
PRINT_FIELD_U(", ", msg, pdiag_ino);
|
||||
PRINT_FIELD_COOKIE(", ", msg, pdiag_cookie);
|
||||
decode_nla = true;
|
||||
|
@ -118,7 +118,16 @@ static const netlink_route_decoder_t route_decoders[] = {
|
||||
|
||||
[RTM_DELNSID - RTM_BASE] = decode_rtgenmsg,
|
||||
[RTM_GETNSID - RTM_BASE] = decode_rtgenmsg,
|
||||
[RTM_NEWNSID - RTM_BASE] = decode_rtgenmsg
|
||||
[RTM_NEWNSID - RTM_BASE] = decode_rtgenmsg,
|
||||
|
||||
[RTM_NEWSTATS - RTM_BASE] = decode_ifstatsmsg,
|
||||
[RTM_GETSTATS - RTM_BASE] = decode_ifstatsmsg,
|
||||
|
||||
[RTM_NEWCACHEREPORT - RTM_BASE] = decode_cachereport,
|
||||
|
||||
[RTM_NEWCHAIN - RTM_BASE] = decode_tcmsg,
|
||||
[RTM_DELCHAIN - RTM_BASE] = decode_tcmsg,
|
||||
[RTM_GETCHAIN - RTM_BASE] = decode_tcmsg,
|
||||
};
|
||||
|
||||
bool
|
||||
|
@ -40,11 +40,13 @@ route_decode_name(struct tcb *tcp, \
|
||||
/* End of DECL_NETLINK_ROUTE_DECODER definition. */
|
||||
|
||||
extern DECL_NETLINK_ROUTE_DECODER(decode_br_port_msg);
|
||||
extern DECL_NETLINK_ROUTE_DECODER(decode_cachereport);
|
||||
extern DECL_NETLINK_ROUTE_DECODER(decode_dcbmsg);
|
||||
extern DECL_NETLINK_ROUTE_DECODER(decode_fib_rule_hdr);
|
||||
extern DECL_NETLINK_ROUTE_DECODER(decode_ifaddrlblmsg);
|
||||
extern DECL_NETLINK_ROUTE_DECODER(decode_ifaddrmsg);
|
||||
extern DECL_NETLINK_ROUTE_DECODER(decode_ifinfomsg);
|
||||
extern DECL_NETLINK_ROUTE_DECODER(decode_ifstatsmsg);
|
||||
extern DECL_NETLINK_ROUTE_DECODER(decode_ndmsg);
|
||||
extern DECL_NETLINK_ROUTE_DECODER(decode_ndtmsg);
|
||||
extern DECL_NETLINK_ROUTE_DECODER(decode_netconfmsg);
|
||||
|
@ -156,7 +156,7 @@ decode_smc_diag_shutdown(struct tcb *const tcp,
|
||||
const void *const opaque_data)
|
||||
{
|
||||
const struct decode_nla_xlat_opts opts = {
|
||||
ARRSZ_PAIR(sock_shutdown_flags), "???_SHUTDOWN",
|
||||
sock_shutdown_flags, "???_SHUTDOWN",
|
||||
.size = 1,
|
||||
};
|
||||
|
||||
@ -203,11 +203,11 @@ decode_smc_diag_fallback(struct tcb *const tcp,
|
||||
* net/smc/smc_clc.h
|
||||
*/
|
||||
tprints("{reason=");
|
||||
printxval_search_ex(smc_decl_codes, fb.reason,
|
||||
"SMC_CLC_DECL_???", XLAT_STYLE_VERBOSE);
|
||||
printxval_ex(smc_decl_codes, fb.reason, "SMC_CLC_DECL_???",
|
||||
XLAT_STYLE_VERBOSE);
|
||||
tprints(", peer_diagnosis=");
|
||||
printxval_search_ex(smc_decl_codes, fb.peer_diagnosis,
|
||||
"SMC_CLC_DECL_???", XLAT_STYLE_VERBOSE);
|
||||
printxval_ex(smc_decl_codes, fb.peer_diagnosis, "SMC_CLC_DECL_???",
|
||||
XLAT_STYLE_VERBOSE);
|
||||
tprints("}");
|
||||
|
||||
return true;
|
||||
@ -235,16 +235,15 @@ DECL_NETLINK_DIAG_DECODER(decode_smc_diag_msg)
|
||||
(void *) &msg + offset)) {
|
||||
PRINT_FIELD_XVAL("", msg, diag_state,
|
||||
smc_states, "SMC_???");
|
||||
PRINT_FIELD_XVAL_INDEX(", ", msg, diag_fallback,
|
||||
smc_diag_mode,
|
||||
"SMC_DIAG_MODE_???");
|
||||
PRINT_FIELD_XVAL(", ", msg, diag_fallback,
|
||||
smc_diag_mode, "SMC_DIAG_MODE_???");
|
||||
PRINT_FIELD_U(", ", msg, diag_shutdown);
|
||||
/*
|
||||
* AF_SMC protocol family socket handler
|
||||
* keeping the AF_INET sock address.
|
||||
*/
|
||||
PRINT_FIELD_INET_DIAG_SOCKID(", ", msg, id, AF_INET);
|
||||
PRINT_FIELD_U(", ", msg, diag_uid);
|
||||
PRINT_FIELD_UID(", ", msg, diag_uid);
|
||||
PRINT_FIELD_U(", ", msg, diag_inode);
|
||||
decode_nla = true;
|
||||
}
|
||||
|
65
nlattr.c
65
nlattr.c
@ -101,7 +101,8 @@ decode_nlattr_with_data(struct tcb *const tcp,
|
||||
print_nlattr(nla, table, dflt);
|
||||
|
||||
if (nla_len > NLA_HDRLEN) {
|
||||
const unsigned int idx = size ? nla->nla_type : 0;
|
||||
const unsigned int idx =
|
||||
size ? nla->nla_type & NLA_TYPE_MASK : 0;
|
||||
|
||||
tprints(", ");
|
||||
if (!decoders
|
||||
@ -215,10 +216,8 @@ decode_nla_meminfo(struct tcb *const tcp,
|
||||
unsigned int count = 0;
|
||||
print_array_ex(tcp, addr, nmemb, &mem, sizeof(mem),
|
||||
tfetch_mem, print_uint32_array_member, &count,
|
||||
PAF_PRINT_INDICES | PAF_INDEX_XLAT_VALUE_INDEXED
|
||||
| XLAT_STYLE_FMT_U,
|
||||
ARRSZ_PAIR(netlink_sk_meminfo_indices),
|
||||
"SK_MEMINFO_???");
|
||||
PAF_PRINT_INDICES | XLAT_STYLE_FMT_U,
|
||||
netlink_sk_meminfo_indices, "SK_MEMINFO_???");
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -261,7 +260,14 @@ decode_nla_gid(struct tcb *const tcp,
|
||||
const unsigned int len,
|
||||
const void *const opaque_data)
|
||||
{
|
||||
return decode_nla_uid(tcp, addr, len, opaque_data);
|
||||
uint32_t gid;
|
||||
|
||||
if (len < sizeof(gid))
|
||||
return false;
|
||||
else if (!umove_or_printaddr(tcp, addr, &gid))
|
||||
printgid("", gid);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
@ -305,8 +311,7 @@ decode_nla_xval(struct tcb *const tcp,
|
||||
data.val = opts->process_fn(data.val);
|
||||
if (opts->prefix)
|
||||
tprints(opts->prefix);
|
||||
printxval_dispatch_ex(opts->xlat, opts->xlat_size, data.val,
|
||||
opts->dflt, opts->xt, opts->style);
|
||||
printxval_ex(opts->xlat, data.val, opts->dflt, opts->style);
|
||||
if (opts->suffix)
|
||||
tprints(opts->suffix);
|
||||
}
|
||||
@ -326,11 +331,9 @@ decode_nla_ether_proto(struct tcb *const tcp,
|
||||
const unsigned int len,
|
||||
const void *const opaque_data)
|
||||
{
|
||||
const struct decode_nla_xlat_opts opts = {
|
||||
static const struct decode_nla_xlat_opts opts = {
|
||||
.xlat = ethernet_protocols,
|
||||
.xlat_size = ethernet_protocols_size,
|
||||
.dflt = "ETHER_P_???",
|
||||
.xt = XT_SORTED,
|
||||
.prefix = "htons(",
|
||||
.suffix = ")",
|
||||
.size = 2,
|
||||
@ -346,10 +349,8 @@ decode_nla_ip_proto(struct tcb *const tcp,
|
||||
const unsigned int len,
|
||||
const void *const opaque_data)
|
||||
{
|
||||
const struct decode_nla_xlat_opts opts = {
|
||||
static const struct decode_nla_xlat_opts opts = {
|
||||
.xlat = inet_protocols,
|
||||
.xlat_size = inet_protocols_size,
|
||||
.xt = XT_SORTED,
|
||||
.dflt = "IPPROTO_???",
|
||||
.size = 1,
|
||||
};
|
||||
@ -357,6 +358,38 @@ decode_nla_ip_proto(struct tcb *const tcp,
|
||||
return decode_nla_xval(tcp, addr, len, &opts);
|
||||
}
|
||||
|
||||
bool
|
||||
decode_nla_in_addr(struct tcb *const tcp,
|
||||
const kernel_ulong_t addr,
|
||||
const unsigned int len,
|
||||
const void *const opaque_data)
|
||||
{
|
||||
struct in_addr in;
|
||||
|
||||
if (len < sizeof(in))
|
||||
return false;
|
||||
else if (!umove_or_printaddr(tcp, addr, &in))
|
||||
print_inet_addr(AF_INET, &in, sizeof(in), NULL);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
decode_nla_in6_addr(struct tcb *const tcp,
|
||||
const kernel_ulong_t addr,
|
||||
const unsigned int len,
|
||||
const void *const opaque_data)
|
||||
{
|
||||
struct in6_addr in6;
|
||||
|
||||
if (len < sizeof(in6))
|
||||
return false;
|
||||
else if (!umove_or_printaddr(tcp, addr, &in6))
|
||||
print_inet_addr(AF_INET6, &in6, sizeof(in6), NULL);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
decode_nla_flags(struct tcb *const tcp,
|
||||
const kernel_ulong_t addr,
|
||||
@ -377,10 +410,6 @@ decode_nla_flags(struct tcb *const tcp,
|
||||
|
||||
const size_t bytes_offs = is_bigendian ? sizeof(data) - len : 0;
|
||||
|
||||
if (opts->xt == XT_INDEXED)
|
||||
error_func_msg("indexed xlats are currently incompatible with "
|
||||
"printflags");
|
||||
|
||||
if (!umoven_or_printaddr(tcp, addr, len, data.bytes + bytes_offs)) {
|
||||
if (opts->process_fn)
|
||||
data.flags = opts->process_fn(data.flags);
|
||||
|
6
nlattr.h
6
nlattr.h
@ -34,9 +34,7 @@
|
||||
|
||||
struct decode_nla_xlat_opts {
|
||||
const struct xlat *xlat;
|
||||
size_t xlat_size; /* is not needed for XT_NORMAL */
|
||||
const char *dflt;
|
||||
enum xlat_type xt;
|
||||
enum xlat_style style;
|
||||
const char *prefix;
|
||||
const char *suffix;
|
||||
@ -100,11 +98,15 @@ DECL_NLA(fd);
|
||||
DECL_NLA(uid);
|
||||
DECL_NLA(gid);
|
||||
DECL_NLA(ifindex);
|
||||
DECL_NLA(ifla_af_spec);
|
||||
DECL_NLA(ether_proto);
|
||||
DECL_NLA(ip_proto);
|
||||
DECL_NLA(in_addr);
|
||||
DECL_NLA(in6_addr);
|
||||
DECL_NLA(meminfo);
|
||||
DECL_NLA(rt_class);
|
||||
DECL_NLA(rt_proto);
|
||||
DECL_NLA(rtnl_link_stats64);
|
||||
DECL_NLA(tc_stats);
|
||||
|
||||
#endif /* !STRACE_NLATTR_H */
|
||||
|
15
numa.c
15
numa.c
@ -142,18 +142,7 @@ print_status(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
|
||||
{
|
||||
const int status = *(int *) elem_buf;
|
||||
|
||||
if (status < 0 && (unsigned) -status < nerrnos)
|
||||
tprintf("-%s", errnoent[-status]);
|
||||
else
|
||||
tprintf("%d", status);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
print_int(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
|
||||
{
|
||||
tprintf("%d", *(int *) elem_buf);
|
||||
print_err(status, true);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -169,7 +158,7 @@ SYS_FUNC(move_pages)
|
||||
tfetch_mem, print_addr, 0);
|
||||
tprints(", ");
|
||||
print_array(tcp, tcp->u_arg[3], npages, &buf, sizeof(int),
|
||||
tfetch_mem, print_int, 0);
|
||||
tfetch_mem, print_int32_array_member, 0);
|
||||
tprints(", ");
|
||||
} else {
|
||||
print_array(tcp, tcp->u_arg[4], npages, &buf, sizeof(int),
|
||||
|
20
open.c
20
open.c
@ -76,11 +76,10 @@ print_dirfd(struct tcb *tcp, int fd)
|
||||
const char *
|
||||
sprint_open_modes(unsigned int flags)
|
||||
{
|
||||
static char outstr[(1 + ARRAY_SIZE(open_mode_flags)) * sizeof("O_LARGEFILE")];
|
||||
static char outstr[sizeof("flags O_ACCMODE")];
|
||||
char *p;
|
||||
char sep;
|
||||
const char *str;
|
||||
const struct xlat *x;
|
||||
|
||||
sep = ' ';
|
||||
p = stpcpy(outstr, "flags");
|
||||
@ -93,21 +92,10 @@ sprint_open_modes(unsigned int flags)
|
||||
return outstr;
|
||||
sep = '|';
|
||||
}
|
||||
*p++ = '\0';
|
||||
|
||||
for (x = open_mode_flags; x->str; x++) {
|
||||
if ((flags & x->val) == x->val) {
|
||||
*p++ = sep;
|
||||
p = stpcpy(p, x->str);
|
||||
flags &= ~x->val;
|
||||
if (!flags)
|
||||
return outstr;
|
||||
sep = '|';
|
||||
}
|
||||
}
|
||||
/* flags is still nonzero */
|
||||
*p++ = sep;
|
||||
p = xappendstr(outstr, p, "%#x", flags);
|
||||
return outstr;
|
||||
return sprintflags_ex(outstr, open_mode_flags, flags, sep,
|
||||
XLAT_STYLE_ABBREV) ?: outstr;
|
||||
}
|
||||
|
||||
void
|
||||
|
99
perf.c
99
perf.c
@ -31,6 +31,7 @@
|
||||
#include "defs.h"
|
||||
|
||||
#include "perf_event_struct.h"
|
||||
#include "print_fields.h"
|
||||
|
||||
#include "xlat/hw_breakpoint_len.h"
|
||||
#include "xlat/hw_breakpoint_type.h"
|
||||
@ -111,12 +112,6 @@ fetch_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define PRINT_XLAT(prefix, xlat, x, dflt) \
|
||||
do { \
|
||||
tprints(prefix); \
|
||||
printxval_search(xlat, x, dflt); \
|
||||
} while (0)
|
||||
|
||||
void
|
||||
print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
|
||||
{
|
||||
@ -159,9 +154,9 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
|
||||
use_new_size = 1;
|
||||
}
|
||||
|
||||
PRINT_XLAT("{type=", perf_type_id, attr->type, "PERF_TYPE_???");
|
||||
tprints(", size=");
|
||||
printxval(perf_attr_size, attr->size, "PERF_ATTR_SIZE_???");
|
||||
PRINT_FIELD_XVAL("{", *attr, type, perf_type_id, "PERF_TYPE_???");
|
||||
PRINT_FIELD_XVAL(", ", *attr, size, perf_attr_size,
|
||||
"PERF_ATTR_SIZE_???");
|
||||
|
||||
if (use_new_size) {
|
||||
tprints(" => ");
|
||||
@ -175,12 +170,12 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
|
||||
|
||||
switch (attr->type) {
|
||||
case PERF_TYPE_HARDWARE:
|
||||
PRINT_XLAT(", config=", perf_hw_id, attr->config,
|
||||
"PERF_COUNT_HW_???");
|
||||
PRINT_FIELD_XVAL(", ", *attr, config, perf_hw_id,
|
||||
"PERF_COUNT_HW_???");
|
||||
break;
|
||||
case PERF_TYPE_SOFTWARE:
|
||||
PRINT_XLAT(", config=", perf_sw_ids, attr->config,
|
||||
"PERF_COUNT_SW_???");
|
||||
PRINT_FIELD_XVAL(", ", *attr, config, perf_sw_ids,
|
||||
"PERF_COUNT_SW_???");
|
||||
break;
|
||||
case PERF_TYPE_TRACEPOINT:
|
||||
/*
|
||||
@ -188,17 +183,20 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
|
||||
* debugfs tracing/events/../../id if ftrace is enabled
|
||||
* in the kernel."
|
||||
*/
|
||||
tprintf(", config=%" PRIu64, attr->config);
|
||||
PRINT_FIELD_U(", ", *attr, config);
|
||||
break;
|
||||
case PERF_TYPE_HW_CACHE:
|
||||
/*
|
||||
* (perf_hw_cache_id) | (perf_hw_cache_op_id << 8) |
|
||||
* (perf_hw_cache_op_result_id << 16)
|
||||
*/
|
||||
PRINT_XLAT(", config=", perf_hw_cache_id, attr->config & 0xFF,
|
||||
"PERF_COUNT_HW_CACHE_???");
|
||||
PRINT_XLAT("|", perf_hw_cache_op_id, (attr->config >> 8) & 0xFF,
|
||||
tprints(", config=");
|
||||
printxval(perf_hw_cache_id, attr->config & 0xFF,
|
||||
"PERF_COUNT_HW_CACHE_???");
|
||||
tprints("|");
|
||||
printxval(perf_hw_cache_op_id, (attr->config >> 8) & 0xFF,
|
||||
"PERF_COUNT_HW_CACHE_OP_???");
|
||||
tprints("<<8|");
|
||||
/*
|
||||
* Current code (see set_ext_hw_attr in arch/x86/events/core.c,
|
||||
* tile_map_cache_event in arch/tile/kernel/perf_event.c,
|
||||
@ -214,9 +212,9 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
|
||||
* armpmu_map_cache_event in drivers/perf/arm_pmu.c) assumes
|
||||
* that cache result is 8 bits in size.
|
||||
*/
|
||||
PRINT_XLAT("<<8|", perf_hw_cache_op_result_id,
|
||||
(attr->config >> 16) & 0xFF,
|
||||
"PERF_COUNT_HW_CACHE_RESULT_???");
|
||||
printxval(perf_hw_cache_op_result_id,
|
||||
(attr->config >> 16) & 0xFF,
|
||||
"PERF_COUNT_HW_CACHE_RESULT_???");
|
||||
tprints("<<16");
|
||||
if (attr->config >> 24) {
|
||||
tprintf("|%#" PRIx64 "<<24", attr->config >> 24);
|
||||
@ -241,7 +239,7 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
|
||||
* to zero. Its parameters are set in other places."
|
||||
*/
|
||||
default:
|
||||
tprintf(", config=%#" PRIx64, attr->config);
|
||||
PRINT_FIELD_X(", ", *attr, config);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -249,17 +247,14 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
|
||||
goto print_perf_event_attr_out;
|
||||
|
||||
if (attr->freq)
|
||||
tprintf(", sample_freq=%" PRIu64, attr->sample_freq);
|
||||
PRINT_FIELD_U(", ", *attr, sample_freq);
|
||||
else
|
||||
tprintf(", sample_period=%" PRIu64, attr->sample_period);
|
||||
PRINT_FIELD_U(", ", *attr, sample_period);
|
||||
|
||||
tprints(", sample_type=");
|
||||
printflags64(perf_event_sample_format, attr->sample_type,
|
||||
"PERF_SAMPLE_???");
|
||||
|
||||
tprints(", read_format=");
|
||||
printflags64(perf_event_read_format, attr->read_format,
|
||||
"PERF_FORMAT_???");
|
||||
PRINT_FIELD_FLAGS(", ", *attr, sample_type, perf_event_sample_format,
|
||||
"PERF_SAMPLE_???");
|
||||
PRINT_FIELD_FLAGS(", ", *attr, read_format, perf_event_read_format,
|
||||
"PERF_FORMAT_???");
|
||||
|
||||
tprintf(", disabled=%u"
|
||||
", inherit=%u"
|
||||
@ -330,22 +325,22 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
|
||||
}
|
||||
|
||||
if (attr->watermark)
|
||||
tprintf(", wakeup_watermark=%u", attr->wakeup_watermark);
|
||||
PRINT_FIELD_U(", ", *attr, wakeup_watermark);
|
||||
else
|
||||
tprintf(", wakeup_events=%u", attr->wakeup_events);
|
||||
PRINT_FIELD_U(", ", *attr, wakeup_events);
|
||||
|
||||
if (attr->type == PERF_TYPE_BREAKPOINT)
|
||||
/* Any combination of R/W with X is deemed invalid */
|
||||
PRINT_XLAT(", bp_type=", hw_breakpoint_type, attr->bp_type,
|
||||
(attr->bp_type <=
|
||||
(HW_BREAKPOINT_X | HW_BREAKPOINT_RW)) ?
|
||||
"HW_BREAKPOINT_INVALID" :
|
||||
"HW_BREAKPOINT_???");
|
||||
PRINT_FIELD_XVAL(", ", *attr, bp_type, hw_breakpoint_type,
|
||||
(attr->bp_type <=
|
||||
(HW_BREAKPOINT_X | HW_BREAKPOINT_RW))
|
||||
? "HW_BREAKPOINT_INVALID"
|
||||
: "HW_BREAKPOINT_???");
|
||||
|
||||
if (attr->type == PERF_TYPE_BREAKPOINT)
|
||||
tprintf(", bp_addr=%#" PRIx64, attr->bp_addr);
|
||||
PRINT_FIELD_X(", ", *attr, bp_addr);
|
||||
else
|
||||
tprintf(", config1=%#" PRIx64, attr->config1);
|
||||
PRINT_FIELD_X(", ", *attr, config1);
|
||||
|
||||
/*
|
||||
* Fields after bp_addr/config1 are optional and may not present; check
|
||||
@ -354,15 +349,15 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
|
||||
|
||||
_PERF_CHECK_FIELD(bp_len);
|
||||
if (attr->type == PERF_TYPE_BREAKPOINT)
|
||||
tprintf(", bp_len=%" PRIu64, attr->bp_len);
|
||||
PRINT_FIELD_U(", ", *attr, bp_len);
|
||||
else
|
||||
tprintf(", config2=%#" PRIx64, attr->config2);
|
||||
PRINT_FIELD_X(", ", *attr, config2);
|
||||
|
||||
_PERF_CHECK_FIELD(branch_sample_type);
|
||||
if (attr->sample_type & PERF_SAMPLE_BRANCH_STACK) {
|
||||
tprints(", branch_sample_type=");
|
||||
printflags64(perf_branch_sample_type, attr->branch_sample_type,
|
||||
"PERF_SAMPLE_BRANCH_???");
|
||||
PRINT_FIELD_FLAGS(", ", *attr, branch_sample_type,
|
||||
perf_branch_sample_type,
|
||||
"PERF_SAMPLE_BRANCH_???");
|
||||
}
|
||||
|
||||
_PERF_CHECK_FIELD(sample_regs_user);
|
||||
@ -372,7 +367,7 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
|
||||
* described in the kernel header
|
||||
* arch/ARCH/include/uapi/asm/perf_regs.h."
|
||||
*/
|
||||
tprintf(", sample_regs_user=%#" PRIx64, attr->sample_regs_user);
|
||||
PRINT_FIELD_X(", ", *attr, sample_regs_user);
|
||||
|
||||
_PERF_CHECK_FIELD(sample_stack_user);
|
||||
/*
|
||||
@ -380,26 +375,24 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
|
||||
* specified."
|
||||
*/
|
||||
if (attr->sample_type & PERF_SAMPLE_STACK_USER)
|
||||
tprintf(", sample_stack_user=%#" PRIx32,
|
||||
attr->sample_stack_user);
|
||||
PRINT_FIELD_X(", ", *attr, sample_stack_user);
|
||||
|
||||
if (attr->use_clockid) {
|
||||
_PERF_CHECK_FIELD(clockid);
|
||||
tprints(", clockid=");
|
||||
printxval(clocknames, attr->clockid, "CLOCK_???");
|
||||
PRINT_FIELD_XVAL(", ", *attr, clockid, clocknames, "CLOCK_???");
|
||||
}
|
||||
|
||||
_PERF_CHECK_FIELD(sample_regs_intr);
|
||||
tprintf(", sample_regs_intr=%#" PRIx64, attr->sample_regs_intr);
|
||||
PRINT_FIELD_X(", ", *attr, sample_regs_intr);
|
||||
|
||||
_PERF_CHECK_FIELD(aux_watermark);
|
||||
tprintf(", aux_watermark=%" PRIu32, attr->aux_watermark);
|
||||
PRINT_FIELD_U(", ", *attr, aux_watermark);
|
||||
|
||||
_PERF_CHECK_FIELD(sample_max_stack);
|
||||
tprintf(", sample_max_stack=%" PRIu16, attr->sample_max_stack);
|
||||
PRINT_FIELD_U(", ", *attr, sample_max_stack);
|
||||
|
||||
/* _PERF_CHECK_FIELD(__reserved_2);
|
||||
tprintf(", __reserved2=%" PRIu16, attr->__reserved_2); */
|
||||
PRINT_FIELD_U(", ", *attr, __reserved2); */
|
||||
|
||||
print_perf_event_attr_out:
|
||||
if ((attr->size && (attr->size > size)) ||
|
||||
|
2
poll.c
2
poll.c
@ -169,7 +169,7 @@ SYS_FUNC(ppoll)
|
||||
if (entering(tcp)) {
|
||||
decode_poll_entering(tcp);
|
||||
|
||||
print_timespec(tcp, tcp->u_arg[2]);
|
||||
print_timespec(tcp, tcp->u_arg[2], false);
|
||||
tprints(", ");
|
||||
/* NB: kernel requires arg[4] == NSIG_BYTES */
|
||||
print_sigset_addr_len(tcp, tcp->u_arg[3], tcp->u_arg[4]);
|
||||
|
8
prctl.c
8
prctl.c
@ -161,7 +161,7 @@ SYS_FUNC(prctl)
|
||||
tprints(", ");
|
||||
} else if (!umove_or_printaddr(tcp, arg2, &i)) {
|
||||
tprints("[");
|
||||
tprints(signame(i));
|
||||
printsignal(i);
|
||||
tprints("]");
|
||||
}
|
||||
break;
|
||||
@ -241,6 +241,7 @@ SYS_FUNC(prctl)
|
||||
|
||||
switch (arg2) {
|
||||
case PR_SPEC_STORE_BYPASS:
|
||||
case PR_SPEC_INDIRECT_BRANCH:
|
||||
tcp->auxstr = sprintflags("",
|
||||
pr_spec_get_store_bypass_flags,
|
||||
(kernel_ulong_t) tcp->u_rval);
|
||||
@ -335,10 +336,10 @@ SYS_FUNC(prctl)
|
||||
|
||||
case PR_SET_PDEATHSIG:
|
||||
tprints(", ");
|
||||
if (arg2 > 128)
|
||||
if (arg2 > nsig)
|
||||
tprintf("%" PRI_klu, arg2);
|
||||
else
|
||||
tprints(signame(arg2));
|
||||
printsignal(arg2);
|
||||
return RVAL_DECODED;
|
||||
|
||||
case PR_SET_PTRACER:
|
||||
@ -413,6 +414,7 @@ SYS_FUNC(prctl)
|
||||
|
||||
switch (arg2) {
|
||||
case PR_SPEC_STORE_BYPASS:
|
||||
case PR_SPEC_INDIRECT_BRANCH:
|
||||
printxval64(pr_spec_set_store_bypass_flags, arg3,
|
||||
"PR_SPEC_???");
|
||||
break;
|
||||
|
@ -33,5 +33,12 @@
|
||||
void
|
||||
print_dev_t(const unsigned long long dev)
|
||||
{
|
||||
tprintf("makedev(%u, %u)", major(dev), minor(dev));
|
||||
if (xlat_verbosity(xlat_verbose) != XLAT_STYLE_ABBREV)
|
||||
tprintf("%llu", dev);
|
||||
if (xlat_verbosity(xlat_verbose) != XLAT_STYLE_RAW)
|
||||
return;
|
||||
|
||||
(xlat_verbosity(xlat_verbose) == XLAT_STYLE_ABBREV
|
||||
? tprintf : tprintf_comment)("makedev(%u, %u)",
|
||||
major(dev), minor(dev));
|
||||
}
|
||||
|
@ -99,21 +99,10 @@
|
||||
(xlat_), NULL); \
|
||||
} while (0)
|
||||
|
||||
#define PRINT_FIELD_XVAL_SORTED_SIZED(prefix_, where_, field_, xlat_, \
|
||||
xlat_size_, dflt_) \
|
||||
#define PRINT_FIELD_ERR(prefix_, where_, field_, neg_) \
|
||||
do { \
|
||||
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
|
||||
printxval_searchn((xlat_), (xlat_size_), \
|
||||
zero_extend_signed_to_ull((where_).field_), \
|
||||
(dflt_)); \
|
||||
} while (0)
|
||||
|
||||
#define PRINT_FIELD_XVAL_INDEX(prefix_, where_, field_, xlat_, dflt_) \
|
||||
do { \
|
||||
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
|
||||
printxval_index((xlat_), \
|
||||
zero_extend_signed_to_ull((where_).field_), \
|
||||
(dflt_)); \
|
||||
print_err((where_).field_, (neg_)); \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
@ -129,7 +118,10 @@
|
||||
zero_extend_signed_to_ull((where_).field_)); \
|
||||
} while (0)
|
||||
|
||||
#define PRINT_FIELD_UID PRINT_FIELD_ID
|
||||
#define PRINT_FIELD_UID(prefix_, where_, field_) \
|
||||
printuid(prefix_ #field_ "=", (where_).field_)
|
||||
#define PRINT_FIELD_GID(prefix_, where_, field_) \
|
||||
printgid(prefix_ #field_ "=", (where_).field_)
|
||||
|
||||
#define PRINT_FIELD_U64(prefix_, where_, field_) \
|
||||
do { \
|
||||
@ -183,6 +175,27 @@
|
||||
STRACE_PRINTF("%s%s=inet_addr(\"%s\")", (prefix_), #field_, \
|
||||
inet_ntoa((where_).field_))
|
||||
|
||||
#define PRINT_FIELD_INET6_ADDR(prefix_, where_, field_) \
|
||||
PRINT_FIELD_INET_ADDR((prefix_), (where_), field_, AF_INET6)
|
||||
|
||||
#define PRINT_FIELD_AX25_ADDR(prefix_, where_, field_) \
|
||||
do { \
|
||||
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
|
||||
print_ax25_addr(&(where_).field_); \
|
||||
} while (0)
|
||||
|
||||
#define PRINT_FIELD_X25_ADDR(prefix_, where_, field_) \
|
||||
do { \
|
||||
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
|
||||
print_x25_addr(&(where_).field_); \
|
||||
} while (0)
|
||||
|
||||
#define PRINT_FIELD_ROSE_ADDR(prefix_, where_, field_) \
|
||||
do { \
|
||||
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
|
||||
print_rose_addr(&(where_).field_); \
|
||||
} while (0)
|
||||
|
||||
#define PRINT_FIELD_NET_PORT(prefix_, where_, field_) \
|
||||
STRACE_PRINTF("%s%s=htons(%u)", (prefix_), #field_, \
|
||||
ntohs((where_).field_))
|
||||
@ -250,4 +263,13 @@
|
||||
(size_)); \
|
||||
} while (0)
|
||||
|
||||
#define PRINT_FIELD_HWADDR_SZ(prefix_, where_, field_, size_, hwtype_) \
|
||||
do { \
|
||||
static_assert(sizeof(((where_).field_)[0]) == 1, \
|
||||
"hwaddress is not a byte array"); \
|
||||
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
|
||||
print_hwaddr("", (const uint8_t *) ((where_).field_), \
|
||||
(size_), (hwtype_)); \
|
||||
} while (0)
|
||||
|
||||
#endif /* !STRACE_PRINT_FIELDS_H */
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user