Commit Graph

1166 Commits

Author SHA1 Message Date
c36875b170 tests: use TAIL_ALLOC_OBJECT_VAR_PTR
Automatically convert tests to use TAIL_ALLOC_OBJECT_VAR_PTR macro
with the following sed expression:

sed -ri \
's/^([[:space:]]*)(([^*]+[[:alnum:]_])( \*)?) *\*([^ =]+) = tail_alloc\(sizeof\((\2|\*\5)\)\);/\1TAIL_ALLOC_OBJECT_VAR_PTR(\2, \5);/' \
tests/{move_pages,net-sockaddr,sendfile}.c
2017-03-16 13:46:36 +00:00
72b7cfb3bf tests: add TAIL_ALLOC_OBJECT_{CONST,VAR}_PTR to tests.h
Introduce a new macros for the most widespread use of tail_alloc.

* tests/tests.h (TAIL_ALLOC_OBJECT_CONST_PTR,
TAIL_ALLOC_OBJECT_VAR_PTR): New macros.
2017-03-16 13:46:36 +00:00
Victor Krapivensky
9407d10e12 Decode RUSAGE_THREAD
* xlat/usagewho.in: Add values for existing entities, add
RUSAGE_THREAD.
* tests/getrusage.c: Test decoding of RUSAGE_THREAD.
2017-03-16 12:39:12 +00:00
Eugene Syromyatnikov
b24254d34c tests/sched.test: use heredoc in order to avoid spawning of subprocess
Pipelined commands executed in subprocesses (some shells have special
provision for last command in the pipeline, but it is not guaranteed
and not POSIX), so exit codes of these subprocesses can be lost.
In order to avoid creating subprocesses, input for read commands
is better to supply via heredoc and not pipe.

* tests/sched.test: Move test cases to heredoc.
2017-03-15 01:10:51 +00:00
30c16384ef tests: do not skip sched.test if one of its subtests skips
* tests/sched.test (try_run_prog): New function.
Use it instead of run_prog.
2017-03-15 01:05:45 +00:00
245d6d20ce tests: do not check decoding of setitimer syscall outside xetitimer.test
xetitimer.test already implements a comprehensive test of setitimer
syscall parser, no need to duplicate its parts in other tests.

* tests/clock_nanosleep.c (main): Remove setitimer expected output.
* tests/nanosleep.c (main): Likewise.
* tests/clock_nanosleep.test: Remove setitimer from the trace set.
* tests/nanosleep.test: Likewise.
2017-03-15 00:00:29 +00:00
1e92920f81 tests: check decoding of getitimer and setitimer corner cases
* tests/sched_xetattr.c: Include <unistd.h> and <asm/unistd.h>.
(main): Check that pointer and integer arguments of getitimer
and setitimer syscalls are decoded properly.
* tests/xetitimer.test: Add -a option.
2017-03-14 22:35:13 +00:00
645eb6405b tests: rewrite sigreturn syscall decoding check from match_grep to match_diff
Unlike the former test that was based on match_grep,
the new one uses match_diff and does more rigorous testing.

* tests/sigreturn.c: Rewrite.
* tests/sigreturn.test: Likewise.
2017-03-13 15:22:51 +00:00
5c6951e73e tests: check decoding of rt_sigreturn syscall
* tests/rt_sigreturn.c: New file.
* tests/rt_sigreturn.test: New test.
* tests/.gitignore: Add rt_sigreturn.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add rt_sigreturn.test.
2017-03-13 15:22:50 +00:00
Eugene Syromyatnikov
811638e9c1 Implement -e trace=%sched option for tracing sched_* syscalls
Based on the patch by Md Haris Iqbal
(https://sourceforge.net/p/strace/mailman/message/35111320/)

linux/*/syscallent.h part is modified automatically by:

    git grep -Fl 'SEN(sched_' linux/ | xargs sed -i \
        's/0\(,[[:space:]]*SEN(sched_\)/TSC\1/'

* sysent.h (TRACE_SCHED): New definition.
* syscall.c: Alias TSC to TRACE_SCHED around syscallent.h inclusion.
* linux/32/syscallent.h: Add TSC flag for sched_* sycalls.
* linux/64/syscallent.h: Likewise.
* linux/alpha/syscallent.h: Likewise.
* linux/arm/syscallent.h: Likewise.
* linux/avr32/syscallent.h: Likewise.
* linux/bfin/syscallent.h: Likewise.
* linux/crisv10/syscallent.h: Likewise.
* linux/hppa/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/ia64/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/mips/syscallent-n32.h: Likewise.
* linux/mips/syscallent-n64.h: Likewise.
* linux/mips/syscallent-o32.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/powerpc64/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/sparc64/syscallent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
* linux/xtensa/syscallent.h: Likewise.
* qualify.c (lookup_class): Add TRACE_SCHED for "%sched".
* tests/ksysent.c: Define TSC to 0.
* tests/nsyscalls.c: Likewise.
* tests/sched.test: New test.
* tests/Makefile.am (DECODER_TESTS): Add sched.test.
* strace.1 (.SS Filtering): Add information about %sched syscall class.
* NEWS: Mention this change.

Co-authored-by: Md Haris Iqbal <haris.phnx@gmail.com>
2017-03-05 01:11:13 +01:00
Eugene Syromyatnikov
6477079361 Add "%" prefix for syscall classes in qualify
(as suggested in
https://www.mail-archive.com/strace-devel@lists.sourceforge.net/msg05147.html )

In order to move them to a different namespace than syscall names. This is
already a problem in case of ipc class which shadows ipc syscall.

Old behaviour is retained in order to preserve backwards compatibility.

* qualify.c (lookup_class) <syscall_class>: Add %-prefixed class definitions.
* strace.1 (.SS Filtering): Add information regarding %-prefixed class
syntax, declare legacy class syntax deprecated.
* tests/net.test: Update to use %-prefixed syscall class name.
* tests/netlink_protocol.test: Likewise.
* tests/qual_fault-exit_group.test: Likewise.
* tests/qual_syscall.test: Likewise.
* tests/scm_rights-fd.test: Likewise.
* tests/sigreturn.test: Likewise.
* tests/uio.test: Likewise.
* NEWS: Mention this change.
2017-03-05 00:32:18 +01:00
73a21f1a3f tests: simplify print_time_t
* tests/print_time.c (print_time_t): Treat localtime errors as fatal.
2017-02-28 01:21:15 +00:00
bc41bcbb0b tests: transform print_time_t into print_time_t_nsec
* tests/print_time.c (print_time_t): Rename to print_time_t_nsec,
take second argument and print it.
* tests/tests.h (print_time_t): Rename to print_time_t_nsec,
add second argument.
* tests/utime.c (main): Use print_time_t_nsec instead of print_time_t.
* tests/xstatx.c (print_stat): Likewise.  Pass nanoseconds
to print_time_t_nsec instead of printing them.
2017-02-26 23:23:31 +00:00
0698ab728f tests: use print_time_t in utime.test
* tests/utime.c (print_tm): Remove.
(main): Use print_time_t instead of print_tm.
2017-02-26 22:57:37 +00:00
af10e6e751 tests: move print_time function to libtests
Rename print_time function to print_time_t and move it to libtests.

* tests/print_time.c: New file.
* tests/Makefile.am (libtests_a_SOURCES): Add it.
* tests/tests.h (print_time_t): New prototype.
* tests/print_time.c (print_time): Remove.
(print_stat): Replace print_time with print_time_t.
2017-02-26 20:35:37 +00:00
b8a045fbf0 tests: macroize printing of atime, mtime, and ctime fields in xstatx.c
Introduce a macro for printing similar time related fields.

* print_struct_stat.c (PRINT_ST_TIME): New macro.
(print_stat): Use it.
2017-02-26 19:14:34 +00:00
f7b9a6ac63 x32: fix decoding of flags argument of preadv2 and pwritev2 syscalls
x32 is the only linux architecture where preadv2 and pwritev2 syscalls
take 5 arguments instead of 6.

* io.c (PREADV2_PWRITEV2_FLAGS_ARG_NO): New macro.
(SYS_FUNC(preadv2), SYS_FUNC(pwritev2)): Use it.
* linux/x32/syscallent.h (preadv2, pwritev2): Change nargs to 5.
* NEWS: Mention this fix.
* tests/preadv2-pwritev2.c (main): Fix invocation of preadv2
and pwritev2 syscalls on x32.
2017-02-25 15:55:31 +00:00
7519e54937 tests: rewrite ppoll syscall decoding check from match_grep to match_diff
Unlike the former test that was based on match_grep,
the new one uses match_diff and does more rigorous testing.

* tests/ppoll-v.c: New file.
* tests/ppoll-v.test: New test.
* tests/ppoll.c: Rewrite.
* tests/ppoll.test: Likewise.
* tests/ppoll.expected: Remove.
* tests/ppoll-v.expected: Remove.
* tests/.gitignore: Add ppoll-v.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add ppoll-v.test.
(EXTRA_DIST): Remove ppoll.expected and ppoll-v.expected.
2017-02-21 22:39:45 +00:00
667b764c41 tests: move get_sigset_size function to libtests
* tests/get_sigset_size.c: New file.
* tests/Makefile.am (libtests_a_SOURCES): Add it.
* tests/tests.h (get_sigset_size): New prototype.
* tests/ptrace.c: Do not check for __NR_rt_sigprocmask.
(main): Use get_sigset_size.
* tests/signalfd4.c: Do not check for __NR_rt_sigprocmask.
(get_sigset_size): Remove.
2017-02-20 00:10:35 +00:00
556652be53 sched: enhance decoding of sched_setattr syscall
Implement read/write semantics of struct sched_attr.size argument
of sched_setattr syscall.  Do not print members of struct sched_attr
besides sched_attr.size when the specified structure size is less than
the minimal size allowed by the kernel.

* sched.c (print_sched_attr): Fetch struct sched_attr.size and use it
as the structure size.  Print struct sched_attr.size only when the
structure size is less than SCHED_ATTR_MIN_SIZE.
(SYS_FUNC(sched_setattr)): Call print_sched_attr with zero size
argument.  Print struct sched_attr.size returned by the kernel
on exiting syscall in case of E2BIG. Print the last syscall argument
on exiting syscall.
(SYS_FUNC(sched_getattr)): Do not call print_sched_attr with zero size
argument.
* NEWS: Mention it.
* tests/sched_xetattr.c (main): Check it.
2017-02-19 00:31:40 +00:00
f31755fda2 tests: check decoding of sched_[gs]etattr corner cases
* tests/sched_xetattr.c (main): Check that integer arguments
of sched_getattr and sched_setattr syscalls are decoded properly
by adding a few cases with filled higher 32 bits.
Check that pointer argument is decoded properly
on F8ILL_KULONG_SUPPORTED architectures.
2017-02-18 09:58:52 +00:00
3e80074350 Move definition of struct sched_attr to a separate header file
Avoid multiple defintions of struct sched_attr by creating a separate
header file with its definition and using it in other places.

* sched_attr.h: New file.
* Makefile.am (strace_SOURCES): Add it.
* sched.c: Include it.
(print_sched_attr): Use it.
* tests/sched_xetattr.c: Include it.
(main): Use it.
2017-02-18 09:58:52 +00:00
6e9ad7be61 tests: rewrite sched_xetattr.test from match_grep to match_diff
Unlike the previous edition of the test that was based on match_grep,
the new one is match_diff based and does more rigorous testing.

* tests/adjtimex.c: Include "xlat.h" and "xlat/schedulers.h",
(sys_sched_getattr, sys_sched_setattr): New functions.
(main): Use them.  Update expected output.
* tests/adjtimex.test: Use run_strace_match_diff.
2017-02-18 09:58:52 +00:00
5b2e59a413 bpf: update BPF_PROG_ATTACH decoding
Implement decoding of BPF_F_ALLOW_OVERRIDE flag of BPF_PROG_ATTACH
command introduced by linux kernel commit v4.10-rc7-174-g7f67763.

* configure.ac: Check for union bpf_attr.attach_flags
instead of union bpf_attr.attach_type.
* xlat/bpf_attach_flags.in: New file.
* bpf.c: Include "xlat/bpf_attach_flags.h".
(bpf_prog_attach_detach): Rename print_attach_bpf_fd argument
to print_attach.  Add attach_flags field to the structure,
print it in case of BPF_PROG_ATTACH.
* tests/bpf.c: Check for HAVE_UNION_BPF_ATTR_ATTACH_FLAGS
instead of HAVE_UNION_BPF_ATTR_ATTACH_TYPE.
(prog_cgroup): Initialize attach_flags field.
(main): Update expected output.
2017-02-17 00:05:00 +00:00
f19251a808 tests: rewrite adjtimex.test from match_grep to match_diff
Unlike the previous edition of the test that was based on match_grep,
the new one is match_diff based and does more rigorous testing.

* tests/adjtimex.c: Include "xlat.h", "xlat/adjtimex_state.h",
and "xlat/adjtimex_status.h".
(main): Update expected output.
* tests/adjtimex.test: Use run_strace_match_diff.
2017-02-16 21:02:44 +00:00
18b582ec11 tests: replace casts of 0xffffffff00000000ULL with F8ILL_KULONG_MASK
* tests/init_delete_module.h (bogus_zero): Remove.
* tests/delete_module.c (main): Replace bogus_zero and
(kernel_ulong_t) 0xffffffff00000000ULL with F8ILL_KULONG_MASK.
* tests/finit_module.c (main): Replace bogus_zero
with F8ILL_KULONG_MASK.
* tests/init_module.c (main): Likewise.
* tests/pipe2.c (main): Likewise.
* tests/epoll_ctl.c (invoke_syscall): Replace
(unsigned long) 0xffffffff00000000ULL with F8ILL_KULONG_MASK.
* tests/rt_tgsigqueueinfo.c (k_tgsigqueueinfo): Likewise.
* tests/fanotify_init.c (main): Likewise.
* tests/xetpgid.c (main): Likewise.
* tests/xetpriority.c (main): Likewise.
(kernel_ulong_t) 0xffffffff00000000ULL with F8ILL_KULONG_MASK.
* tests/fanotify_mark.c (main): Likewise.
* tests/file_handle.c (main): Likewise.
* tests/kexec_load.c (main): Likewise.
* tests/setfsugid.c (main): Likewise.
* tests/getgroups.c (main): Replace (long) 0xffffffff00000000ULL
with F8ILL_KULONG_MASK.
* tests/setgroups.c (main): Replace (long) 0xffffffff00000000ULL
and (unsigned long) 0xffffffff00000000ULL with F8ILL_KULONG_MASK.
2017-02-16 16:36:14 +00:00
1d5e810ce8 tests: fill higher bits of integer arguments of fcntl* syscalls
Check that integer arguments of fcntl and fcntl64 syscalls are decoded
properly by casting them to kernel_ulong_t and filling higher bits.

* tests/struct_flock.c (invoke_test_syscall): Cast "fd" and "cmd"
syscall arguments to kernel_ulong_t, fill their higher 32 bits.
2017-02-16 12:51:00 +00:00
ec75764697 tests: use sprintrc in tests of fcntl and fcntl64 syscalls
* tests/struct_flock.c (EINVAL_STR): Remove.
(test_flock_einval, test_flock): Use sprintrc instead of EINVAL_STR.
* tests/fcntl.c (test_flock64_einval): Likewise.
* tests/fcntl64.c (test_flock64_einval, test_flock64): Likewise.
2017-02-16 12:51:00 +00:00
9ff5dbe36d tests: skip scno tampering tests on compat mips abi
* tests/scno_tampering.sh: In case of mips abi, skip the test
unless it is the native abi.
2017-02-13 17:30:00 +00:00
2063341fef Fix -Werror=duplicate-decl-specifier compilation issues
capability.c:82:28: error: duplicate "const" declaration specifier
capability.c:110:33: error: duplicate "const" declaration specifier
rt_tgsigqueueinfo.c:42:61: error: duplicate "const" declaration specifier
utime.c:66:23: error: duplicate "const" declaration specifier
waitid.c:147:20: error: duplicate "const" declaration specifier

* capability.c (cap_user_header_t, cap_user_data_t): Remove.
(get_cap_header): Change return type
to "const struct user_cap_header_struct *".
(print_cap_header, print_cap_data): Change the type of last argument
to "const struct user_cap_header_struct * const".
(SYS_FUNC(capget)): Change type of "h" variable
to "const struct user_cap_header_struct *".
(SYS_FUNC(capset)): Change type of "h" variable
to "const struct user_cap_header_struct * const".
* tests/rt_tgsigqueueinfo.c (k_tgsigqueueinfo): Change the type of last
argument to "const void *const".
* tests/utime.c (main): Change the type of "tail_u" variable
to "const struct utimbuf *const".
* tests/waitid.c (do_waitid): Change the type of 3rd argument
to "const siginfo_t *const".
2017-02-12 19:14:15 +00:00
c10dd66fb7 tests: rewrite pipe syscall decoding check from match_grep to match_diff
* configure.ac (AC_CHECK_FUNCS): Remove pipe2.
* tests/pipe.c: Include <asm/unistd.h>, skip the test if [!__NR_pipe]
instead of [!HAVE_PIPE2].
(main): Do not call pipe2.
* tests/pipe.test: Skip the test if libc pipe wrapper does not use
pipe syscall, rewrite from match_grep to match_diff.
* tests/pipe.expected: Update expected output.
2017-02-12 14:12:41 +00:00
3c5dbffe61 tests: rewrite pipe2 syscall decoding check from match_grep to match_diff
Unlike pipe.test that is based on match_grep, the new test
is based on match_diff and does more rigorous testing.

* tests/pipe2.c: New file.
* tests/pipe2.test: New test.
* tests/.gitignore: Add pipe2.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add pipe2.test.
2017-02-11 13:40:42 +00:00
649fe41781 tests: rewrite mq.test from match_grep to match_diff
Unlike the previous edition of the test that was based on match_grep,
the new one is match_diff based and does more rigorous testing.

* tests/mq.c: Include <stdio.h>.
(NAME): New macro.
(main): Use it.  Print expected output.
* tests/mq.expected: Remove.
* tests/Makefile.am (EXTRA_DIST): Remove mq.expected.
* tests/mq.test: Use run_strace_match_diff.
2017-02-10 00:14:45 +00:00
98313939b3 tests: check signal injection along with fault injection
* tests/qual_inject-error-signal.c: New file.
* tests/qual_inject-error-signal.expected: Likewise.
* tests/qual_inject-error-signal.test: New test.
* tests/.gitignore: Add qual_inject-error-signal.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(MISC_TESTS): Add qual_inject-error-signal.test.
(EXTRA_DIST): Add qual_inject-error-signal.expected.
2017-02-09 22:26:14 +00:00
8b1f878809 tests: simplify qual_inject-signal.test
* tests/qual_inject-signal.test: Use $NAME instead of qual_inject-signal.
2017-02-09 22:26:14 +00:00
1124db4483 Make symbolic errno values match case-insensitive
Follow the example of case-insensitive symbolic signal values in signal
and inject expressions and make symbolic errno values in inject
expressions case-insensitive.

* qualify.c (find_errno_by_name): Use strcasecmp instead of strcmp
to match symbolic errno values.
* tests/qual_fault.c (main): Likewise.
* tests/qual_fault.test: Test case-insensitive symbolic errno match.
2017-02-09 14:38:08 +00:00
e2040dede4 tests: check case-insensitive symbolic signal match
* tests/qual_signal.test: Test case-insensitive symbolic signal match.
2017-02-09 14:38:08 +00:00
e0fc01c0ef tests: update ipc_sem.test for new glibc
Starting with commit glibc-2.24-553-g40c0a78, glibc may pass NULL
address to semctl like other libcs.

* tests/ipc_sem.c (main) [__GLIBC__]: Remove.
2017-02-08 15:54:35 +00:00
75c3844167 tests: fix typo in bpf.test
* tests/bpf.c (main): Add missing semicolon.

Fixes: ad427721 ("tests: rewrite bpf.test from match_grep to match_diff")
2017-02-08 15:12:40 +00:00
34878f17b9 tests: check signal injection
* tests/qual_inject-signal.c: New file.
* tests/qual_inject-signal.expected: Likewise.
* tests/qual_inject-signal.test: New test.
* tests/.gitignore: Add qual_inject-signal.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(MISC_TESTS): Add qual_inject-signal.test.
(EXTRA_DIST): Add qual_inject-signal.expected.
2017-02-08 13:51:33 +00:00
be73ca4bae Implement -e inject= option
Introduce -e inject= as a general injection option,
limit -e fault= option to syscall fault injection.

Change default return code of syscall fault injection to ENOSYS.

* qualify.c (parse_inject_token): Add fault_tokens_only argument,
do not accept retval= and signal= tokens when fault_tokens_only
is set to true.
(parse_inject_expression): Add fault_tokens_only argument,
forward it to parse_inject_token.
(qualify_inject_common): New function.
(qualify_fault): Use it.
(qualify_inject): New function.
(qual_options): New entry.
* strace.1: Describe -e inject= option.
* NEWS: Mention -e inject= option.
* tests/qual_fault-syntax.test: Test that -e fault= option does not
support retval=, signal=, and multiple error= tokens.
* tests/qual_fault.c (DEFAULT_ERRNO): Set to ENOSYS unconditionally.
* tests/qual_inject-retval.test: Replace -e fault= option
with -e inject= option.
* tests/qual_inject-syntax.test: New test.
* tests/Makefile.am (MISC_TESTS): Add it.
2017-02-08 09:28:38 +00:00
d1dfcc533e tests: prepare for introduction of -e inject= option
Rename files related to fault injection to avoid further confusion.

* tests/fault_injection-exit_group.expected: Rename
to tests/qual_fault-exit_group.expected.
* tests/fault_injection-exit_group.test: Rename
to tests/qual_fault-exit_group.test.
* tests/fault_syntax.test: Rename to tests/qual_fault-syntax.test.
* tests/fault_injection.c: Rename to tests/qual_fault.c.
* tests/fault_injection.test: Rename to tests/qual_fault.test.
* tests/fault_injection-retval.c: Rename to tests/qual_inject-retval.c.
* tests/fault_injection-retval.test: Rename
to tests/qual_inject-retval.test.
* tests/fault_injection.sh: Rename to tests/scno_tampering.sh.
* tests/.gitignore: Update.
* tests/Makefile.am (check_PROGRAMS, DECODER_TESTS, MISC_TESTS,
EXTRA_DIST): Update.
2017-02-08 09:28:30 +00:00
779a28e117 tests: make Makefile.am lists sorted in C locale
* tests/Makefile.am (check_PROGRAMS, DECODER_TESTS, MISC_TESTS,
EXTRA_DIST): Make sorted in C locale.
2017-02-07 17:56:32 +00:00
86477a6228 tests: use ARG_STR in msg_control.test
Drop local VAL_STR macro in favour of ARG_STR macro from tests/tests.h.

* tests/msg_control.c (VAL_STR): Remove.
(test_sol_socket, test_sol_ip): Replace VAL_STR with ARG_STR.
2017-02-07 15:25:41 +00:00
bf4e76e4e7 tests: check decoding of bpf corner cases
* tests/bpf.c (bogus_bpf): New function.
(BOGUS_BPF): New macro.
(main): Use them.
* tests/bpf.test: Add -a option.
2017-01-31 19:38:45 +00:00
ad4277214e tests: rewrite bpf.test from match_grep to match_diff
* tests/bpf.c (errstr): New variable.
(sys_bpf): New function.
(map_create, map_any, prog_load, obj_manage, prog_cgroup): Use it.
(main): Update expected output.
* tests/bpf.test: Use run_strace_match_diff.
2017-01-29 23:12:07 +00:00
Quentin Monnet
0a8dd6a68c Update bpf syscall decoding
Implement decoding of BPF_OBJ_PIN, BPF_OBJ_GET, BPF_PROG_ATTACH,
and BPF_PROG_DETACH commands.

* bpf.c: Include "xlat/bpf_attach_type.h".
(bpf_obj_manage, bpf_prog_attach, bpf_prog_detach): New functions.
(SYS_FUNC(bpf)): Use them.
* configure.ac: Check for union bpf_attr.bpf_fd and union
bpf_attr.attach_type.
* xlat/bpf_attach_type.in: New file.
* xlat/bpf_commands.in: Update list of BPF_* command constants.
* xlat/bpf_map_types.in: Update list of BPF_MAP_TYPE_* constants.
* xlat/bpf_prog_types.in: Update list of BPF_PROG_TYPE_* constants.
* tests/bpf.c [HAVE_UNION_BPF_ATTR_BPF_FD] (obj_manage): New function.
[HAVE_UNION_BPF_ATTR_ATTACH_TYPE] (prog_cgroup): Likewise.
(main): Use them.
2017-01-29 21:54:43 +00:00
Elvira Khabirova
fe871501ff tests: check success injection
* tests/fault_injection-retval.c: New file.
* tests/fault_injection-retval.test: New test.
* tests/.gitignore: Add fault_injection-retval.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(MISC_TESTS): Add fault_injection-retval.test.
2017-01-28 09:55:20 +00:00
JingPiao Chen
8b7be09c7b Implement decoding of ustat syscall
* configure.ac (AC_CHECK_HEADERS): Add ustat.h.
* ustat.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* linux/dummy.h: Remove sys_ustat.
* tests/ustat.c: New file.
* tests/ustat.test: New test.
* tests/.gitignore: Add ustat.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add ustat.test.
2017-01-20 18:30:11 +00:00
ca2bf7c9e9 tests: drop non-USE_ASM_STAT case support
With the switch of fstatat family tests to USE_ASM_STAT variant,
there are no non-USE_ASM_STAT users left.  Remove support of unused
non-USE_ASM_STAT case.

* configure.ac (AC_CHECK_MEMBERS): Remove struct stat.st_mtim.tv_nsec.
* tests/fstatat.c (USE_ASM_STAT): Remove.
* tests/fstatx.c: Likewise.
* tests/lstatx.c: Likewise.
* tests/xstatx.c: Assume USE_ASM_STAT.
[!USE_ASM_STAT]: Remove.
2017-01-13 20:07:09 +00:00