diff options
author | Joanne Koong <joannelkoong@gmail.com> | 2025-04-02 16:24:12 -0700 |
---|---|---|
committer | Bernd Schubert <bernd@bsbernd.com> | 2025-04-04 23:26:18 +0200 |
commit | ead0a13d57dcbc5ac7b5396722a61cc99cd0c9dc (patch) | |
tree | b852ac6923f2d6e55863257fb8ab2cfdccad65c5 | |
parent | 197ea99fe4520b1ada8a4f2e3e1dcaf6de145002 (diff) | |
download | libfuse-ead0a13d57dcbc5ac7b5396722a61cc99cd0c9dc.tar.gz |
meson: add option for enabling usdt
Default is having usdt disabled.
Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
-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') |