|
|
f43afa |
From 9b1d74f9a9d606f1e483690afae0a4a8207c76db Mon Sep 17 00:00:00 2001
|
|
|
f43afa |
From: David Smith <dsmith@redhat.com>
|
|
|
f43afa |
Date: Fri, 7 Feb 2014 10:27:14 -0600
|
|
|
f43afa |
Subject: [PATCH] Remove the transport's unused "dropped" file.
|
|
|
f43afa |
|
|
|
f43afa |
* runtime/transport/relay_v2.c: Unless _STP_USE_DROPPED_FILE is defined,
|
|
|
f43afa |
don't bother creating the unused "dropped" file.
|
|
|
f43afa |
---
|
|
|
f43afa |
runtime/transport/relay_v2.c | 13 ++++++++++++-
|
|
|
f43afa |
1 file changed, 12 insertions(+), 1 deletion(-)
|
|
|
f43afa |
|
|
|
f43afa |
diff --git a/runtime/transport/relay_v2.c b/runtime/transport/relay_v2.c
|
|
|
f43afa |
index 6c9815d..97e02f9 100644
|
|
|
f43afa |
--- a/runtime/transport/relay_v2.c
|
|
|
f43afa |
+++ b/runtime/transport/relay_v2.c
|
|
|
f43afa |
@@ -43,8 +43,10 @@
|
|
|
f43afa |
struct _stp_relay_data_type {
|
|
|
f43afa |
struct rchan *rchan;
|
|
|
f43afa |
atomic_t /* enum _stp_transport_state */ transport_state;
|
|
|
f43afa |
+#ifdef _STP_USE_DROPPED_FILE
|
|
|
f43afa |
struct dentry *dropped_file;
|
|
|
f43afa |
atomic_t dropped;
|
|
|
f43afa |
+#endif
|
|
|
f43afa |
atomic_t wakeup;
|
|
|
f43afa |
struct timer_list timer;
|
|
|
f43afa |
int overwrite_flag;
|
|
|
f43afa |
@@ -160,6 +162,7 @@ static void _stp_transport_data_fs_overwrite(int overwrite)
|
|
|
f43afa |
_stp_relay_data.overwrite_flag = overwrite;
|
|
|
f43afa |
}
|
|
|
f43afa |
|
|
|
f43afa |
+#ifdef _STP_USE_DROPPED_FILE
|
|
|
f43afa |
static int __stp_relay_dropped_open(struct inode *inode, struct file *filp)
|
|
|
f43afa |
{
|
|
|
f43afa |
return 0;
|
|
|
f43afa |
@@ -181,6 +184,7 @@ static struct file_operations __stp_relay_dropped_fops = {
|
|
|
f43afa |
.open = __stp_relay_dropped_open,
|
|
|
f43afa |
.read = __stp_relay_dropped_read,
|
|
|
f43afa |
};
|
|
|
f43afa |
+#endif
|
|
|
f43afa |
|
|
|
f43afa |
/*
|
|
|
f43afa |
* Keep track of how many times we encountered a full subbuffer, to aid
|
|
|
f43afa |
@@ -193,7 +197,9 @@ static int __stp_relay_subbuf_start_callback(struct rchan_buf *buf,
|
|
|
f43afa |
if (_stp_relay_data.overwrite_flag || !relay_buf_full(buf))
|
|
|
f43afa |
return 1;
|
|
|
f43afa |
|
|
|
f43afa |
+#ifdef _STP_USE_DROPPED_FILE
|
|
|
f43afa |
atomic_inc(&_stp_relay_data.dropped);
|
|
|
f43afa |
+#endif
|
|
|
f43afa |
return 0;
|
|
|
f43afa |
}
|
|
|
f43afa |
|
|
|
f43afa |
@@ -270,8 +276,10 @@ static void _stp_transport_data_fs_stop(void)
|
|
|
f43afa |
static void _stp_transport_data_fs_close(void)
|
|
|
f43afa |
{
|
|
|
f43afa |
_stp_transport_data_fs_stop();
|
|
|
f43afa |
+#ifdef _STP_USE_DROPPED_FILE
|
|
|
f43afa |
if (_stp_relay_data.dropped_file)
|
|
|
f43afa |
debugfs_remove(_stp_relay_data.dropped_file);
|
|
|
f43afa |
+#endif
|
|
|
f43afa |
if (_stp_relay_data.rchan) {
|
|
|
f43afa |
relay_close(_stp_relay_data.rchan);
|
|
|
f43afa |
_stp_relay_data.rchan = NULL;
|
|
|
f43afa |
@@ -286,9 +294,11 @@ static int _stp_transport_data_fs_init(void)
|
|
|
f43afa |
|
|
|
f43afa |
atomic_set(&_stp_relay_data.transport_state, STP_TRANSPORT_STOPPED);
|
|
|
f43afa |
_stp_relay_data.overwrite_flag = 0;
|
|
|
f43afa |
+ _stp_relay_data.rchan = NULL;
|
|
|
f43afa |
+
|
|
|
f43afa |
+#ifdef _STP_USE_DROPPED_FILE
|
|
|
f43afa |
atomic_set(&_stp_relay_data.dropped, 0);
|
|
|
f43afa |
_stp_relay_data.dropped_file = NULL;
|
|
|
f43afa |
- _stp_relay_data.rchan = NULL;
|
|
|
f43afa |
|
|
|
f43afa |
/* Create "dropped" file. */
|
|
|
f43afa |
_stp_relay_data.dropped_file
|
|
|
f43afa |
@@ -306,6 +316,7 @@ static int _stp_transport_data_fs_init(void)
|
|
|
f43afa |
|
|
|
f43afa |
_stp_relay_data.dropped_file->d_inode->i_uid = KUIDT_INIT(_stp_uid);
|
|
|
f43afa |
_stp_relay_data.dropped_file->d_inode->i_gid = KGIDT_INIT(_stp_gid);
|
|
|
f43afa |
+#endif
|
|
|
f43afa |
|
|
|
f43afa |
/* Create "trace" file. */
|
|
|
f43afa |
npages = _stp_subbuf_size * _stp_nsubbufs;
|
|
|
f43afa |
--
|
|
|
f43afa |
1.8.3.1
|
|
|
f43afa |
|