[RHEL7,COMMIT] fs/fuse kio_pcs: disable TRACE/DTRACE for release kernel

Submitted by Konstantin Khorenko on Aug. 27, 2018, 3:03 p.m.

Details

Message ID 201808271503.w7RF3D0r025397@finist_ce7.work
State New
Series "fs/fuse kio_pcs: disable TRACE/DTRACE for release kernel"
Headers show

Commit Message

Konstantin Khorenko Aug. 27, 2018, 3:03 p.m.
The commit is pushed to "branch-rh7-3.10.0-862.11.6.vz7.71.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-862.11.6.vz7.71.4
------>
commit 689cf45e5293aaf045a3f8fd38172729bfbe87a9
Author: Pavel Butsykin <pbutsykin@virtuozzo.com>
Date:   Mon Aug 27 18:03:13 2018 +0300

    fs/fuse kio_pcs: disable TRACE/DTRACE for release kernel
    
    This patch disables TRACE/DTRACE in release build for better performance. The
    main traces for investigating problems on the release kernel is FUSE_KTRACE, and
    they remain enabled in release build by default.
    
    Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com>
    Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 fs/fuse/kio/pcs/log.h         | 19 +++++--------------
 fs/fuse/kio/pcs/pcs_map.c     |  2 +-
 fs/fuse/kio/pcs/pcs_sock_io.c |  8 +++-----
 3 files changed, 9 insertions(+), 20 deletions(-)

Patch hide | download patch | download mbox

diff --git a/fs/fuse/kio/pcs/log.h b/fs/fuse/kio/pcs/log.h
index 5309e2e5102b..a26ed08a557a 100644
--- a/fs/fuse/kio/pcs/log.h
+++ b/fs/fuse/kio/pcs/log.h
@@ -23,20 +23,11 @@ 
 
 extern unsigned int pcs_loglevel;
 
-#define __PCS_DEBUG__ 1
-#define __PCS_DTRACE__ 1
-
-#ifndef __PCS_DEBUG__
-#define pcs_log(level, fmt, ...)
-#define TRACE(fmt, ...) do {} while (0)
-#define DTRACE(fmt, ...) do {} while (0)
-#else
+#ifdef CONFIG_FUSE_KIO_DEBUG
 #define TRACE(fmt, args...)	if (pcs_loglevel >= LOG_TRACE) trace_printk("%d: " fmt "\n", __LINE__, ## args)
-
-#ifndef __PCS_DTRACE__
-#define DTRACE(fmt, ...) do {} while (0)
-#else
 #define DTRACE(fmt, args...)	if (pcs_loglevel >= LOG_DTRACE) trace_printk("%d: " fmt "\n", __LINE__, ## args)
-#endif /* __PCS_DTRACE__ */
-#endif /* __PCS_DEBUG__ */
+#else
+#define TRACE(fmt, ...) do {} while (0)
+#define DTRACE(fmt, ...) do {} while (0)
+#endif /* CONFIG_FUSE_KIO_DEBUG */
 #endif /* __PCSLOG_H__ */
diff --git a/fs/fuse/kio/pcs/pcs_map.c b/fs/fuse/kio/pcs/pcs_map.c
index d91501a26204..5565eac8ee50 100644
--- a/fs/fuse/kio/pcs/pcs_map.c
+++ b/fs/fuse/kio/pcs/pcs_map.c
@@ -208,7 +208,7 @@  void pcs_mapping_open(struct pcs_mapping * mapping)
 
 void pcs_mapping_dump(struct pcs_mapping * mapping)
 {
-	struct pcs_dentry_info *di = pcs_dentry_from_mapping(mapping);
+	struct pcs_dentry_info *di __maybe_unused = pcs_dentry_from_mapping(mapping);
 	unsigned long pos = 0;
 	struct pcs_map_entry *maps[MAP_BATCH];
 	int nr_maps, total = 0;
diff --git a/fs/fuse/kio/pcs/pcs_sock_io.c b/fs/fuse/kio/pcs/pcs_sock_io.c
index 2e3bd897954e..0579939f776f 100644
--- a/fs/fuse/kio/pcs/pcs_sock_io.c
+++ b/fs/fuse/kio/pcs/pcs_sock_io.c
@@ -29,9 +29,7 @@  static void sio_msg_sent(struct pcs_msg * msg)
 
 void sio_push(struct pcs_sockio * sio)
 {
-	struct pcs_rpc *ep = sio->parent;
-
-	TRACE(PEER_FMT" flush \n", PEER_ARGS(ep));
+	TRACE(PEER_FMT" flush \n", PEER_ARGS(sio->parent));
 	if (sio->flags & PCS_SOCK_F_CORK) {
 		int optval = 1;
 		int ret;
@@ -505,7 +503,7 @@  static void pcs_sk_data_ready(struct sock *sk, int count)
 
 	TRACE(PEER_FMT" queue count:%d \n", PEER_ARGS(ep), count);
 
-	pcs_rpc_kick_queue(sio->parent);
+	pcs_rpc_kick_queue(ep);
 }
 static void pcs_sk_write_space(struct sock *sk)
 {
@@ -514,7 +512,7 @@  static void pcs_sk_write_space(struct sock *sk)
 
 	TRACE(PEER_FMT" queue \n", PEER_ARGS(ep));
 
-	pcs_rpc_kick_queue(sio->parent);
+	pcs_rpc_kick_queue(ep);
 
 }