summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClark Williams <clark.williams@gmail.com>2013-03-13 19:36:29 -0500
committerClark Williams <clark.williams@gmail.com>2013-03-13 19:36:29 -0500
commit83adb67c7928a73f6434e98cba736717d656ceb4 (patch)
treeb7f20a78e9c4bae3af69475c8f1e8707c4352ce7
parent1906cc53f5c4e6803cd91403d327c7da272d389a (diff)
downloadrt-tests-83adb67c7928a73f6434e98cba736717d656ceb4.tar.gz
cyclictest: allow break threshold without doing any tracing
Add the --notrace/-A option, intended to be used in conjunction with the -b option. This will cause cyclictest to exit when a threshold is hit, but will not perform any tracing operations, allowing more sophisticated tracing to be done externally. Signed-off-by: Clark Williams <clark.williams@gmail.com>
-rw-r--r--src/cyclictest/cyclictest.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
index a8f9534..7eb4799 100644
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -165,6 +165,7 @@ struct thread_stat {
static int shutdown;
static int tracelimit = 0;
+static int notrace = 0;
static int ftrace = 0;
static int kernelversion;
static int verbose = 0;
@@ -446,7 +447,7 @@ static int settracer(char *tracer)
static void setup_tracer(void)
{
- if (!tracelimit)
+ if (!tracelimit || notrace)
return;
if (mount_debugfs(NULL))
@@ -1101,6 +1102,7 @@ static void process_options (int argc, char *argv[])
*/
static struct option long_options[] = {
{"affinity", optional_argument, NULL, 'a'},
+ {"notrace", no_argument, NULL, 'A'},
{"breaktrace", required_argument, NULL, 'b'},
{"preemptirqs", no_argument, NULL, 'B'},
{"clock", required_argument, NULL, 'c'},
@@ -1161,6 +1163,7 @@ static void process_options (int argc, char *argv[])
setaffinity = AFFINITY_USEALL;
}
break;
+ case 'A': notrace = 1; break;
case 'b': tracelimit = atoi(optarg); break;
case 'B': tracetype = PREEMPTIRQSOFF; break;
case 'c': clocksel = atoi(optarg); break;
@@ -1400,7 +1403,7 @@ static void sighand(int sig)
shutdown = 1;
if (refresh_on_max)
pthread_cond_signal(&refresh_on_max_cond);
- if (tracelimit)
+ if (tracelimit && !notrace)
tracing(0);
}
@@ -1921,7 +1924,7 @@ int main(int argc, char **argv)
}
out:
/* ensure that the tracer is stopped */
- if (tracelimit)
+ if (tracelimit && !notrace)
tracing(0);
@@ -1937,7 +1940,7 @@ int main(int argc, char **argv)
/* turn off the function tracer */
fileprefix = procfileprefix;
- if (tracetype)
+ if (tracetype && !notrace)
setkernvar("ftrace_enabled", "0");
fileprefix = get_debugfileprefix();