Linux-rt-users archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 2/5] rt-tests: cyclictest: Make tracemark work correctly again
@ 2019-09-17 14:24 John Kacur
  0 siblings, 0 replies; only message in thread
From: John Kacur @ 2019-09-17 14:24 UTC (permalink / raw)
  To: rt-users; +Cc: Clark Williams, John Kacur, Kurt Kanzenbach

commit f5ccfbe4d6641e48f56152be135d901dd31cba7e
was a little too aggressive removing ftrace code.

We were able to remove ftrace code because this functionality is
available using trace-cmd, in conjunction with the tracemark option in
cyclictest. Put back the parts of tracemark needed to make this work
correctly.

After this patch you can get tracing info like this as an example.

trace-cmd record -p function ./cyclictest -t -b100 --tracemark

Signed-off-by: John Kacur <jkacur@redhat.com>

Corrected a typo
Reported-by: Kurt Kanzenbach <kurt.kanzenbach@linutronix.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
---
 src/cyclictest/cyclictest.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
index 52f93da7d074..72fb35da3238 100644
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -184,6 +184,7 @@ static void trigger_update(struct thread_param *par, int diff, int64_t ts);
 
 static int shutdown;
 static int tracelimit = 0;
+static int trace_marker = 0;
 static int verbose = 0;
 static int oscope_reduction = 1;
 static int lockall = 0;
@@ -400,6 +401,9 @@ static void debugfs_prepare(void)
 
 static void enable_trace_mark(void)
 {
+	if (!trace_marker)
+		return;
+
 	debugfs_prepare();
 	open_tracemark_fd();
 }
@@ -1167,6 +1171,7 @@ static void process_options (int argc, char *argv[], int max_cpus)
 			{"spike",	     required_argument, NULL, OPT_TRIGGER },
 			{"spike-nodes",	     required_argument, NULL, OPT_TRIGGER_NODES },
 			{"threads",          optional_argument, NULL, OPT_THREADS },
+			{"tracemark",	     no_argument,	NULL, OPT_TRACEMARK },
 			{"unbuffered",       no_argument,       NULL, OPT_UNBUFFERED },
 			{"verbose",          no_argument,       NULL, OPT_VERBOSE },
 			{"dbg_cyclictest",   no_argument,       NULL, OPT_DBGCYCLIC },
@@ -1343,6 +1348,8 @@ static void process_options (int argc, char *argv[], int max_cpus)
 			fatal("--smi is not available on your arch\n");
 #endif
 			break;
+		case OPT_TRACEMARK:
+			trace_marker = 1; break;
 		}
 	}
 
-- 
2.20.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-17 14:24 [PATCH 2/5] rt-tests: cyclictest: Make tracemark work correctly again John Kacur

Linux-rt-users archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-rt-users/0 linux-rt-users/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-rt-users linux-rt-users/ https://lore.kernel.org/linux-rt-users \
		linux-rt-users@vger.kernel.org linux-rt-users@archiver.kernel.org
	public-inbox-index linux-rt-users

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-rt-users


AGPL code for this site: git clone https://public-inbox.org/ public-inbox