From patchwork Wed Nov 20 05:53:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 21645 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 27B0723A4E for ; Wed, 20 Nov 2013 05:54:00 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id wm4sf10505245obc.11 for ; Tue, 19 Nov 2013 21:54:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe:content-type :content-transfer-encoding; bh=7EXMwAS37r0/rMjbF5KHL9K0S0NpmiJFoFSP19wDKVA=; b=N4bdIhtPNWzPJSsIdO7JRMipQ82okoF6HTRRfTUlpwGW5lRfF1ylsrmrMhCEF3+z2p XNquaioQC09motPmp/CkBQvMhdJTE+Bmd6CM6ayvVNDpoYeqYQppKlJVoxR8esum6kXU 4YlMb0v19d3SajieMxWthbDTChXDko3A1q4Tsh7UeCwg0PaXHTkn7TBD/ucY+lbzm5pE Mwyakxbv6W1iUkNy1WAT/WWeJXLXtm8moiiSC7orOJtrfyHpKKnAdH7WjcZoevgixqlL JKMJlnVMUr1MK2M887VchuukCQG/vHjOZKn7695GFurEkXZnZ0E+3GQm8fWg2wwVtbKc FezA== X-Gm-Message-State: ALoCoQkl62e9Yv9a5uf3XYKJBsE3WJMeX/pdFuObBtcwCKX+jkm1S+orJJJ/il6pOJDK8nXpiZ/U X-Received: by 10.42.136.136 with SMTP id u8mr1817170ict.16.1384926840326; Tue, 19 Nov 2013 21:54:00 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.3.129 with SMTP id c1ls3409534qec.84.gmail; Tue, 19 Nov 2013 21:54:00 -0800 (PST) X-Received: by 10.220.159.4 with SMTP id h4mr24353046vcx.1.1384926840148; Tue, 19 Nov 2013 21:54:00 -0800 (PST) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id e3si9002642vek.17.2013.11.19.21.53.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Nov 2013 21:53:59 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.177; Received: by mail-vc0-f177.google.com with SMTP id hv10so2432641vcb.22 for ; Tue, 19 Nov 2013 21:53:59 -0800 (PST) X-Received: by 10.58.46.18 with SMTP id r18mr25125454vem.4.1384926839819; Tue, 19 Nov 2013 21:53:59 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp330367vcz; Tue, 19 Nov 2013 21:53:59 -0800 (PST) X-Received: by 10.224.137.130 with SMTP id w2mr49482539qat.43.1384926838654; Tue, 19 Nov 2013 21:53:58 -0800 (PST) Received: from mail-qe0-f50.google.com (mail-qe0-f50.google.com [209.85.128.50]) by mx.google.com with ESMTPS id s9si6953037qak.113.2013.11.19.21.53.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Nov 2013 21:53:58 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.50 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.128.50; Received: by mail-qe0-f50.google.com with SMTP id 1so5953708qee.9 for ; Tue, 19 Nov 2013 21:53:58 -0800 (PST) X-Received: by 10.224.37.72 with SMTP id w8mr49011227qad.33.1384926838487; Tue, 19 Nov 2013 21:53:58 -0800 (PST) Received: from [127.0.0.1] (git.linaro.org. [54.235.93.228]) by mx.google.com with ESMTPSA id k14sm54248413qen.4.2013.11.19.21.53.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Nov 2013 21:53:57 -0800 (PST) Message-ID: <528C4E6F.20507@linaro.org> Date: Wed, 20 Nov 2013 11:23:51 +0530 From: viresh kumar User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: rjw@rjwysocki.net CC: linaro-kernel@lists.linaro.org, patches@linaro.org, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, nm@ti.com, shawn.guo@linaro.org, ceh@ti.com, Viresh Kumar Subject: Re: [PATCH] cpufreq/stats: Add "unknown" frequency field in stats tables References: In-Reply-To: X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On Tuesday 19 November 2013 11:10 AM, Viresh Kumar wrote: > diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c > index 4cf0d28..ebb21cd 100644 > --- a/drivers/cpufreq/cpufreq_stats.c > +++ b/drivers/cpufreq/cpufreq_stats.c > @@ -72,9 +72,13 @@ static ssize_t show_time_in_state(struct cpufreq_policy *policy, char *buf) > return 0; > cpufreq_stats_update(stat->cpu); > for (i = 0; i < stat->state_num; i++) { > - len += sprintf(buf + len, "%u %llu\n", stat->freq_table[i], > - (unsigned long long) > - jiffies_64_to_clock_t(stat->time_in_state[i])); > + if (stat->freq_table[i] == -1) > + return sprintf(buf + len, "unknown"); > + else > + return sprintf(buf + len, "%u", stat->freq_table[i]); > + > + len += sprintf(buf + len, " %llu\n", (unsigned long long) > + jiffies_64_to_clock_t(stat->time_in_state[i])); > } > return len; Somehow I forgot to add below fix with this patch, which I have tested at that time. jiffies_64_to_clock_t(stat->time_in_state[i])); diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c index ebb21cd..89012d1 100644 --- a/drivers/cpufreq/cpufreq_stats.c +++ b/drivers/cpufreq/cpufreq_stats.c @@ -73,9 +73,9 @@ static ssize_t show_time_in_state(struct cpufreq_policy *policy, char *buf) cpufreq_stats_update(stat->cpu); for (i = 0; i < stat->state_num; i++) { if (stat->freq_table[i] == -1) - return sprintf(buf + len, "unknown"); + len+= sprintf(buf + len, "unknown"); else - return sprintf(buf + len, "%u", stat->freq_table[i]); + len+= sprintf(buf + len, "%u", stat->freq_table[i]); len += sprintf(buf + len, " %llu\n", (unsigned long long)