lkml.org 
[lkml]   [2010]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Tracing of power:power_start events doesn't work
From
Date
On Wed, 2010-05-05 at 16:11 +0200, Ronny Tschüter wrote:

> /*
> * Include the apic definitions for x86 to have the APIC timer related
> defines
> @@ -796,6 +797,18 @@ static int acpi_idle_bm_check(void)
> */
> static inline void acpi_idle_do_entry(struct acpi_processor_cx *cx)
> {
> + switch (cx->type) {
> + case ACPI_STATE_C1:
> + trace_power_start(POWER_CSTATE, 1);
> + break;
> + case ACPI_STATE_C2:
> + trace_power_start(POWER_CSTATE, 2);
> + break;
> + case ACPI_STATE_C3:
> + trace_power_start(POWER_CSTATE, 3);
> + break;
> + }
> +

Depending on gcc, the above can bloat the code since each call to
trace_power_start() is a macro expanded. Try to call it just once.
Perhaps one of the following:


trace_power_start(POWER_CSTATE,
cx->type == ACPI_STATE_C1 ? 1 :
cx->type == ACPI_STATE_C2 ? 2 :
3);

Or make a local variable instead, although the above would compile out
completely if tracing is not enabled.


int type:

switch (cx->type) {
case ACPI_STATE_C1:
type = 1;
break;
case ACPI_STATE_C2:
type = 2;
break;
case ACPI_STATE_C3:
type = 3;
break;
}
trace_power_start(POWER_CSTATE, type);

-- Steve

> /* Don't trace irqs off for idle */
> stop_critical_timings();
> if (cx->entry_method == ACPI_CSTATE_FFH) {
>


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2010-05-05 16:35    [W:0.113 / U:0.436 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site