Improve timer_create failure message
Subsystems (3)
PATCH 1/1 Improve timer_create failure message
Improve timer_create failure message to give more information to the user.
--- tools/testing/selftests/timers/alarmtimer-suspend.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
tools/testing/selftests/timers/alarmtimer-suspend.c +3 -2
@@ -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 ; }
Signature · 1 line
2.43.0
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
PATCH 1/1 selftests: timers: improve timer_create failure message
improve timer_create failure message with strerror() function to give more information to the user.
--- tools/testing/selftests/timers/alarmtimer-suspend.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
tools/testing/selftests/timers/alarmtimer-suspend.c +3 -2
@@ -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 ; }
Signature · 1 line
2.43.0
Shuah Khan
maintainerRe: [PATCH] selftests: timers: improve timer_create failure message
Quoted 21 lines · Gianfranco Trad
improve
timer_createfailure message withstrerror()function to give more information to the user.Signed-off-by Gianfranco Trad <[email protected]>--- tools/testing/selftests/timers/alarmtimer-suspend.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)tools/testing/selftests/timers/alarmtimer-suspend.c +1
-0@@ -28,6 +28,7 @@#include <signal.h> #include <stdlib.h> #include <pthread.h> +#include <errno.h> #include "../kselftest.h" #define CLOCK_REALTIME 0
tools/testing/selftests/timers/alarmtimer-suspend.c int main(void) · line 150
Quoted 10 lines
tools/testing/selftests/timers/alarmtimer-suspend.c +2
-2@@ -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
Re: [PATCH] selftests: timers: improve timer_create failure message
Quoted 24 lines · Shuah Khan
Quoted 22 lines · Gianfranco Trad
improve
timer_createfailure message withstrerror()function to give more information to the user.Signed-off-by Gianfranco Trad <[email protected]>--- tools/testing/selftests/timers/alarmtimer-suspend.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)tools/testing/selftests/timers/alarmtimer-suspend.c +1
-0@@ -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)
Quoted 12 lines
tools/testing/selftests/timers/alarmtimer-suspend.c int main(void) · line 150
Quoted 9 lines
tools/testing/selftests/timers/alarmtimer-suspend.c +2
-2alarmcount =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.
Shuah Khan
maintainerRe: [PATCH] selftests: timers: improve timer_create failure message
Quoted 9 lines · John Stultz
Quoted 4 lines · Shuah Khan
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 <[email protected]>
Thank you. Applied to linux-kselftest next for Linux 6.13-rc1
thanks,
-- Shuah