From patchwork Fri Jun 7 05:12:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 17657 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f69.google.com (mail-yh0-f69.google.com [209.85.213.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2F58125E33 for ; Fri, 7 Jun 2013 05:13:13 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id b12sf2501211yha.8 for ; Thu, 06 Jun 2013 22:13:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=vv8eGacOnhIAyfRIdIRr1A/v3MUDo1emeUUHe7+WXTo=; b=N54kdNXZznWqwjCbb29O9aWAgb3w6kQn0UP09beFKLP6hWqanaO5HZv2SqxeJGkFM7 gweltdgNeS/iJdKkuzFQ5Wy1mLs5L+simf7+0HxbDZT7W9FLF3YhYld93Mz+kx5hDii/ l+TN0IWV91YsvVYIUgza/TDrafracsBue/76D5PvT/Dp9e+ETpF4ZTPu41wSeN7c3qNm SO6s0Fe3yu763iQmu2HNk1YYEKTDhAVZbjByrJbOutWPVp2nKnTJ7i7CqyLS9u6NgDuS i5zLfRSuKRHWBcum5EJK2K43+majKM5cgUetmh6dGWunzGV5MeP2z4r0uFKXVPzM1unG uP0A== X-Received: by 10.224.165.143 with SMTP id i15mr632263qay.0.1370581991731; Thu, 06 Jun 2013 22:13:11 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.29.74 with SMTP id i10ls1613384qeh.76.gmail; Thu, 06 Jun 2013 22:13:11 -0700 (PDT) X-Received: by 10.52.21.227 with SMTP id y3mr19633979vde.49.1370581991350; Thu, 06 Jun 2013 22:13:11 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id ha3si2084676vdb.147.2013.06.06.22.13.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Jun 2013 22:13:11 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.181 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.181; Received: by mail-vc0-f181.google.com with SMTP id lf11so1759332vcb.12 for ; Thu, 06 Jun 2013 22:13:11 -0700 (PDT) X-Received: by 10.58.29.42 with SMTP id g10mr391749veh.59.1370581991134; Thu, 06 Jun 2013 22:13:11 -0700 (PDT) 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.221.10.206 with SMTP id pb14csp97932vcb; Thu, 6 Jun 2013 22:13:10 -0700 (PDT) X-Received: by 10.68.252.227 with SMTP id zv3mr42713134pbc.14.1370581989756; Thu, 06 Jun 2013 22:13:09 -0700 (PDT) Received: from mail-pb0-x235.google.com (mail-pb0-x235.google.com [2607:f8b0:400e:c01::235]) by mx.google.com with ESMTPS id nc20si650356pab.92.2013.06.06.22.13.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Jun 2013 22:13:09 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c01::235 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=2607:f8b0:400e:c01::235; Received: by mail-pb0-f53.google.com with SMTP id xb12so4131126pbc.26 for ; Thu, 06 Jun 2013 22:13:09 -0700 (PDT) X-Received: by 10.66.121.193 with SMTP id lm1mr1015687pab.138.1370581989153; Thu, 06 Jun 2013 22:13:09 -0700 (PDT) Received: from localhost ([122.167.67.123]) by mx.google.com with ESMTPSA id ix3sm5423701pbc.37.2013.06.06.22.13.03 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 06 Jun 2013 22:13:08 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, robin.randhawa@arm.com, Steve.Bannister@arm.com, Liviu.Dudau@arm.com, charles.garcia-tobin@arm.com, arvind.chauhan@arm.com, cw00.choi@samsung.com, Viresh Kumar Subject: [PATCH] cpufreq: stats: Remove CONFIG_CPU_FREQ_STAT_DETAILS Date: Fri, 7 Jun 2013 10:42:57 +0530 Message-Id: <1683304a60f5188dc7f94e1a7797f12a4d1b47ab.1370581794.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e X-Gm-Message-State: ALoCoQk1UpfxwKMLz1TMlG6b3cEIdMpJMPUQsnYW2FZUt17F99KdyJHXYNB1qpaNQGja//1/FXMW X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.181 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: , Current cpufreq stats has got three parts: time_in_state, total_trans and trans_table. trans_table was present under a separate macro's from others: CONFIG_CPU_FREQ_STAT_DETAILS The reason quoted for that was: - trans_table goes against the traditional /sysfs rule of one value per interface. It provides a whole bunch of value in a 2 dimensional matrix form. I don't understand how necessary it is to keep trans_table inside a separate macro. These are all cpufreq sysfs stats, probably it doesn't matter if its one dimensional or two. Lets remove CONFIG_CPU_FREQ_STAT_DETAILS and use CONFIG_CPU_FREQ_STAT only to make code more cleaner (i.e. remove unnecessary macros). Signed-off-by: Viresh Kumar --- Documentation/cpu-freq/cpufreq-stats.txt | 18 ++++-------------- arch/mips/configs/lemote2f_defconfig | 1 - arch/powerpc/configs/ppc6xx_defconfig | 1 - arch/sh/configs/sh7785lcr_32bit_defconfig | 1 - drivers/cpufreq/Kconfig | 9 --------- drivers/cpufreq/cpufreq_stats.c | 12 ------------ 6 files changed, 4 insertions(+), 38 deletions(-) diff --git a/Documentation/cpu-freq/cpufreq-stats.txt b/Documentation/cpu-freq/cpufreq-stats.txt index fc64749..838f990 100644 --- a/Documentation/cpu-freq/cpufreq-stats.txt +++ b/Documentation/cpu-freq/cpufreq-stats.txt @@ -111,18 +111,8 @@ Config Main Menu cpufreq-stats. "CPU frequency translation statistics" (CONFIG_CPU_FREQ_STAT) provides the -basic statistics which includes time_in_state and total_trans. - -"CPU frequency translation statistics details" (CONFIG_CPU_FREQ_STAT_DETAILS) -provides fine grained cpufreq stats by trans_table. The reason for having a -separate config option for trans_table is: -- trans_table goes against the traditional /sysfs rule of one value per - interface. It provides a whole bunch of value in a 2 dimensional matrix - form. - -Once these two options are enabled and your CPU supports cpufrequency, you -will be able to see the CPU frequency statistics in /sysfs. - - - +statistics which includes time_in_state, total_trans and fine grained cpufreq +stats by trans_table. +Once this option is enabled and your CPU supports cpufrequency, you will be able +to see the CPU frequency statistics in /sysfs. diff --git a/arch/mips/configs/lemote2f_defconfig b/arch/mips/configs/lemote2f_defconfig index 343bebc..f9229e9 100644 --- a/arch/mips/configs/lemote2f_defconfig +++ b/arch/mips/configs/lemote2f_defconfig @@ -41,7 +41,6 @@ CONFIG_PM_RUNTIME=y CONFIG_CPU_FREQ=y CONFIG_CPU_FREQ_DEBUG=y CONFIG_CPU_FREQ_STAT=m -CONFIG_CPU_FREQ_STAT_DETAILS=y CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y CONFIG_CPU_FREQ_GOV_POWERSAVE=m CONFIG_CPU_FREQ_GOV_USERSPACE=m diff --git a/arch/powerpc/configs/ppc6xx_defconfig b/arch/powerpc/configs/ppc6xx_defconfig index be1cb6e..bb7664c 100644 --- a/arch/powerpc/configs/ppc6xx_defconfig +++ b/arch/powerpc/configs/ppc6xx_defconfig @@ -58,7 +58,6 @@ CONFIG_GEF_SBC610=y CONFIG_CPU_FREQ=y CONFIG_CPU_FREQ_DEBUG=y CONFIG_CPU_FREQ_STAT=m -CONFIG_CPU_FREQ_STAT_DETAILS=y CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y CONFIG_CPU_FREQ_GOV_PERFORMANCE=y CONFIG_CPU_FREQ_GOV_POWERSAVE=m diff --git a/arch/sh/configs/sh7785lcr_32bit_defconfig b/arch/sh/configs/sh7785lcr_32bit_defconfig index 9bdcf72..7ce136d 100644 --- a/arch/sh/configs/sh7785lcr_32bit_defconfig +++ b/arch/sh/configs/sh7785lcr_32bit_defconfig @@ -25,7 +25,6 @@ CONFIG_SH_SH7785LCR=y CONFIG_NO_HZ=y CONFIG_HIGH_RES_TIMERS=y CONFIG_CPU_FREQ=y -CONFIG_CPU_FREQ_STAT_DETAILS=y CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y CONFIG_SH_CPU_FREQ=y CONFIG_HEARTBEAT=y diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig index 534fcb8..f64ed8a 100644 --- a/drivers/cpufreq/Kconfig +++ b/drivers/cpufreq/Kconfig @@ -36,15 +36,6 @@ config CPU_FREQ_STAT If in doubt, say N. -config CPU_FREQ_STAT_DETAILS - bool "CPU frequency translation statistics details" - depends on CPU_FREQ_STAT - help - This will show detail CPU frequency translation table in sysfs file - system. - - If in doubt, say N. - choice prompt "Default CPUFreq governor" default CPU_FREQ_DEFAULT_GOV_USERSPACE if ARM_SA1100_CPUFREQ || ARM_SA1110_CPUFREQ diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c index fb65dec..c774005 100644 --- a/drivers/cpufreq/cpufreq_stats.c +++ b/drivers/cpufreq/cpufreq_stats.c @@ -33,9 +33,7 @@ struct cpufreq_stats { unsigned int last_index; u64 *time_in_state; unsigned int *freq_table; -#ifdef CONFIG_CPU_FREQ_STAT_DETAILS unsigned int *trans_table; -#endif }; static DEFINE_PER_CPU(struct cpufreq_stats *, cpufreq_stats_table); @@ -86,7 +84,6 @@ static ssize_t show_time_in_state(struct cpufreq_policy *policy, char *buf) return len; } -#ifdef CONFIG_CPU_FREQ_STAT_DETAILS static ssize_t show_trans_table(struct cpufreq_policy *policy, char *buf) { ssize_t len = 0; @@ -131,7 +128,6 @@ static ssize_t show_trans_table(struct cpufreq_policy *policy, char *buf) return len; } cpufreq_freq_attr_ro(trans_table); -#endif cpufreq_freq_attr_ro(total_trans); cpufreq_freq_attr_ro(time_in_state); @@ -139,9 +135,7 @@ cpufreq_freq_attr_ro(time_in_state); static struct attribute *default_attrs[] = { &total_trans.attr, &time_in_state.attr, -#ifdef CONFIG_CPU_FREQ_STAT_DETAILS &trans_table.attr, -#endif NULL }; static struct attribute_group stats_attr_group = { @@ -231,9 +225,7 @@ static int cpufreq_stats_create_table(struct cpufreq_policy *policy, alloc_size = count * sizeof(int) + count * sizeof(u64); -#ifdef CONFIG_CPU_FREQ_STAT_DETAILS alloc_size += count * count * sizeof(int); -#endif stat->max_state = count; stat->time_in_state = kzalloc(alloc_size, GFP_KERNEL); if (!stat->time_in_state) { @@ -242,9 +234,7 @@ static int cpufreq_stats_create_table(struct cpufreq_policy *policy, } stat->freq_table = (unsigned int *)(stat->time_in_state + count); -#ifdef CONFIG_CPU_FREQ_STAT_DETAILS stat->trans_table = stat->freq_table + count; -#endif j = 0; for (i = 0; table[i].frequency != CPUFREQ_TABLE_END; i++) { unsigned int freq = table[i].frequency; @@ -333,9 +323,7 @@ static int cpufreq_stat_notifier_trans(struct notifier_block *nb, spin_lock(&cpufreq_stats_lock); stat->last_index = new_index; -#ifdef CONFIG_CPU_FREQ_STAT_DETAILS stat->trans_table[old_index * stat->max_state + new_index]++; -#endif stat->total_trans++; spin_unlock(&cpufreq_stats_lock); return 0;