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