* Re: More RT Test Programs
[not found] ` <4B26B838.1080303@osadl.org>
@ 2009-12-14 23:55 ` John Kacur
2009-12-20 20:42 ` Carsten Emde
0 siblings, 1 reply; 6+ messages in thread
From: John Kacur @ 2009-12-14 23:55 UTC (permalink / raw)
To: Carsten Emde; +Cc: linux-rt-users, Clark Williams, Thomas Gleixner
On Mon, 14 Dec 2009, Carsten Emde wrote:
> John,
>
> > So, for now I am going to at least temporarily submit a patch that
> > removes building the modules from the main makefile.
> That's okay.
>
> > Of course you can still cd to src/backfire and build the module there
> > without any problems.
> Yes. Shouldn't we then explain this a little bit better in sendme?
>
> Carsten.
>
>
> Signed-off-by: Carsten Emde <C.Emde@osadl.org>
>
> --- sendme-old.c 2009-12-14 22:59:45.114507575 +0100
> +++ sendme.c 2009-12-14 23:07:48.714144429 +0100
> @@ -232,7 +232,12 @@
> path = open("/dev/backfire", O_RDWR);
> if (path < 0) {
> fprintf(stderr, "ERROR: Could not access backfire device, "
> - "try 'modprobe backfire'\n");
> + "try 'modprobe backfire'.\n"
> + "If the module backfire can't be loaded, "
> + "it may need to be built first.\n"
> + "Execute 'cd src/backfire; make' in the "
> + "rt-tests directory (requires rt-tests\n"
> + "sources and kernel-devel package).\n");
> return 1;
> }
> fl.l_type = F_WRLCK;
>
Thanks Carsten - I applied it to my git tree and pushed it.
Clark - pls pull.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: More RT Test Programs
2009-12-14 23:55 ` More RT Test Programs John Kacur
@ 2009-12-20 20:42 ` Carsten Emde
2009-12-20 22:51 ` John Kacur
0 siblings, 1 reply; 6+ messages in thread
From: Carsten Emde @ 2009-12-20 20:42 UTC (permalink / raw)
To: Clark Williams; +Cc: John Kacur, linux-rt-users, Thomas Gleixner
Clark,
by some reason, this patch didn't make it into 0.57. Would you mind to
pull it from John's tree?
Thanks,
Carsten.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: More RT Test Programs
2009-12-20 20:42 ` Carsten Emde
@ 2009-12-20 22:51 ` John Kacur
2009-12-20 23:49 ` Carsten Emde
0 siblings, 1 reply; 6+ messages in thread
From: John Kacur @ 2009-12-20 22:51 UTC (permalink / raw)
To: Carsten Emde; +Cc: Clark Williams, linux-rt-users, Thomas Gleixner
On Sun, Dec 20, 2009 at 9:42 PM, Carsten Emde <Carsten.Emde@osadl.org> wrote:
> Clark,
>
> by some reason, this patch didn't make it into 0.57. Would you mind to
> pull it from John's tree?
>
> Thanks,
>
> Carsten.
Hi Carsten - I think that Clark pulled my tree after I grabbed this
last patch. We are aware of it, and it's lined-up for the
next round of updates. I'll be posting some more tomorrow.
Thanks.
--
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] 6+ messages in thread
* Re: More RT Test Programs
2009-12-20 22:51 ` John Kacur
@ 2009-12-20 23:49 ` Carsten Emde
2009-12-21 0:08 ` John Kacur
[not found] ` <520f0cf10912201605y4019b940p346c73b927a52b39@mail.gmail.com>
0 siblings, 2 replies; 6+ messages in thread
From: Carsten Emde @ 2009-12-20 23:49 UTC (permalink / raw)
To: John Kacur; +Cc: Clark Williams, linux-rt-users, Thomas Gleixner
[-- Attachment #1: Type: text/plain, Size: 1121 bytes --]
John,
> [..] I'll be posting some more tomorrow.
Okay, great.
I have found an issue with all source files of the new tests. At some
stage between the original files and Clark's tree, the line delimiters
changed from NL to CR/NL. Would be great, if you could move this back to NL.
A second issue is related to the removal of the getcpu() definition.
There is a leftover in svsematest.c which should also be removed for
consistency. However, this and the other tests no longer compile in EL5
without this definition - should we better revert this and provide a
working recognition through "grep sched_getcpu
/usr/include/bits/sched.h"? Or is EL5 irrelevant in this context? I
still have an EL5 test machine where all RT kernels are tested.
Another issue is in the file backfire.c After you removed the line
>> - sed s/__VERSION_STRING__/$(VERSION_STRING)/ [..]
from the Makefile, the driver is producing the rather ugly syslog message:
backfire driver v__VERSION_STRING__
instead of
backfire driver v0.57
or similar.
We better completely remove the version display.
Signed-off-by: Carsten Emde <C.Emde@osadl.org>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: fix-backfire-version-display.patch --]
[-- Type: text/x-patch; name="fix-backfire-version-display.patch", Size: 396 bytes --]
--- backfire.c-orig 2009-12-20 22:40:48.000000000 +0100
+++ backfire.c 2009-12-20 22:41:40.000000000 +0100
@@ -132,7 +132,7 @@
if (ret)
printk(KERN_ERR "backfire: can't register dynamic misc device\n");
else
- printk(KERN_INFO "backfire driver v__VERSION_STRING__ misc device %d\n",
+ printk(KERN_INFO "backfire driver misc device %d\n",
backfire_dev.minor);
return ret;
}
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: More RT Test Programs
2009-12-20 23:49 ` Carsten Emde
@ 2009-12-21 0:08 ` John Kacur
[not found] ` <520f0cf10912201605y4019b940p346c73b927a52b39@mail.gmail.com>
1 sibling, 0 replies; 6+ messages in thread
From: John Kacur @ 2009-12-21 0:08 UTC (permalink / raw)
To: Carsten Emde; +Cc: Clark Williams, linux-rt-users, Thomas Gleixner
(Carsten - resend to cc all)
On Mon, Dec 21, 2009 at 12:49 AM, Carsten Emde <Carsten.Emde@osadl.org> wrote:
> John,
>
>> [..] I'll be posting some more tomorrow.
> Okay, great.
>
> I have found an issue with all source files of the new tests. At some
> stage between the original files and Clark's tree, the line delimiters
> changed from NL to CR/NL. Would be great, if you could move this back to NL.
Weird - I'll remove them.
It's not coming from you is it? The patch that you attached here has
^M at the end
of each line. I can run that through a script to remove it - but you
should look into
where that is coming from on your end.
>
> A second issue is related to the removal of the getcpu() definition.
> There is a leftover in svsematest.c which should also be removed for
> consistency. However, this and the other tests no longer compile in EL5
> without this definition - should we better revert this and provide a
> working recognition through "grep sched_getcpu
> /usr/include/bits/sched.h"? Or is EL5 irrelevant in this context? I
> still have an EL5 test machine where all RT kernels are tested.
Yup - I've been struggling with a resolution for this issue, I have something
to post tomorrow after my testing is complete. EL5 is not irrelevant to us.
Do you test 32-bit as well as 64-bit?
>
> Another issue is in the file backfire.c After you removed the line
>>> - sed s/__VERSION_STRING__/$(VERSION_STRING)/ [..]
> from the Makefile, the driver is producing the rather ugly syslog message:
> backfire driver v__VERSION_STRING__
> instead of
> backfire driver v0.57
> or similar.
>
> We better completely remove the version display.
Thanks for the patch, I will apply it.
>
> Signed-off-by: Carsten Emde <C.Emde@osadl.org>
>
--
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] 6+ messages in thread
* Re: More RT Test Programs
[not found] ` <520f0cf10912201605y4019b940p346c73b927a52b39@mail.gmail.com>
@ 2009-12-21 2:10 ` Carsten Emde
0 siblings, 0 replies; 6+ messages in thread
From: Carsten Emde @ 2009-12-21 2:10 UTC (permalink / raw)
To: John Kacur; +Cc: Clark Williams, RT-Users, Thomas Gleixner
[-- Attachment #1: Type: text/plain, Size: 1838 bytes --]
John,
>> I have found an issue with all source files of the new tests. At some
>> stage between the original files and Clark's tree, the line delimiters
>> changed from NL to CR/NL. Would be great, if you could move this back to NL.
> Weird - I'll remove them.
> It's not coming from you is it? The patch that you attached here has
> ^M at the end of each line.
Yes, this is because of the ^Ms in the original file. I had to use
diff's -w option.
> I can run that through a script to remove it - but you
> should look into where that is coming from on your end.
Okay. Here comes another patch. Let's see in what shape it arrives at
your side. I converted the files and did not use diff's -w option this
time. You need to remove the ^Ms from the patched files; otherwise, the
patch will not apply.
>> A second issue is related to the removal of the getcpu() definition.
>> There is a leftover in svsematest.c which should also be removed for
>> consistency. However, this and the other tests no longer compile in EL5
>> without this definition - should we better revert this and provide a
>> working recognition through "grep sched_getcpu
>> /usr/include/bits/sched.h"? Or is EL5 irrelevant in this context? I
>> still have an EL5 test machine where all RT kernels are tested.
> Yup - I've been struggling with a resolution for this issue, I have something
> to post tomorrow after my testing is complete. EL5 is not irrelevant to us.
Below comes a proposal of a patch that works here on EL5.
> Do you test 32-bit as well as 64-bit?
No - currently, I have only an F11 machine that runs 64-bit. Is there an
issue with EL5 64-bit?
Carsten.
-=-------------------------------------------------------------------=-
Generate getcpu.h to use getcpu() instead of sched_getcpu(), if needed.
Signed-off-by: Carsten Emde <C.Emde@osadl.org>
[-- Attachment #2: use-getcpu-if-sched_getcpu-not-available.patch --]
[-- Type: text/x-patch, Size: 4845 bytes --]
Index: rt-tests/Makefile
===================================================================
--- rt-tests.orig/Makefile
+++ rt-tests/Makefile
@@ -20,7 +20,11 @@ endif
UTILS = src/lib/rt-utils.o
.PHONY: all
-all: $(TARGETS)
+all: src/lib/getcpu.h $(TARGETS)
+
+src/lib/getcpu.h:
+ @touch $@
+ @grep -q sched_getcpu /usr/include/bits/sched.h && echo "#define HAS_SCHED_GETCPU" >$@; true
cyclictest: src/cyclictest/cyclictest.c $(UTILS)
$(CC) $(CFLAGS) -D VERSION_STRING=$(VERSION_STRING) $^ -o $@ $(LIBS)
@@ -59,7 +63,7 @@ CLEANUP += $(if $(wildcard .git), Change
.PHONY: clean
clean:
for F in $(CLEANUP); do find -type f -name $$F | xargs rm -f; done
- rm -f hwlatdetect
+ rm -f hwlatdetect src/lib/getcpu.h
.PHONY: distclean
distclean: clean
Index: rt-tests/src/backfire/sendme.c
===================================================================
--- rt-tests.orig/src/backfire/sendme.c
+++ rt-tests/src/backfire/sendme.c
@@ -30,6 +30,7 @@
#include <string.h>
#include <time.h>
#include "rt-utils.h"
+#include "getcpu.h"
#define _GNU_SOURCE
#include <utmpx.h>
@@ -38,11 +39,17 @@
#include <sys/time.h>
#include <sys/mman.h>
+#include <linux/unistd.h>
+
#define USEC_PER_SEC 1000000
#define NSEC_PER_SEC 1000000000
#define SIGTEST SIGHUP
+#ifndef HAS_SCHED_GETCPU
+#define getcpu(cpu, node, cache) syscall(__NR_getcpu, cpu, node, cache)
+#endif
+
enum {
AFFINITY_UNSPECIFIED,
AFFINITY_SPECIFIED,
@@ -197,8 +204,15 @@ int main(int argc, char *argv[])
if (setaffinity != AFFINITY_UNSPECIFIED) {
CPU_ZERO(&mask);
- if (setaffinity == AFFINITY_USECURRENT)
+ if (setaffinity == AFFINITY_USECURRENT) {
+#ifdef HAS_SCHED_GETCPU
affinity = sched_getcpu();
+#else
+ int c, s;
+ s = getcpu(&c, NULL, NULL);
+ affinity = (s == -1) ? s : c;
+#endif
+ }
CPU_SET(affinity, &mask);
if (sched_setaffinity(0, sizeof(mask), &mask) == -1)
fprintf(stderr, "WARNING: Could not set CPU affinity "
Index: rt-tests/src/ptsematest/ptsematest.c
===================================================================
--- rt-tests.orig/src/ptsematest/ptsematest.c
+++ rt-tests/src/ptsematest/ptsematest.c
@@ -35,11 +35,15 @@
#include <linux/unistd.h>
#include <utmpx.h>
#include "rt-utils.h"
+#include "getcpu.h"
#define __USE_GNU
#include <pthread.h>
#define gettid() syscall(__NR_gettid)
+#ifndef HAS_SCHED_GETCPU
+#define getcpu(cpu, node, cache) syscall(__NR_getcpu, cpu, node, cache)
+#endif
#define USEC_PER_SEC 1000000
@@ -108,7 +112,13 @@ void *semathread(void *param)
if(par->max_cycles && par->samples >= par->max_cycles)
par->shutdown = 1;
if (mustgetcpu) {
+#ifdef HAS_SCHED_GETCPU
par->cpu = sched_getcpu();
+#else
+ int c, s;
+ s = getcpu(&c, NULL, NULL);
+ par->cpu = (s == -1) ? s : c;
+#endif
}
} else {
/* Receiver */
@@ -150,7 +160,13 @@ void *semathread(void *param)
if (par->max_cycles && par->samples >= par->max_cycles)
par->shutdown = 1;
if (mustgetcpu) {
+#ifdef HAS_SCHED_GETCPU
par->cpu = sched_getcpu();
+#else
+ int c, s;
+ s = getcpu(&c, NULL, NULL);
+ par->cpu = (s == -1) ? s : c;
+#endif
}
nanosleep(&par->delay, NULL);
pthread_mutex_unlock(&syncmutex[par->num]);
Index: rt-tests/src/sigwaittest/sigwaittest.c
===================================================================
--- rt-tests.orig/src/sigwaittest/sigwaittest.c
+++ rt-tests/src/sigwaittest/sigwaittest.c
@@ -37,11 +37,15 @@
#include <linux/unistd.h>
#include <utmpx.h>
#include "rt-utils.h"
+#include "getcpu.h"
#define __USE_GNU
#include <pthread.h>
#define gettid() syscall(__NR_gettid)
+#ifndef HAS_SCHED_GETCPU
+#define getcpu(cpu, node, cache) syscall(__NR_getcpu, cpu, node, cache)
+#endif
#define USEC_PER_SEC 1000000
@@ -139,7 +143,13 @@ void *semathread(void *param)
par->shutdown = 1;
if (mustgetcpu) {
+#ifdef HAS_SCHED_GETCPU
par->cpu = sched_getcpu();
+#else
+ int c, s;
+ s = getcpu(&c, NULL, NULL);
+ par->cpu = (s == -1) ? s : c;
+#endif
}
sigwait(&sigset, &sig);
} else {
@@ -163,7 +173,13 @@ void *semathread(void *param)
par->shutdown = 1;
if (mustgetcpu) {
+#ifdef HAS_SCHED_GETCPU
par->cpu = sched_getcpu();
+#else
+ int c, s;
+ s = getcpu(&c, NULL, NULL);
+ par->cpu = (s == -1) ? s : c;
+#endif
}
/*
* Latency is the time spent between sending and
Index: rt-tests/src/svsematest/svsematest.c
===================================================================
--- rt-tests.orig/src/svsematest/svsematest.c
+++ rt-tests/src/svsematest/svsematest.c
@@ -42,8 +42,7 @@
#include <sys/time.h>
#include <sys/mman.h>
#include "rt-utils.h"
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-12-21 2:20 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <388070393.1730301260825543554.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com>
[not found] ` <4B26B838.1080303@osadl.org>
2009-12-14 23:55 ` More RT Test Programs John Kacur
2009-12-20 20:42 ` Carsten Emde
2009-12-20 22:51 ` John Kacur
2009-12-20 23:49 ` Carsten Emde
2009-12-21 0:08 ` John Kacur
[not found] ` <520f0cf10912201605y4019b940p346c73b927a52b39@mail.gmail.com>
2009-12-21 2:10 ` Carsten Emde
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).