rt-tests/SOURCES/rt-tests-cyclictest-Make-tracemark-work-correctly-ag.patch
2021-09-10 04:02:47 +00:00

69 lines
2.3 KiB
Diff

From 33f07f6ee2053dc16dd667c763326515e87f19e3 Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Mon, 16 Sep 2019 20:37:22 +0200
Subject: [PATCH] rt-tests: cyclictest: Make tracemark work correctly again
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