From 410a17a2773219eb9136f497ec5aff5e65470d14 Mon Sep 17 00:00:00 2001 From: jxy_git Date: Sat, 1 Jul 2023 13:57:43 +0800 Subject: [PATCH] Provides program configuration options and default values --- src/fsslower/fsslower.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/fsslower/fsslower.c b/src/fsslower/fsslower.c index f3cde581..57b9e724 100644 --- a/src/fsslower/fsslower.c +++ b/src/fsslower/fsslower.c @@ -43,3 +43,20 @@ static struct fs_config { [F_FSYNC] = "xfs_file_fsync", }}, }; + +static char file_op[] = { + [F_READ] = 'R', + [F_WRITE] = 'W', + [F_OPEN] = 'O', + [F_FSYNC] = 'F', +}; + +static volatile sig_atomic_t exiting = 0; + +/* options */ +static enum fs_type fs_type = NONE; +static pid_t target_pid = 0; +static time_t duration = 0; +static __u64 min_lat_ms = 10; +static bool csv = false; +static bool verbose = false; -- Gitee