Skip to contentSkip to conversation

trace-cmd: Fix create_recorder() path assignment

PATCH New Steven Rostedt 1 participant 1 message Feb 9, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 trace-cmd: Fix create_recorder() path assignment

From: "Steven Rostedt (VMware)" <[email protected]>

The assignment of path was suppose to copy the dir variable that is returned from tracefs_tracing_dir(), but instead the path copied itself.

This broke the communication between host and guest as well as networking.

Fixes b8498696e0 ("trace-cmd: Use tracefs_tracing_dir() instead of tracefs_find_tracing_dir()")
---
 tracecmd/trace-record.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tracecmd/trace-record.c +1 -1
index a1c4e919..b05eef35 100644
@@ -3341,7 +3341,7 @@ static int create_recorder(struct buffer_instance *instance, int cpu,
 			const char *dir = tracefs_tracing_dir();
 
 			if (dir)
-				path = strdup(path);
+				path = strdup(dir);
 		}
 		if (!path)
 			die("can't get the tracing directory");
Signature · 1 line
2.25.4