From patchwork Fri Nov 4 16:55:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Mayer X-Patchwork-Id: 9412915 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CDDD86022E for ; Fri, 4 Nov 2016 16:56:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BCF772909A for ; Fri, 4 Nov 2016 16:56:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AF27D2AF25; Fri, 4 Nov 2016 16:56:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1AAD82909A for ; Fri, 4 Nov 2016 16:56:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933685AbcKDQ4V (ORCPT ); Fri, 4 Nov 2016 12:56:21 -0400 Received: from smtp-out-no.shaw.ca ([64.59.134.13]:51418 "EHLO smtp-out-no.shaw.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932283AbcKDQ4U (ORCPT ); Fri, 4 Nov 2016 12:56:20 -0400 Received: from triton.mmayer.net ([70.71.160.251]) by shaw.ca with SMTP id 2hmscnhDcc4x72hmtcCryd; Fri, 04 Nov 2016 10:56:20 -0600 X-Authority-Analysis: v=2.2 cv=WohbCZXv c=1 sm=1 tr=0 a=6xzog4CasRozao6qlzTIAw==:117 a=6xzog4CasRozao6qlzTIAw==:17 a=L24OOQBejmoA:10 a=Q-fNiiVtAAAA:8 a=fCiJrds_p3HdgpqkWIYA:9 a=Fp8MccfUoT0GBdDC_Lng:22 Received: by triton.mmayer.net (Postfix, from userid 501) id 927E12AE4ABB; Fri, 4 Nov 2016 09:56:18 -0700 (PDT) From: Markus Mayer To: Viresh Kumar , "Rafael J . Wysocki" Cc: Power Management List , Broadcom Kernel List , Linux Kernel Mailing List , Markus Mayer Subject: [PATCH v2 2/2] cpufreq: stats: clear statistics Date: Fri, 4 Nov 2016 09:55:36 -0700 Message-Id: <20161104165536.20088-3-code@mmayer.net> X-Mailer: git-send-email 2.9.2 In-Reply-To: <20161104165536.20088-1-code@mmayer.net> References: <20161104165536.20088-1-code@mmayer.net> X-CMAE-Envelope: MS4wfIL18LaF9+uePx9njS6AoHDN/8hn/HQ698s8FMHhyVt61mUbcmGFPmE7xcN98zGODW2+7GKgVKKNT5J9lqmufojsKMZ0Hbe9ZWEsTUoV+q9NesjVNXJD 4mrv0EWPBYI4BNMTXYdRF9NArrX2bBpa/zbCBd4QOU+y0at9kL/kE2wKsoZ1T5FGQrmv5aicv20C50mtlP7VOQQBYCG+LuI3Di+t4yanPGNJvvgFr0k4xcX4 cp913jxMguFMnGyg2W4NWU/OESQbXdZOtf76xq4JWvj2kPmdmOonsATKZVNCeGcVJueZdkLy5cCjeEPjJ4jZcOIeOG+sGrL+NZZWyTmDvADYmRfFyaAnJFIq leKVsX7XGev2tLiC+jdUa0HOnE6w9Q== Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Mayer Allow CPUfreq statistics to be cleared by writing anything to /sys/.../cpufreq/stats/reset. Signed-off-by: Markus Mayer --- Documentation/cpu-freq/cpufreq-stats.txt | 6 ++++++ drivers/cpufreq/cpufreq_stats.c | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/Documentation/cpu-freq/cpufreq-stats.txt b/Documentation/cpu-freq/cpufreq-stats.txt index 8d9773f..3c355f6 100644 --- a/Documentation/cpu-freq/cpufreq-stats.txt +++ b/Documentation/cpu-freq/cpufreq-stats.txt @@ -44,11 +44,17 @@ the stats driver insertion. total 0 drwxr-xr-x 2 root root 0 May 14 16:06 . drwxr-xr-x 3 root root 0 May 14 15:58 .. +--w------- 1 root root 4096 May 14 16:06 reset -r--r--r-- 1 root root 4096 May 14 16:06 time_in_state -r--r--r-- 1 root root 4096 May 14 16:06 total_trans -r--r--r-- 1 root root 4096 May 14 16:06 trans_table -------------------------------------------------------------------------------- +- reset +Write-only attribute that can be used to reset the stat counters. This can be +useful for evaluating system behaviour under different governors without the +need for a reboot. + - time_in_state This gives the amount of time spent in each of the frequencies supported by this CPU. The cat output will have "