IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
Negative micro/nanoseconds values are treated as invalid by kernel
anyway, and in one case (timespec_valid in include/linux/time.h)
it is even checked by conversion to unsigned long.
* print_timespec.c (timespec_fmt): Change tv_sec format to %lld and
tv_nsec format to %llu.
(print_timespec_t): Cast tv_sec to long long and process tv_nsec with
zero_extend_signed_to_ull.
(sprint_timespec): Likewise.
* print_timeval.c (timeval_fmt): Change tv_sec format to %lld and
tv_usec format to %llu.
(print_timeval_t): Cast tv_sec to long long and process tv_nsec with
zero_extend_signed_to_ull.
(sprint_timeval, print_timeval32_t, sprint_timeval32): Likewise.
* defs.h (TIMESPEC_TEXT_BUFSIZE): Update.
* tests/adjtimex.c (main): Change tv_sec printing format to %lld, cast
it to long long; change tv_usec printing format to %llu, process it with
zero_extend_signed_to_ull.
* tests/clock_nanosleep.c (main): Change tv_sec printing format to %lld,
cast it to long long; change tv_nsec printing format to %llu, process it
with zero_extend_signed_to_ull.
* tests/clock_xettime.c (main): Likewise.
* tests/futex.c (main): Likewise.
* tests/futimesat.c (print_tv): Likewise.
* tests/getrusage.c (invoke_print): Likewise.
* tests/mq_sendrecv.c (do_send, do_recv, main): Likewise.
* tests/nanosleep.c (main): Likewise.
* tests/pselect6.c (main): Likewise.
* tests/restart_syscall.c (main): Likewise.
* tests/rt_sigtimedwait.c (iterate, main): Likewise.
* tests/sched_rr_get_interval.c (main): Likewise.
* tests/semop.c (main): Likewise.
* tests/timer_xettime.c (main): Likewise.
* tests/timerfd_xettime.c (main): Likewise.
* tests/waitid.c (main): Likewise.
* tests/xetitimer.c (main): Likewise.
* tests/xettimeofday.c (main): Likewise.
* tests/xselect.c (main): Likewise.
* tests/xutimes.c (print_tv): Likewise.
* tests/wait4.c (sprint_rusage): Likewise.
* tests/waitid.c (sprint_rusage): Likewise.
* tests/utimensat.c (print_ts): Likewise.
(main): Add check for higher bits of tv_sec/tv_nsec.
Co-authored-by: Dmitry V. Levin <ldv@altlinux.org>
Refactor sprinttime: implement sprinttime_nsec and sprinttime_usec
that handle nanoseconds and microseconds, respectively.
Always print raw values of time data fields, format string
representations of time as comments.
* defs.h (sprinttime): Change argument type from time_t to long long.
(sprinttime_nsec, sprinttime_usec): New prototypes.
* util.c (sprinttime_ex, sprinttime_nsec, sprinttime_usec): New
functions.
(sprinttime): Turn into a thin wrapper around sprinttime_ex.
* stat.h (struct strace_stat): Add has_nsec field.
* fetch_struct_stat.c (HAVE_NSEC): New macro.
(fetch_struct_stat): Initialize has_nsec field with HAVE_NSEC.
* fetch_struct_stat64.c (HAVE_NSEC): New macro.
(fetch_struct_stat64): Initialize has_nsec field with HAVE_NSEC.
* print_struct_stat.c (print_struct_stat) <PRINT_ST_TIME>:
Print raw values of time fields, use sprinttime_nsec to format a string
representation of time, use tprints_comment to print it as a comment.
* statx.c (SYS_FUNC(statx)) <PRINT_FIELD_TIME>: Likewise.
* utime.c (SYS_FUNC(utime)): Print raw values of struct utimbuf.actime
and struct utimbuf.modtime fields, use sprinttime to format a string
representation of time, use tprints_comment to print it as a comment.
* tests/tests.h (print_time_t_nsec): Add int argument.
* tests/print_time.c (print_time_t_ex): New function.
(print_time_t_nsec): Add int argument, turn into a thin wrapper around
print_time_t_ex.
* tests/utime.c (main): Update expected output.
* tests/xstatx.c [!IS_STATX] (HAVE_NSEC): New macro.
[!IS_STATX] (PRINT_ST_TIME), [IS_STATX] (PRINT_FIELD_TIME): Update
expected output.
* NEWS: Mention this timestamps representation improvement.
Co-authored-by: Dmitry V. Levin <ldv@altlinux.org>
stat.sample is created by appropriate executables and never removed.
* tests/gen_tests.in (trace_fstat, trace_lstat, trace_stat,
trace_stat_like): Remove stat.sample creation.
Rewrite sched.test using test_trace_expr().
* tests/gen_tests.in (sched): New entry.
* tests/sched.in: New file, derived from a set of tests in sched.test.
* tests/sched.test: Remove.
* tests/Makefile.am (DECODER_TESTS): Remove sched.test.
(EXTRA_DIST): Add sched.in.
Rewrite regex.test using test_trace_expr().
* tests/gen_tests.in (regex): New entry.
* tests/regex.in: New file, derived from a set of tests in regex.test.
* tests/regex.test: Remove.
* tests/Makefile.am (DECODER_TESTS): Remove regex.test.
(EXTRA_DIST): Add regex.in.
Rewrite clock.test using test_trace_expr().
* tests/gen_tests.in (clock): New entry.
* tests/clock.in: New file, derived from a set of tests in clock.test.
* tests/clock.test: Remove.
* tests/Makefile.am (DECODER_TESTS): Remove clock.test.
(EXTRA_DIST): Add clock.in.
Rewrite trace_statfs.test using test_trace_expr().
* tests/gen_tests.in (trace_statfs): New entry.
* tests/trace_statfs.in: New file, derived from a set of tests
in trace_statfs.test.
* tests/trace_statfs.test: Remove.
* tests/Makefile.am (DECODER_TESTS): Remove trace_statfs.test.
(EXTRA_DIST): Add trace_statfs.in.
This introduces three new helpers:
prog_set_subtract subtracts one program set from another,
test_pure_prog_set runs strace check on a set of programs,
test_trace_expr tests trace expressions.
* tests/init.sh (prog_set_subtract, test_pure_prog_set,
test_trace_expr): New functions.
As tests are now run in separate directories.
* tests/xstatx.c: Use fixed "stat.sample" name for sample file.
* tests/fstat.test: Use it as an argument for -P option.
* tests/gen_tests.in (fstat64, lstat, lstat64, newfstatat, oldlstat,
oldstat, stat, stat64, statx): Likewise.
This solves problems like the need to update test suite on every
New Year's Eve.
* Makefile.am (dist-hook): Generate .year.
* copyright-year-gen: New file.
* configure.ac (copyright_year): New m4 variable, defined as the output
of copyright-year-gen script.
(AC_COPYRIGHT): Use it.
(COPYRIGHT_YEAR): New output variable and preprocessor macro.
* strace.c (print_version): Use COPYRIGHT_YEAR.
* strace.spec.in (%prep): Save the value of COPYRIGHT_YEAR autoconf
variable to .year file.
* tests/strace-V.test (config_year): New variable, derived from config.h.
Add sanity checks for $config_year and use it in expected output.
Reported-by: Andreas Schwab <schwab@suse.de>
* tests/gen_tests.in (pread64-pwrite64): New entry.
* tests/pread64-pwrite64.c: (main): Skip the test if /proc/self/fd/
is not available.
* tests/pread64-pwrite64.test: Remove.
* tests/Makefile.am (DECODER_TESTS): Remove pread64-pwrite64.test.
* tests/gen_tests.in (read-write): New entry.
* tests/read-write.c: (main): Skip the test if /proc/self/fd/
is not available.
* tests/read-write.test: Remove.
* tests/Makefile.am (DECODER_TESTS): Remove read-write.test.
* numa.c (print_status): Do not lose a minus sign when printing
a symbolic error code.
* tests/move_pages.c (print_status_array): Update expected output.
* tests/xutimes.c: New file, based on utimes.c.
* tests/utimes.c [__NR_utimes] (TEST_SYSCALL_NR, TEST_SYSCALL_STR,
TEST_STRUCT): New macros.
[__NR_utimes]: Replace all the rest with include "xutimes.c".
* tests/Makefile.am (EXTRA_DIST): Add xutimes.c.
* tests/utimes.c (errstr): New variable.
(print_ts, k_utimes): New functions.
(main): Use them to do more rigorous testing of utimes syscall parser.
* tests/gen_tests.in (utimes): Update -a option.
* tests/futimesat.c (errstr): New variable.
(print_ts, k_futimesat): New functions.
(main): Use them to do more rigorous testing of futimesat syscall parser.
When the whole pair of struct timeval structures cannot be fetched from
tracee's memory, print the address. This behavior follows the kernel's
that uses copy_from_user for the whole pair, too.
* print_timeval.c (print_timeval_item): Remove.
(print_timeval_pair): Rename to print_timeval_utimes, all callers
updated. Fetch the whole timeval_t array with a single
umove_or_printaddr call.
* tests/futimesat.c (main): Update expected output.
* tests/utimes.c (main): Likewise.
The new test also does more rigorous testing.
* tests/utimensat.c: Stop including <assert.h> and <errno.h>, include
<unistd.h> and <asm/unistd.h>, check __NR_utimensat instead
of HAVE_UTIMENSAT.
(errstr): New variable.
(k_utimensat): New function, a thin wrapper around
syscall(__NR_utimensat).
(main): Use them instead of utimensat.
* tests/gen_tests.in (utimensat): New entry.
* tests/utimensat.test: Remove.
* tests/Makefile.am (DECODER_TESTS): Remove it.
* tests/clock.test: Remove futimesat, utime, utimensat, and utimes tests
from the list of exceptions.
* tests/utime.c (main): Do not use time(), use fixed timestamp instead.
* tests/futimesat.c (main): Do not use gettimeofday(), use fixed
timestamps instead.
* tests/utimensat.c (main): Likewise.
* tests/utimes.c (main): Likewise.
* tests/mq_sendrecv.c (MQ_NAME): Remove.
(mq_name): New static variable.
(cleanup): Use it instead of MQ_NAME.
(main): Initialize it dynamically using the pid of process. Use it
instead of MQ_NAME.
* tests/mq.c (NAME): Remove.
(main): Replace the fixed message queue name with a dynamically
made name containing the pid of process.
* tests/gen_tests.in (mq): Update -a option.