Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4486480pxj; Tue, 22 Jun 2021 01:03:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMO5kOfotPGTCpYdcPBXFbrKgn/s94Tmv6RvOxsUisAWcUGvp13NDTxtnx9RcBXkQBklMb X-Received: by 2002:a17:906:dbec:: with SMTP id yd12mr2657155ejb.102.1624349022350; Tue, 22 Jun 2021 01:03:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624349022; cv=none; d=google.com; s=arc-20160816; b=ECj/eKKvwXy8gVTKSja3qWPzp7XGj6ve6rMsQRmZNFBpRwzlUifjqd3jcixwWthy0L eqNVAoeAdKI07qvksJS+7Fui0okSBzmf0hbRUp5zdKRo1U5EkKV2Q6gSJ4VtfixURE5Y 8YfKy8j7MAxd5CSKpfYXoQLa9PaHG3XA7T5WmM1vvmOkesVrA2jZ+cCRQFGXB7LuaVdM qFy9HhzvTt0ylY4yl4FJLbPmQHyWISJ/rS65p883+JW2fnDeN1StKA/fipkmc1IRxegc 6OPATFw7WpfpTK1h88au9IIvIZb3E60uaPNoa3iBrIzLrcO4cctpyeEjpPjEjuiGm5h5 i/Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=cKnVQVVEWYhKR6y04fKULU9WM3QW3KBmnui4h1ub7Kc=; b=Ga5luMqKtB1Rd0wsWtiqyLLsTrYR/T93uhPdSQw4N09WAiYx35g1nqoKItS/TYtjlK rhJKGkDn0ys0HEwverUZcg+nS9kzgF4Zv3cfO82YriL954X9E0ZzCTKDsfnvZEIp1Lph iP/9AbjTR4jtM7IjDWtbvOTG5uPEffph6E1h83WaGHssgmTD/fkzUjJ728+m0Y0VN6O4 sv5A9QwVZcBLGDSgnl4maAPWruA7Wy5Y8hHCJC2v++pVnlzCafZp3ZOuoQS4E+JZ4tqL +QOhdp4jWnqHS4QRHhBp3LzhqsrsNjXHvIdl48Xpi3TsWW8mC7MF7C3yRLgAtAnAzxWi Oa9g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v4si21404897edj.103.2021.06.22.01.03.15; Tue, 22 Jun 2021 01:03:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230377AbhFVICJ (ORCPT + 99 others); Tue, 22 Jun 2021 04:02:09 -0400 Received: from foss.arm.com ([217.140.110.172]:44126 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230384AbhFVIB7 (ORCPT ); Tue, 22 Jun 2021 04:01:59 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 58874D6E; Tue, 22 Jun 2021 00:59:44 -0700 (PDT) Received: from e123648.arm.com (unknown [10.57.9.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 279F43F718; Tue, 22 Jun 2021 00:59:42 -0700 (PDT) From: Lukasz Luba To: linux-kernel@vger.kernel.org, daniel.lezcano@linaro.org Cc: linux-pm@vger.kernel.org, amitk@kernel.org, rui.zhang@intel.com, lukasz.luba@arm.com, dietmar.eggemann@arm.com, Chris.Redpath@arm.com, Beata.Michalska@arm.com, viresh.kumar@linaro.org, rjw@rjwysocki.net, amit.kachhap@gmail.com Subject: [RFC PATCH 3/4] cpufreq: Add Active Stats calls tracking frequency changes Date: Tue, 22 Jun 2021 08:59:24 +0100 Message-Id: <20210622075925.16189-4-lukasz.luba@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210622075925.16189-1-lukasz.luba@arm.com> References: <20210622075925.16189-1-lukasz.luba@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The Active Stats framework tracks and accounts the activity of the CPU for each performance level. It accounts the real residency, when the CPU was not idle, at a given performance level. This patch adds needed calls which provide the CPU frequency transition events to the Active Stats framework. Signed-off-by: Lukasz Luba --- drivers/cpufreq/cpufreq.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 802abc925b2a..d79cb9310572 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -14,6 +14,7 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +#include #include #include #include @@ -387,6 +388,8 @@ static void cpufreq_notify_transition(struct cpufreq_policy *policy, cpufreq_stats_record_transition(policy, freqs->new); policy->cur = freqs->new; + + active_stats_cpu_freq_change(policy->cpu, freqs->new); } } @@ -2085,6 +2088,8 @@ unsigned int cpufreq_driver_fast_switch(struct cpufreq_policy *policy, policy->cpuinfo.max_freq); cpufreq_stats_record_transition(policy, freq); + active_stats_cpu_freq_fast_change(policy->cpu, freq); + if (trace_cpu_frequency_enabled()) { for_each_cpu(cpu, policy->cpus) trace_cpu_frequency(freq, cpu); -- 2.17.1