RFC: cyclictest notrace option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch adds the --notrace/-A option to cyclictest. The intent is to
allow use of the -b/--breaktrace option but to have cyclictest do no
actual ftrace operations (i.e. stop when threshold is hit and do
nothing wrt ftrace).  The idea is that you can do more sophisticated
tracing with the trace-cmd script, so do that rather than trying to put
all combinations of tracing into cyclictest. 

I've push this and the previous patch up to my kernel.org repository in
the work branch:

git://git.kernel.org/pub/scm/linux/kernel/git/clrkwllms/rt-tests.git

commit 83adb67c7928a73f6434e98cba736717d656ceb4
Author: Clark Williams <clark.williams@xxxxxxxxx>
Date:   Wed Mar 13 19:36:29 2013 -0500

    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@xxxxxxxxx>

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();
 

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux