From patchwork Thu Feb 26 15:40:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: deepak.s@linux.intel.com X-Patchwork-Id: 5894231 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0C7F09F38E for ; Thu, 26 Feb 2015 15:43:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 24F85203A5 for ; Thu, 26 Feb 2015 15:43:52 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 547E820394 for ; Thu, 26 Feb 2015 15:43:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E85356E7F2; Thu, 26 Feb 2015 07:43:49 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 6B98F6E7E8 for ; Thu, 26 Feb 2015 07:43:45 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 26 Feb 2015 07:43:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,653,1418112000"; d="scan'208";a="672108529" Received: from deepu.iind.intel.com ([10.223.82.32]) by fmsmga001.fm.intel.com with ESMTP; 26 Feb 2015 07:43:43 -0800 From: deepak.s@linux.intel.com To: intel-gfx@lists.freedesktop.org Date: Thu, 26 Feb 2015 21:10:28 +0530 Message-Id: <1424965229-16691-2-git-send-email-deepak.s@linux.intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1424965229-16691-1-git-send-email-deepak.s@linux.intel.com> References: <1424965229-16691-1-git-send-email-deepak.s@linux.intel.com> Subject: [Intel-gfx] [PATCH 1/2] tests/pm_rc6_residency: Fix proper residency calculation X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Deepak S With current code we are not considering the RC6 residency during sysfs read. This is causing test to fail due to incorrect residency_accuracy check This patch consider code time spent for accuracy check Signed-off-by: Deepak S --- tests/pm_rc6_residency.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/pm_rc6_residency.c b/tests/pm_rc6_residency.c index 2658a89..1600ac3 100644 --- a/tests/pm_rc6_residency.c +++ b/tests/pm_rc6_residency.c @@ -37,6 +37,7 @@ #define SLEEP_DURATION 3000 // in milliseconds #define RC6_FUDGE 900 // in milliseconds +#define CODE_TIME 50 // in microseconfs static unsigned int readit(const char *path) { @@ -102,7 +103,7 @@ static void residency_accuracy(int value[],const char *name_of_rc6_residency) "the GPU is as idle as possible(ie. no X, " "running and running no other tests)\n"); - counter = ((double)value[1] - (double)value[0]) /(double) SLEEP_DURATION; + counter = ((double)value[1] - (double)value[0]) /(double) (SLEEP_DURATION + CODE_TIME); if( counter > 0.9 ){ counter_result = counter;