public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Improve timer_create failure message
@ 2024-08-29 14:25 Gianfranco Trad
  2024-08-29 15:14 ` Thomas Gleixner
  0 siblings, 1 reply; 6+ messages in thread
From: Gianfranco Trad @ 2024-08-29 14:25 UTC (permalink / raw)
  To: jstultz, tglx, sboyd, anna-maria, frederic, shuah
  Cc: linux-kernel, linux-kselftest, Gianfranco Trad

Improve timer_create failure message to give more information to the user.

Signed-off-by: Gianfranco Trad <gianf.trad@gmail.com>
---
 tools/testing/selftests/timers/alarmtimer-suspend.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/timers/alarmtimer-suspend.c b/tools/testing/selftests/timers/alarmtimer-suspend.c
index ad52e608b88e..74acdb87d4f4 100644
--- a/tools/testing/selftests/timers/alarmtimer-suspend.c
+++ b/tools/testing/selftests/timers/alarmtimer-suspend.c
@@ -28,6 +28,7 @@
 #include <signal.h>
 #include <stdlib.h>
 #include <pthread.h>
+#include <errno.h>
 #include "../kselftest.h"
 
 #define CLOCK_REALTIME			0
@@ -142,8 +143,8 @@ int main(void)
 
 		alarmcount = 0;
 		if (timer_create(alarm_clock_id, &se, &tm1) == -1) {
-			printf("timer_create failed, %s unsupported?\n",
-					clockstring(alarm_clock_id));
+			printf("timer_create failed, %s unsupported?: %s\n",
+					clockstring(alarm_clock_id), strerror(errno));
 			break;
 		}
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Improve timer_create failure message
  2024-08-29 14:25 [PATCH] Improve timer_create failure message Gianfranco Trad
@ 2024-08-29 15:14 ` Thomas Gleixner
  2024-08-29 15:37   ` [PATCH] selftests: timers: improve " Gianfranco Trad
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Gleixner @ 2024-08-29 15:14 UTC (permalink / raw)
  To: Gianfranco Trad, jstultz, sboyd, anna-maria, frederic, shuah
  Cc: linux-kernel, linux-kselftest, Gianfranco Trad

On Thu, Aug 29 2024 at 16:25, Gianfranco Trad wrote:

Please add a proper subsystem prefix to the subject.                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                                                                               git log --oneline $FILE                                                                                                                                                                                                                                                                                                      
gives you a decent hint       

Thanks,

       tglx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] selftests: timers: improve timer_create failure message
  2024-08-29 15:14 ` Thomas Gleixner
@ 2024-08-29 15:37   ` Gianfranco Trad
  2024-09-30 18:49     ` Shuah Khan
  0 siblings, 1 reply; 6+ messages in thread
From: Gianfranco Trad @ 2024-08-29 15:37 UTC (permalink / raw)
  To: jstultz, tglx, sboyd, anna-maria, frederic, shuah
  Cc: linux-kernel, linux-kselftest, Gianfranco Trad

improve timer_create failure message with strerror() function
to give more information to the user.

Signed-off-by: Gianfranco Trad <gianf.trad@gmail.com>
---
 tools/testing/selftests/timers/alarmtimer-suspend.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/timers/alarmtimer-suspend.c b/tools/testing/selftests/timers/alarmtimer-suspend.c
index ad52e608b88e..74acdb87d4f4 100644
--- a/tools/testing/selftests/timers/alarmtimer-suspend.c
+++ b/tools/testing/selftests/timers/alarmtimer-suspend.c
@@ -28,6 +28,7 @@
 #include <signal.h>
 #include <stdlib.h>
 #include <pthread.h>
+#include <errno.h>
 #include "../kselftest.h"
 
 #define CLOCK_REALTIME			0
@@ -142,8 +143,8 @@ int main(void)
 
 		alarmcount = 0;
 		if (timer_create(alarm_clock_id, &se, &tm1) == -1) {
-			printf("timer_create failed, %s unsupported?\n",
-					clockstring(alarm_clock_id));
+			printf("timer_create failed, %s unsupported?: %s\n",
+					clockstring(alarm_clock_id), strerror(errno));
 			break;
 		}
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] selftests: timers: improve timer_create failure message
  2024-08-29 15:37   ` [PATCH] selftests: timers: improve " Gianfranco Trad
@ 2024-09-30 18:49     ` Shuah Khan
  2024-09-30 19:19       ` John Stultz
  0 siblings, 1 reply; 6+ messages in thread
From: Shuah Khan @ 2024-09-30 18:49 UTC (permalink / raw)
  To: Gianfranco Trad, jstultz, tglx, sboyd, anna-maria, frederic,
	shuah
  Cc: linux-kernel, linux-kselftest, Shuah Khan

On 8/29/24 09:37, Gianfranco Trad wrote:
> improve timer_create failure message with strerror() function
> to give more information to the user.
> 
> Signed-off-by: Gianfranco Trad <gianf.trad@gmail.com>
> ---
>   tools/testing/selftests/timers/alarmtimer-suspend.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/testing/selftests/timers/alarmtimer-suspend.c b/tools/testing/selftests/timers/alarmtimer-suspend.c
> index ad52e608b88e..74acdb87d4f4 100644
> --- a/tools/testing/selftests/timers/alarmtimer-suspend.c
> +++ b/tools/testing/selftests/timers/alarmtimer-suspend.c
> @@ -28,6 +28,7 @@
>   #include <signal.h>
>   #include <stdlib.h>
>   #include <pthread.h>
> +#include <errno.h>
>   #include "../kselftest.h"
>   
>   #define CLOCK_REALTIME			0
> @@ -142,8 +143,8 @@ int main(void)
>   
>   		alarmcount = 0;
>   		if (timer_create(alarm_clock_id, &se, &tm1) == -1) {
> -			printf("timer_create failed, %s unsupported?\n",
> -					clockstring(alarm_clock_id));
> +			printf("timer_create failed, %s unsupported?: %s\n",
> +					clockstring(alarm_clock_id), strerror(errno));
>   			break;
>   		}
>   

Jon, Does this look good to you? I can pick this up if you
okay with this change.

thanks,
-- Shuah



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] selftests: timers: improve timer_create failure message
  2024-09-30 18:49     ` Shuah Khan
@ 2024-09-30 19:19       ` John Stultz
  2024-09-30 19:53         ` Shuah Khan
  0 siblings, 1 reply; 6+ messages in thread
From: John Stultz @ 2024-09-30 19:19 UTC (permalink / raw)
  To: Shuah Khan
  Cc: Gianfranco Trad, tglx, sboyd, anna-maria, frederic, shuah,
	linux-kernel, linux-kselftest

On Mon, Sep 30, 2024 at 11:49 AM Shuah Khan <skhan@linuxfoundation.org> wrote:
>
> On 8/29/24 09:37, Gianfranco Trad wrote:
> > improve timer_create failure message with strerror() function
> > to give more information to the user.
> >
> > Signed-off-by: Gianfranco Trad <gianf.trad@gmail.com>
> > ---
> >   tools/testing/selftests/timers/alarmtimer-suspend.c | 5 +++--
> >   1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/tools/testing/selftests/timers/alarmtimer-suspend.c b/tools/testing/selftests/timers/alarmtimer-suspend.c
> > index ad52e608b88e..74acdb87d4f4 100644
> > --- a/tools/testing/selftests/timers/alarmtimer-suspend.c
> > +++ b/tools/testing/selftests/timers/alarmtimer-suspend.c
> > @@ -28,6 +28,7 @@
> >   #include <signal.h>
> >   #include <stdlib.h>
> >   #include <pthread.h>
> > +#include <errno.h>
> >   #include "../kselftest.h"
> >
> >   #define CLOCK_REALTIME                      0
> > @@ -142,8 +143,8 @@ int main(void)
> >
> >               alarmcount = 0;
> >               if (timer_create(alarm_clock_id, &se, &tm1) == -1) {
> > -                     printf("timer_create failed, %s unsupported?\n",
> > -                                     clockstring(alarm_clock_id));
> > +                     printf("timer_create failed, %s unsupported?: %s\n",
> > +                                     clockstring(alarm_clock_id), strerror(errno));
> >                       break;
> >               }
> >
>
> Jon, Does this look good to you? I can pick this up if you
> okay with this change.

No objection from me, sorry this slipped by me.

Acked-by: John Stultz <jstultz@google.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] selftests: timers: improve timer_create failure message
  2024-09-30 19:19       ` John Stultz
@ 2024-09-30 19:53         ` Shuah Khan
  0 siblings, 0 replies; 6+ messages in thread
From: Shuah Khan @ 2024-09-30 19:53 UTC (permalink / raw)
  To: John Stultz
  Cc: Gianfranco Trad, tglx, sboyd, anna-maria, frederic, shuah,
	linux-kernel, linux-kselftest, Shuah Khan

On 9/30/24 13:19, John Stultz wrote:
> On Mon, Sep 30, 2024 at 11:49 AM Shuah Khan <skhan@linuxfoundation.org> wrote:
>>

>> Jon, Does this look good to you? I can pick this up if you
>> okay with this change.
> 
> No objection from me, sorry this slipped by me.
> 
> Acked-by: John Stultz <jstultz@google.com>

Thank you. Applied to linux-kselftest next for Linux 6.13-rc1

thanks,
-- Shuah

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-09-30 19:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-29 14:25 [PATCH] Improve timer_create failure message Gianfranco Trad
2024-08-29 15:14 ` Thomas Gleixner
2024-08-29 15:37   ` [PATCH] selftests: timers: improve " Gianfranco Trad
2024-09-30 18:49     ` Shuah Khan
2024-09-30 19:19       ` John Stultz
2024-09-30 19:53         ` Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox