Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp491945ybl; Tue, 28 Jan 2020 06:48:15 -0800 (PST) X-Google-Smtp-Source: APXvYqzabWq2TWtTyq0q1G0w70fkKGPb76csbxOxgVeK4ilkJ+mGKZZqUd34owP+sGDXm5x2mQ6p X-Received: by 2002:a9d:4706:: with SMTP id a6mr15399137otf.331.1580222895558; Tue, 28 Jan 2020 06:48:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580222895; cv=none; d=google.com; s=arc-20160816; b=PmAoXkN7kcDvL5qSOoF/Gq9/OlaBCMO2Bn9NN0BEkO4dKte7UK5b3Hb1wOQG3+TUob n2L6MGvTdBTvnAsa5i0mvgvItzrHefxXhykny+R+u/JqF0bDY/5Di+bcRLOoJ6KKPz/M Szcn9OUtaXXekKtqp7eFUfEdPzF2AF91oXLMyntGHcKUf2I7p/2VrpM7JB1Zj5j1ea+z 6YOtNE1kp+iKE9LxGQBm+qbUJ8f7k6Ag8oscyh6OzaZWQxwsQNi81bvnuS1VMuc7DlG+ IghVkp6BpjKp+9TGvqFtlS1SfpG9nvUEsh4NgQCrEG1TlA/ZEHnf31ic+3dxPDBGuFdD HGKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kaVvC7ycGesstWLUMYgbZe/yNbWRzHFq93Rk4SecfTs=; b=khLFEmCn1Qjvtt9N61z0SownlZMFjvhTeO+VFm2Yppv8yLFH5Nk2jL6YyEx1vzpDrC PD+olQANHx9U0fGgr/d7U+N3MAhZOJJJwO4DdwKcnf7uPPRW4J3JqOQIlIg/ByweMTIZ iRftQbeqVB7tMf0m9XRYLc55/SRYnob5kZgRaaE3mYp9Whwrhqj7i8SMuTQx22H8c03k yUNGyxzLXT+E4RHccro7wt+3ZtyC2hhzgQvgvxXVGSdKq5tWeRZgCxFCWFXZ3CU0eRcZ A71E5q/YIVJhvxqISmJpWAhwYr4yIiBhcXyoBmzMJ5cv6q0AQsT+t4wvyqQPeB4DPj4h uCIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=x9h9lfFu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h18si2110419otk.227.2020.01.28.06.48.03; Tue, 28 Jan 2020 06:48:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=x9h9lfFu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730724AbgA1OUq (ORCPT + 99 others); Tue, 28 Jan 2020 09:20:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:45642 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730676AbgA1OUj (ORCPT ); Tue, 28 Jan 2020 09:20:39 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 79DF721739; Tue, 28 Jan 2020 14:20:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580221238; bh=M+PUZmZsdhjRf7ZRL8gzs8BS3+3m8JGyHtXIXr7cI0I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x9h9lfFuUrSO+aOs4ulIt18UL1ptMRkJq8Te2BVjS95sjc9bjNQ6zVWd0oowAQgsQ ia6Kl/igdPAiYRqNDMoAp2KMXXWSrmrTogZygCBJvcXHTcJ7Vi/JwZL8eXPocBskvf cWQDLNES4PukIiOy3+k5sKmQdyzgw4uI45ROxRtE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Matthias Kaehlcke , Daniel Lezcano , Javi Merino , Viresh Kumar , Eduardo Valentin , Sasha Levin Subject: [PATCH 4.9 143/271] thermal: cpu_cooling: Actually trace CPU load in thermal_power_cpu_get_power Date: Tue, 28 Jan 2020 15:04:52 +0100 Message-Id: <20200128135903.208053628@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200128135852.449088278@linuxfoundation.org> References: <20200128135852.449088278@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Matthias Kaehlcke [ Upstream commit bf45ac18b78038e43af3c1a273cae4ab5704d2ce ] The CPU load values passed to the thermal_power_cpu_get_power tracepoint are zero for all CPUs, unless, unless the thermal_power_cpu_limit tracepoint is enabled too: irq/41-rockchip-98 [000] .... 290.972410: thermal_power_cpu_get_power: cpus=0000000f freq=1800000 load={{0x0,0x0,0x0,0x0}} dynamic_power=4815 vs irq/41-rockchip-96 [000] .... 95.773585: thermal_power_cpu_get_power: cpus=0000000f freq=1800000 load={{0x56,0x64,0x64,0x5e}} dynamic_power=4959 irq/41-rockchip-96 [000] .... 95.773596: thermal_power_cpu_limit: cpus=0000000f freq=408000 cdev_state=10 power=416 There seems to be no good reason for omitting the CPU load information depending on another tracepoint. My guess is that the intention was to check whether thermal_power_cpu_get_power is (still) enabled, however 'load_cpu != NULL' already indicates that it was at least enabled when cpufreq_get_requested_power() was entered, there seems little gain from omitting the assignment if the tracepoint was just disabled, so just remove the check. Fixes: 6828a4711f99 ("thermal: add trace events to the power allocator governor") Signed-off-by: Matthias Kaehlcke Reviewed-by: Daniel Lezcano Acked-by: Javi Merino Acked-by: Viresh Kumar Signed-off-by: Eduardo Valentin Signed-off-by: Sasha Levin --- drivers/thermal/cpu_cooling.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c index f49d2989d0005..984e5f5141403 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c @@ -607,7 +607,7 @@ static int cpufreq_get_requested_power(struct thermal_cooling_device *cdev, load = 0; total_load += load; - if (trace_thermal_power_cpu_limit_enabled() && load_cpu) + if (load_cpu) load_cpu[i] = load; i++; -- 2.20.1