[RHEL7,COMMIT] fs/fuse kio: disable duplication FUSE_K* messages to debugfs by default

Submitted by Konstantin Khorenko on Jan. 10, 2019, 10:22 a.m.

Details

Message ID 201901101022.x0AAM8qm004864@finist-ce7.sw.ru
State New
Series "kio_pcs: Compact the logs and make eyes happy"
Headers show

Commit Message

Konstantin Khorenko Jan. 10, 2019, 10:22 a.m.
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@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@virtuozzo.com>
    Acked-by: Pavel Emelianov <xemul@virtuozzo.com>
---
 fs/fuse/kio/pcs/pcs_fuse_kdirect.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

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();
 }