* [PATCH v2] kselftests: timers: Make set-timer-lat fail more gracefully for !CAP_WAKE_ALARM
@ 2015-04-02 3:43 John Stultz
2015-04-02 14:21 ` Shuah Khan
0 siblings, 1 reply; 3+ messages in thread
From: John Stultz @ 2015-04-02 3:43 UTC (permalink / raw)
To: lkml
Cc: John Stultz, Shuah Khan, Prarit Bhargava, Thomas Gleixner,
Richard Cochran
The set-timer-lat test fails when testing CLOCK_BOOTTIME_ALARM
or CLOCK_REALTIME_ALARM when the user isn't running as root or
with CAP_WAKE_ALARM.
So this patch improves the error checking so we report the
issue more clearly and continue rather then reporting a failure.
Cc: Shuah Khan <shuahkh@osg.samsung.com>
Cc: Prarit Bhargava <prarit@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
---
v2: Fix a few checkpatch warnings.
tools/testing/selftests/timers/set-timer-lat.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/tools/testing/selftests/timers/set-timer-lat.c b/tools/testing/selftests/timers/set-timer-lat.c
index 2ed3267..4fc98c5 100644
--- a/tools/testing/selftests/timers/set-timer-lat.c
+++ b/tools/testing/selftests/timers/set-timer-lat.c
@@ -139,6 +139,13 @@ int do_timer(int clock_id, int flags)
err = timer_create(clock_id, &se, &tm1);
if (err) {
+ if ((clock_id == CLOCK_REALTIME_ALARM) ||
+ (clock_id == CLOCK_BOOTTIME_ALARM)) {
+ printf("%-22s %s missing CAP_WAKE_ALARM? : [UNSUPPORTED]\n",
+ clockstring(clock_id),
+ flags ? "ABSTIME":"RELTIME");
+ return 0;
+ }
printf("%s - timer_create() failed\n", clockstring(clock_id));
return -1;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] kselftests: timers: Make set-timer-lat fail more gracefully for !CAP_WAKE_ALARM
2015-04-02 3:43 [PATCH v2] kselftests: timers: Make set-timer-lat fail more gracefully for !CAP_WAKE_ALARM John Stultz
@ 2015-04-02 14:21 ` Shuah Khan
2015-04-02 18:50 ` Shuah Khan
0 siblings, 1 reply; 3+ messages in thread
From: Shuah Khan @ 2015-04-02 14:21 UTC (permalink / raw)
To: John Stultz, lkml
Cc: Prarit Bhargava, Thomas Gleixner, Richard Cochran, Shuah Khan
On 04/01/2015 09:43 PM, John Stultz wrote:
> The set-timer-lat test fails when testing CLOCK_BOOTTIME_ALARM
> or CLOCK_REALTIME_ALARM when the user isn't running as root or
> with CAP_WAKE_ALARM.
>
> So this patch improves the error checking so we report the
> issue more clearly and continue rather then reporting a failure.
>
> Cc: Shuah Khan <shuahkh@osg.samsung.com>
> Cc: Prarit Bhargava <prarit@redhat.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Richard Cochran <richardcochran@gmail.com>
> Signed-off-by: John Stultz <john.stultz@linaro.org>
> ---
> v2: Fix a few checkpatch warnings.
>
Thanks. I will get this into 4.1-rc2.
-- Shuah
--
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] kselftests: timers: Make set-timer-lat fail more gracefully for !CAP_WAKE_ALARM
2015-04-02 14:21 ` Shuah Khan
@ 2015-04-02 18:50 ` Shuah Khan
0 siblings, 0 replies; 3+ messages in thread
From: Shuah Khan @ 2015-04-02 18:50 UTC (permalink / raw)
To: John Stultz, lkml
Cc: Prarit Bhargava, Thomas Gleixner, Richard Cochran, Shuah Khan
On 04/02/2015 08:21 AM, Shuah Khan wrote:
> On 04/01/2015 09:43 PM, John Stultz wrote:
>> The set-timer-lat test fails when testing CLOCK_BOOTTIME_ALARM
>> or CLOCK_REALTIME_ALARM when the user isn't running as root or
>> with CAP_WAKE_ALARM.
>>
>> So this patch improves the error checking so we report the
>> issue more clearly and continue rather then reporting a failure.
>>
>> Cc: Shuah Khan <shuahkh@osg.samsung.com>
>> Cc: Prarit Bhargava <prarit@redhat.com>
>> Cc: Thomas Gleixner <tglx@linutronix.de>
>> Cc: Richard Cochran <richardcochran@gmail.com>
>> Signed-off-by: John Stultz <john.stultz@linaro.org>
>> ---
>> v2: Fix a few checkpatch warnings.
>>
>
> Thanks. I will get this into 4.1-rc2.
>
Applied to linux-kselftest next for 4.1
thanks,
-- Shuah
--
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-04-02 18:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-02 3:43 [PATCH v2] kselftests: timers: Make set-timer-lat fail more gracefully for !CAP_WAKE_ALARM John Stultz
2015-04-02 14:21 ` Shuah Khan
2015-04-02 18:50 ` Shuah Khan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.