mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ronny Tschüter" <Ronny.Tschueter@tu-dresden.de>
To: rostedt@goodmis.org
Cc: Arjan van de Ven <arjan@linux.intel.com>,
	Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Tracing of power:power_start events doesn't work
Date: Wed, 05 May 2010 16:11:28 +0200	[thread overview]
Message-ID: <4BE17C90.2020205@tu-dresden.de> (raw)
In-Reply-To: <1273019517.22438.10.camel@gandalf.stny.rr.com>

Hello,

I took a look at ftrace and tried to narrow my problem down.

  1) <idle>-0    |                     |  cpuidle_idle_call() {
  1) <idle>-0    |                     |    menu_select() {
  1) <idle>-0    |   0.219 us    |      pm_qos_requirement();
  1) <idle>-0    |   0.219 us    |      tick_nohz_get_sleep_length();
  1) <idle>-0    |   0.210 us    |      nr_iowait_cpu();
  1) <idle>-0    |   0.213 us    |      this_cpu_load();
  1) <idle>-0    |   0.213 us    |      nr_iowait_cpu();
  1) <idle>-0    |   2.472 us    |    }
  1) <idle>-0    |                     |    acpi_idle_enter_simple() {
  1) <idle>-0    |                     |      
lapic_timer_state_broadcast() {
  1) <idle>-0    |                     |        clockevents_notify() {
  1) <idle>-0    |   0.234 us    |          _raw_spin_lock_irqsave();
  1) <idle>-0    |                     |          
raw_notifier_call_chain() {
  1) <idle>-0    |                     |            tick_notify() {
  1) <idle>-0    |                     |              
tick_broadcast_oneshot_control() {
  1) <idle>-0    |   0.237 us    |                _raw_spin_lock_irqsave();
  1) <idle>-0    |                     |                
clockevents_set_mode() {
  1) <idle>-0    |                     |                  
lapic_timer_setup() {
  1) <idle>-0    |   0.222 us    |                    
native_apic_mem_read();
  1) <idle>-0    |   0.213 us    |                    
native_apic_mem_write();
  1) <idle>-0    |   0.210 us    |                    
native_apic_mem_write();
  1) <idle>-0    |   1.554 us    |                  }
  1) <idle>-0    |   2.007 us    |                }
  1) <idle>-0    |                     |                
tick_dev_program_event() {
  1) <idle>-0    |                     |                  ktime_get() {
  1) <idle>-0    |   0.606 us    |                    read_hpet();
  1) <idle>-0    |   1.053 us    |                  }
  1) <idle>-0    |                     |                  
clockevents_program_event() {
  1) <idle>-0    |                     |                    
hpet_legacy_next_event() {
  1) <idle>-0    |   1.692 us    |                      hpet_next_event();
  1) <idle>-0    |   2.190 us    |                    }
  1) <idle>-0    |   2.664 us    |                  }
  1) <idle>-0    |   4.410 us    |                }
  1) <idle>-0    |   0.237 us    |                
_raw_spin_unlock_irqrestore();
  1) <idle>-0    |   8.022 us    |              }
  1) <idle>-0    |   8.460 us    |            }
  1) <idle>-0    |   8.943 us    |          }
  1) <idle>-0    |   0.231 us    |          _raw_spin_unlock_irqrestore();
  1) <idle>-0    | + 10.296 us   |        }
  1) <idle>-0    | + 10.734 us   |      }
  1) <idle>-0    |                     |      ktime_get_real() {
  1) <idle>-0    |                     |        getnstimeofday() {
  1) <idle>-0    |   0.630 us    |          read_hpet();
  1) <idle>-0    |   1.389 us    |        }
  1) <idle>-0    |   1.830 us    |      }
  1) <idle>-0    | ! 3833.301 us |      acpi_idle_do_entry()

Like the callgraph shows, my machine uses the cpuidle framework with 
menu governor and an acpi-based driver to handle idle states. 
Unfortunately I can't find any instrumentation for tracing power events 
in the cpuidle.c and processor_idle.c (acpi idle management). The 
following patch achieved success.

diff --git a/old/processor_idle.c b/new/processor_idle.c
index cc978a8..1668d34 100644
--- a/old/processor_idle.c
+++ b/new/processor_idle.c
@@ -42,6 +42,7 @@
  #include <linux/clockchips.h>
  #include <linux/cpuidle.h>
  #include <linux/irqflags.h>
+#include <trace/events/power.h>

  /*
   * 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;
+    }
+
      /* Don't trace irqs off for idle */
      stop_critical_timings();
      if (cx->entry_method == ACPI_CSTATE_FFH) {


  parent reply	other threads:[~2010-05-05 14:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-03 13:19 Ronny Tschüter
2010-05-03 21:36 ` Frank Ch. Eigler
2010-05-05  0:31 ` Steven Rostedt
2010-05-05  6:34   ` Ronny Tschüter
2010-05-05 17:23     ` Frederic Weisbecker
2010-05-06  6:32       ` Ronny Tschüter
2010-05-05 14:11   ` Ronny Tschüter [this message]
2010-05-05 14:31     ` Steven Rostedt
2010-05-05 14:33       ` Arjan van de Ven
2010-05-12  8:57         ` Robert Schöne
2010-06-11 10:26           ` Ronny Tschüter
2010-06-29 14:49             ` Ronny Tschüter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BE17C90.2020205@tu-dresden.de \
    --to=ronny.tschueter@tu-dresden.de \
    --cc=arjan@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome