* [patch] testsuite: watchthreads-reorder: Linux kernel compat.
@ 2010-05-31 2:10 Jan Kratochvil
2010-05-31 3:33 ` Pedro Alves
0 siblings, 1 reply; 3+ messages in thread
From: Jan Kratochvil @ 2010-05-31 2:10 UTC (permalink / raw)
To: gdb-patches
Hi,
since Linux kernel linux-2.6.33 this testcase started to FAIL due to:
http://lkml.org/lkml/2009/12/17/141
464763cf1c6df632dccc8f2f4c7e50163154a2c0
I believe GDB should remain compatible with both Linux kernel variants.
Testing the Linux kernel behavior should not be a goal of the GDB testsuite,
such test has been checked into
cvs -d :pserver:anoncvs:anoncvs@sources.redhat.com:/cvs/systemtap co ptrace-tests
as:
tests/state-tracing-stop.c
OK to check-in?
Thanks,
Jan
2010-05-30 Jan Kratochvil <jan.kratochvil@redhat.com>
Accept the new Linux kernel "t (tracing stop)" string.
* gdb.threads/watchthreads-reorder.c (thread1_func, thread2_func):
Update comment.
(proc_string) <T (tracing stop)>: New.
(main): Update the state_wait expect string.
--- a/gdb/testsuite/gdb.threads/watchthreads-reorder.c
+++ b/gdb/testsuite/gdb.threads/watchthreads-reorder.c
@@ -99,7 +99,7 @@ thread1_func (void *unused)
rwatch_store = thread1_rwatch;
- /* Be sure the "T (tracing stop)" test can proceed for both threads. */
+ /* Be sure the "t (tracing stop)" test can proceed for both threads. */
timed_mutex_lock (&terminate_mutex);
i = pthread_mutex_unlock (&terminate_mutex);
assert (i == 0);
@@ -125,7 +125,7 @@ thread2_func (void *unused)
rwatch_store = thread2_rwatch;
- /* Be sure the "T (tracing stop)" test can proceed for both threads. */
+ /* Be sure the "t (tracing stop)" test can proceed for both threads. */
timed_mutex_lock (&terminate_mutex);
i = pthread_mutex_unlock (&terminate_mutex);
assert (i == 0);
@@ -165,6 +165,12 @@ proc_string (const char *filename, const char *line)
exit (EXIT_FAILURE);
}
+ /* torvalds/linux-2.6.git 464763cf1c6df632dccc8f2f4c7e50163154a2c0
+ has changed "T (tracing stop)" to "t (tracing stop)". Make the GDB
+ testcase backward compatible with older Linux kernels. */
+ if (strcmp (&buf[line_len], "T (tracing stop)") == 0)
+ buf[line_len] = 't';
+
return &buf[line_len];
}
if (errno != 0)
@@ -336,9 +342,9 @@ main (int argc, char **argv)
{
/* s390x-unknown-linux-gnu will fail with "R (running)". */
- state_wait (thread1_tid, "T (tracing stop)");
+ state_wait (thread1_tid, "t (tracing stop)");
- state_wait (thread2_tid, "T (tracing stop)");
+ state_wait (thread2_tid, "t (tracing stop)");
}
cleanup ();
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] testsuite: watchthreads-reorder: Linux kernel compat.
2010-05-31 2:10 [patch] testsuite: watchthreads-reorder: Linux kernel compat Jan Kratochvil
@ 2010-05-31 3:33 ` Pedro Alves
2010-05-31 19:03 ` Jan Kratochvil
0 siblings, 1 reply; 3+ messages in thread
From: Pedro Alves @ 2010-05-31 3:33 UTC (permalink / raw)
To: gdb-patches; +Cc: Jan Kratochvil
On Sunday 30 May 2010 22:13:26, Jan Kratochvil wrote:
> OK to check-in?
I tried to understand why you did this within proc_string, but I don't
think I got it, since proc_string is used to extract other lines, not
just the "State:" line. Why not do this within state_wait? Okay with
that change. Okay as is too if there's a good reason to do it as is.
>
>
> Thanks,
> Jan
>
>
> 2010-05-30 Jan Kratochvil <jan.kratochvil@redhat.com>
>
> Accept the new Linux kernel "t (tracing stop)" string.
> * gdb.threads/watchthreads-reorder.c (thread1_func, thread2_func):
> Update comment.
> (proc_string) <T (tracing stop)>: New.
> (main): Update the state_wait expect string.
>
> --- a/gdb/testsuite/gdb.threads/watchthreads-reorder.c
> +++ b/gdb/testsuite/gdb.threads/watchthreads-reorder.c
> @@ -99,7 +99,7 @@ thread1_func (void *unused)
>
> rwatch_store = thread1_rwatch;
>
> - /* Be sure the "T (tracing stop)" test can proceed for both threads. */
> + /* Be sure the "t (tracing stop)" test can proceed for both threads. */
> timed_mutex_lock (&terminate_mutex);
> i = pthread_mutex_unlock (&terminate_mutex);
> assert (i == 0);
> @@ -125,7 +125,7 @@ thread2_func (void *unused)
>
> rwatch_store = thread2_rwatch;
>
> - /* Be sure the "T (tracing stop)" test can proceed for both threads. */
> + /* Be sure the "t (tracing stop)" test can proceed for both threads. */
> timed_mutex_lock (&terminate_mutex);
> i = pthread_mutex_unlock (&terminate_mutex);
> assert (i == 0);
> @@ -165,6 +165,12 @@ proc_string (const char *filename, const char *line)
> exit (EXIT_FAILURE);
> }
>
> + /* torvalds/linux-2.6.git 464763cf1c6df632dccc8f2f4c7e50163154a2c0
> + has changed "T (tracing stop)" to "t (tracing stop)". Make the GDB
> + testcase backward compatible with older Linux kernels. */
> + if (strcmp (&buf[line_len], "T (tracing stop)") == 0)
> + buf[line_len] = 't';
> +
> return &buf[line_len];
> }
> if (errno != 0)
> @@ -336,9 +342,9 @@ main (int argc, char **argv)
> {
> /* s390x-unknown-linux-gnu will fail with "R (running)". */
>
> - state_wait (thread1_tid, "T (tracing stop)");
> + state_wait (thread1_tid, "t (tracing stop)");
>
> - state_wait (thread2_tid, "T (tracing stop)");
> + state_wait (thread2_tid, "t (tracing stop)");
> }
>
> cleanup ();
>
--
Pedro Alves
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] testsuite: watchthreads-reorder: Linux kernel compat.
2010-05-31 3:33 ` Pedro Alves
@ 2010-05-31 19:03 ` Jan Kratochvil
0 siblings, 0 replies; 3+ messages in thread
From: Jan Kratochvil @ 2010-05-31 19:03 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches
On Mon, 31 May 2010 04:10:07 +0200, Pedro Alves wrote:
> I tried to understand why you did this within proc_string, but I don't
> think I got it, since proc_string is used to extract other lines, not
> just the "State:" line. Why not do this within state_wait? Okay with
> that change.
I fully agree, thanks for catching it.
Checked-in with that change.
Regards,
Jan
http://sourceware.org/ml/gdb-cvs/2010-05/msg00255.html
--- src/gdb/testsuite/ChangeLog 2010/05/28 23:47:40 1.2293
+++ src/gdb/testsuite/ChangeLog 2010/05/31 03:31:16 1.2294
@@ -1,3 +1,11 @@
+2010-05-31 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ Accept the new Linux kernel "t (tracing stop)" string.
+ * gdb.threads/watchthreads-reorder.c (thread1_func, thread2_func):
+ Update comment.
+ (state_wait) <T (tracing stop)>: New.
+ (main): Update the state_wait expect string.
+
2010-05-28 Pedro Alves <pedro@codesourcery.com>
* limits.c, limits.exp: Delete files.
--- src/gdb/testsuite/gdb.threads/watchthreads-reorder.c 2010/01/20 21:09:30 1.3
+++ src/gdb/testsuite/gdb.threads/watchthreads-reorder.c 2010/05/31 03:31:17 1.4
@@ -99,7 +99,7 @@
rwatch_store = thread1_rwatch;
- /* Be sure the "T (tracing stop)" test can proceed for both threads. */
+ /* Be sure the "t (tracing stop)" test can proceed for both threads. */
timed_mutex_lock (&terminate_mutex);
i = pthread_mutex_unlock (&terminate_mutex);
assert (i == 0);
@@ -125,7 +125,7 @@
rwatch_store = thread2_rwatch;
- /* Be sure the "T (tracing stop)" test can proceed for both threads. */
+ /* Be sure the "t (tracing stop)" test can proceed for both threads. */
timed_mutex_lock (&terminate_mutex);
i = pthread_mutex_unlock (&terminate_mutex);
assert (i == 0);
@@ -211,6 +211,13 @@
do
{
state = proc_string (filename, "State:\t");
+
+ /* torvalds/linux-2.6.git 464763cf1c6df632dccc8f2f4c7e50163154a2c0
+ has changed "T (tracing stop)" to "t (tracing stop)". Make the GDB
+ testcase backward compatible with older Linux kernels. */
+ if (strcmp (state, "T (tracing stop)") == 0)
+ state = "t (tracing stop)";
+
if (strcmp (state, wanted) == 0)
{
free (filename);
@@ -336,9 +343,9 @@
{
/* s390x-unknown-linux-gnu will fail with "R (running)". */
- state_wait (thread1_tid, "T (tracing stop)");
+ state_wait (thread1_tid, "t (tracing stop)");
- state_wait (thread2_tid, "T (tracing stop)");
+ state_wait (thread2_tid, "t (tracing stop)");
}
cleanup ();
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-05-31 3:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-31 2:10 [patch] testsuite: watchthreads-reorder: Linux kernel compat Jan Kratochvil
2010-05-31 3:33 ` Pedro Alves
2010-05-31 19:03 ` Jan Kratochvil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox