Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752518AbdIVQUN (ORCPT ); Fri, 22 Sep 2017 12:20:13 -0400 Received: from ec2-52-27-115-49.us-west-2.compute.amazonaws.com ([52.27.115.49]:43957 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752078AbdIVQUL (ORCPT ); Fri, 22 Sep 2017 12:20:11 -0400 Subject: Re: [PATCH] selftests: timers: set-timer-lat: Fix hang when testing unsupported alarms To: Greg Hackmann , john.stultz@linaro.org, tglx@linutronix.de, sboyd@codeaurora.org, shuah@kernel.org Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Shuah Khan , Shuah Khan References: <20170921194510.16305-1-shuahkh@osg.samsung.com> <8378e236-a46d-835d-639f-87963158695f@osg.samsung.com> <61d7ab12-f7e5-97aa-258a-30b56e906d7e@google.com> From: Shuah Khan Message-ID: <32cb5f22-dab2-fad9-bb07-403caf5431bb@osg.samsung.com> Date: Fri, 22 Sep 2017 10:20:09 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <61d7ab12-f7e5-97aa-258a-30b56e906d7e@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4451 Lines: 76 On 09/22/2017 09:51 AM, Greg Hackmann wrote: > On 09/22/2017 07:41 AM, Shuah Khan wrote: >> I assume you are good with this fix. I plan to apply it to linux-kselftest fixes >> today. Please let me know if you have any objections. >> >> thanks, >> -- Shuah >> > > AIUI this check was added so set-timer-lat would treat a missing CAP_WAKE_ALARM as a skipped test (rather than making the entire test fail). So setup_timer()'s callers would need to treat this as a special case, by returning immediately but with a return value of 0. I see. Instead of marking the UNSUPPORTED case as fail, you would like to see it as skip. The following is the output with this patch. So I think you don't want to see the "Bail out!" at the end. I will make the change and send v2. ./set-timer-lat Setting timers for every 1 seconds CLOCK_REALTIME ABSTIME PERIODIC timer fired early: 0 : [OK] CLOCK_REALTIME ABSTIME PERIODIC max latency: 479361 ns : [OK] CLOCK_REALTIME RELTIME PERIODIC timer fired early: 0 : [OK] CLOCK_REALTIME RELTIME PERIODIC max latency: 210625 ns : [OK] CLOCK_REALTIME ABSTIME ONE-SHOT timer fired early: 0 : [OK] CLOCK_REALTIME ABSTIME ONE-SHOT max latency: 152892 ns : [OK] CLOCK_REALTIME ABSTIME ONE-SHOT count: 1 : [OK] CLOCK_REALTIME RELTIME ONE-SHOT timer fired early: 0 : [OK] CLOCK_REALTIME RELTIME ONE-SHOT max latency: 167839 ns : [OK] CLOCK_REALTIME RELTIME ONE-SHOT count: 1 : [OK] CLOCK_MONOTONIC ABSTIME PERIODIC timer fired early: 0 : [OK] CLOCK_MONOTONIC ABSTIME PERIODIC max latency: 190204 ns : [OK] CLOCK_MONOTONIC RELTIME PERIODIC timer fired early: 0 : [OK] CLOCK_MONOTONIC RELTIME PERIODIC max latency: 212418 ns : [OK] CLOCK_MONOTONIC ABSTIME ONE-SHOT timer fired early: 0 : [OK] CLOCK_MONOTONIC ABSTIME ONE-SHOT max latency: 158816 ns : [OK] CLOCK_MONOTONIC ABSTIME ONE-SHOT count: 1 : [OK] CLOCK_MONOTONIC RELTIME ONE-SHOT timer fired early: 0 : [OK] CLOCK_MONOTONIC RELTIME ONE-SHOT max latency: 172362 ns : [OK] CLOCK_MONOTONIC RELTIME ONE-SHOT count: 1 : [OK] CLOCK_BOOTTIME ABSTIME PERIODIC timer fired early: 0 : [OK] CLOCK_BOOTTIME ABSTIME PERIODIC max latency: 180767 ns : [OK] CLOCK_BOOTTIME RELTIME PERIODIC timer fired early: 0 : [OK] CLOCK_BOOTTIME RELTIME PERIODIC max latency: 202772 ns : [OK] CLOCK_BOOTTIME ABSTIME ONE-SHOT timer fired early: 0 : [OK] CLOCK_BOOTTIME ABSTIME ONE-SHOT max latency: 117733 ns : [OK] CLOCK_BOOTTIME ABSTIME ONE-SHOT count: 1 : [OK] CLOCK_BOOTTIME RELTIME ONE-SHOT timer fired early: 0 : [OK] CLOCK_BOOTTIME RELTIME ONE-SHOT max latency: 171882 ns : [OK] CLOCK_BOOTTIME RELTIME ONE-SHOT count: 1 : [OK] CLOCK_REALTIME_ALARM ABSTIME missing CAP_WAKE_ALARM? : [UNSUPPORTED] CLOCK_REALTIME_ALARM RELTIME missing CAP_WAKE_ALARM? : [UNSUPPORTED] CLOCK_REALTIME_ALARM ABSTIME missing CAP_WAKE_ALARM? : [UNSUPPORTED] CLOCK_REALTIME_ALARM RELTIME missing CAP_WAKE_ALARM? : [UNSUPPORTED] CLOCK_BOOTTIME_ALARM ABSTIME missing CAP_WAKE_ALARM? : [UNSUPPORTED] CLOCK_BOOTTIME_ALARM RELTIME missing CAP_WAKE_ALARM? : [UNSUPPORTED] CLOCK_BOOTTIME_ALARM ABSTIME missing CAP_WAKE_ALARM? : [UNSUPPORTED] CLOCK_BOOTTIME_ALARM RELTIME missing CAP_WAKE_ALARM? : [UNSUPPORTED] CLOCK_TAI ABSTIME PERIODIC timer fired early: 0 : [OK] CLOCK_TAI ABSTIME PERIODIC max latency: 183220 ns : [OK] CLOCK_TAI RELTIME PERIODIC timer fired early: 0 : [OK] CLOCK_TAI RELTIME PERIODIC max latency: 201380 ns : [OK] CLOCK_TAI ABSTIME ONE-SHOT timer fired early: 0 : [OK] CLOCK_TAI ABSTIME ONE-SHOT max latency: 117230 ns : [OK] CLOCK_TAI ABSTIME ONE-SHOT count: 1 : [OK] CLOCK_TAI RELTIME ONE-SHOT timer fired early: 0 : [OK] CLOCK_TAI RELTIME ONE-SHOT max latency: 154236 ns : [OK] CLOCK_TAI RELTIME ONE-SHOT count: 1 : [OK] Bail out! Pass 0 Fail 0 Xfail 0 Xpass 0 Skip 0 Error 0 1..0 thanks, -- Shuah