Loading include/client/syscalls/detail/syscall_info.h +1 −0 Viewed Changes for include/client/syscalls/detail/syscall_info.h: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ typedef enum { mmap_prot, /* protections for the mmap() family of syscalls */ mmap_flags, /* flags for the mmap() family of syscalls */ clone_flags, /* flags for the clone() syscall */ clone3_args, /* args for the clone3() syscall */ signum, /* signal numbers */ sigproc_how, /* sigprocmask argument */ arg, /* generic argument, no special formatting */ Loading include/client/syscalls/args.hpp +92 −0 Viewed Changes for include/client/syscalls/args.hpp: 92 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ #include <sys/mman.h> #include <sys/stat.h> #include <sys/types.h> #include <linux/sched.h> #include <sched.h> #include <syscall.h> #include <unistd.h> Loading Loading @@ -76,6 +77,7 @@ enum class type { mmap_prot = ::arg_type_t::mmap_prot, mmap_flags = ::arg_type_t::mmap_flags, clone_flags = ::arg_type_t::clone_flags, clone3_args = ::arg_type_t::clone3_args, signum = ::arg_type_t::signum, sigproc_how = ::arg_type_t::sigproc_how, generic = ::arg_type_t::arg, Loading @@ -96,6 +98,7 @@ static constexpr auto whence = type::whence; static constexpr auto mmap_prot = type::mmap_prot; static constexpr auto mmap_flags = type::mmap_flags; static constexpr auto clone_flags = type::clone_flags; static constexpr auto clone3_args = type::clone3_args; static constexpr auto signum = type::signum; static constexpr auto sigproc_how = type::sigproc_how; static constexpr auto generic = type::generic; Loading Loading @@ -154,6 +157,9 @@ format_mmap_flags_arg_to(FmtBuffer& buffer, const printable_arg& parg); template <typename FmtBuffer> inline void format_clone_flags_arg_to(FmtBuffer& buffer, const printable_arg& parg); template <typename FmtBuffer> inline void format_clone3_args_arg_to(FmtBuffer& buffer, const printable_arg& parg); template <typename FmtBuffer> inline void format_signum_arg_to(FmtBuffer& buffer, const printable_arg& parg); Loading Loading @@ -182,6 +188,7 @@ std::array<formatter<FmtBuffer>, arg_type_max> formatters = { /* [mmap_prot] = */ format_mmap_prot_arg_to, /* [mmap_flags] = */ format_mmap_flags_arg_to, /* [clone_flags] = */ format_clone_flags_arg_to, /* [clone3_args] = */ format_clone3_args_arg_to, /* [signum] = */ format_signum_arg_to, /* [sigproc_how] = */ format_sigproc_how_arg_to, /* [arg] = */ format_arg_to, Loading Loading @@ -444,6 +451,91 @@ format_clone_flags_arg_to(FmtBuffer& buffer, const printable_arg& parg) { return; } /** * format_clone3_args_arg_to - format a 'args' argument * * Format a 'args' argument (such as those passed to clone3()) * and append the resulting string to the provided buffer. */ template <typename FmtBuffer> inline void format_clone3_args_arg_to(FmtBuffer& buffer, const printable_arg& parg) { // struct clone_args { // u64 flags; /* Flags bit mask */ // u64 pidfd; /* Where to store PID file descriptor // (int *) */ // u64 child_tid; /* Where to store child TID, // in child's memory (pid_t *) */ // u64 parent_tid; /* Where to store child TID, // in parent's memory (pid_t *) */ // u64 exit_signal; /* Signal to deliver to parent on // child termination */ // u64 stack; /* Pointer to lowest byte of stack */ // u64 stack_size; /* Size of stack */ // u64 tls; /* Location of new TLS */ // u64 set_tid; /* Pointer to a pid_t array // (since Linux 5.5) */ // u64 set_tid_size; /* Number of elements in set_tid // (since Linux 5.5) */ // u64 cgroup; /* File descriptor for target cgroup // of child (since Linux 5.7) */ // }; struct clone_args* ca = reinterpret_cast<clone_args*>(parg.value); /* Names for clone3() args arg */ const auto flag_names = utils::make_array( FLAG_ENTRY(CLONE_VM), FLAG_ENTRY(CLONE_FS), FLAG_ENTRY(CLONE_FILES), FLAG_ENTRY(CLONE_SIGHAND), FLAG_ENTRY(CLONE_PTRACE), FLAG_ENTRY(CLONE_VFORK), FLAG_ENTRY(CLONE_PARENT), FLAG_ENTRY(CLONE_THREAD), FLAG_ENTRY(CLONE_NEWNS), FLAG_ENTRY(CLONE_SYSVSEM), FLAG_ENTRY(CLONE_SETTLS), FLAG_ENTRY(CLONE_PARENT_SETTID), FLAG_ENTRY(CLONE_CHILD_CLEARTID), FLAG_ENTRY(CLONE_DETACHED), FLAG_ENTRY(CLONE_UNTRACED), FLAG_ENTRY(CLONE_CHILD_SETTID), #ifdef CLONE_NEWCGROUP FLAG_ENTRY(CLONE_NEWCGROUP), #endif FLAG_ENTRY(CLONE_NEWUTS), FLAG_ENTRY(CLONE_NEWIPC), FLAG_ENTRY(CLONE_NEWUSER), FLAG_ENTRY(CLONE_NEWPID), FLAG_ENTRY(CLONE_NEWNET), FLAG_ENTRY(CLONE_IO)); fmt::format_to(std::back_inserter(buffer), "{}=", "flags"); format_flag_set(buffer, ca->flags, flag_names); fmt::format_to(std::back_inserter(buffer), "|", "signal"); format_signum_arg_to(buffer, {"", ca->exit_signal}); fmt::format_to(std::back_inserter(buffer), ",{}={}", "pidfd", (void*)ca->pidfd); fmt::format_to(std::back_inserter(buffer), ",{}={}", "child_tid", (void*)ca->child_tid); fmt::format_to(std::back_inserter(buffer), ",{}={}", "parent_tid", (void*)ca->parent_tid); fmt::format_to(std::back_inserter(buffer), ",{}={}", "stack", (void*)ca->stack); fmt::format_to(std::back_inserter(buffer), ",{}={}", "stack_size", ca->stack_size); fmt::format_to(std::back_inserter(buffer), ",{}={}", "tls", (void*)ca->tls); fmt::format_to(std::back_inserter(buffer), ",{}={}", "set_tid", (void*)ca->set_tid); // set_tid size and cgroup fmt::format_to(std::back_inserter(buffer), ",{}={}", "set_tid_size", ca->set_tid_size); fmt::format_to(std::back_inserter(buffer), ",{}={}", "cgroup", ca->cgroup); return; } /** * format_signum_arg_to - format a 'signum' argument * Loading include/client/path.hpp +2 −0 Viewed Changes for include/client/path.hpp: 2 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -42,6 +42,8 @@ namespace gkfs::path { static const std::string excluded_paths[2] = {"sys/", "proc/"}; unsigned int match_components(const std::string& path, unsigned int& path_components, const std::vector<std::string>& components); Loading include/config.hpp +2 −2 Viewed Changes for include/config.hpp: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -114,8 +114,8 @@ constexpr auto dir = "metadata"; // which metadata should be considered apart from size and mode // Blocks are used to store the rename status (-1 is a renamed file) constexpr auto use_atime = false; constexpr auto use_ctime = false; constexpr auto use_mtime = false; constexpr auto use_ctime = true; constexpr auto use_mtime = true; constexpr auto use_link_cnt = false; #ifdef HAS_RENAME constexpr auto use_blocks = true; Loading src/client/syscalls/detail/syscall_info.c +1 −1 Viewed Changes for src/client/syscalls/detail/syscall_info.c: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -642,7 +642,7 @@ SYSCALL(getpmsg, 5, S_RET(rdec), S_NARG(arg, "arg0"), SYSCALL(pidfd_open, 2, S_RET(rdec), S_NARG(dec, "pid"), S_NARG(arg, "flags")), #endif #ifdef SYS_clone3 SYSCALL(clone3, 4, S_RET(rdec), S_NARG(arg, "flags"), S_NARG(ptr, "child_tid"), S_NARG(ptr, "parent_tid"), S_NARG(ptr, "tls")), SYSCALL(clone3, 4, S_RET(rdec), S_NARG(clone3_args, "flags"), S_NARG(arg, "size")), #endif #ifdef SYS_close_range SYSCALL(close_range, 3, S_RET(rdec), S_NARG(dec, "low"), S_NARG(dec, "high"), S_NARG(arg, "flags")), Loading Loading
include/client/syscalls/detail/syscall_info.h +1 −0 Viewed Changes for include/client/syscalls/detail/syscall_info.h: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ typedef enum { mmap_prot, /* protections for the mmap() family of syscalls */ mmap_flags, /* flags for the mmap() family of syscalls */ clone_flags, /* flags for the clone() syscall */ clone3_args, /* args for the clone3() syscall */ signum, /* signal numbers */ sigproc_how, /* sigprocmask argument */ arg, /* generic argument, no special formatting */ Loading
include/client/syscalls/args.hpp +92 −0 Viewed Changes for include/client/syscalls/args.hpp: 92 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ #include <sys/mman.h> #include <sys/stat.h> #include <sys/types.h> #include <linux/sched.h> #include <sched.h> #include <syscall.h> #include <unistd.h> Loading Loading @@ -76,6 +77,7 @@ enum class type { mmap_prot = ::arg_type_t::mmap_prot, mmap_flags = ::arg_type_t::mmap_flags, clone_flags = ::arg_type_t::clone_flags, clone3_args = ::arg_type_t::clone3_args, signum = ::arg_type_t::signum, sigproc_how = ::arg_type_t::sigproc_how, generic = ::arg_type_t::arg, Loading @@ -96,6 +98,7 @@ static constexpr auto whence = type::whence; static constexpr auto mmap_prot = type::mmap_prot; static constexpr auto mmap_flags = type::mmap_flags; static constexpr auto clone_flags = type::clone_flags; static constexpr auto clone3_args = type::clone3_args; static constexpr auto signum = type::signum; static constexpr auto sigproc_how = type::sigproc_how; static constexpr auto generic = type::generic; Loading Loading @@ -154,6 +157,9 @@ format_mmap_flags_arg_to(FmtBuffer& buffer, const printable_arg& parg); template <typename FmtBuffer> inline void format_clone_flags_arg_to(FmtBuffer& buffer, const printable_arg& parg); template <typename FmtBuffer> inline void format_clone3_args_arg_to(FmtBuffer& buffer, const printable_arg& parg); template <typename FmtBuffer> inline void format_signum_arg_to(FmtBuffer& buffer, const printable_arg& parg); Loading Loading @@ -182,6 +188,7 @@ std::array<formatter<FmtBuffer>, arg_type_max> formatters = { /* [mmap_prot] = */ format_mmap_prot_arg_to, /* [mmap_flags] = */ format_mmap_flags_arg_to, /* [clone_flags] = */ format_clone_flags_arg_to, /* [clone3_args] = */ format_clone3_args_arg_to, /* [signum] = */ format_signum_arg_to, /* [sigproc_how] = */ format_sigproc_how_arg_to, /* [arg] = */ format_arg_to, Loading Loading @@ -444,6 +451,91 @@ format_clone_flags_arg_to(FmtBuffer& buffer, const printable_arg& parg) { return; } /** * format_clone3_args_arg_to - format a 'args' argument * * Format a 'args' argument (such as those passed to clone3()) * and append the resulting string to the provided buffer. */ template <typename FmtBuffer> inline void format_clone3_args_arg_to(FmtBuffer& buffer, const printable_arg& parg) { // struct clone_args { // u64 flags; /* Flags bit mask */ // u64 pidfd; /* Where to store PID file descriptor // (int *) */ // u64 child_tid; /* Where to store child TID, // in child's memory (pid_t *) */ // u64 parent_tid; /* Where to store child TID, // in parent's memory (pid_t *) */ // u64 exit_signal; /* Signal to deliver to parent on // child termination */ // u64 stack; /* Pointer to lowest byte of stack */ // u64 stack_size; /* Size of stack */ // u64 tls; /* Location of new TLS */ // u64 set_tid; /* Pointer to a pid_t array // (since Linux 5.5) */ // u64 set_tid_size; /* Number of elements in set_tid // (since Linux 5.5) */ // u64 cgroup; /* File descriptor for target cgroup // of child (since Linux 5.7) */ // }; struct clone_args* ca = reinterpret_cast<clone_args*>(parg.value); /* Names for clone3() args arg */ const auto flag_names = utils::make_array( FLAG_ENTRY(CLONE_VM), FLAG_ENTRY(CLONE_FS), FLAG_ENTRY(CLONE_FILES), FLAG_ENTRY(CLONE_SIGHAND), FLAG_ENTRY(CLONE_PTRACE), FLAG_ENTRY(CLONE_VFORK), FLAG_ENTRY(CLONE_PARENT), FLAG_ENTRY(CLONE_THREAD), FLAG_ENTRY(CLONE_NEWNS), FLAG_ENTRY(CLONE_SYSVSEM), FLAG_ENTRY(CLONE_SETTLS), FLAG_ENTRY(CLONE_PARENT_SETTID), FLAG_ENTRY(CLONE_CHILD_CLEARTID), FLAG_ENTRY(CLONE_DETACHED), FLAG_ENTRY(CLONE_UNTRACED), FLAG_ENTRY(CLONE_CHILD_SETTID), #ifdef CLONE_NEWCGROUP FLAG_ENTRY(CLONE_NEWCGROUP), #endif FLAG_ENTRY(CLONE_NEWUTS), FLAG_ENTRY(CLONE_NEWIPC), FLAG_ENTRY(CLONE_NEWUSER), FLAG_ENTRY(CLONE_NEWPID), FLAG_ENTRY(CLONE_NEWNET), FLAG_ENTRY(CLONE_IO)); fmt::format_to(std::back_inserter(buffer), "{}=", "flags"); format_flag_set(buffer, ca->flags, flag_names); fmt::format_to(std::back_inserter(buffer), "|", "signal"); format_signum_arg_to(buffer, {"", ca->exit_signal}); fmt::format_to(std::back_inserter(buffer), ",{}={}", "pidfd", (void*)ca->pidfd); fmt::format_to(std::back_inserter(buffer), ",{}={}", "child_tid", (void*)ca->child_tid); fmt::format_to(std::back_inserter(buffer), ",{}={}", "parent_tid", (void*)ca->parent_tid); fmt::format_to(std::back_inserter(buffer), ",{}={}", "stack", (void*)ca->stack); fmt::format_to(std::back_inserter(buffer), ",{}={}", "stack_size", ca->stack_size); fmt::format_to(std::back_inserter(buffer), ",{}={}", "tls", (void*)ca->tls); fmt::format_to(std::back_inserter(buffer), ",{}={}", "set_tid", (void*)ca->set_tid); // set_tid size and cgroup fmt::format_to(std::back_inserter(buffer), ",{}={}", "set_tid_size", ca->set_tid_size); fmt::format_to(std::back_inserter(buffer), ",{}={}", "cgroup", ca->cgroup); return; } /** * format_signum_arg_to - format a 'signum' argument * Loading
include/client/path.hpp +2 −0 Viewed Changes for include/client/path.hpp: 2 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -42,6 +42,8 @@ namespace gkfs::path { static const std::string excluded_paths[2] = {"sys/", "proc/"}; unsigned int match_components(const std::string& path, unsigned int& path_components, const std::vector<std::string>& components); Loading
include/config.hpp +2 −2 Viewed Changes for include/config.hpp: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -114,8 +114,8 @@ constexpr auto dir = "metadata"; // which metadata should be considered apart from size and mode // Blocks are used to store the rename status (-1 is a renamed file) constexpr auto use_atime = false; constexpr auto use_ctime = false; constexpr auto use_mtime = false; constexpr auto use_ctime = true; constexpr auto use_mtime = true; constexpr auto use_link_cnt = false; #ifdef HAS_RENAME constexpr auto use_blocks = true; Loading
src/client/syscalls/detail/syscall_info.c +1 −1 Viewed Changes for src/client/syscalls/detail/syscall_info.c: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -642,7 +642,7 @@ SYSCALL(getpmsg, 5, S_RET(rdec), S_NARG(arg, "arg0"), SYSCALL(pidfd_open, 2, S_RET(rdec), S_NARG(dec, "pid"), S_NARG(arg, "flags")), #endif #ifdef SYS_clone3 SYSCALL(clone3, 4, S_RET(rdec), S_NARG(arg, "flags"), S_NARG(ptr, "child_tid"), S_NARG(ptr, "parent_tid"), S_NARG(ptr, "tls")), SYSCALL(clone3, 4, S_RET(rdec), S_NARG(clone3_args, "flags"), S_NARG(arg, "size")), #endif #ifdef SYS_close_range SYSCALL(close_range, 3, S_RET(rdec), S_NARG(dec, "low"), S_NARG(dec, "high"), S_NARG(arg, "flags")), Loading