* cyclictest - fix comparison about flexible word counts of available_tracers file.
@ 2009-04-05 6:45 GeunSik Lim
2009-04-05 14:05 ` Thomas Gleixner
2009-04-05 14:50 ` Clark Williams
0 siblings, 2 replies; 4+ messages in thread
From: GeunSik Lim @ 2009-04-05 6:45 UTC (permalink / raw)
To: Clark Williams, Thomas Gleixner; +Cc: rt-users
[-- Attachment #1: Type: text/plain, Size: 2955 bytes --]
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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[-- Attachment #2: fix-comparison-wordcount-available-tracers.patch --]
[-- Type: application/octet-stream, Size: 444 bytes --]
--- ./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;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: cyclictest - fix comparison about flexible word counts of available_tracers file.
2009-04-05 6:45 cyclictest - fix comparison about flexible word counts of available_tracers file GeunSik Lim
@ 2009-04-05 14:05 ` Thomas Gleixner
2009-04-05 14:50 ` Clark Williams
1 sibling, 0 replies; 4+ messages in thread
From: Thomas Gleixner @ 2009-04-05 14:05 UTC (permalink / raw)
To: GeunSik Lim; +Cc: Clark Williams, rt-users
On Sun, 5 Apr 2009, GeunSik Lim wrote:
> [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.
Good catch. Can you please clean up the patch and resend it with a
patch description and your Signed-off-by line ?
> --------------------------------------------------
> [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;
Please remove
> /* 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) {
while (1) {
please
> ret = fscanf(fp, "%99s", name);
> if (!ret) {
> ret = -1;
Thanks,
tglx
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: cyclictest - fix comparison about flexible word counts of available_tracers file.
2009-04-05 6:45 cyclictest - fix comparison about flexible word counts of available_tracers file GeunSik Lim
2009-04-05 14:05 ` Thomas Gleixner
@ 2009-04-05 14:50 ` Clark Williams
2009-04-06 2:49 ` GeunSik Lim
1 sibling, 1 reply; 4+ messages in thread
From: Clark Williams @ 2009-04-05 14:50 UTC (permalink / raw)
To: GeunSik Lim; +Cc: Thomas Gleixner, rt-users
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Sun, 5 Apr 2009 15:45:33 +0900
GeunSik Lim <leemgs1@gmail.com> wrote:
> 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.
>
GeunSik,
Good catch! I applied your patch, but then found a bug in either
fscanf or debugfs (probably debugfs). Since I didn't have IRQSOFF or
PREEMPTOFF set in my kernel, those tracers weren't available and fscanf
never returned EOF (it kept returning the "nop" tracer). So I reworked
your patch to read everything in and parse it using strtok(3).
The git tree has been updated and an rt-tests-0.34.tar.gz tarball is
available at:
http://www.kernel.org/pub/linux//kernel/people/clrkwllms/rt-tests/
Clark
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (GNU/Linux)
iEYEARECAAYFAknYxR4ACgkQHyuj/+TTEp3TNwCbBNrEHMLjPmAS6JciwjyXWqME
wpcAn3+nUGdOwCJR6sFGfwundPtaITrk
=dT+3
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: cyclictest - fix comparison about flexible word counts of available_tracers file.
2009-04-05 14:50 ` Clark Williams
@ 2009-04-06 2:49 ` GeunSik Lim
0 siblings, 0 replies; 4+ messages in thread
From: GeunSik Lim @ 2009-04-06 2:49 UTC (permalink / raw)
To: Clark Williams; +Cc: Thomas Gleixner, rt-users
Dear Clark
Thanks your patching.
Since I didn't have IRQSOFF or
> PREEMPTOFF set in my kernel, those tracers weren't available and fscanf
> never returned EOF (it kept returning the "nop" tracer).
Clark. I think that Your approach is right.
In fact , I also thought this case that a developer disable
PREEMPTOFF or IRQSOFF on "#>make menuconfig" setting menu.
As you know, Most peoples will use -P or -I option when they enabled
PREEMPTOFF or IRQSOFF in Linux Kernel just.
But, Exception Handling is important as your explanation.
Thanks again.
2009/4/5 Clark Williams <williams@redhat.com>:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Sun, 5 Apr 2009 15:45:33 +0900
> GeunSik Lim <leemgs1@gmail.com> wrote:
>
>> 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.
>>
>
> GeunSik,
>
> Good catch! I applied your patch, but then found a bug in either
> fscanf or debugfs (probably debugfs). Since I didn't have IRQSOFF or
> PREEMPTOFF set in my kernel, those tracers weren't available and fscanf
> never returned EOF (it kept returning the "nop" tracer). So I reworked
> your patch to read everything in and parse it using strtok(3).
>
> The git tree has been updated and an rt-tests-0.34.tar.gz tarball is
> available at:
>
> http://www.kernel.org/pub/linux//kernel/people/clrkwllms/rt-tests/
>
> Clark
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.10 (GNU/Linux)
>
> iEYEARECAAYFAknYxR4ACgkQHyuj/+TTEp3TNwCbBNrEHMLjPmAS6JciwjyXWqME
> wpcAn3+nUGdOwCJR6sFGfwundPtaITrk
> =dT+3
> -----END PGP SIGNATURE-----
>
--
Regards,
GeunSik Lim
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-04-06 2:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-05 6:45 cyclictest - fix comparison about flexible word counts of available_tracers file GeunSik Lim
2009-04-05 14:05 ` Thomas Gleixner
2009-04-05 14:50 ` Clark Williams
2009-04-06 2:49 ` GeunSik Lim
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).