* [PATCH] shmobile: Rename cpuidle states to fit to general conventions
2011-02-27 21:36 [PATCH] Several riskless, tiny fixes Thomas Renninger
@ 2011-02-27 21:36 ` Thomas Renninger
2011-03-11 3:40 ` Paul Mundt
2011-02-27 21:36 ` [PATCH] intel_idle: Rename cpuidle states Thomas Renninger
` (4 subsequent siblings)
5 siblings, 1 reply; 13+ messages in thread
From: Thomas Renninger @ 2011-02-27 21:36 UTC (permalink / raw)
Cc: trenn, lenb, mingo, linux-kernel, linux-sh
C0 is known as "busy", "not idle" state.
X86 "busy polling" state also got renamed from C0
to "POLL" recently.
Let's stay consistent with naming to avoid confusions.
Signed-off-by: Thomas Renninger <trenn@suse.de>
Acked-by: Magnus Damm <damm@opensource.se>
CC: linux-sh@vger.kernel.org
---
arch/sh/kernel/cpu/shmobile/cpuidle.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/sh/kernel/cpu/shmobile/cpuidle.c b/arch/sh/kernel/cpu/shmobile/cpuidle.c
index c19e2a9..e4469e72 100644
--- a/arch/sh/kernel/cpu/shmobile/cpuidle.c
+++ b/arch/sh/kernel/cpu/shmobile/cpuidle.c
@@ -75,7 +75,7 @@ void sh_mobile_setup_cpuidle(void)
i = CPUIDLE_DRIVER_STATE_START;
state = &dev->states[i++];
- snprintf(state->name, CPUIDLE_NAME_LEN, "C0");
+ snprintf(state->name, CPUIDLE_NAME_LEN, "C1");
strncpy(state->desc, "SuperH Sleep Mode", CPUIDLE_DESC_LEN);
state->exit_latency = 1;
state->target_residency = 1 * 2;
@@ -88,7 +88,7 @@ void sh_mobile_setup_cpuidle(void)
if (sh_mobile_sleep_supported & SUSP_SH_SF) {
state = &dev->states[i++];
- snprintf(state->name, CPUIDLE_NAME_LEN, "C1");
+ snprintf(state->name, CPUIDLE_NAME_LEN, "C2");
strncpy(state->desc, "SuperH Sleep Mode [SF]",
CPUIDLE_DESC_LEN);
state->exit_latency = 100;
@@ -101,7 +101,7 @@ void sh_mobile_setup_cpuidle(void)
if (sh_mobile_sleep_supported & SUSP_SH_STANDBY) {
state = &dev->states[i++];
- snprintf(state->name, CPUIDLE_NAME_LEN, "C2");
+ snprintf(state->name, CPUIDLE_NAME_LEN, "C3");
strncpy(state->desc, "SuperH Mobile Standby Mode [SF]",
CPUIDLE_DESC_LEN);
state->exit_latency = 2300;
--
1.7.3.4
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH] intel_idle: Rename cpuidle states
2011-02-27 21:36 [PATCH] Several riskless, tiny fixes Thomas Renninger
2011-02-27 21:36 ` [PATCH] shmobile: Rename cpuidle states to fit to general conventions Thomas Renninger
@ 2011-02-27 21:36 ` Thomas Renninger
2011-02-28 16:04 ` Len Brown
2011-02-27 21:36 ` [PATCH] pm_qos: Make pm_qos settings readable Thomas Renninger
` (3 subsequent siblings)
5 siblings, 1 reply; 13+ messages in thread
From: Thomas Renninger @ 2011-02-27 21:36 UTC (permalink / raw)
Cc: trenn, lenb, mingo, linux-kernel
Userspace apps might have to cut off parts off the
idle state name for display reasons.
Switch NHM-C1 to C1-NHM (and others) so that a cut off
name is unique and makes sense to the user.
Signed-off-by: Thomas Renninger <trenn@suse.de>
CC: lenb@kernel.org
---
drivers/idle/intel_idle.c | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index 1fa091e..de6d0c5 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -100,7 +100,7 @@ static struct cpuidle_state *cpuidle_state_table;
static struct cpuidle_state nehalem_cstates[MWAIT_MAX_NUM_CSTATES] = {
{ /* MWAIT C0 */ },
{ /* MWAIT C1 */
- .name = "NHM-C1",
+ .name = "C1-NHM",
.desc = "MWAIT 0x00",
.driver_data = (void *) 0x00,
.flags = CPUIDLE_FLAG_TIME_VALID,
@@ -108,7 +108,7 @@ static struct cpuidle_state nehalem_cstates[MWAIT_MAX_NUM_CSTATES] = {
.target_residency = 6,
.enter = &intel_idle },
{ /* MWAIT C2 */
- .name = "NHM-C3",
+ .name = "C3-NHM",
.desc = "MWAIT 0x10",
.driver_data = (void *) 0x10,
.flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
@@ -116,7 +116,7 @@ static struct cpuidle_state nehalem_cstates[MWAIT_MAX_NUM_CSTATES] = {
.target_residency = 80,
.enter = &intel_idle },
{ /* MWAIT C3 */
- .name = "NHM-C6",
+ .name = "C6-NHM",
.desc = "MWAIT 0x20",
.driver_data = (void *) 0x20,
.flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
@@ -128,7 +128,7 @@ static struct cpuidle_state nehalem_cstates[MWAIT_MAX_NUM_CSTATES] = {
static struct cpuidle_state snb_cstates[MWAIT_MAX_NUM_CSTATES] = {
{ /* MWAIT C0 */ },
{ /* MWAIT C1 */
- .name = "SNB-C1",
+ .name = "C1-SNB",
.desc = "MWAIT 0x00",
.driver_data = (void *) 0x00,
.flags = CPUIDLE_FLAG_TIME_VALID,
@@ -136,7 +136,7 @@ static struct cpuidle_state snb_cstates[MWAIT_MAX_NUM_CSTATES] = {
.target_residency = 1,
.enter = &intel_idle },
{ /* MWAIT C2 */
- .name = "SNB-C3",
+ .name = "C3-SNB",
.desc = "MWAIT 0x10",
.driver_data = (void *) 0x10,
.flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
@@ -144,7 +144,7 @@ static struct cpuidle_state snb_cstates[MWAIT_MAX_NUM_CSTATES] = {
.target_residency = 211,
.enter = &intel_idle },
{ /* MWAIT C3 */
- .name = "SNB-C6",
+ .name = "C6-SNB",
.desc = "MWAIT 0x20",
.driver_data = (void *) 0x20,
.flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
@@ -152,7 +152,7 @@ static struct cpuidle_state snb_cstates[MWAIT_MAX_NUM_CSTATES] = {
.target_residency = 345,
.enter = &intel_idle },
{ /* MWAIT C4 */
- .name = "SNB-C7",
+ .name = "C7-SNB",
.desc = "MWAIT 0x30",
.driver_data = (void *) 0x30,
.flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
@@ -164,7 +164,7 @@ static struct cpuidle_state snb_cstates[MWAIT_MAX_NUM_CSTATES] = {
static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = {
{ /* MWAIT C0 */ },
{ /* MWAIT C1 */
- .name = "ATM-C1",
+ .name = "C1-ATM",
.desc = "MWAIT 0x00",
.driver_data = (void *) 0x00,
.flags = CPUIDLE_FLAG_TIME_VALID,
@@ -172,7 +172,7 @@ static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = {
.target_residency = 4,
.enter = &intel_idle },
{ /* MWAIT C2 */
- .name = "ATM-C2",
+ .name = "C2-ATM",
.desc = "MWAIT 0x10",
.driver_data = (void *) 0x10,
.flags = CPUIDLE_FLAG_TIME_VALID,
@@ -181,7 +181,7 @@ static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = {
.enter = &intel_idle },
{ /* MWAIT C3 */ },
{ /* MWAIT C4 */
- .name = "ATM-C4",
+ .name = "C4-ATM",
.desc = "MWAIT 0x30",
.driver_data = (void *) 0x30,
.flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
@@ -190,7 +190,7 @@ static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = {
.enter = &intel_idle },
{ /* MWAIT C5 */ },
{ /* MWAIT C6 */
- .name = "ATM-C6",
+ .name = "C6-ATM",
.desc = "MWAIT 0x52",
.driver_data = (void *) 0x52,
.flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
--
1.7.3.4
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH] pm_qos: Make pm_qos settings readable
2011-02-27 21:36 [PATCH] Several riskless, tiny fixes Thomas Renninger
2011-02-27 21:36 ` [PATCH] shmobile: Rename cpuidle states to fit to general conventions Thomas Renninger
2011-02-27 21:36 ` [PATCH] intel_idle: Rename cpuidle states Thomas Renninger
@ 2011-02-27 21:36 ` Thomas Renninger
2011-02-28 21:08 ` Rafael J. Wysocki
2011-02-27 21:36 ` [PATCH] perf: timechart: fix black idle boxes in the title Thomas Renninger
` (2 subsequent siblings)
5 siblings, 1 reply; 13+ messages in thread
From: Thomas Renninger @ 2011-02-27 21:36 UTC (permalink / raw)
Cc: trenn, lenb, mingo, linux-kernel, mgross
I have a machine where entering deep C-states broke.
pm_qos was a hot candidate, but I couldn't find any way to double
check without the need of recompiling.
While in this case it was a driver bug (ath9k):
https://bugzilla.kernel.org/show_bug.cgi?id=27532
powertop or others may want to read out cpu_dma_latency
restrictions which could be the cause of preventing a machine
entering deeper C-states.
Output with this patch:
# default value of 2000 * USEC_PER_SEC (0x77359400)
cat /dev/network_latency |hexdump
0000000 9400 7735
0000004
# value of 55 us which is the reason for not entering C2
cat /dev/cpu_dma_latency |hexdump
0000000 0037 0000
0000004
There is no reason to hide this info -> make pm_qos files readable.
Signed-off-by: Thomas Renninger <trenn@suse.de>
CC: mgross@linux.intel.com
CC: mingo@elte.hu
---
kernel/pm_qos_params.c | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/kernel/pm_qos_params.c b/kernel/pm_qos_params.c
index aeaa7f8..0da058b 100644
--- a/kernel/pm_qos_params.c
+++ b/kernel/pm_qos_params.c
@@ -103,11 +103,14 @@ static struct pm_qos_object *pm_qos_array[] = {
static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf,
size_t count, loff_t *f_pos);
+static ssize_t pm_qos_power_read(struct file *filp, char __user *buf,
+ size_t count, loff_t *f_pos);
static int pm_qos_power_open(struct inode *inode, struct file *filp);
static int pm_qos_power_release(struct inode *inode, struct file *filp);
static const struct file_operations pm_qos_power_fops = {
.write = pm_qos_power_write,
+ .read = pm_qos_power_read,
.open = pm_qos_power_open,
.release = pm_qos_power_release,
.llseek = noop_llseek,
@@ -376,6 +379,27 @@ static int pm_qos_power_release(struct inode *inode, struct file *filp)
}
+static ssize_t pm_qos_power_read(struct file *filp, char __user *buf,
+ size_t count, loff_t *f_pos)
+{
+ s32 value;
+ unsigned long flags;
+ struct pm_qos_object *o;
+ struct pm_qos_request_list *pm_qos_req = filp->private_data;;
+
+ if (!pm_qos_req)
+ return -EINVAL;
+ if (!pm_qos_request_active(pm_qos_req))
+ return -EINVAL;
+
+ o = pm_qos_array[pm_qos_req->pm_qos_class];
+ spin_lock_irqsave(&pm_qos_lock, flags);
+ value = pm_qos_get_value(o);
+ spin_unlock_irqrestore(&pm_qos_lock, flags);
+
+ return simple_read_from_buffer(buf, count, f_pos, &value, sizeof(s32));
+}
+
static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf,
size_t count, loff_t *f_pos)
{
--
1.7.3.4
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [PATCH] pm_qos: Make pm_qos settings readable
2011-02-27 21:36 ` [PATCH] pm_qos: Make pm_qos settings readable Thomas Renninger
@ 2011-02-28 21:08 ` Rafael J. Wysocki
0 siblings, 0 replies; 13+ messages in thread
From: Rafael J. Wysocki @ 2011-02-28 21:08 UTC (permalink / raw)
To: Thomas Renninger, lenb; +Cc: mingo, linux-kernel, mgross
On Sunday, February 27, 2011, Thomas Renninger wrote:
> I have a machine where entering deep C-states broke.
> pm_qos was a hot candidate, but I couldn't find any way to double
> check without the need of recompiling.
>
> While in this case it was a driver bug (ath9k):
> https://bugzilla.kernel.org/show_bug.cgi?id=27532
>
> powertop or others may want to read out cpu_dma_latency
> restrictions which could be the cause of preventing a machine
> entering deeper C-states.
>
> Output with this patch:
>
> # default value of 2000 * USEC_PER_SEC (0x77359400)
> cat /dev/network_latency |hexdump
> 0000000 9400 7735
> 0000004
>
> # value of 55 us which is the reason for not entering C2
> cat /dev/cpu_dma_latency |hexdump
> 0000000 0037 0000
> 0000004
>
> There is no reason to hide this info -> make pm_qos files readable.
>
> Signed-off-by: Thomas Renninger <trenn@suse.de>
> CC: mgross@linux.intel.com
> CC: mingo@elte.hu
Applied to suspend-2.6/linux-next.
Thanks,
Rafael
> ---
> kernel/pm_qos_params.c | 24 ++++++++++++++++++++++++
> 1 files changed, 24 insertions(+), 0 deletions(-)
>
> diff --git a/kernel/pm_qos_params.c b/kernel/pm_qos_params.c
> index aeaa7f8..0da058b 100644
> --- a/kernel/pm_qos_params.c
> +++ b/kernel/pm_qos_params.c
> @@ -103,11 +103,14 @@ static struct pm_qos_object *pm_qos_array[] = {
>
> static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf,
> size_t count, loff_t *f_pos);
> +static ssize_t pm_qos_power_read(struct file *filp, char __user *buf,
> + size_t count, loff_t *f_pos);
> static int pm_qos_power_open(struct inode *inode, struct file *filp);
> static int pm_qos_power_release(struct inode *inode, struct file *filp);
>
> static const struct file_operations pm_qos_power_fops = {
> .write = pm_qos_power_write,
> + .read = pm_qos_power_read,
> .open = pm_qos_power_open,
> .release = pm_qos_power_release,
> .llseek = noop_llseek,
> @@ -376,6 +379,27 @@ static int pm_qos_power_release(struct inode *inode, struct file *filp)
> }
>
>
> +static ssize_t pm_qos_power_read(struct file *filp, char __user *buf,
> + size_t count, loff_t *f_pos)
> +{
> + s32 value;
> + unsigned long flags;
> + struct pm_qos_object *o;
> + struct pm_qos_request_list *pm_qos_req = filp->private_data;;
> +
> + if (!pm_qos_req)
> + return -EINVAL;
> + if (!pm_qos_request_active(pm_qos_req))
> + return -EINVAL;
> +
> + o = pm_qos_array[pm_qos_req->pm_qos_class];
> + spin_lock_irqsave(&pm_qos_lock, flags);
> + value = pm_qos_get_value(o);
> + spin_unlock_irqrestore(&pm_qos_lock, flags);
> +
> + return simple_read_from_buffer(buf, count, f_pos, &value, sizeof(s32));
> +}
> +
> static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf,
> size_t count, loff_t *f_pos)
> {
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH] perf: timechart: fix black idle boxes in the title.
2011-02-27 21:36 [PATCH] Several riskless, tiny fixes Thomas Renninger
` (2 preceding siblings ...)
2011-02-27 21:36 ` [PATCH] pm_qos: Make pm_qos settings readable Thomas Renninger
@ 2011-02-27 21:36 ` Thomas Renninger
2011-02-28 8:22 ` [tip:perf/urgent] perf timechart: Fix " tip-bot for Thomas Renninger
2011-02-27 21:36 ` [PATCH] perf: timechart -> fix max number of cpus Thomas Renninger
2011-02-28 7:54 ` [PATCH] Several riskless, tiny fixes Ingo Molnar
5 siblings, 1 reply; 13+ messages in thread
From: Thomas Renninger @ 2011-02-27 21:36 UTC (permalink / raw)
Cc: trenn, lenb, mingo, linux-kernel, Arnaldo Carvalho de Melo,
Arjan van de Ven
This fix is needed for eye of gnome and firefox svg viewers.
Only Inkscape can handle the broken case.
Compare with the other svg_legenda_box declarations, looks
like a typo slipped in at this place.
Signed-off-by: Thomas Renninger <trenn@suse.de>
CC: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
CC: Arjan van de Ven <arjan@linux.intel.com>
CC: mingo@elte.hu
---
tools/perf/util/svghelper.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/perf/util/svghelper.c b/tools/perf/util/svghelper.c
index fb737fe..96c8660 100644
--- a/tools/perf/util/svghelper.c
+++ b/tools/perf/util/svghelper.c
@@ -456,9 +456,9 @@ void svg_legenda(void)
return;
svg_legenda_box(0, "Running", "sample");
- svg_legenda_box(100, "Idle","rect.c1");
- svg_legenda_box(200, "Deeper Idle", "rect.c3");
- svg_legenda_box(350, "Deepest Idle", "rect.c6");
+ svg_legenda_box(100, "Idle","c1");
+ svg_legenda_box(200, "Deeper Idle", "c3");
+ svg_legenda_box(350, "Deepest Idle", "c6");
svg_legenda_box(550, "Sleeping", "process2");
svg_legenda_box(650, "Waiting for cpu", "waiting");
svg_legenda_box(800, "Blocked on IO", "blocked");
--
1.7.3.4
^ permalink raw reply related [flat|nested] 13+ messages in thread* [tip:perf/urgent] perf timechart: Fix black idle boxes in the title
2011-02-27 21:36 ` [PATCH] perf: timechart: fix black idle boxes in the title Thomas Renninger
@ 2011-02-28 8:22 ` tip-bot for Thomas Renninger
0 siblings, 0 replies; 13+ messages in thread
From: tip-bot for Thomas Renninger @ 2011-02-28 8:22 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, hpa, mingo, arjan, acme, trenn, tglx, mingo
Commit-ID: e853072055a01d8b3c4dc89d231649189454c4f1
Gitweb: http://git.kernel.org/tip/e853072055a01d8b3c4dc89d231649189454c4f1
Author: Thomas Renninger <trenn@suse.de>
AuthorDate: Sun, 27 Feb 2011 22:36:45 +0100
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Mon, 28 Feb 2011 08:56:14 +0100
perf timechart: Fix black idle boxes in the title
This fix is needed for eye of gnome and firefox svg viewers.
Only Inkscape can handle the broken case.
Compare with the other svg_legenda_box declarations, looks
like a typo slipped in at this place.
Signed-off-by: Thomas Renninger <trenn@suse.de>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: lenb@kernel.org
LKML-Reference: <1298842606-55712-5-git-send-email-trenn@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
tools/perf/util/svghelper.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/perf/util/svghelper.c b/tools/perf/util/svghelper.c
index fb737fe..96c8660 100644
--- a/tools/perf/util/svghelper.c
+++ b/tools/perf/util/svghelper.c
@@ -456,9 +456,9 @@ void svg_legenda(void)
return;
svg_legenda_box(0, "Running", "sample");
- svg_legenda_box(100, "Idle","rect.c1");
- svg_legenda_box(200, "Deeper Idle", "rect.c3");
- svg_legenda_box(350, "Deepest Idle", "rect.c6");
+ svg_legenda_box(100, "Idle","c1");
+ svg_legenda_box(200, "Deeper Idle", "c3");
+ svg_legenda_box(350, "Deepest Idle", "c6");
svg_legenda_box(550, "Sleeping", "process2");
svg_legenda_box(650, "Waiting for cpu", "waiting");
svg_legenda_box(800, "Blocked on IO", "blocked");
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH] perf: timechart -> fix max number of cpus
2011-02-27 21:36 [PATCH] Several riskless, tiny fixes Thomas Renninger
` (3 preceding siblings ...)
2011-02-27 21:36 ` [PATCH] perf: timechart: fix black idle boxes in the title Thomas Renninger
@ 2011-02-27 21:36 ` Thomas Renninger
2011-02-28 8:23 ` [tip:perf/urgent] perf timechart: Fix " tip-bot for Thomas Renninger
2011-02-28 7:54 ` [PATCH] Several riskless, tiny fixes Ingo Molnar
5 siblings, 1 reply; 13+ messages in thread
From: Thomas Renninger @ 2011-02-27 21:36 UTC (permalink / raw)
Cc: trenn, lenb, mingo, linux-kernel, Arnaldo Carvalho de Melo,
Arjan van de Ven
Currently numcpus is determined in pid_put_sample which is only
called on sched_switch/sched_wakeup sample processing.
On a machine with a lot cpus I often saw the last cpu missing.
Check for (max) numcpus on every event happening and in the beginning.
-> fixes the issue for me.
Signed-off-by: Thomas Renninger <trenn@suse.de>
CC: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
CC: Arjan van de Ven <arjan@linux.intel.com>
CC: mingo@elte.hu
---
tools/perf/builtin-timechart.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c
index 746cf03..0ace786 100644
--- a/tools/perf/builtin-timechart.c
+++ b/tools/perf/builtin-timechart.c
@@ -264,9 +264,6 @@ pid_put_sample(int pid, int type, unsigned int cpu, u64 start, u64 end)
c->start_time = start;
if (p->start_time == 0 || p->start_time > start)
p->start_time = start;
-
- if (cpu > numcpus)
- numcpus = cpu;
}
#define MAX_CPUS 4096
@@ -511,6 +508,9 @@ static int process_sample_event(event_t *event __used,
if (!event_str)
return 0;
+ if (sample->cpu > numcpus)
+ numcpus = sample->cpu;
+
if (strcmp(event_str, "power:cpu_idle") == 0) {
struct power_processor_entry *ppe = (void *)te;
if (ppe->state == (u32)PWR_EVENT_EXIT)
--
1.7.3.4
^ permalink raw reply related [flat|nested] 13+ messages in thread* [tip:perf/urgent] perf timechart: Fix max number of cpus
2011-02-27 21:36 ` [PATCH] perf: timechart -> fix max number of cpus Thomas Renninger
@ 2011-02-28 8:23 ` tip-bot for Thomas Renninger
0 siblings, 0 replies; 13+ messages in thread
From: tip-bot for Thomas Renninger @ 2011-02-28 8:23 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, hpa, mingo, arjan, acme, trenn, tglx, mingo
Commit-ID: 54b08f5f90feebc9756d96e0c7bf2fdffe4af7c3
Gitweb: http://git.kernel.org/tip/54b08f5f90feebc9756d96e0c7bf2fdffe4af7c3
Author: Thomas Renninger <trenn@suse.de>
AuthorDate: Sun, 27 Feb 2011 22:36:46 +0100
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Mon, 28 Feb 2011 08:56:15 +0100
perf timechart: Fix max number of cpus
Currently numcpus is determined in pid_put_sample which is only
called on sched_switch/sched_wakeup sample processing.
On a machine with a lot cpus I often saw the last cpu missing.
Check for (max) numcpus on every event happening and in the
beginning. -> fixes the issue for me.
Signed-off-by: Thomas Renninger <trenn@suse.de>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: lenb@kernel.org
LKML-Reference: <1298842606-55712-6-git-send-email-trenn@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
tools/perf/builtin-timechart.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c
index 746cf03..0ace786 100644
--- a/tools/perf/builtin-timechart.c
+++ b/tools/perf/builtin-timechart.c
@@ -264,9 +264,6 @@ pid_put_sample(int pid, int type, unsigned int cpu, u64 start, u64 end)
c->start_time = start;
if (p->start_time == 0 || p->start_time > start)
p->start_time = start;
-
- if (cpu > numcpus)
- numcpus = cpu;
}
#define MAX_CPUS 4096
@@ -511,6 +508,9 @@ static int process_sample_event(event_t *event __used,
if (!event_str)
return 0;
+ if (sample->cpu > numcpus)
+ numcpus = sample->cpu;
+
if (strcmp(event_str, "power:cpu_idle") == 0) {
struct power_processor_entry *ppe = (void *)te;
if (ppe->state == (u32)PWR_EVENT_EXIT)
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH] Several riskless, tiny fixes
2011-02-27 21:36 [PATCH] Several riskless, tiny fixes Thomas Renninger
` (4 preceding siblings ...)
2011-02-27 21:36 ` [PATCH] perf: timechart -> fix max number of cpus Thomas Renninger
@ 2011-02-28 7:54 ` Ingo Molnar
2011-02-28 20:43 ` Rafael J. Wysocki
5 siblings, 1 reply; 13+ messages in thread
From: Ingo Molnar @ 2011-02-28 7:54 UTC (permalink / raw)
To: Thomas Renninger, Rafael J. Wysocki; +Cc: lenb, linux-kernel
* Thomas Renninger <trenn@suse.de> wrote:
> Some of these could still get pushed into 2.6.38?
>
> If not, it would be great if they get queued in:
> - x86-tip tree, the two perf patches and the pm_qos patch
I suspect the pm_qos patch should be processed by the PM tree - Rafael?
Thanks,
Ingo
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH] Several riskless, tiny fixes
2011-02-28 7:54 ` [PATCH] Several riskless, tiny fixes Ingo Molnar
@ 2011-02-28 20:43 ` Rafael J. Wysocki
0 siblings, 0 replies; 13+ messages in thread
From: Rafael J. Wysocki @ 2011-02-28 20:43 UTC (permalink / raw)
To: Ingo Molnar; +Cc: Thomas Renninger, lenb, linux-kernel
On Monday, February 28, 2011, Ingo Molnar wrote:
>
> * Thomas Renninger <trenn@suse.de> wrote:
>
> > Some of these could still get pushed into 2.6.38?
> >
> > If not, it would be great if they get queued in:
> > - x86-tip tree, the two perf patches and the pm_qos patch
>
> I suspect the pm_qos patch should be processed by the PM tree - Rafael?
That's correct, thanks!
Rafael
^ permalink raw reply [flat|nested] 13+ messages in thread