Realtime tests: Fix robust mutex conditionals

Message ID 1412111852-22329-1-git-send-email-gary.robertson@linaro.org
State New
Headers show

Commit Message

gary.robertson@linaro.org Sept. 30, 2014, 9:17 p.m.
From: "Gary S. Robertson" <gary.robertson@linaro.org>

sbrk_mutex, testpi-5, and testpi-6 realtime tests in subdir
testcases/realtime/func/pi-tests used compile time config variables
which were not generated by autoconf in order to configure tests
for robust mutexes.  Changed these conditionals to use the config
variables actually generated in the autoconf process.

Signed-off-by: Gary S. Robertson <gary.robertson@linaro.org>
---
 testcases/realtime/func/pi-tests/sbrk_mutex.c |    2 +-
 testcases/realtime/func/pi-tests/testpi-5.c   |    2 +-
 testcases/realtime/func/pi-tests/testpi-6.c   |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

Comments

gary.robertson@linaro.org Oct. 21, 2014, 7:29 p.m. | #1
LTP developers,

Just wondered if this patch slipped through the cracks as I have heard no
comments for almost a month.
After floundering about for a long while trying to decipher the
macros-within-macros mysteries of autoconf in an OpenEmbedded build
environment I finally arrived at a proper solution for successfully
building the mutex tests for priority inheritance and robust mutexes.
This patch and its counterpart for priority inheritance mutex conditionals
are the LTP part of that solution, and address build-time issues which are
not confined to the OE build environment.

Apologies for all the previous noise and thanks for your forbearance while
I groped for understanding.

Gary Robertson

On Tue, Sep 30, 2014 at 4:17 PM, Gary S. Robertson <
gary.robertson@linaro.org> wrote:

> From: "Gary S. Robertson" <gary.robertson@linaro.org>
>
> sbrk_mutex, testpi-5, and testpi-6 realtime tests in subdir
> testcases/realtime/func/pi-tests used compile time config variables
> which were not generated by autoconf in order to configure tests
> for robust mutexes.  Changed these conditionals to use the config
> variables actually generated in the autoconf process.
>
> Signed-off-by: Gary S. Robertson <gary.robertson@linaro.org>
> ---
>  testcases/realtime/func/pi-tests/sbrk_mutex.c |    2 +-
>  testcases/realtime/func/pi-tests/testpi-5.c   |    2 +-
>  testcases/realtime/func/pi-tests/testpi-6.c   |    2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/testcases/realtime/func/pi-tests/sbrk_mutex.c
> b/testcases/realtime/func/pi-tests/sbrk_mutex.c
> index 684021f..5c325b4 100644
> --- a/testcases/realtime/func/pi-tests/sbrk_mutex.c
> +++ b/testcases/realtime/func/pi-tests/sbrk_mutex.c
> @@ -45,7 +45,7 @@
>  #include <unistd.h>
>  #include "librttest.h"
>
> -#if defined(HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS) &&
> defined(PTHREAD_MUTEX_ROBUST_NP)
> +#if HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS
>
>  #define NUM_MUTEXES 5000
>  #define NUM_THREADS 50
> diff --git a/testcases/realtime/func/pi-tests/testpi-5.c
> b/testcases/realtime/func/pi-tests/testpi-5.c
> index a1d93cc..70f02fd 100644
> --- a/testcases/realtime/func/pi-tests/testpi-5.c
> +++ b/testcases/realtime/func/pi-tests/testpi-5.c
> @@ -69,7 +69,7 @@ int do_test(int argc, char **argv)
>         pthread_mutexattr_t mutexattr;
>         int retc, protocol;
>
> -#if HAS_PTHREAD_MUTEXATTR_PROTOCOL_FUNCTIONS
> +#if HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS
>
>         if (pthread_mutexattr_init(&mutexattr) != 0)
>                 printf("Failed to init mutexattr\n");
> diff --git a/testcases/realtime/func/pi-tests/testpi-6.c
> b/testcases/realtime/func/pi-tests/testpi-6.c
> index b3c3e4a..f715eee 100644
> --- a/testcases/realtime/func/pi-tests/testpi-6.c
> +++ b/testcases/realtime/func/pi-tests/testpi-6.c
> @@ -41,7 +41,7 @@
>  #include <unistd.h>
>  #include <librttest.h>
>
> -#if defined(PTHREAD_MUTEX_ROBUST_NP)
> +#if HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS
>  pthread_mutex_t child_mutex;
>
>  void *child_thread(void *arg)
> --
> 1.7.9.5
>
>
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
Jan Stancek Oct. 24, 2014, 11:58 a.m. | #2
----- Original Message -----
> From: "Gary S. Robertson" <gary.robertson@linaro.org>
> To: ltp-list@lists.sourceforge.net
> Cc: "mike holmes" <mike.holmes@linaro.org>
> Sent: Tuesday, 30 September, 2014 11:17:32 PM
> Subject: [LTP] [PATCH] Realtime tests: Fix robust mutex conditionals
> 
> From: "Gary S. Robertson" <gary.robertson@linaro.org>
> 
> sbrk_mutex, testpi-5, and testpi-6 realtime tests in subdir
> testcases/realtime/func/pi-tests used compile time config variables
> which were not generated by autoconf in order to configure tests
> for robust mutexes.  Changed these conditionals to use the config
> variables actually generated in the autoconf process.
> 
> Signed-off-by: Gary S. Robertson <gary.robertson@linaro.org>
> ---
>  testcases/realtime/func/pi-tests/sbrk_mutex.c |    2 +-
>  testcases/realtime/func/pi-tests/testpi-5.c   |    2 +-
>  testcases/realtime/func/pi-tests/testpi-6.c   |    2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/testcases/realtime/func/pi-tests/sbrk_mutex.c
> b/testcases/realtime/func/pi-tests/sbrk_mutex.c
> index 684021f..5c325b4 100644
> --- a/testcases/realtime/func/pi-tests/sbrk_mutex.c
> +++ b/testcases/realtime/func/pi-tests/sbrk_mutex.c
> @@ -45,7 +45,7 @@
>  #include <unistd.h>
>  #include "librttest.h"
>  
> -#if defined(HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS) &&
> defined(PTHREAD_MUTEX_ROBUST_NP)
> +#if HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS
>  
>  #define NUM_MUTEXES 5000
>  #define NUM_THREADS 50
> diff --git a/testcases/realtime/func/pi-tests/testpi-5.c
> b/testcases/realtime/func/pi-tests/testpi-5.c
> index a1d93cc..70f02fd 100644
> --- a/testcases/realtime/func/pi-tests/testpi-5.c
> +++ b/testcases/realtime/func/pi-tests/testpi-5.c
> @@ -69,7 +69,7 @@ int do_test(int argc, char **argv)
>  	pthread_mutexattr_t mutexattr;
>  	int retc, protocol;
>  
> -#if HAS_PTHREAD_MUTEXATTR_PROTOCOL_FUNCTIONS
> +#if HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS

Shouldn't this one be "HAS_PRIORITY_INHERIT"? I'm looking at the
testcase, but I can't see any robust API being used.

Regards,
Jan

>  
>  	if (pthread_mutexattr_init(&mutexattr) != 0)
>  		printf("Failed to init mutexattr\n");
> diff --git a/testcases/realtime/func/pi-tests/testpi-6.c
> b/testcases/realtime/func/pi-tests/testpi-6.c
> index b3c3e4a..f715eee 100644
> --- a/testcases/realtime/func/pi-tests/testpi-6.c
> +++ b/testcases/realtime/func/pi-tests/testpi-6.c
> @@ -41,7 +41,7 @@
>  #include <unistd.h>
>  #include <librttest.h>
>  
> -#if defined(PTHREAD_MUTEX_ROBUST_NP)
> +#if HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS
>  pthread_mutex_t child_mutex;
>  
>  void *child_thread(void *arg)
> --
> 1.7.9.5
> 
> 
> ------------------------------------------------------------------------------
> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list
> 

------------------------------------------------------------------------------
gary.robertson@linaro.org Oct. 24, 2014, 12:51 p.m. | #3
Jan,

In testpi-6.c at line 77, the do_test() function attempts to set the
following mutex protocol:

    if (pthread_mutexattr_setrobust_np(&mutexattr,
                       PTHREAD_MUTEX_ROBUST_NP) != 0)
        printf("Can't set robust mutex\n");

The test in general appears to check how cleanly the robust mutex
implementation handles attempts to acquire the mutex recursively.
Since the mutex is NOT initialized as a recursive type, the recursive
locking attempt is expected to fail in order for the test to pass.
I agree that I don't see how the ROBUST attribute comes into play here, but
this is the way the test was written and my patch just allows it to compile
cleanly.

Gary

On Fri, Oct 24, 2014 at 6:58 AM, Jan Stancek <jstancek@redhat.com> wrote:

>
>
>
>
> ----- Original Message -----
> > From: "Gary S. Robertson" <gary.robertson@linaro.org>
> > To: ltp-list@lists.sourceforge.net
> > Cc: "mike holmes" <mike.holmes@linaro.org>
> > Sent: Tuesday, 30 September, 2014 11:17:32 PM
> > Subject: [LTP] [PATCH] Realtime tests: Fix robust mutex conditionals
> >
> > From: "Gary S. Robertson" <gary.robertson@linaro.org>
> >
> > sbrk_mutex, testpi-5, and testpi-6 realtime tests in subdir
> > testcases/realtime/func/pi-tests used compile time config variables
> > which were not generated by autoconf in order to configure tests
> > for robust mutexes.  Changed these conditionals to use the config
> > variables actually generated in the autoconf process.
> >
> > Signed-off-by: Gary S. Robertson <gary.robertson@linaro.org>
> > ---
> >  testcases/realtime/func/pi-tests/sbrk_mutex.c |    2 +-
> >  testcases/realtime/func/pi-tests/testpi-5.c   |    2 +-
> >  testcases/realtime/func/pi-tests/testpi-6.c   |    2 +-
> >  3 files changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/testcases/realtime/func/pi-tests/sbrk_mutex.c
> > b/testcases/realtime/func/pi-tests/sbrk_mutex.c
> > index 684021f..5c325b4 100644
> > --- a/testcases/realtime/func/pi-tests/sbrk_mutex.c
> > +++ b/testcases/realtime/func/pi-tests/sbrk_mutex.c
> > @@ -45,7 +45,7 @@
> >  #include <unistd.h>
> >  #include "librttest.h"
> >
> > -#if defined(HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS) &&
> > defined(PTHREAD_MUTEX_ROBUST_NP)
> > +#if HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS
> >
> >  #define NUM_MUTEXES 5000
> >  #define NUM_THREADS 50
> > diff --git a/testcases/realtime/func/pi-tests/testpi-5.c
> > b/testcases/realtime/func/pi-tests/testpi-5.c
> > index a1d93cc..70f02fd 100644
> > --- a/testcases/realtime/func/pi-tests/testpi-5.c
> > +++ b/testcases/realtime/func/pi-tests/testpi-5.c
> > @@ -69,7 +69,7 @@ int do_test(int argc, char **argv)
> >       pthread_mutexattr_t mutexattr;
> >       int retc, protocol;
> >
> > -#if HAS_PTHREAD_MUTEXATTR_PROTOCOL_FUNCTIONS
> > +#if HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS
>
> Shouldn't this one be "HAS_PRIORITY_INHERIT"? I'm looking at the
> testcase, but I can't see any robust API being used.
>
> Regards,
> Jan
>
> >
> >       if (pthread_mutexattr_init(&mutexattr) != 0)
> >               printf("Failed to init mutexattr\n");
> > diff --git a/testcases/realtime/func/pi-tests/testpi-6.c
> > b/testcases/realtime/func/pi-tests/testpi-6.c
> > index b3c3e4a..f715eee 100644
> > --- a/testcases/realtime/func/pi-tests/testpi-6.c
> > +++ b/testcases/realtime/func/pi-tests/testpi-6.c
> > @@ -41,7 +41,7 @@
> >  #include <unistd.h>
> >  #include <librttest.h>
> >
> > -#if defined(PTHREAD_MUTEX_ROBUST_NP)
> > +#if HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS
> >  pthread_mutex_t child_mutex;
> >
> >  void *child_thread(void *arg)
> > --
> > 1.7.9.5
> >
> >
> >
> ------------------------------------------------------------------------------
> > Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
> > Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
> > Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
> > Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
> >
> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
> > _______________________________________________
> > Ltp-list mailing list
> > Ltp-list@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/ltp-list
> >
>
------------------------------------------------------------------------------
Jan Stancek Oct. 24, 2014, 1:06 p.m. | #4
----- Original Message -----
> From: "Gary Robertson" <gary.robertson@linaro.org>
> To: "Jan Stancek" <jstancek@redhat.com>
> Cc: "ltp-list" <ltp-list@lists.sourceforge.net>, "mike holmes" <mike.holmes@linaro.org>
> Sent: Friday, 24 October, 2014 2:51:21 PM
> Subject: Re: [LTP] [PATCH] Realtime tests: Fix robust mutex conditionals
> 
> Jan,
> 
> In testpi-6.c at line 77, the do_test() function attempts to set the
> following mutex protocol:

Gary,

My question was for testpi-5.c:

-#if HAS_PTHREAD_MUTEXATTR_PROTOCOL_FUNCTIONS
+#if HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS

Regards,
Jan

> 
>     if (pthread_mutexattr_setrobust_np(&mutexattr,
>                        PTHREAD_MUTEX_ROBUST_NP) != 0)
>         printf("Can't set robust mutex\n");
> 
> The test in general appears to check how cleanly the robust mutex
> implementation handles attempts to acquire the mutex recursively.
> Since the mutex is NOT initialized as a recursive type, the recursive
> locking attempt is expected to fail in order for the test to pass.
> I agree that I don't see how the ROBUST attribute comes into play here, but
> this is the way the test was written and my patch just allows it to compile
> cleanly.
> 
> Gary
> 
> On Fri, Oct 24, 2014 at 6:58 AM, Jan Stancek <jstancek@redhat.com> wrote:
> 
> >
> >
> >
> >
> > ----- Original Message -----
> > > From: "Gary S. Robertson" <gary.robertson@linaro.org>
> > > To: ltp-list@lists.sourceforge.net
> > > Cc: "mike holmes" <mike.holmes@linaro.org>
> > > Sent: Tuesday, 30 September, 2014 11:17:32 PM
> > > Subject: [LTP] [PATCH] Realtime tests: Fix robust mutex conditionals
> > >
> > > From: "Gary S. Robertson" <gary.robertson@linaro.org>
> > >
> > > sbrk_mutex, testpi-5, and testpi-6 realtime tests in subdir
> > > testcases/realtime/func/pi-tests used compile time config variables
> > > which were not generated by autoconf in order to configure tests
> > > for robust mutexes.  Changed these conditionals to use the config
> > > variables actually generated in the autoconf process.
> > >
> > > Signed-off-by: Gary S. Robertson <gary.robertson@linaro.org>
> > > ---
> > >  testcases/realtime/func/pi-tests/sbrk_mutex.c |    2 +-
> > >  testcases/realtime/func/pi-tests/testpi-5.c   |    2 +-
> > >  testcases/realtime/func/pi-tests/testpi-6.c   |    2 +-
> > >  3 files changed, 3 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/testcases/realtime/func/pi-tests/sbrk_mutex.c
> > > b/testcases/realtime/func/pi-tests/sbrk_mutex.c
> > > index 684021f..5c325b4 100644
> > > --- a/testcases/realtime/func/pi-tests/sbrk_mutex.c
> > > +++ b/testcases/realtime/func/pi-tests/sbrk_mutex.c
> > > @@ -45,7 +45,7 @@
> > >  #include <unistd.h>
> > >  #include "librttest.h"
> > >
> > > -#if defined(HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS) &&
> > > defined(PTHREAD_MUTEX_ROBUST_NP)
> > > +#if HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS
> > >
> > >  #define NUM_MUTEXES 5000
> > >  #define NUM_THREADS 50
> > > diff --git a/testcases/realtime/func/pi-tests/testpi-5.c
> > > b/testcases/realtime/func/pi-tests/testpi-5.c
> > > index a1d93cc..70f02fd 100644
> > > --- a/testcases/realtime/func/pi-tests/testpi-5.c
> > > +++ b/testcases/realtime/func/pi-tests/testpi-5.c
> > > @@ -69,7 +69,7 @@ int do_test(int argc, char **argv)
> > >       pthread_mutexattr_t mutexattr;
> > >       int retc, protocol;
> > >
> > > -#if HAS_PTHREAD_MUTEXATTR_PROTOCOL_FUNCTIONS
> > > +#if HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS
> >
> > Shouldn't this one be "HAS_PRIORITY_INHERIT"? I'm looking at the
> > testcase, but I can't see any robust API being used.
> >
> > Regards,
> > Jan
> >
> > >
> > >       if (pthread_mutexattr_init(&mutexattr) != 0)
> > >               printf("Failed to init mutexattr\n");
> > > diff --git a/testcases/realtime/func/pi-tests/testpi-6.c
> > > b/testcases/realtime/func/pi-tests/testpi-6.c
> > > index b3c3e4a..f715eee 100644
> > > --- a/testcases/realtime/func/pi-tests/testpi-6.c
> > > +++ b/testcases/realtime/func/pi-tests/testpi-6.c
> > > @@ -41,7 +41,7 @@
> > >  #include <unistd.h>
> > >  #include <librttest.h>
> > >
> > > -#if defined(PTHREAD_MUTEX_ROBUST_NP)
> > > +#if HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS
> > >  pthread_mutex_t child_mutex;
> > >
> > >  void *child_thread(void *arg)
> > > --
> > > 1.7.9.5
> > >
> > >
> > >
> > ------------------------------------------------------------------------------
> > > Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
> > > Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
> > > Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
> > > Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
> > >
> > http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
> > > _______________________________________________
> > > Ltp-list mailing list
> > > Ltp-list@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/ltp-list
> > >
> >
> 

------------------------------------------------------------------------------
gary.robertson@linaro.org Oct. 24, 2014, 2:27 p.m. | #5
Jan,

Ahh!  Yes I believe you are right about that one.  I'll fix that and
re-submit.
I guess at this point it will need a third patch since it should have been
in the 'PI' conditionals patch instead of the 'ROBUST' patch.


Thanks

Gary

On Fri, Oct 24, 2014 at 8:06 AM, Jan Stancek <jstancek@redhat.com> wrote:

>
>
>
>
> ----- Original Message -----
> > From: "Gary Robertson" <gary.robertson@linaro.org>
> > To: "Jan Stancek" <jstancek@redhat.com>
> > Cc: "ltp-list" <ltp-list@lists.sourceforge.net>, "mike holmes" <
> mike.holmes@linaro.org>
> > Sent: Friday, 24 October, 2014 2:51:21 PM
> > Subject: Re: [LTP] [PATCH] Realtime tests: Fix robust mutex conditionals
> >
> > Jan,
> >
> > In testpi-6.c at line 77, the do_test() function attempts to set the
> > following mutex protocol:
>
> Gary,
>
> My question was for testpi-5.c:
>
> -#if HAS_PTHREAD_MUTEXATTR_PROTOCOL_FUNCTIONS
> +#if HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS
>
> Regards,
> Jan
>
> >
> >     if (pthread_mutexattr_setrobust_np(&mutexattr,
> >                        PTHREAD_MUTEX_ROBUST_NP) != 0)
> >         printf("Can't set robust mutex\n");
> >
> > The test in general appears to check how cleanly the robust mutex
> > implementation handles attempts to acquire the mutex recursively.
> > Since the mutex is NOT initialized as a recursive type, the recursive
> > locking attempt is expected to fail in order for the test to pass.
> > I agree that I don't see how the ROBUST attribute comes into play here,
> but
> > this is the way the test was written and my patch just allows it to
> compile
> > cleanly.
> >
> > Gary
> >
> > On Fri, Oct 24, 2014 at 6:58 AM, Jan Stancek <jstancek@redhat.com>
> wrote:
> >
> > >
> > >
> > >
> > >
> > > ----- Original Message -----
> > > > From: "Gary S. Robertson" <gary.robertson@linaro.org>
> > > > To: ltp-list@lists.sourceforge.net
> > > > Cc: "mike holmes" <mike.holmes@linaro.org>
> > > > Sent: Tuesday, 30 September, 2014 11:17:32 PM
> > > > Subject: [LTP] [PATCH] Realtime tests: Fix robust mutex conditionals
> > > >
> > > > From: "Gary S. Robertson" <gary.robertson@linaro.org>
> > > >
> > > > sbrk_mutex, testpi-5, and testpi-6 realtime tests in subdir
> > > > testcases/realtime/func/pi-tests used compile time config variables
> > > > which were not generated by autoconf in order to configure tests
> > > > for robust mutexes.  Changed these conditionals to use the config
> > > > variables actually generated in the autoconf process.
> > > >
> > > > Signed-off-by: Gary S. Robertson <gary.robertson@linaro.org>
> > > > ---
> > > >  testcases/realtime/func/pi-tests/sbrk_mutex.c |    2 +-
> > > >  testcases/realtime/func/pi-tests/testpi-5.c   |    2 +-
> > > >  testcases/realtime/func/pi-tests/testpi-6.c   |    2 +-
> > > >  3 files changed, 3 insertions(+), 3 deletions(-)
> > > >
> > > > diff --git a/testcases/realtime/func/pi-tests/sbrk_mutex.c
> > > > b/testcases/realtime/func/pi-tests/sbrk_mutex.c
> > > > index 684021f..5c325b4 100644
> > > > --- a/testcases/realtime/func/pi-tests/sbrk_mutex.c
> > > > +++ b/testcases/realtime/func/pi-tests/sbrk_mutex.c
> > > > @@ -45,7 +45,7 @@
> > > >  #include <unistd.h>
> > > >  #include "librttest.h"
> > > >
> > > > -#if defined(HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS) &&
> > > > defined(PTHREAD_MUTEX_ROBUST_NP)
> > > > +#if HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS
> > > >
> > > >  #define NUM_MUTEXES 5000
> > > >  #define NUM_THREADS 50
> > > > diff --git a/testcases/realtime/func/pi-tests/testpi-5.c
> > > > b/testcases/realtime/func/pi-tests/testpi-5.c
> > > > index a1d93cc..70f02fd 100644
> > > > --- a/testcases/realtime/func/pi-tests/testpi-5.c
> > > > +++ b/testcases/realtime/func/pi-tests/testpi-5.c
> > > > @@ -69,7 +69,7 @@ int do_test(int argc, char **argv)
> > > >       pthread_mutexattr_t mutexattr;
> > > >       int retc, protocol;
> > > >
> > > > -#if HAS_PTHREAD_MUTEXATTR_PROTOCOL_FUNCTIONS
> > > > +#if HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS
> > >
> > > Shouldn't this one be "HAS_PRIORITY_INHERIT"? I'm looking at the
> > > testcase, but I can't see any robust API being used.
> > >
> > > Regards,
> > > Jan
> > >
> > > >
> > > >       if (pthread_mutexattr_init(&mutexattr) != 0)
> > > >               printf("Failed to init mutexattr\n");
> > > > diff --git a/testcases/realtime/func/pi-tests/testpi-6.c
> > > > b/testcases/realtime/func/pi-tests/testpi-6.c
> > > > index b3c3e4a..f715eee 100644
> > > > --- a/testcases/realtime/func/pi-tests/testpi-6.c
> > > > +++ b/testcases/realtime/func/pi-tests/testpi-6.c
> > > > @@ -41,7 +41,7 @@
> > > >  #include <unistd.h>
> > > >  #include <librttest.h>
> > > >
> > > > -#if defined(PTHREAD_MUTEX_ROBUST_NP)
> > > > +#if HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS
> > > >  pthread_mutex_t child_mutex;
> > > >
> > > >  void *child_thread(void *arg)
> > > > --
> > > > 1.7.9.5
> > > >
> > > >
> > > >
> > >
> ------------------------------------------------------------------------------
> > > > Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
> > > > Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS
> Reports
> > > > Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
> > > > Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
> > > >
> > >
> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
> > > > _______________________________________________
> > > > Ltp-list mailing list
> > > > Ltp-list@lists.sourceforge.net
> > > > https://lists.sourceforge.net/lists/listinfo/ltp-list
> > > >
> > >
> >
>
------------------------------------------------------------------------------
gary.robertson@linaro.org Oct. 24, 2014, 4:47 p.m. | #6
Here are the two new patches which correct the robust mutex conditionals
and also fix the erroneous correction of the PI conditional in testpi-5.c
Thanks for straightening me out on this one!


------------------------------------------------------------------------------
Jan Stancek Oct. 28, 2014, 3:10 p.m. | #7
----- Original Message -----
> From: "Gary S. Robertson" <gary.robertson@linaro.org>
> To: jstancek@redhat.com
> Cc: ltp-list@lists.sourceforge.net, "mike holmes" <mike.holmes@linaro.org>
> Sent: Friday, 24 October, 2014 6:47:30 PM
> Subject: [LTP][PATCH V2] Realtime tests: Fix robust mutex conditionals
> 
> Here are the two new patches which correct the robust mutex conditionals
> and also fix the erroneous correction of the PI conditional in testpi-5.c
> Thanks for straightening me out on this one!
> 

Hi,

sorry for delay, I'm out of office this week.
I tested and pushed both.

Thank you,
Jan

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

Patch hide | download patch | download mbox

diff --git a/testcases/realtime/func/pi-tests/sbrk_mutex.c b/testcases/realtime/func/pi-tests/sbrk_mutex.c
index 684021f..5c325b4 100644
--- a/testcases/realtime/func/pi-tests/sbrk_mutex.c
+++ b/testcases/realtime/func/pi-tests/sbrk_mutex.c
@@ -45,7 +45,7 @@ 
 #include <unistd.h>
 #include "librttest.h"
 
-#if defined(HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS) && defined(PTHREAD_MUTEX_ROBUST_NP)
+#if HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS
 
 #define NUM_MUTEXES 5000
 #define NUM_THREADS 50
diff --git a/testcases/realtime/func/pi-tests/testpi-5.c b/testcases/realtime/func/pi-tests/testpi-5.c
index a1d93cc..70f02fd 100644
--- a/testcases/realtime/func/pi-tests/testpi-5.c
+++ b/testcases/realtime/func/pi-tests/testpi-5.c
@@ -69,7 +69,7 @@  int do_test(int argc, char **argv)
 	pthread_mutexattr_t mutexattr;
 	int retc, protocol;
 
-#if HAS_PTHREAD_MUTEXATTR_PROTOCOL_FUNCTIONS
+#if HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS
 
 	if (pthread_mutexattr_init(&mutexattr) != 0)
 		printf("Failed to init mutexattr\n");
diff --git a/testcases/realtime/func/pi-tests/testpi-6.c b/testcases/realtime/func/pi-tests/testpi-6.c
index b3c3e4a..f715eee 100644
--- a/testcases/realtime/func/pi-tests/testpi-6.c
+++ b/testcases/realtime/func/pi-tests/testpi-6.c
@@ -41,7 +41,7 @@ 
 #include <unistd.h>
 #include <librttest.h>
 
-#if defined(PTHREAD_MUTEX_ROBUST_NP)
+#if HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS
 pthread_mutex_t child_mutex;
 
 void *child_thread(void *arg)