From patchwork Wed Mar 25 23:44:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 46340 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7F8EC21584 for ; Wed, 25 Mar 2015 23:44:45 +0000 (UTC) Received: by wizj7 with SMTP id j7sf2142115wiz.0 for ; Wed, 25 Mar 2015 16:44:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=9DpHz4o4GYaKIWpcKPxjqVUAeswFmzmRnAsX+Fht9yk=; b=LaoDtJMU5JRcqTpl/ggRNV1HPruA+2knpGOQ80ViWqaRCyyyWwiwaEByFFmrFugTqj IF+OOvQlX5ZyR8CUgZovsHlJ1Ww7HHGyYZhWs1vyWpUMcPWVZbZyVZI3qZrosG/eTXXG GA5K9glKu++JRxkb1IvUFtKaXYctShxqs5v9Z30/LzaJeGqDXF2UigsoevJpSUUoJUYn cyXx3yHf+5TitPMcLfyLSHiTBG/1G4hk1gQnF9swn7Z6cwxThlDCQem0zk/1DIaQpgpY 6A9KgDZnwPlRHgJrImLpNvL7IsTO9nx4P8RrmApbJFSi7+EJG+frjg+g+1tUgeSkLJ6e YyFw== X-Gm-Message-State: ALoCoQlyolZ9Mo9xBMkklqAFn2BLN6DNRV55hNXwhLyGb3FNJpTTWxiswYe0qe143dQygw728aoW X-Received: by 10.152.4.229 with SMTP id n5mr2643039lan.1.1427327084712; Wed, 25 Mar 2015 16:44:44 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.4.38 with SMTP id cb6ls144998lad.97.gmail; Wed, 25 Mar 2015 16:44:44 -0700 (PDT) X-Received: by 10.112.54.165 with SMTP id k5mr10854701lbp.57.1427327084567; Wed, 25 Mar 2015 16:44:44 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id rr6si3232642lbb.7.2015.03.25.16.44.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Mar 2015 16:44:44 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by lbcmq2 with SMTP id mq2so29413841lbc.0 for ; Wed, 25 Mar 2015 16:44:44 -0700 (PDT) X-Received: by 10.152.43.51 with SMTP id t19mr10573332lal.73.1427327084132; Wed, 25 Mar 2015 16:44:44 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.57.201 with SMTP id k9csp270405lbq; Wed, 25 Mar 2015 16:44:43 -0700 (PDT) X-Received: by 10.66.144.36 with SMTP id sj4mr22134146pab.32.1427327082534; Wed, 25 Mar 2015 16:44:42 -0700 (PDT) Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com. [209.85.220.46]) by mx.google.com with ESMTPS id az1si5741312pbc.16.2015.03.25.16.44.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Mar 2015 16:44:42 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.46 as permitted sender) client-ip=209.85.220.46; Received: by pabxg6 with SMTP id xg6so44547344pab.0 for ; Wed, 25 Mar 2015 16:44:41 -0700 (PDT) X-Received: by 10.70.95.166 with SMTP id dl6mr21288582pdb.142.1427327081507; Wed, 25 Mar 2015 16:44:41 -0700 (PDT) Received: from localhost.localdomain (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id ok8sm3560807pdb.66.2015.03.25.16.44.40 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Mar 2015 16:44:40 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , Shuah Khan , Prarit Bhargava , Thomas Gleixner , Richard Cochran Subject: [PATCH 1/2] kselftests: timers: Make set-timer-lat fail more gracefully for !CAP_WAKE_ALARM Date: Wed, 25 Mar 2015 16:44:32 -0700 Message-Id: <1427327073-19011-1-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.9.1 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: john.stultz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 Cc: Prarit Bhargava Cc: Thomas Gleixner Cc: Richard Cochran Signed-off-by: John Stultz Signed-off-by: John Stultz --- 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 3ea2eff..dbc9537c 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; }