From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC268C4742C for ; Tue, 10 Nov 2020 12:53:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 997882065E for ; Tue, 10 Nov 2020 12:53:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730391AbgKJMxL (ORCPT ); Tue, 10 Nov 2020 07:53:11 -0500 Received: from mx2.suse.de ([195.135.220.15]:60656 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726721AbgKJMxK (ORCPT ); Tue, 10 Nov 2020 07:53:10 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id A4F4CABDE; Tue, 10 Nov 2020 12:53:09 +0000 (UTC) From: Thomas Renninger To: Rafael Wysocki , Viresh Kumar , Jonathan Corbet , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , Shuah Khan , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] cpufreq: stats: Switch to ktime and msec instead of jiffies and usertime Date: Tue, 10 Nov 2020 13:53:08 +0100 Message-ID: <1832747.5iOEhN7m9D@c100> In-Reply-To: <0e0fb542b6f6b26944cb2cf356041348aeac95f6.1605006378.git.viresh.kumar@linaro.org> References: <0e0fb542b6f6b26944cb2cf356041348aeac95f6.1605006378.git.viresh.kumar@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Dienstag, 10. November 2020, 12:07:37 CET schrieb Viresh Kumar: > The cpufreq and thermal core, both provide sysfs statistics to help > userspace learn about the behavior of frequencies and cooling states. > > This is how they look: > /sys/devices/system/cpu/cpufreq/policy0/stats/time_in_state:1200000 399 > The results look like this after this commit: > /sys/devices/system/cpu/cpufreq/policy0/stats/time_in_state:1200000 3830 How would userspace know whether it's ms or 10ms? whatabout a new file with the same convention as cooling devices (adding ms): > /sys/class/thermal/cooling_device0/stats/time_in_state_ms:state0 3888 > /sys/devices/system/cpu/cpufreq/policy0/stats/time_in_state_ms:1200000 3830 Somewhat off-topic, some ideas: I wonder how useful these stats still are. CPU_FREQ_STAT is off on my system: config CPU_FREQ_STAT bool "CPU frequency transition statistics" help Export CPU frequency statistics information through sysfs. If in doubt, say N. Iirc this was a module at former times? commit 1aefc75b2449eb68a6fc3ca932e2a4ee353b748d Author: Rafael J. Wysocki Date: Tue May 31 22:14:44 2016 +0200 cpufreq: stats: Make the stats code non-modular outlined 2 problems with cpufreq_stats being non-modular, but also seem to fix them up: ... and drop the notifiers from it Make the stats sysfs attributes appear empty if fast frequency switching is enabled... Thomas