diff options
-rw-r--r-- | lib/fuse_lowlevel.c | 27 | ||||
-rw-r--r-- | meson.build | 2 | ||||
-rw-r--r-- | meson_options.txt | 2 |
3 files changed, 30 insertions, 1 deletions
diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index a5d9e0c..ff7a73b 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -17,7 +17,6 @@ #include "fuse_opt.h" #include "fuse_misc.h" #include "mount_util.h" -#include "usdt.h" #include "util.h" #include <stdint.h> @@ -34,6 +33,10 @@ #include <sys/file.h> #include <sys/ioctl.h> +#ifdef USDT_ENABLED +#include "usdt.h" +#endif + #ifndef F_LINUX_SPECIFIC_BASE #define F_LINUX_SPECIFIC_BASE 1024 #endif @@ -61,6 +64,7 @@ static __attribute__((constructor)) void fuse_ll_init_pagesize(void) pagesize = getpagesize(); } +#ifdef USDT_ENABLED /* tracepoints */ static void trace_request_receive(int err) { @@ -77,6 +81,27 @@ static void trace_request_reply(uint64_t unique, unsigned int len, { USDT(libfuse, request_reply, unique, len, error, reply_err); } +#else +static void trace_request_receive(int err) +{ + (void)err; +} + +static void trace_request_process(unsigned int opcode, unsigned int unique) +{ + (void)opcode; + (void)unique; +} + +static void trace_request_reply(uint64_t unique, unsigned int len, + int error, int reply_err) +{ + (void)unique; + (void)len; + (void)error; + (void)reply_err; +} +#endif static void convert_stat(const struct stat *stbuf, struct fuse_attr *attr) { diff --git a/meson.build b/meson.build index bab98da..f28df3d 100644 --- a/meson.build +++ b/meson.build @@ -98,6 +98,8 @@ private_cfg.set('HAVE_STRUCT_STAT_ST_ATIMESPEC', prefix: include_default, args: args_default)) +private_cfg.set('USDT_ENABLED', get_option('enable-usdt')) + # # Compiler configuration # diff --git a/meson_options.txt b/meson_options.txt index fa4749c..957c5fc 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -22,3 +22,5 @@ option('tests', type : 'boolean', value : true, option('disable-libc-symbol-version', type : 'boolean', value : false, description: 'Disable versioned symbols through libc') +option('enable-usdt', type : 'boolean', value : false, + description: 'Enable user statically defined tracepoints for extra observability') |