From patchwork Mon Mar 17 11:17:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 26344 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f199.google.com (mail-yk0-f199.google.com [209.85.160.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C1D6D202FE for ; Mon, 17 Mar 2014 11:17:29 +0000 (UTC) Received: by mail-yk0-f199.google.com with SMTP id 200sf30370206ykr.2 for ; Mon, 17 Mar 2014 04:17:29 -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:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=tdYSON+8jiC32LxNKXOlwJ4ureVXhI5/60aFl5aV3eI=; b=eAdS8ZWm26VxXSpMDoAUe8W7r8cZCDmI437A6cICVo5ggqL34cAulepMJlRe3a12DG J52UwG1nj4UMqvWD8+N6nWMmP/uYHGY4rUjCYVOsYaCL5qZJ3qON4jCjakezPDazF+3t ZOLxI6bmPXnMRbYhAdqATVTHSv/Hm4HofbbwVGKDKVHfh1sSOsgBVlVC2y9HLfTjXmiq bAMWyRQH1mTEu389KyyUKFUlm1fhZEQGomn6nz0j+UgITXxErLN4VbibrLWfnWyj6DdY 1bGz5oV1D1sCjf/wfpprEBruHbddzsnwXqI1kFfMEUDSCh0R19BfyRwAf9kiZMKaTa33 6S/A== X-Gm-Message-State: ALoCoQk5OWlNWBDwJpNYlC3iNon8Jp8JBZ/d99Y96Xq0NJCu7373YnI3LtxRLTqEvzPh5ej3WJ0E X-Received: by 10.58.57.39 with SMTP id f7mr8640059veq.36.1395055049288; Mon, 17 Mar 2014 04:17:29 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.89.70 with SMTP id u64ls884658qgd.80.gmail; Mon, 17 Mar 2014 04:17:29 -0700 (PDT) X-Received: by 10.52.166.103 with SMTP id zf7mr616522vdb.30.1395055049157; Mon, 17 Mar 2014 04:17:29 -0700 (PDT) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id y10si2718662vei.204.2014.03.17.04.17.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Mar 2014 04:17:29 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.173; Received: by mail-ve0-f173.google.com with SMTP id oy12so5597147veb.32 for ; Mon, 17 Mar 2014 04:17:29 -0700 (PDT) X-Received: by 10.220.88.204 with SMTP id b12mr19113130vcm.3.1395055049065; Mon, 17 Mar 2014 04:17:29 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp119062vck; Mon, 17 Mar 2014 04:17:28 -0700 (PDT) X-Received: by 10.68.112.164 with SMTP id ir4mr2805553pbb.153.1395055048139; Mon, 17 Mar 2014 04:17:28 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gj8si14092833pbc.354.2014.03.17.04.17.27; Mon, 17 Mar 2014 04:17:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932673AbaCQLR0 (ORCPT + 11 others); Mon, 17 Mar 2014 07:17:26 -0400 Received: from mail-wi0-f177.google.com ([209.85.212.177]:61872 "EHLO mail-wi0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932658AbaCQLRZ (ORCPT ); Mon, 17 Mar 2014 07:17:25 -0400 Received: by mail-wi0-f177.google.com with SMTP id cc10so1968149wib.4 for ; Mon, 17 Mar 2014 04:17:24 -0700 (PDT) X-Received: by 10.180.164.69 with SMTP id yo5mr7577725wib.55.1395055044551; Mon, 17 Mar 2014 04:17:24 -0700 (PDT) Received: from localhost.localdomain (AToulouse-654-1-306-199.w86-199.abo.wanadoo.fr. [86.199.89.199]) by mx.google.com with ESMTPSA id 19sm37388809wjy.17.2014.03.17.04.17.23 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Mar 2014 04:17:23 -0700 (PDT) From: Daniel Lezcano To: rjw@rjwysocki.net, lenb@kernel.org Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH] cpuidle: sysfs: Export target residency information Date: Mon, 17 Mar 2014 12:17:30 +0100 Message-Id: <1395055050-27729-1-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.lezcano@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , >From userspace, there is no way to know the target residency for each idle state. If we want to write tools to measure the accuracy of the idle state selection from the governor, we need this info. As the exit latency is exported through sysfs, exporting the target residency in the same place makes sense. Signed-off-by: Daniel Lezcano --- drivers/cpuidle/sysfs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c index e918b6d..efe2f17 100644 --- a/drivers/cpuidle/sysfs.c +++ b/drivers/cpuidle/sysfs.c @@ -293,6 +293,7 @@ static ssize_t show_state_##_name(struct cpuidle_state *state, \ } define_show_state_function(exit_latency) +define_show_state_function(target_residency) define_show_state_function(power_usage) define_show_state_ull_function(usage) define_show_state_ull_function(time) @@ -304,6 +305,7 @@ define_store_state_ull_function(disable) define_one_state_ro(name, show_state_name); define_one_state_ro(desc, show_state_desc); define_one_state_ro(latency, show_state_exit_latency); +define_one_state_ro(residency, show_state_target_residency); define_one_state_ro(power, show_state_power_usage); define_one_state_ro(usage, show_state_usage); define_one_state_ro(time, show_state_time); @@ -313,6 +315,7 @@ static struct attribute *cpuidle_state_default_attrs[] = { &attr_name.attr, &attr_desc.attr, &attr_latency.attr, + &attr_residency.attr, &attr_power.attr, &attr_usage.attr, &attr_time.attr,