From: Steven Rostedt <rostedt@goodmis.org>
To: linux-trace-devel@vger.kernel.org
Subject: [PATCH 1/3] trace-cmd: Move add_event_pid() out of #ifndef NO_PTRACE
Date: Wed, 16 Dec 2020 17:00:33 -0500 [thread overview]
Message-ID: <20201216220103.883960678@goodmis.org> (raw)
In-Reply-To: 20201216220032.809666622@goodmis.org
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
When NO_PTRACE is defined, add_event_pid() is also not defined, but it is
used outside of NO_PTRACE pre processor block. And this causes a
"add_event_pid" not defined build failure.
Fixes: 0844cff1c ("trace-cmd: Fix "trace-cmd reset" command to restore the default value of set_event_pid")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
tracecmd/trace-record.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
index f8baed7dcd47..e2d1cedf05fb 100644
--- a/tracecmd/trace-record.c
+++ b/tracecmd/trace-record.c
@@ -1312,8 +1312,13 @@ out:
free(pidfds);
return ret;
}
-#ifndef NO_PTRACE
+static void add_event_pid(struct buffer_instance *instance, const char *buf)
+{
+ tracefs_instance_file_write(instance->tracefs, "set_event_pid", buf);
+}
+
+#ifndef NO_PTRACE
/**
* append_pid_filter - add a new pid to an existing filter
* @curr_filter: the filter to append to. If NULL, then allocate one
@@ -1369,11 +1374,6 @@ static void update_sched_events(struct buffer_instance *instance, int pid)
static int open_instance_fd(struct buffer_instance *instance,
const char *file, int flags);
-static void add_event_pid(struct buffer_instance *instance, const char *buf)
-{
- tracefs_instance_file_write(instance->tracefs, "set_event_pid", buf);
-}
-
static void add_new_filter_child_pid(int pid, int child)
{
struct buffer_instance *instance;
--
2.29.2
next prev parent reply other threads:[~2020-12-16 22:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-16 22:00 [PATCH 0/3] trace-cmd: Some fixes, and add make-trace-cmd.sh package building helper script Steven Rostedt
2020-12-16 22:00 ` Steven Rostedt [this message]
2020-12-16 22:00 ` [PATCH 3/3] trace-cmd: Add a make-trace-cmd.sh script to simplify creating a trace-cmd package 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=20201216220103.883960678@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).