aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2016-09-16 11:19:11 -0400
committerSteven Rostedt <rostedt@goodmis.org>2016-11-01 18:02:40 -0400
commit17e61dba5514479fd13d45bcb6e03a7d0108720d (patch)
tree80fc54f1ce80d5d16925314dd99864b7034587d0
parent7b09ce69dafb8e4f29d2a6b54db8a4a824a7445b (diff)
downloadtrace-cmd-17e61dba5514479fd13d45bcb6e03a7d0108720d.tar.gz
trace-cmd msg: Remove hook for telling trace-msg.c about debugging
Now that debug is a global variable, there needs no function hook to tell trace-msg.c that we are in debugging mode. Just have trace-msg.c read the debug variable to know what to do. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--trace-cmd.h3
-rw-r--r--trace-listen.c3
-rw-r--r--trace-msg.c11
-rw-r--r--trace-record.c4
4 files changed, 2 insertions, 19 deletions
diff --git a/trace-cmd.h b/trace-cmd.h
index 57983453..b779ede5 100644
--- a/trace-cmd.h
+++ b/trace-cmd.h
@@ -288,9 +288,6 @@ int tracecmd_msg_initial_setting(int fd, int *cpus, int *pagesize);
int tracecmd_msg_send_port_array(int fd, int total_cpus, int *ports);
int tracecmd_msg_collect_metadata(int ifd, int ofd);
-/* msg debugging */
-void tracecmd_msg_set_debug(int debug);
-
/* --- Plugin handling --- */
extern struct pevent_plugin_option trace_ftrace_options[];
diff --git a/trace-listen.c b/trace-listen.c
index 86f6d966..17ff9d8c 100644
--- a/trace-listen.c
+++ b/trace-listen.c
@@ -1004,9 +1004,6 @@ void trace_listen(int argc, char **argv)
signal_setup(SIGINT, finish);
signal_setup(SIGTERM, finish);
- if (debug)
- tracecmd_msg_set_debug(debug);
-
do_listen(port);
return;
diff --git a/trace-msg.c b/trace-msg.c
index e53c073e..4e700bfc 100644
--- a/trace-msg.c
+++ b/trace-msg.c
@@ -34,6 +34,7 @@
#include <linux/types.h>
#include "trace-cmd-local.h"
+#include "trace-local.h"
#include "trace-msg.h"
typedef __u32 u32;
@@ -397,14 +398,6 @@ error:
#define MSG_WAIT_MSEC 5000
static int msg_wait_to = MSG_WAIT_MSEC;
-void tracecmd_msg_set_debug(int debug)
-{
- if (debug)
- msg_wait_to = -1;
- else
- msg_wait_to = MSG_WAIT_MSEC;
-}
-
/*
* A return value of 0 indicates time-out
*/
@@ -415,7 +408,7 @@ static int tracecmd_msg_recv_wait(int fd, struct tracecmd_msg *msg)
pfd.fd = fd;
pfd.events = POLLIN;
- ret = poll(&pfd, 1, msg_wait_to);
+ ret = poll(&pfd, 1, debug ? -1 : msg_wait_to);
if (ret < 0)
return -errno;
else if (ret == 0)
diff --git a/trace-record.c b/trace-record.c
index 61b5e61c..7b7da385 100644
--- a/trace-record.c
+++ b/trace-record.c
@@ -4636,10 +4636,6 @@ void trace_record (int argc, char **argv)
if (profile && !buffer_instances)
top_instance.profile = 1;
- /* Let msg protocol know if we are debugging */
- if (debug)
- tracecmd_msg_set_debug(debug);
-
/*
* If top_instance doesn't have any plugins or events, then
* remove it from being processed.