From d3c01d884a140ad30019539d44bf7eb212b10fa0 Mon Sep 17 00:00:00 2001 From: jxy_git Date: Sat, 1 Jul 2023 14:05:28 +0800 Subject: [PATCH] Defines the available command-line options for the program --- src/fsslower/fsslower.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/fsslower/fsslower.c b/src/fsslower/fsslower.c index 6918a3fa..0f74f8b1 100644 --- a/src/fsslower/fsslower.c +++ b/src/fsslower/fsslower.c @@ -72,3 +72,14 @@ const char argp_program_doc[] = " fsslower -t ext4 # trace ext4 operations slower than 10 ms\n" " fsslower -t nfs -p 1216 # trace nfs operations with PID 1216 only\n" " fsslower -t xfs -c -d 1 # trace xfs operations for 1s with csv output\n"; + +static const struct argp_option opts[] = { + { "csv", 'c', NULL, 0, "Output as csv"}, + { "duration", 'd', "DURATION", 0, "Total duration of trace in seconds" }, + { "pid", 'p', "PID", 0, "Process ID to trace" }, + { "min", 'm', "MIN", 0, "Min latency to trace, in ms (default 10)" }, + { "type", 't', "Filesystem", 0, "Which filesystem to trace, [btrfs/ext4/nfs/xfs]" }, + { "verbose", 'v', NULL, 0, "Verbose debug output" }, + { NULL, 'h', NULL, OPTION_HIDDEN, "Show the full help" }, + {} +}; -- Gitee