cyclictest - fix comparison about flexible word counts of available_tracers file.

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

 



Dear Thomas,

I found bug at settracer function of cyclictest.c source (rt-test ver 0.33).
settracer func use 10 times in the for() statement to searching tracer
like preemptoff , irqsoff , preemptirqsoff.
But, I think that we have to consider 10+ words in the available_tracers file.

[root@fedora9 tracing]# cd /debug/tracing/
[root@fedora9 tracing]# cat available_tracers
syscall blk kmemtrace power branch function_graph mmiotrace wakeup_rt
wakeup preemptirqsoff preemptoff irqsoff function sched_switch
initcall nop
[root@fedora9 tracing]# cat available_tracers  | wc -w
16
[root@fedora9 tracing]#
[root@fedora9 tracing]# git clone
git://git.kernel.org/pub/scm/linux/kernel/git/clrkwllms/rt-tests.git
[root@fedora9 tracing]# cd rt-tests
[root@fedora9 tracing]# make clean ; make all
[root@fedora9 tracing]# ./cyclictest  -n -t 3 -b 1000000 -P-D 2 --> Success
[root@fedora9 tracing]#./cyclictest  -n -t 3 -b 1000000 -I -D 2  --> Failed
[root@fedora9 tracing]#./cyclictest  -n -t 3 -b 1000000 -B-D 2 --> Failed


So I made  patch file to consider above case.
If I mistake, correct me.

--------------------------------------------------
[root@fedora9 cyclictest]# diff -urN ./cyclictest.c.ori  ./cyclictest.c
--- ./cyclictest.c.ori	2009-04-05 23:48:03.000000000 +0900
+++ ./cyclictest.c	2009-04-06 00:15:51.000000000 +0900
@@ -320,7 +320,7 @@
 	char name[100];
 	FILE *fp;
 	int ret;
-	int i;
+	//int i;

 	/* Make sure tracer is available */
 	strncpy(filename, debugfileprefix, sizeof(filename));
@@ -330,7 +330,7 @@
 	if (!fp)
 		return -1;

-	for (i = 0; i < 10; i++) {
+	while(1) {
 		ret = fscanf(fp, "%99s", name);
 		if (!ret) {
 			ret = -1;


--------------------------------------------------

After patching .....

[root@fedora9 tracing]#./cyclictest  -n -t 3 -b 1000000 -I -D 2
[root@fedora9 tracing]# cat trace
# tracer: irqsoff
#
# irqsoff latency trace v1.1.5 on 2.6.29.1-rt4.20090403-ftrace-lgs
# --------------------------------------------------------------------
# latency: 108 us, #3/3, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2)
#    -----------------
#    | task: swapper-0 (uid:0 nice:0 policy:0 rt_prio:0)
#    -----------------
#
#                  _------=> CPU#
#                 / _-----=> irqs-off
#                | / _----=> need-resched
#                || / _---=> hardirq/softirq
#                ||| / _--=> preempt-depth
#                |||| /
#                |||||     delay
#  cmd     pid   ||||| time  |   caller
#     \   /      |||||   \   |   /
  <idle>-0       0d..1    3us!: acpi_idle_do_entry <-acpi_idle_enter_bm
  <idle>-0       0.N.1  107us+: cpu_idle <-rest_init
  <idle>-0       0.N.1  110us : trace_preempt_on <-rest_init


-- 
Regards,
GeunSik Lim
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Attachment: fix-comparison-wordcount-available-tracers.patch
Description: Binary data


[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