[Devel] [PATCH RHEL7 COMMIT] fs/fuse kio: disable duplication FUSE_K* messages to debugfs by default
Konstantin Khorenko
khorenko at virtuozzo.com
Thu Jan 10 13:22:10 MSK 2019
The commit is pushed to "branch-rh7-3.10.0-957.1.3.vz7.83.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-957.1.3.vz7.83.4
------>
commit 5ca7deec74edce5c6d5a4d670661272a42de8532
Author: Pavel Butsykin <pbutsykin at virtuozzo.com>
Date: Thu Jan 10 13:22:08 2019 +0300
fs/fuse kio: disable duplication FUSE_K* messages to debugfs by default
It's not very polite to put trace messages to debugfs without asking the user,
while they are only used for easier debugging fuse_kio_pcs module. This patch
disables debugfs tracing by default and makes it possible to enable this traces
via debugfs_tracing option.
https://pmc.acronis.com/browse/VSTOR-18383
Signed-off-by: Pavel Butsykin <pbutsykin at virtuozzo.com>
Acked-by: Pavel Emelianov <xemul at virtuozzo.com>
---
fs/fuse/kio/pcs/pcs_fuse_kdirect.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
index debfe0688ae4..bef782942335 100644
--- a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
+++ b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
@@ -31,6 +31,10 @@ unsigned int pcs_loglevel = LOG_TRACE;
module_param(pcs_loglevel, uint, 0644);
MODULE_PARM_DESC(pcs_loglevel, "Trace level");
+unsigned int debugfs_tracing;
+module_param(debugfs_tracing, uint, 0644);
+MODULE_PARM_DESC(debugfs_tracing, "Enable/Disbale debugfs tracing");
+
#ifdef CONFIG_DEBUG_KERNEL
static int set_sockio_fail_percent(const char *val, struct kernel_param *kp)
{
@@ -1480,10 +1484,12 @@ void __kfuse_trace(struct fuse_conn * fc, unsigned long ip, const char * fmt, ..
if (t)
memcpy(t + 1, buf, len + 1);
FUSE_TRACE_COMMIT(tr);
- if (ip)
- __trace_puts(ip, buf, len);
- else
- pr_debug("%s\n", buf);
+ if (unlikely(debugfs_tracing)) {
+ if (ip)
+ __trace_puts(ip, buf, len);
+ else
+ pr_debug("%s\n", buf);
+ }
}
put_cpu();
}
More information about the Devel
mailing list