From: Steven Rostedt <rostedt@goodmis.org>
To: linux-trace-devel@vger.kernel.org
Subject: [PATCH v2 2/5] trace-cmd: Place "trace.dat" into the macro DEFAULT_INPUT_FILE
Date: Wed, 22 Jan 2020 12:22:49 -0500 [thread overview]
Message-ID: <20200122172410.322761876@goodmis.org> (raw)
In-Reply-To: 20200122172247.539894616@goodmis.org
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
The trace-cmd commands default the input/output file as "trace.dat". Instead
of using the open coded string, make a macro to use instead.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
tracecmd/include/trace-local.h | 1 +
tracecmd/trace-dump.c | 3 +--
tracecmd/trace-hist.c | 2 +-
tracecmd/trace-mem.c | 2 +-
tracecmd/trace-read.c | 2 +-
tracecmd/trace-record.c | 2 +-
tracecmd/trace-restore.c | 2 +-
tracecmd/trace-split.c | 2 +-
8 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/tracecmd/include/trace-local.h b/tracecmd/include/trace-local.h
index 0658115c2a6a..44f1e62a779a 100644
--- a/tracecmd/include/trace-local.h
+++ b/tracecmd/include/trace-local.h
@@ -14,6 +14,7 @@
#define TRACE_AGENT_DEFAULT_PORT 823
+#define DEFAUT_INPUT_FILE "trace.dat"
#define GUEST_PIPE_NAME "trace-pipe-cpu"
#define GUEST_DIR_FMT "/var/lib/trace-cmd/virt/%s"
#define GUEST_FIFO_FMT GUEST_DIR_FMT "/" GUEST_PIPE_NAME "%d"
diff --git a/tracecmd/trace-dump.c b/tracecmd/trace-dump.c
index ed6705886e39..415e913872f1 100644
--- a/tracecmd/trace-dump.c
+++ b/tracecmd/trace-dump.c
@@ -13,7 +13,6 @@
#include "trace-local.h"
-#define DEF_INPUT_FILE "trace.dat"
#define TRACING_STR "tracing"
#define HEAD_PAGE_STR "header_page"
#define HEAD_PAGE_EVENT "header_event"
@@ -602,7 +601,7 @@ void trace_dump(int argc, char **argv)
}
if (!input_file)
- input_file = DEF_INPUT_FILE;
+ input_file = DEFAUT_INPUT_FILE;
if (!verbosity && !validate)
verbosity = SUMMARY;
diff --git a/tracecmd/trace-hist.c b/tracecmd/trace-hist.c
index 384a7ff09306..c45182679b8f 100644
--- a/tracecmd/trace-hist.c
+++ b/tracecmd/trace-hist.c
@@ -1037,7 +1037,7 @@ void trace_hist(int argc, char **argv)
}
if (!input_file)
- input_file = "trace.dat";
+ input_file = DEFAUT_INPUT_FILE;
handle = tracecmd_alloc(input_file);
if (!handle)
diff --git a/tracecmd/trace-mem.c b/tracecmd/trace-mem.c
index 078a61bc702a..37046fd8310b 100644
--- a/tracecmd/trace-mem.c
+++ b/tracecmd/trace-mem.c
@@ -548,7 +548,7 @@ void trace_mem(int argc, char **argv)
}
if (!input_file)
- input_file = "trace.dat";
+ input_file = DEFAUT_INPUT_FILE;
handle = tracecmd_alloc(input_file);
if (!handle)
diff --git a/tracecmd/trace-read.c b/tracecmd/trace-read.c
index c0d640d3515b..8c2b2ae39f5e 100644
--- a/tracecmd/trace-read.c
+++ b/tracecmd/trace-read.c
@@ -74,7 +74,7 @@ struct pid_list *comm_list;
static unsigned int page_size;
static int input_fd;
-static const char *default_input_file = "trace.dat";
+static const char *default_input_file = DEFAUT_INPUT_FILE;
static const char *input_file;
static int multi_inputs;
static int max_file_size;
diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
index 80b223414246..b0860bbf5a0a 100644
--- a/tracecmd/trace-record.c
+++ b/tracecmd/trace-record.c
@@ -68,7 +68,7 @@ static int rt_prio;
static int keep;
-static const char *output_file = "trace.dat";
+static const char *output_file = DEFAUT_INPUT_FILE;
static int latency;
static int sleep_time = 1000;
diff --git a/tracecmd/trace-restore.c b/tracecmd/trace-restore.c
index b649cf4d2962..e3b86dd2085c 100644
--- a/tracecmd/trace-restore.c
+++ b/tracecmd/trace-restore.c
@@ -25,7 +25,7 @@
void trace_restore (int argc, char **argv)
{
struct tracecmd_output *handle;
- const char *output_file = "trace.dat";
+ const char *output_file = DEFAUT_INPUT_FILE;
const char *output = NULL;
const char *input = NULL;
const char *tracing_dir = NULL;
diff --git a/tracecmd/trace-split.c b/tracecmd/trace-split.c
index 6c8a774e13d0..b4d0df32217c 100644
--- a/tracecmd/trace-split.c
+++ b/tracecmd/trace-split.c
@@ -23,7 +23,7 @@
#include "trace-local.h"
static unsigned int page_size;
-static const char *default_input_file = "trace.dat";
+static const char *default_input_file = DEFAUT_INPUT_FILE;
static const char *input_file;
enum split_types {
--
2.24.1
next prev parent reply other threads:[~2020-01-22 17:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-22 17:22 [PATCH v2 0/5] trace-cmd: A few udpates Steven Rostedt
2020-01-22 17:22 ` [PATCH v2 1/5] trace-cmd: Create TRACECMD_MAGIC macro for magic number of trace-cmd data file Steven Rostedt
2020-01-22 17:22 ` Steven Rostedt [this message]
2020-01-22 17:22 ` [PATCH v2 3/5] trace-cmd: Add installation of ld.conf.d file for library paths Steven Rostedt
2020-01-22 17:22 ` [PATCH v2 4/5] trace-cmd: Have libtracecmd.so include libtraceevent Steven Rostedt
2020-01-22 17:22 ` [PATCH v2 5/5] trace-cmd: Remove unused trace_util function declarations Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200122172410.322761876@goodmis.org \
--to=rostedt@goodmis.org \
--cc=linux-trace-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.