From: Steven Rostedt <rostedt@goodmis.org>
To: linux-trace-devel@vger.kernel.org
Cc: "Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
Subject: [PATCH 1/6 v2] trace-cmd: Move add_event_pid() out of #ifndef NO_PTRACE
Date: Wed, 16 Dec 2020 18:19:43 -0500 [thread overview]
Message-ID: <20201216232145.010165486@goodmis.org> (raw)
In-Reply-To: 20201216231942.127326802@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 23:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-16 23:19 [PATCH 0/6 v2] trace-cmd/kernelshark: Fixed build, cleanups and fix kernelshark Steven Rostedt
2020-12-16 23:19 ` Steven Rostedt [this message]
2020-12-16 23:19 ` [PATCH 2/6 v2] trace-cmd: Add #include <fcntl.h> to trace-cmd-private.h Steven Rostedt
2020-12-16 23:19 ` [PATCH 3/6 v2] trace-cmd: Add a make-trace-cmd.sh script to simplify creating a trace-cmd package Steven Rostedt
2020-12-16 23:19 ` [PATCH 4/6 v2] trace-cmd: Do not have local builds of libtraceevent or libtracefs use system headers Steven Rostedt
2020-12-16 23:19 ` [PATCH 5/6 v2] kernelshark: Build libtraceevent and libtracefs locally Steven Rostedt
2020-12-16 23:19 ` [PATCH 6/6 v2] trace-cmd: Re-enable the build of KernelShark v1 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=20201216232145.010165486@goodmis.org \
--to=rostedt@goodmis.org \
--cc=linux-trace-devel@vger.kernel.org \
--cc=y.karadz@gmail.com \
/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.