File revert-trace-cmd-if-event-fork-exists-use-it-instead-of-ptrace.patch of Package trace-cmd

From fd08daf26446026be39e2c919bab6ce0f897d915 Mon Sep 17 00:00:00 2001
From: Mel Gorman <mgorman@techsingularity.net>
Date: Wed, 1 Nov 2017 16:06:08 +0000
Subject: [PATCH] Revert "trace-cmd: If event-fork option exists use it instead
 of PTRACE"

This reverts commit cffe9b73690324bcdccea8ab0cd29dd1855e7c77 due
to a failure to properly trace the activity of children. See bug
https://bugzilla.suse.com/show_bug.cgi?id=1064552
---
 trace-record.c | 26 ++++----------------------
 1 file changed, 4 insertions(+), 22 deletions(-)

diff --git a/trace-record.c b/trace-record.c
index 1b55043e2842..5d0908ab5a3d 100644
--- a/trace-record.c
+++ b/trace-record.c
@@ -125,7 +125,6 @@ static int nr_filter_pids;
 static int len_filter_pids;
 
 static int have_set_event_pid;
-static int have_event_fork;
 
 struct opt_list {
 	struct opt_list *next;
@@ -308,17 +307,8 @@ static void test_set_event_pid(void)
 		have_set_event_pid = 1;
 		reset_save_file(path, RESET_DEFAULT_PRIO);
 	}
-	tracecmd_put_tracing_file(path);
-
-	path = tracecmd_get_tracing_file("options/event-fork");
-	ret = stat(path, &st);
-	if (!ret) {
-		have_event_fork = 1;
-		reset_save_file(path, RESET_DEFAULT_PRIO);
-	}
-	tracecmd_put_tracing_file(path);
-
 	tested = 1;
+	tracecmd_put_tracing_file(path);
 }
 
 /**
@@ -4198,7 +4188,6 @@ void trace_record (int argc, char **argv)
 	int manual = 0;
 	char *max_graph_depth = NULL;
 	int topt = 0;
-	int do_child = 0;
 	int data_flags = 0;
 
 	int c;
@@ -4456,15 +4445,10 @@ void trace_record (int argc, char **argv)
 			break;
 		case 'c':
 			test_set_event_pid();
-			if (!have_event_fork) {
 #ifdef NO_PTRACE
-				die("-c invalid: ptrace not supported");
+			die("-c invalid: ptrace not supported");
 #endif
-				do_ptrace = 1;
-			} else {
-				save_option("event-fork");
-				do_child = 1;
-			}
+			do_ptrace = 1;
 			break;
 		case 'C':
 			instance->clock = optarg;
@@ -4647,9 +4631,7 @@ void trace_record (int argc, char **argv)
 	}
 
 	if (do_ptrace && !filter_task && (filter_pid < 0))
-		die(" -c can only be used with -F (or -P with event-fork support)");
-	if (do_child && !filter_task &&! filter_pid)
-		die(" -c can only be used with -P or -F");
+		die(" -c can only be used with -F or -P");
 
 	if ((argc - optind) >= 2) {
 		if (start)
openSUSE Build Service is sponsored by