From patchwork Wed Jul 2 09:30:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "sandeep.tripathy@linaro.org" X-Patchwork-Id: 32960 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f199.google.com (mail-pd0-f199.google.com [209.85.192.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7121F20560 for ; Wed, 2 Jul 2014 09:31:38 +0000 (UTC) Received: by mail-pd0-f199.google.com with SMTP id r10sf50975342pdi.6 for ; Wed, 02 Jul 2014 02:31:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=+s1gWh487T+watUxs/qUc0AhfUbYeMteH64TuK/+WBU=; b=Lne8jigSFPqr/Tt6Y3AjO9uaGxcGb4kbkBQlEMIfArBygR2eMejNN3mLJuvyXpUFRV F2YNyCtubz0NxQd5pOTCIkHlaSYVJjY3vK9WSVtJ/UDjXiXnhLJw0iMqEaLQsqYuulJN i/4KvssNKyIvEm5n2AG8JmpHT3SY7M0hT2Bbj6zFhpQoOokhexQI7fDeIPE2BnhFgqOB bD2BZDfscHr5sgg/7f6//EUntdfcv+mOrSg7hXeQSLuKu15oN6luwN7ITjFutQmfDxI/ tbHfWjHmPQ4vA4wrG9BHu2vtMxVWwg7AXcaS04+VlVBRow4cqI6UkVAxd4Scn54hUMUJ 46Mg== X-Gm-Message-State: ALoCoQmFRGvcpY0gyqFkyxsz1ie25CGylWcoVqBx6eencg6/B+A9L31bknSlnQxaLEzMV6o3cbti X-Received: by 10.66.66.196 with SMTP id h4mr1117050pat.22.1404293497987; Wed, 02 Jul 2014 02:31:37 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.30.165 with SMTP id d34ls2462765qgd.25.gmail; Wed, 02 Jul 2014 02:31:37 -0700 (PDT) X-Received: by 10.220.17.199 with SMTP id t7mr43704057vca.1.1404293497889; Wed, 02 Jul 2014 02:31:37 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id iw8si4018380vdb.59.2014.07.02.02.31.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 02 Jul 2014 02:31:37 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.174 as permitted sender) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id jx11so10952207veb.33 for ; Wed, 02 Jul 2014 02:31:37 -0700 (PDT) X-Received: by 10.52.24.68 with SMTP id s4mr913177vdf.37.1404293497792; Wed, 02 Jul 2014 02:31:37 -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.37.5 with SMTP id tc5csp279509vcb; Wed, 2 Jul 2014 02:31:37 -0700 (PDT) X-Received: by 10.68.112.225 with SMTP id it1mr70361130pbb.23.1404293497050; Wed, 02 Jul 2014 02:31:37 -0700 (PDT) Received: from mail-pd0-f178.google.com (mail-pd0-f178.google.com [209.85.192.178]) by mx.google.com with ESMTPS id lf13si29679527pab.199.2014.07.02.02.31.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 02 Jul 2014 02:31:37 -0700 (PDT) Received-SPF: pass (google.com: domain of sandeep.tripathy@linaro.org designates 209.85.192.178 as permitted sender) client-ip=209.85.192.178; Received: by mail-pd0-f178.google.com with SMTP id r10so11671645pdi.37 for ; Wed, 02 Jul 2014 02:31:36 -0700 (PDT) X-Received: by 10.68.90.68 with SMTP id bu4mr68256599pbb.5.1404293496588; Wed, 02 Jul 2014 02:31:36 -0700 (PDT) Received: from LBBLR-TRIPATHY.ban.broadcom.com ([202.140.36.34]) by mx.google.com with ESMTPSA id qu5sm6458529pab.10.2014.07.02.02.31.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Jul 2014 02:31:36 -0700 (PDT) From: Sandeep Tripathy To: rjw@rjwysocki.net, daniel.lezcano@linaro.org Cc: rostedt@goodmis.org, linux-pm@vger.kernel.org, linaro-kernel@lists.linaro.org, patches@linaro.org, Sandeep Tripathy Subject: [PATCH] cpuidle/idle: move idle traces to cpuidle_enter_state Date: Wed, 2 Jul 2014 15:00:58 +0530 Message-Id: <1404293458-9799-1-git-send-email-sandeep.tripathy@linaro.org> X-Mailer: git-send-email 1.9.1 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: sandeep.tripathy@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.174 as permitted sender) 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: , idle_exit event is the first event after a core exits idle state. So this should be traced before local irq is ebabled. Likewise idle_entry is the last event before a core enters idle state. This will ease visualising the cpu idle state from kernel traces. Signed-off-by: Sandeep Tripathy Acked-by: Daniel Lezcano --- drivers/cpuidle/cpuidle.c | 3 +++ kernel/sched/idle.c | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index 8236746..97680d0 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c @@ -99,12 +99,15 @@ int cpuidle_enter_state(struct cpuidle_device *dev, struct cpuidle_driver *drv, ktime_t time_start, time_end; s64 diff; + trace_cpu_idle_rcuidle(index, dev->cpu); time_start = ktime_get(); entered_state = target_state->enter(dev, drv, index); time_end = ktime_get(); + trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, dev->cpu); + if (!cpuidle_state_is_coupled(dev, drv, entered_state)) local_irq_enable(); diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c index 8f4390a..07c446a 100644 --- a/kernel/sched/idle.c +++ b/kernel/sched/idle.c @@ -141,7 +141,6 @@ static int cpuidle_idle_call(void) &dev->cpu); if (!ret) { - trace_cpu_idle_rcuidle(next_state, dev->cpu); /* * Enter the idle state previously @@ -154,9 +153,6 @@ static int cpuidle_idle_call(void) entered_state = cpuidle_enter(drv, dev, next_state); - trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, - dev->cpu); - if (broadcast) clockevents_notify( CLOCK_EVT_NOTIFY_BROADCAST_EXIT,