tracefile: faccessat2 added.

This commit is contained in:
Ole Tange 2022-07-01 03:34:19 +08:00
commit 81ebcc00be

View file

@ -247,7 +247,7 @@ B<strace>(1)
use Getopt::Long; use Getopt::Long;
sub version(); sub version();
$Global::progname = "tracefile"; $Global::progname = "tracefile";
$Global::version = 20201211; $Global::version = 20220701;
Getopt::Long::Configure("bundling","require_order"); Getopt::Long::Configure("bundling","require_order");
get_options_from_array(\@ARGV) || die_usage(); get_options_from_array(\@ARGV) || die_usage();
@ -285,12 +285,14 @@ while(<IN>) {
my $addinfo = $4; my $addinfo = $4;
if($function eq "openat" if($function eq "openat"
or or
$function eq "faccessat") { $function eq "faccessat"
or
$function eq "faccessat2") {
# openat(AT_FDCWD, "/sys/devices/system/cpu", O_RDONLY|O_CLOEXEC) = 4 # openat(AT_FDCWD, "/sys/devices/system/cpu", O_RDONLY|O_CLOEXEC) = 4
# openat(4, "kernel_max", O_RDONLY|O_CLOEXEC) = 5 # openat(4, "kernel_max", O_RDONLY|O_CLOEXEC) = 5
# faccessat(4, "cpu0/cache/index4", F_OK) = -1 ENOENT # faccessat(4, "cpu0/cache/index4", F_OK) = -1 ENOENT
# openat can open a file descriptor # openat can open a file descriptor
# openat/faccessat can open relative to a file descriptor # openat/faccessat(2) can open relative to a file descriptor
if($addinfo =~ /= (-?\d+)(\s[^=]*)?$/) { if($addinfo =~ /= (-?\d+)(\s[^=]*)?$/) {
my $fd = $1; my $fd = $1;
if($first_arg eq "AT_FDCWD") { if($first_arg eq "AT_FDCWD") {
@ -358,22 +360,24 @@ while(<IN>) {
# rw = read+write # rw = read+write
# n = neither (false match) # n = neither (false match)
# ? = TODO figure out what they do # ? = TODO figure out what they do
%funcs =
qw(access r acct ? chdir r chmod w chown w chown16 w %funcs = qw(access r acct ? chdir r chmod w chown w chown16 w
chroot r creat w execv r execve r execveat r faccessat chroot r creat w execv r execve r execveat r
r fanotify_mark ? fchmodat w fchownat w fstat r fstat64 faccessat r faccessat2 r fanotify_mark ? fchmodat
r fstatat64 r fstatfs r fstatfs64 r futimesat r getcwd w fchownat w fstat r fstat64 r fstatat64 r fstatfs
r getxattr r inotify_add_watch r link w linkat w r fstatfs64 r futimesat r getcwd r getxattr r
listxattr r lstat r lstat64 r mkdir w mkdirat w mknod w inotify_add_watch r link w linkat w listxattr r
mknodat w mount r name_to_handle_at ? newfstatat r lstat r lstat64 r mkdir w mkdirat w mknod w
oldfstat r oldlstat r oldstat r open rw openat rw mknodat w mount r name_to_handle_at ? newfstatat
osf_fstatfs r osf_statfs r osf_utimes r perror n pivotroot r r oldfstat r oldlstat r oldstat r open rw openat
printargs ? printf n quotactl ? readlink r readlinkat r rw osf_fstatfs r osf_statfs r osf_utimes r perror
removexattr w rename w renameat w renameat2 w rmdir w n pivotroot r printargs ? printf n quotactl ?
setxattr w stat r stat64 r statfs r statfs64 r statx r readlink r readlinkat r removexattr w rename w
swapoff w swapon w symlink w symlinkat w truncate w renameat w renameat2 w rmdir w setxattr w stat r
truncate64 w umount r umount2 r unlink w unlinkat w stat64 r statfs r statfs64 r statx r swapoff w
uselib r utime w utimensat w utimes w); swapon w symlink w symlinkat w truncate w
truncate64 w umount r umount2 r unlink w unlinkat
w uselib r utime w utimensat w utimes w);
} }
sub readfunc { sub readfunc {