From 6f11acd360f7e49149f7830d289399e4b7cf6a77 Mon Sep 17 00:00:00 2001 From: Chris Metcalf Date: Mon, 6 May 2013 11:21:13 -0400 Subject: [PATCH] tests/stat: support fstatat syscall for stat() Newer Linux architectures don't support the stat/stat64 syscalls. Instead they use fstatat() with AT_FDCWD and an extra flags argument. Support seeing this output in the 'strace -efile' test. As part of this change, use "grep -E -x" syntax consistently for all stat tests, since the number of \(foo\)\? expressions was becoming pretty unwieldy. * tests/stat: Update stat/stat64 check regexp to handle architectures that use fstatat instead. Use "grep -E -x" syntax consistently. Signed-off-by: Chris Metcalf --- tests/stat | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/stat b/tests/stat index 5fe0b866..0c1b8043 100755 --- a/tests/stat +++ b/tests/stat @@ -19,20 +19,20 @@ rm -f sample timeout -s 9 $check_timeout \ $STRACE -edesc $truncate_cmd 2>&1 > /dev/null 2> check.log && -LC_ALL=C grep -x 'ftruncate\(64\)\?(1, 46118400000) \+= 0' check.log > /dev/null || +LC_ALL=C grep -E -x 'ftruncate(64)?\(1, 46118400000\) += 0' check.log > /dev/null || { cat check.log; fail_ 'strace -edesc failed to trace ftruncate/ftruncate64 properly'; } -LC_ALL=C grep -x 'lseek(1, 46118400000, SEEK_CUR) \+= 46118400000\|_llseek(1, 46118400000, \[46118400000\], SEEK_CUR) \+= 0' check.log > /dev/null || +LC_ALL=C grep -E -x 'lseek\(1, 46118400000, SEEK_CUR\) += 46118400000|_llseek\(1, 46118400000, \[46118400000\], SEEK_CUR\) += 0' check.log > /dev/null || { cat check.log; fail_ 'strace -edesc failed to trace lseek/_llseek properly'; } timeout -s 9 $check_timeout \ $STRACE -efile find -L sample > /dev/null 2> check.log && -LC_ALL=C grep -x 'stat\(64\)\?("sample", {st_mode=S_IFREG|0644, st_size=46118400000, \.\.\.}) \+= 0' check.log > /dev/null || +LC_ALL=C grep -E -x 'f?stat(at)?(64)?\((AT_FDCWD, )?"sample", [{]st_mode=S_IFREG\|0644, st_size=46118400000, \.\.\.}(, 0)?\) += 0' check.log > /dev/null || { cat check.log; fail_ 'strace -efile failed to trace stat/stat64 properly'; } timeout -s 9 $check_timeout \ $STRACE -efile find sample > /dev/null 2> check.log && -LC_ALL=C grep '^[[:alnum:]_]*stat[[:alnum:]_]*([^()"]*"sample", {st_mode=S_IFREG|0644, st_size=46118400000, \.\.\.}' check.log > /dev/null || +LC_ALL=C grep -E -x '[[:alnum:]_]*stat[[:alnum:]_]*\([^()"]*"sample", [{]st_mode=S_IFREG\|0644, st_size=46118400000, \.\.\.}.*' check.log > /dev/null || { cat check.log; fail_ 'strace -efile failed to trace newfstatat/fstatat64 properly'; } rm -f sample -- 2.40.0