All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [git commit] package/trace-cmd: fix build without ptrace
@ 2021-01-25 21:40 Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2021-01-25 21:40 UTC (permalink / raw)
  To: buildroot

commit: https://git.buildroot.net/buildroot/commit/?id=931351630b58a08fca67507c2d0113a5428a0ec3
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

Fixes:
 - http://autobuild.buildroot.org/results/4cf43a1ff70a2e2751e2a1a768940401c5583cdf

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 ...ove-add_event_pid-out-of-ifndef-NO_PTRACE.patch | 51 ++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/package/trace-cmd/0003-trace-cmd-Move-add_event_pid-out-of-ifndef-NO_PTRACE.patch b/package/trace-cmd/0003-trace-cmd-Move-add_event_pid-out-of-ifndef-NO_PTRACE.patch
new file mode 100644
index 0000000000..ca32e69ab1
--- /dev/null
+++ b/package/trace-cmd/0003-trace-cmd-Move-add_event_pid-out-of-ifndef-NO_PTRACE.patch
@@ -0,0 +1,51 @@
+From 2f55ded528cfd8ef468bdd1f8bb82dcf1cfae04a Mon Sep 17 00:00:00 2001
+From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
+Date: Wed, 16 Dec 2020 18:19:43 -0500
+Subject: [PATCH] trace-cmd: Move add_event_pid() out of #ifndef NO_PTRACE
+
+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.
+
+Link: https://lore.kernel.org/linux-trace-devel/20201216232145.010165486 at goodmis.org
+
+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>
+[Retrieved from:
+https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/commit/?id=2f55ded528cfd8ef468bdd1f8bb82dcf1cfae04a]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ 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 f8baed7d..e2d1cedf 100644
+--- a/tracecmd/trace-record.c
++++ b/tracecmd/trace-record.c
+@@ -1312,8 +1312,13 @@ static int trace_wait_for_processes(struct buffer_instance *instance) {
+ 	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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Buildroot] [git commit] package/trace-cmd: fix build without ptrace
@ 2016-08-21 20:22 Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2016-08-21 20:22 UTC (permalink / raw)
  To: buildroot

commit: https://git.buildroot.net/buildroot/commit/?id=25b248b7e6af754703d22eab4cd2a0024f1ea2c7
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

Backport upstream patch.

Fixes:
http://autobuild.buildroot.net/results/78c/78ca1819cdecce81336cadca17762fde8276d13a

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 ...ix-trace-record.c-with-non-ptrace-compile.patch | 32 ++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/package/trace-cmd/0001-trace-cmd-Fix-trace-record.c-with-non-ptrace-compile.patch b/package/trace-cmd/0001-trace-cmd-Fix-trace-record.c-with-non-ptrace-compile.patch
new file mode 100644
index 0000000..5f7d2ba
--- /dev/null
+++ b/package/trace-cmd/0001-trace-cmd-Fix-trace-record.c-with-non-ptrace-compile.patch
@@ -0,0 +1,32 @@
+From bdfcddd4f135dc1d4fefb0373d9ebb93ef5110cb Mon Sep 17 00:00:00 2001
+From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>
+Date: Mon, 7 Dec 2015 16:41:19 -0500
+Subject: [PATCH] trace-cmd: Fix trace-record.c with non ptrace compile
+
+Fix ptrace_wait() when NO_PTRACE=1 is defined.
+
+Status: upstream
+
+Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
+[Romain backport to 2.6]
+Signed-off-by: Romain Naour <romain.naour@gmail.com>
+---
+ trace-record.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/trace-record.c b/trace-record.c
+index df82883..f83ec4b 100644
+--- a/trace-record.c
++++ b/trace-record.c
+@@ -1099,7 +1099,7 @@ static void ptrace_wait(enum trace_type type, int main_pid)
+ 		 (!WIFEXITED(status) || pid != main_pid));
+ }
+ #else
+-static inline void ptrace_wait(int main_pid) { }
++static inline void ptrace_wait(enum trace_type type, int main_pid) { }
+ static inline void enable_ptrace(void) { }
+ static inline void ptrace_attach(int pid) { }
+ 
+-- 
+2.5.5
+

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-25 21:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-25 21:40 [Buildroot] [git commit] package/trace-cmd: fix build without ptrace Thomas Petazzoni
  -- strict thread matches above, loose matches on Subject: below --
2016-08-21 20:22 Thomas Petazzoni

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.