linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] rt-tests: cyclictest.8: Remove invalid tracing options from the manpage
@ 2019-09-16 21:51 John Kacur
  2019-09-16 21:51 ` [PATCH 2/4] rt-tests: cyclictest: Make tracemark work correctly again John Kacur
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: John Kacur @ 2019-09-16 21:51 UTC (permalink / raw)
  To: rt-users; +Cc: Clark Williams, John Kacur, Tom Rix

Most tracing options have been removed from cyclictest since the
user can now use trace-cmd together with cyclictest to get the same
functionality. Update the manpage to reflect this.

Reported-by: Tom Rix <trix@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
---
 src/cyclictest/cyclictest.8 | 35 -----------------------------------
 1 file changed, 35 deletions(-)

diff --git a/src/cyclictest/cyclictest.8 b/src/cyclictest/cyclictest.8
index a05d1f4c9d4a..b64a16ae8bbb 100644
--- a/src/cyclictest/cyclictest.8
+++ b/src/cyclictest/cyclictest.8
@@ -52,9 +52,6 @@ Align thread wakeups to a specific offset in microseconds
 .B \-b, \-\-breaktrace=USEC
 Send break trace command when latency > USEC
 .TP
-.B \-B, \-\-preemptirqs
-Both preempt and irqsoff tracing (used with -b)
-.TP
 .B \-c, \-\-clock=CLOCK
 select clock
 .br
@@ -62,9 +59,6 @@ select clock
 .br
 1 = CLOCK_REALTIME
 .TP
-.B \-C, \-\-context
-context switch tracing (used with \-b)
-.TP
 .B \-d, \-\-distance=DIST
 Distance of thread intervals in us, default = 500
 .TP
@@ -73,12 +67,6 @@ Specify a length for the test run.
 .br
 Append 'm', 'h', or 'd' to specify minutes, hours or days.
 .TP
-.B \-E, \-\-event
-event tracing (used with \-b)
-.TP
-.B \-f, \-\-ftrace
-Enable function tracing using ftrace as tracer. This option is available only with \-b.
-.TP
 .B \-F, \-\-fifo=<path>
 Create a named pipe at path and write stats to it
 .TP
@@ -94,9 +82,6 @@ Dump the latency histogram to <path> instead of stdout.
 .B \-i, \-\-interval=INTV
 Set the base interval of the thread(s) in microseconds (default is 1000us). This sets the interval of the first thread. See also \-d.
 .TP
-.B \-I, \-\-irqsoff
-Irgsoff tracing (used with \-b)
-.TP
 .B \-l, \-\-loops=LOOPS
 Set the number of loops. The default is 0 (endless). This option is useful for automated tests with a given number of test cycles. Cyclictest is stopped once the number of timer intervals has been reached.
 .TP
@@ -113,26 +98,16 @@ running cyclictest on low-bandwidth connections)
 .B \-n, \-\-nanosleep
 Use clock_nanosleep instead of posix interval timers. Setting this option runs the tests with clock_nanosleep instead of posix interval timers.
 .TP
-.B \-\-notrace
-suppress tracing
-.TP
 .B \-N, \-\-nsecs
 Show results in nanoseconds instead of microseconds, which is the default unit.
 .TP
 .B \-o, \-\-oscope=RED
 Oscilloscope mode, reduce verbose output by RED.
 .TP
-.B \-O, \-\-traceopt=TRACING_OPTION
-Used to pass tracing options to ftrace tracers. May be invoked multiple
-times for multiple trace options. For example trace options look at /sys/kernel/debug/tracing/trace_options
-.TP
 .B \-p, \-\-prio=PRIO
 Set the priority of the first thread. The given priority is set to the first test thread. Each further thread gets a lower priority:
 Priority(Thread N) = max(Priority(Thread N\-1) \- 1, 0)
 .TP
-.B \-P, \-\-preemptoff
-Preempt off tracing (used with -b)
-.TP
 .B \-\-policy=NAME
 set the scheduler policy of the measurement threads
 where NAME is one of: other, normal, batch, idle, fifo, rr
@@ -178,10 +153,6 @@ the number of available CPUs. See \-d, \-i and \-p for further information.
 .B \-\-tracemark
 write a trace mark when \-b latency is exceeded.
 .TP
-.B \-T, \-\-tracer=TRACEFUNC
-set the ftrace tracer function. Used with the \-b option. Must be one
-of the trace functions available from <debugfs-mountpoint>/kernel/debug/tracing/available_tracers
-.TP
 .B \-u, \-\-unbuffered
 force unbuffered output for live processing
 .TP
@@ -192,12 +163,6 @@ n:c:v
 
 where n=task number c=count v=latency value in us.
 .TP
-.B \\-w, \-\-wakeup
-task wakeup tracing (used with \-b)
-.TP
-.B \\-W, \-\-wakeuprt
-rt-task wakeup tracing (used with \-b)
-.TP
 .B \-\-dbg_cyclictest
 Print info userful for debugging cyclictest
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/4] rt-tests: cyclictest: Make tracemark work correctly again
  2019-09-16 21:51 [PATCH 1/4] rt-tests: cyclictest.8: Remove invalid tracing options from the manpage John Kacur
@ 2019-09-16 21:51 ` John Kacur
  2019-09-17  7:21   ` Kurt Kanzenbach
  2019-09-16 21:51 ` [PATCH 3/4] rt-tests: cyclictest: Fix warning: ‘cpu’ may be used uninitialized John Kacur
  2019-09-16 21:51 ` [PATCH 4/4] rt-tests: cyclictest: Don't allow OPT_SYSTEM with OPT_POSIX_TIMERS John Kacur
  2 siblings, 1 reply; 6+ messages in thread
From: John Kacur @ 2019-09-16 21:51 UTC (permalink / raw)
  To: rt-users; +Cc: Clark Williams, John Kacur

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>
---
 src/cyclictest/cyclictest.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
index 52f93da7d074..45b6041ec1c9 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 = 9;
 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 related	[flat|nested] 6+ messages in thread

* [PATCH 3/4] rt-tests: cyclictest: Fix  warning: ‘cpu’ may be used uninitialized
  2019-09-16 21:51 [PATCH 1/4] rt-tests: cyclictest.8: Remove invalid tracing options from the manpage John Kacur
  2019-09-16 21:51 ` [PATCH 2/4] rt-tests: cyclictest: Make tracemark work correctly again John Kacur
@ 2019-09-16 21:51 ` John Kacur
  2019-09-16 21:51 ` [PATCH 4/4] rt-tests: cyclictest: Don't allow OPT_SYSTEM with OPT_POSIX_TIMERS John Kacur
  2 siblings, 0 replies; 6+ messages in thread
From: John Kacur @ 2019-09-16 21:51 UTC (permalink / raw)
  To: rt-users; +Cc: Clark Williams, John Kacur

Fix warning 'cpu' maybe uninitialized by giving it a default value in
the switch statement. Note, this is a false positive, but documenting
the default value in the switch statement isn't a bad thing.

Signed-off-by: John Kacur <jkacur@redhat.com>
---
 src/cyclictest/cyclictest.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
index 45b6041ec1c9..542e85c27a25 100644
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -1897,6 +1897,7 @@ int main(int argc, char **argv)
 				printf("Thread %d using cpu %d.\n", i, cpu);
 			break;
 		case AFFINITY_USEALL: cpu = i % max_cpus; break;
+		default: cpu = -1;
 		}
 
 		node = -1;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4/4] rt-tests: cyclictest: Don't allow OPT_SYSTEM with OPT_POSIX_TIMERS
  2019-09-16 21:51 [PATCH 1/4] rt-tests: cyclictest.8: Remove invalid tracing options from the manpage John Kacur
  2019-09-16 21:51 ` [PATCH 2/4] rt-tests: cyclictest: Make tracemark work correctly again John Kacur
  2019-09-16 21:51 ` [PATCH 3/4] rt-tests: cyclictest: Fix warning: ‘cpu’ may be used uninitialized John Kacur
@ 2019-09-16 21:51 ` John Kacur
  2 siblings, 0 replies; 6+ messages in thread
From: John Kacur @ 2019-09-16 21:51 UTC (permalink / raw)
  To: rt-users; +Cc: Clark Williams, John Kacur, Tom Rix

OPT_SYSTEM means use sys_nanosleep and sys_setitimer
if you try to combine it with OPT_POSIX_TIMERS, it breaks.

cyclictest becomes unkillable with ctrl-C and only the first thread is
updated.

Fix this by issuing a warning if the user tries to combine the two
options and then use clock_nanosleep.

Reported-by: Tom Rix <trix@redhat.com>
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 542e85c27a25..90449d465398 100644
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -1353,6 +1353,13 @@ static void process_options (int argc, char *argv[], int max_cpus)
 		}
 	}
 
+	if ((use_system == MODE_SYS_OFFSET) && (use_nanosleep == MODE_CYCLIC)) {
+		warn("The system option requires clock_nanosleep\n");
+		warn("and is not compatible with posix_timers\n");
+		warn("Using clock_nanosleep\n");
+		use_nanosleep = MODE_CLOCK_NANOSLEEP;
+	}
+
 	/* if smp wasn't requested, test for numa automatically */
 	if (!smp) {
 #ifdef NUMA
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/4] rt-tests: cyclictest: Make tracemark work correctly again
  2019-09-16 21:51 ` [PATCH 2/4] rt-tests: cyclictest: Make tracemark work correctly again John Kacur
@ 2019-09-17  7:21   ` Kurt Kanzenbach
  2019-09-17 14:20     ` John Kacur
  0 siblings, 1 reply; 6+ messages in thread
From: Kurt Kanzenbach @ 2019-09-17  7:21 UTC (permalink / raw)
  To: John Kacur; +Cc: rt-users, Clark Williams

[-- Attachment #1: Type: text/plain, Size: 1136 bytes --]

Hi John,

On Mon, Sep 16, 2019 at 11:51:09PM +0200, John Kacur wrote:
> 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>
> ---
>  src/cyclictest/cyclictest.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
> index 52f93da7d074..45b6041ec1c9 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 = 9;

Shouldn't this be 'static int trace_marker = 0'? Otherwise it's always set.

Thanks,
Kurt

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/4] rt-tests: cyclictest: Make tracemark work correctly again
  2019-09-17  7:21   ` Kurt Kanzenbach
@ 2019-09-17 14:20     ` John Kacur
  0 siblings, 0 replies; 6+ messages in thread
From: John Kacur @ 2019-09-17 14:20 UTC (permalink / raw)
  To: Kurt Kanzenbach; +Cc: rt-users, Clark Williams



On Tue, 17 Sep 2019, Kurt Kanzenbach wrote:

> Hi John,
> 
> On Mon, Sep 16, 2019 at 11:51:09PM +0200, John Kacur wrote:
> > 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>
> > ---
> >  src/cyclictest/cyclictest.c | 7 +++++++
> >  1 file changed, 7 insertions(+)
> >
> > diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
> > index 52f93da7d074..45b6041ec1c9 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 = 9;
> 
> Shouldn't this be 'static int trace_marker = 0'? Otherwise it's always set.
> 
> Thanks,
> Kurt
> 

I left my computer glasses in Germany - no seriously I did!
Thanks for spotting that, respinning the patch

John

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-09-17 14:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-16 21:51 [PATCH 1/4] rt-tests: cyclictest.8: Remove invalid tracing options from the manpage John Kacur
2019-09-16 21:51 ` [PATCH 2/4] rt-tests: cyclictest: Make tracemark work correctly again John Kacur
2019-09-17  7:21   ` Kurt Kanzenbach
2019-09-17 14:20     ` John Kacur
2019-09-16 21:51 ` [PATCH 3/4] rt-tests: cyclictest: Fix warning: ‘cpu’ may be used uninitialized John Kacur
2019-09-16 21:51 ` [PATCH 4/4] rt-tests: cyclictest: Don't allow OPT_SYSTEM with OPT_POSIX_TIMERS John Kacur

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).