Skip to contentSkip to conversation

cyclictest: Arrange alphabetically for readability of "cyclictest --help".

PATCH New GeunSik Lim 2 participants 6 messages Jul 3, 2009 – Jan 21, 2010 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cyclictest: Arrange alphabetically for readability of "cyclictest --help".

Hi,

This is trivial patch.
But, We need readbility about output of the "#>cyclictest --help" command.

Thks,
GeunSik Lim.

== CUT HERE ==

Subject: [PATCH]cyclictest: Arrange alphabetically for readability of "cyclictest --help".

When we use "#> cyclictest --help" command, we are confusing because of random order of many options. Arrange alphabetically.

After Patch)
[root@fedora11 rt-tests]# ./cyclictest --help
cyclictest V 0.46
Usage:
cyclictest <options>

-a [NUM] --affinity run thread #N on processor #N, if possible
with NUM pin all threads to the processor NUM
-b USEC --breaktrace=USEC send break trace command when latency > USEC
-B --preemptirqs both preempt and irqsoff tracing (used with -b)
-c CLOCK --clock=CLOCK select clock
0 = CLOCK_MONOTONIC (default)
1 = CLOCK_REALTIME

-C       --context         context switch tracing (used with -b)
-d DIST  --distance=DIST   distance of thread intervals in us default=500
-D       --duration=t      specify a length for the test run
                           default is in seconds, but 'm', 'h', or 'd' maybe added
                           to modify value to minutes, hours or days
-E       --event           event tracing (used with -b)
-f       --ftrace          function trace (when -b is active)
-h       --histogram=US    dump a latency histogram to stdout after the run
                           (with same priority about many threads)
                           US is the max time to be be tracked in microseconds
-i INTV  --interval=INTV   base interval of thread in us default=1000
-I       --irqsoff         Irqsoff tracing (used with -b)
-l LOOPS --loops=LOOPS     number of loops: default=0(endless)
-m       --mlockall        lock current and future memory allocations
-n       --nanosleep       use clock_nanosleep
-N       --nsecs           print results in ns instead of ms (default ms)
-o RED   --oscope=RED      oscilloscope mode, reduce verbose output by RED
-O TOPT  --traceopt=TOPT   trace option
-p PRIO  --prio=PRIO       priority of highest prio thread
-P       --preemptoff      Preempt off tracing (used with -b)
-q       --quiet           print only a summary on exit
-r       --relative        use relative timer instead of absolute
-s       --system          use sys_nanosleep and sys_setitimer
-t       --threads         one thread per available processor
-t [NUM] --threads=NUM     number of threads:

without NUM, threads = max_cpus without -t default = 1
-T TRACE --tracer=TRACER set tracing function
configured tracers: unavailable (debugfs not mounted)
-v --verbose output values on stdout for statistics
format: n:c:v n=tasknum c=count v=value in us

-w       --wakeup          task wakeup tracing (used with -b)
-W       --wakeuprt        rt task wakeup tracing (used with -b)
-y POLI  --policy=POLI     policy of realtime thread (1:FIFO, 2:RR)

format: --policy=1(default) or --policy=2

Signed-by-off: GeunSik Lim <[email protected]>

---
 src/cyclictest/cyclictest.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
src/cyclictest/cyclictest.c +9 -9
index 4a6f634..d16782b 100644
@@ -763,8 +763,14 @@ static void display_help(void)
 	       "                           1 = CLOCK_REALTIME\n"
 	       "-C       --context         context switch tracing (used with -b)\n"
 	       "-d DIST  --distance=DIST   distance of thread intervals in us default=500\n"
+	       "-D       --duration=t      specify a length for the test run\n"
+	       "                           default is in seconds, but 'm', 'h', or 'd' maybe added\n"
+	       "                           to modify value to minutes, hours or days\n"
 	       "-E       --event           event tracing (used with -b)\n"
 	       "-f       --ftrace          function trace (when -b is active)\n"
+	       "-h       --histogram=US    dump a latency histogram to stdout after the run\n"
+               "                           (with same priority about many threads)\n"
+	       "                           US is the max time to be be tracked in microseconds\n"
 	       "-i INTV  --interval=INTV   base interval of thread in us default=1000\n"
 	       "-I       --irqsoff         Irqsoff tracing (used with -b)\n"
 	       "-l LOOPS --loops=LOOPS     number of loops: default=0(endless)\n"
@@ -772,26 +778,20 @@ static void display_help(void)
 	       "-n       --nanosleep       use clock_nanosleep\n"
 	       "-N       --nsecs           print results in ns instead of ms (default ms)\n"
 	       "-o RED   --oscope=RED      oscilloscope mode, reduce verbose output by RED\n"
-	       "-O TOPT  --traceopt=TOPT    trace option\n"
+	       "-O TOPT  --traceopt=TOPT   trace option\n"
 	       "-p PRIO  --prio=PRIO       priority of highest prio thread\n"
 	       "-P       --preemptoff      Preempt off tracing (used with -b)\n"
 	       "-q       --quiet           print only a summary on exit\n"
 	       "-r       --relative        use relative timer instead of absolute\n"
 	       "-s       --system          use sys_nanosleep and sys_setitimer\n"
-	       "-T TRACE --tracer=TRACER   set tracing function\n"
-	       "    configured tracers: %s\n"
 	       "-t       --threads         one thread per available processor\n"
 	       "-t [NUM] --threads=NUM     number of threads:\n"
 	       "                           without NUM, threads = max_cpus\n"
 	       "                           without -t default = 1\n"
+	       "-T TRACE --tracer=TRACER   set tracing function\n"
+	       "    configured tracers: %s\n"
 	       "-v       --verbose         output values on stdout for statistics\n"
 	       "                           format: n:c:v n=tasknum c=count v=value in us\n"
-	       "-D       --duration=t      specify a length for the test run\n"
-	       "                           default is in seconds, but 'm', 'h', or 'd' maybe added\n"
-	       "                           to modify value to minutes, hours or days\n"
-	       "-h       --histogram=US    dump a latency histogram to stdout after the run\n"
-               "                           (with same priority about many threads)\n"
-	       "                           US is the max time to be be tracked in microseconds\n"
                "-w       --wakeup          task wakeup tracing (used with -b)\n"
                "-W       --wakeuprt        rt task wakeup tracing (used with -b)\n"
                "-y POLI  --policy=POLI     policy of realtime thread (1:FIFO, 2:RR)\n"
Signature · 16 lines
1.6.3.1

 


-----------------------------------------------
To unsubscribe from this list: send the line "unsubscribe linux-***" 
in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

GeunSik Lim ( Samsung Electronics )
e-Mail  :1) [email protected]
         2) [email protected] , [email protected]
HomePage: http://blog.naver.com/invain/
-----------------------------------------------
#1 lore raw

PATCH 1/1 cyclictest: CFLAGS to support static compiliation with ARM Crosscompiler

Dear williams,

This patch is for support static building using cross-compiler for embedded targetboard like ARM.
When we use -static option for static binary on embedded board after patch.
I tested various toolchain.(e.g: codesourcery toolchain , my self toolchain , cross-tool project's toolchain)
Ref) Don't forget "-static" configuration(CFLAGS += -O2 -static) in Makefile When you need static linking.

Before patch)
/usr/local/arm_v7_vfp_le/bin/../target/usr/lib/librt.a(timer_create.o):
In function `timer_create':
/home/build/BUILD/glibc-2.5.90/rt/../nptl/sysdeps/unix/sysv/linux/timer_create.c:174: undefined reference to pthread_attr_init' /home/build/BUILD/glibc-2.5.90/rt/../nptl/sysdeps/unix/sysv/linux/timer_create.c:192: undefined reference to pthread_attr_setdetachstate' /usr/local/arm_v7_vfp_le/bin/../target/usr/lib/librt.a(timer_routines.o): In function `__start_helper_thread':
/home/build/BUILD/glibc-2.5.90/rt/../nptl/sysdeps/unix/sysv/linux/timer_routines.c:144: undefined reference to pthread_attr_init' /home/build/BUILD/glibc-2.5.90/rt/../nptl/sysdeps/unix/sysv/linux/timer_routines.c:145: undefined reference to pthread_attr_setstacksize' /home/build/BUILD/glibc-2.5.90/rt/../nptl/sysdeps/unix/sysv/linux/timer_routines.c:171: undefined reference to pthread_attr_destroy' /home/build/BUILD/glibc-2.5.90/rt/../nptl/sysdeps/unix/sysv/linux/timer_routines.c:175: undefined reference to pthread_atfork' /usr/local/arm_v7_vfp_le/bin/../target/usr/lib/librt.a(timer_routines.o): In function `timer_helper_thread':
/home/build/BUILD/glibc-2.5.90/rt/../nptl/sysdeps/unix/sysv/linux/timer_routines.c:114: undefined reference to `pthread_exit'
collect2: ld returned 1 exit status
make: *** [cyclictest] Error 1

After patch) Success...
Fedora11$> file ./cyclictest
./cyclictest: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, for GNU/Linux 2.6.18, not stripped

====================================================================

Quoted 1 line

From 45e4dbeb8e7723cefa9117736b0ece5ea188ce6a Mon Sep 17 00:00:00 2001

From: Geunsik Lim <[email protected]>
Date: Thu, 21 Jan 2010 09:00:24 +0900
Subject: [PATCH 2/2] bugfix: Support static linking(-static) with Crosscompiler on ARM targetboard.

This patch is for support static building using cross-compiler for embedded targetboard like ARM.
When we use -static option for static binary on embedded board after patch.
I tested various toolchain.(e.g: codesourcery toolchain , my self toolchain , cross-tool project's toolchain)
Ref) Don't forget "-static" configuration(CFLAGS += -O2 -static) in Makefile When you need static linking.

---
 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Makefile +1 -1
index e14d957..65f506a 100644
@@ -3,7 +3,7 @@ VERSION_STRING = 0.61
 TARGETS	= cyclictest signaltest pi_stress \
 	  hwlatdetect rt-migrate-test ptsematest sigwaittest svsematest \
 	  sendme pip
-LIBS 	= -lpthread -lrt
+LIBS 	= -lrt -lpthread
 EXTRA_LIBS ?= -ldl	# for get_cpu
 DESTDIR	?=
 prefix  ?= /usr/local
Signature · 15 lines
1.6.2.5


-- 
-----------------------------------------------
To unsubscribe from this list: send the line "unsubscribe linux-***" 
in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

GeunSik Lim ( Samsung Electronics )
e-Mail  :1) [email protected]
         2) [email protected] , [email protected]
HomePage: http://blog.naver.com/invain/
-----------------------------------------------
#2 lore raw

Re: [PATCH]cyclictest: CFLAGS to support static compiliation with ARM Crosscompiler

Quoted 65 lines · GeunSik Lim

Dear williams,

This patch is for support static building using cross-compiler for embedded targetboard like ARM.
When we use -static option for static binary on embedded board after patch.
I tested various toolchain.(e.g: codesourcery toolchain , my self toolchain , cross-tool project's toolchain)
Ref) Don't forget "-static" configuration(CFLAGS  += -O2 -static) in Makefile When you need static linking.

Before patch)
/usr/local/arm_v7_vfp_le/bin/../target/usr/lib/librt.a(timer_create.o):
In function `timer_create':
/home/build/BUILD/glibc-2.5.90/rt/../nptl/sysdeps/unix/sysv/linux/timer_create.c:174: undefined reference to pthread_attr_init' /home/build/BUILD/glibc-2.5.90/rt/../nptl/sysdeps/unix/sysv/linux/timer_create.c:192: undefined reference to pthread_attr_setdetachstate' /usr/local/arm_v7_vfp_le/bin/../target/usr/lib/librt.a(timer_routines.o): In function `__start_helper_thread':
/home/build/BUILD/glibc-2.5.90/rt/../nptl/sysdeps/unix/sysv/linux/timer_routines.c:144: undefined reference to pthread_attr_init' /home/build/BUILD/glibc-2.5.90/rt/../nptl/sysdeps/unix/sysv/linux/timer_routines.c:145: undefined reference to pthread_attr_setstacksize' /home/build/BUILD/glibc-2.5.90/rt/../nptl/sysdeps/unix/sysv/linux/timer_routines.c:171: undefined reference to pthread_attr_destroy' /home/build/BUILD/glibc-2.5.90/rt/../nptl/sysdeps/unix/sysv/linux/timer_routines.c:175: undefined reference to pthread_atfork' /usr/local/arm_v7_vfp_le/bin/../target/usr/lib/librt.a(timer_routines.o): In function `timer_helper_thread':
/home/build/BUILD/glibc-2.5.90/rt/../nptl/sysdeps/unix/sysv/linux/timer_routines.c:114: undefined reference to `pthread_exit'
collect2: ld returned 1 exit status
make: *** [cyclictest] Error 1

After patch) Success...
Fedora11$> file ./cyclictest
./cyclictest: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, for GNU/Linux 2.6.18, not stripped

====================================================================

Quoted 1 line

From 45e4dbeb8e7723cefa9117736b0ece5ea188ce6a Mon Sep 17 00:00:00 2001

From: Geunsik Lim <[email protected]>
Date: Thu, 21 Jan 2010 09:00:24 +0900
Subject: [PATCH 2/2] bugfix: Support static linking(-static) with Crosscompiler on ARM targetboard.

This patch is for support static building using cross-compiler for embedded targetboard like ARM.
When we use -static option for static binary on embedded board after patch.
I tested various toolchain.(e.g: codesourcery toolchain , my self toolchain , cross-tool project's toolchain)
Ref) Don't forget "-static" configuration(CFLAGS  += -O2 -static) in Makefile When you need static linking.

---
 Makefile |    2 +-

 1 files changed, 1 insertions(+), 1 deletions(-)
Makefile +0 -0
index e14d957..65f506a 100644
@@ -3,7 +3,7 @@ VERSION_STRING = 0.61
  TARGETS        = cyclictest signaltest pi_stress \
          hwlatdetect rt-migrate-test ptsematest sigwaittest svsematest \

         sendme pip

Makefile +1 -1
-LIBS   = -lpthread -lrt
+LIBS   = -lrt -lpthread
Quoted 6 lines

 EXTRA_LIBS ?= -ldl     # for get_cpu
 DESTDIR        ?=
 prefix  ?= /usr/local
--
1.6.2.5

Did you leave something out?

Thanks
John
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw

Re: [PATCH]cyclictest: CFLAGS to support static compiliation with ARM Crosscompiler

Quoted 2 lines · John Kacur

Did you leave something out?

Not at all.
I summary, We have to change CFLAGS from "-lpthread -lrt" to "-lrt -lpthread" to compile
rt-tests source successfully for static linking with GCC based arm cross compiler.

This is testcase.
Fedora11#> git clone
git://git.kernel.org/pub/scm/linux/kernel/git/clrkwllms/rt-tests.git
Fedora11#> cd rt-tests
Fedora11#> vi Makefile ( for static linking)
CFLAGS += -O2 -static <--- Edit this line.
Fedora11#> make CC=arm-linux-eabi-gcc
We will meet some errors like "undefined reference to . . . . . .
" messages.

Thanks reading.
Geunsik Lim.

Quoted 3 lines

Thanks
John

Signature · 10 lines
Regards,
GeunSik Lim ( Samsung Electronics )
Blog : http://blog.naver.com/invain/
e-Mail: [email protected]
           [email protected] , [email protected]
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
#4 lore raw

Re: [PATCH]cyclictest: CFLAGS to support static compiliation with ARM Crosscompiler

Quoted 9 lines · GeunSik Lim
Quoted 2 lines · John Kacur

Did you leave something out?

Not at all.
I summary, We have to change CFLAGS from "-lpthread -lrt" to "-lrt -lpthread" to compile
rt-tests source successfully for static linking with GCC based arm cross compiler.

Quoted 9 lines

This is testcase.
Fedora11#> git clone
git://git.kernel.org/pub/scm/linux/kernel/git/clrkwllms/rt-tests.git
Fedora11#> cd rt-tests
Fedora11#> vi Makefile ( for static linking)
CFLAGS += -O2 -static <--- Edit this line.
Fedora11#> make CC=arm-linux-eabi-gcc
We will meet some errors like "undefined reference to . . . . . .
" messages.

Okay, I tested that change on normal x86_64 with the static flag, and it does seem to work, so I have no problem with your change.

Are you sure you need a -static link flag for embedded? I was talking to another arm developer who also cross compiles but doesn't need it.

Also, the reason I asked whether something was missing, is that the text to your patch contains "Subject: [PATCH 2/2] bugfix: Support static linking(-static) with"

so I was wondering where Patch 1/2 was.

Thanks.

#5 lore raw

Re: [PATCH]cyclictest: CFLAGS to support static compiliation with ARM Crosscompiler

Quoted 23 lines · John Kacur
Quoted 9 lines · GeunSik Lim
Quoted 2 lines · John Kacur

Did you leave something out?

Not at all.
I summary, We have to  change  CFLAGS from "-lpthread -lrt" to "-lrt -lpthread" to compile
rt-tests source successfully  for static linking with GCC based arm cross compiler.

Quoted 9 lines

This is testcase.
Fedora11#> git clone
git://git.kernel.org/pub/scm/linux/kernel/git/clrkwllms/rt-tests.git
Fedora11#> cd rt-tests
Fedora11#> vi Makefile ( for static linking)
  CFLAGS  += -O2 -static <--- Edit this line.
Fedora11#> make CC=arm-linux-eabi-gcc
   We will meet some errors like  "undefined reference to . . . . . . " messages.

Quoted 2 lines

Okay, I tested that change on normal x86_64 with the static flag, and it does seem to work, so I have no problem with your change.

Thank you for verification on X86 64bit.
For reference, I tested that change on X86 32bit with the "-static"option.

Quoted 3 lines

Are you sure you need a -static link flag for embedded? I was talking to another arm developer who also cross compiles but doesn't need it.

Of course. In general, Most embedded developers use shared linking for Embedded environment. But, Consider some case like Speedup and independent binary for debugging. In this case, We need useful "-static"option.

Quoted 7 lines

Also, the reason I asked whether something was missing, is that the text to your patch contains "Subject: [PATCH 2/2] bugfix: Support static linking(-static) with"

so I was wondering where Patch 1/2 was.

Sorry. I mistook.:)
Patch is just one.

Quoted 2 lines

Thanks.

Signature · 14 lines
Regards,
GeunSik Lim ( Samsung Electronics )
Blog : http://blog.naver.com/invain/
e-Mail: [email protected]
           [email protected] , [email protected]
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html