Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1742019yba; Thu, 9 May 2019 23:43:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqzMsPVW4FY2TotEJTyMVZzQY6crXVfOIuaHf59ZyPf02VRGhLUaoJm0iTKwGmFE6OK7rUKG X-Received: by 2002:aa7:93bb:: with SMTP id x27mr11565534pff.104.1557470633628; Thu, 09 May 2019 23:43:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557470633; cv=none; d=google.com; s=arc-20160816; b=R7hWNtTIT2EO6xAmGVcRzl1wMt/6m6MTtti7baYLZIJsWN90mQBTXzpMcaItmVzRUJ 2qy0rJWxm2r+T3gz4DyDiLqQJKZvDGuAATVQS7tk9IIoa9HwkeYXYf0coKt+BRr2ZkWI 270GTiUiZQzPyCL6fu0G+P4xV2raQK0mnRZ/ryyzOC5vXbZeMp24onOxEqhctndjnjrH 2lKvSGjXjXKJVJEtyMxeTf59T/vvDH2eqG9jn0/rGI67PPNVYl3G2pZQfN3bA1VDae5S 1JXTHOcblxCsEdvcmN9538U6y+NTiX3ZSgBf51svKid6ZPIK2MPNgfHUoIgMlEQfk8pc VGcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=cVET4/9VEsoCcizpYYKFH4n+sy/V1MxHnMW8LTHhZfg=; b=QiXjTQX0yFEPHDZ/eJnKmhNOUO6YVKYBlYO3GkOgXAU3NmXQZf7xZruFl4g8jS6cn8 pJK106ErjT22Ta/V4ln5Ge2n1gQyuIRUUtz9L4WvNraUrK6gFKHEjdhei/KiBrD4V8v2 MtcunAyHtRaSEwJh4k97U/7bJ//9zNAZZgb9SQoufMSGE8BYJsVUWAvXRHqnpcarFKmH RxB6JBXi29O79PPHWTDdunTz+D0mOEmFZN27S0wDAJL/ts145gALaL2LbIWg4SjMPEd3 PMvaArl4kKI+kjf9Ue5lWRq/Z1pd6Xy9wQi2bB3nNhiE+6bFX01L2If2J1Cj2HpZ3oL/ j9BA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aC8u2hYR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a9si6172067pgw.14.2019.05.09.23.43.37; Thu, 09 May 2019 23:43:53 -0700 (PDT) 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=@linaro.org header.s=google header.b=aC8u2hYR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727066AbfEJGmu (ORCPT + 99 others); Fri, 10 May 2019 02:42:50 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:35967 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726940AbfEJGmu (ORCPT ); Fri, 10 May 2019 02:42:50 -0400 Received: by mail-pg1-f196.google.com with SMTP id a3so2518135pgb.3 for ; Thu, 09 May 2019 23:42:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=cVET4/9VEsoCcizpYYKFH4n+sy/V1MxHnMW8LTHhZfg=; b=aC8u2hYRX4tsUez/u0xmNE7+uVk5cv7e8jNX9ogNqizuaN6/WHmJWCRz/rp3UDDHmH Wyn+2xK24//ospIkqqhWogp9vWbfgSek9MQ1eRjnqctK7NG8+kTIdUBZ9w9T1qNjy02H xa0H0lX0WY9FNenlLh2pT3BXErU6176dsBznn4VCggHpBzu9HgJ3iuVI/ZWcAGGeETdi ZQHnozRKcTPoxaJ8WdYUzekaMqeEmayyJ9yI02O8P0oWMcTLT3FaRddu48HkP6RPE/sT rZyW2QA7hErFTKVtXSn8QXBCkPCvTna+mWEGd/RU4YfL9smybzbhZltRG1mstb7796DG sQVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=cVET4/9VEsoCcizpYYKFH4n+sy/V1MxHnMW8LTHhZfg=; b=CH2K97/owjIkDPW9ojyjZlZVhUWSAesL6kAKkuEtdrqL2T34uELJigGAFp9u8teXPU eXbtoLmhP/S6oIfS/0Hx5y0AnnAy3eyRdV+4iTUMtg9w/v+l+0Ii1kGYnOaXJUHAoKa6 wZQujvU47aS9giSNcLw2PB1mRGV/VZtBbJnMEnbe/5de0Yy6G5ftMdF/Xn58e7KnxP1m 3Kw3fzntzT7P0dP2HPqLg4q1Tq1O03Kv6ZFKHitXkP/sKe29LYtfrm+Xv9SVEdTNzMO7 rXVghbtYkPROYocnATcyOCO9NC1e0M/edpDpiVUybDeXiM+G66Qhsg7xjQOt44ppIMpV bZgA== X-Gm-Message-State: APjAAAVa1g+nqNZvCY21j8c986b4U7xpFMzsNEfpj0TAZ+f8xRkT5SIu HxLwnYlyPuTCxjo+bYYhAmp7pw== X-Received: by 2002:a62:2687:: with SMTP id m129mr11991540pfm.204.1557470569520; Thu, 09 May 2019 23:42:49 -0700 (PDT) Received: from localhost ([122.172.118.99]) by smtp.gmail.com with ESMTPSA id s11sm5733051pga.36.2019.05.09.23.42.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 May 2019 23:42:48 -0700 (PDT) Date: Fri, 10 May 2019 12:12:46 +0530 From: Viresh Kumar To: Matthias Kaehlcke Cc: Amit Daniel Kachhap , Javi Merino , Zhang Rui , Eduardo Valentin , Daniel Lezcano , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Douglas Anderson Subject: Re: [PATCH] thermal: cpu_cooling: Actually trace CPU load in thermal_power_cpu_get_power Message-ID: <20190510064246.fanpmhdlbtpngzor@vireshk-i7> References: <20190502183238.182058-1-mka@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190502183238.182058-1-mka@chromium.org> User-Agent: NeoMutt/20180716-391-311a52 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02-05-19, 11:32, Matthias Kaehlcke wrote: > 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 > --- > 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 f7c1f49ec87f..b437804e099b 100644 > --- a/drivers/thermal/cpu_cooling.c > +++ b/drivers/thermal/cpu_cooling.c > @@ -458,7 +458,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++; Acked-by: Viresh Kumar -- viresh