From patchwork Tue Jul 29 10:50:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Punit Agrawal X-Patchwork-Id: 4639701 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B7327C0338 for ; Tue, 29 Jul 2014 10:52:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EE12420158 for ; Tue, 29 Jul 2014 10:52:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F29D52014A for ; Tue, 29 Jul 2014 10:52:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752859AbaG2KwN (ORCPT ); Tue, 29 Jul 2014 06:52:13 -0400 Received: from fw-tnat.cambridge.arm.com ([217.140.96.21]:54736 "EHLO cam-smtp0.cambridge.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752168AbaG2Kv7 (ORCPT ); Tue, 29 Jul 2014 06:51:59 -0400 Received: from e102309-lin (e102309-lin.cambridge.arm.com [10.1.195.33]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with SMTP id s6TApQN6002635; Tue, 29 Jul 2014 11:51:26 +0100 Received: by e102309-lin (sSMTP sendmail emulation); Tue, 29 Jul 2014 11:51:26 +0100 From: Punit Agrawal To: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Punit Agrawal , Zhang Rui , Eduardo Valentin , Steven Rostedt , Frederic Weisbecker , Ingo Molnar Subject: [PATCH 2/3] thermal: trace: Trace when a cooling device's state is updated Date: Tue, 29 Jul 2014 11:50:49 +0100 Message-Id: <1406631050-14975-3-git-send-email-punit.agrawal@arm.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1406631050-14975-1-git-send-email-punit.agrawal@arm.com> References: <1402486305-4017-1-git-send-email-punit.agrawal@arm.com> <1406631050-14975-1-git-send-email-punit.agrawal@arm.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Introduce and use an event to trace when a cooling device's state is updated. This is useful to follow the effect of governor decisions on cooling devices. Cc: Zhang Rui Cc: Eduardo Valentin Cc: Steven Rostedt Cc: Frederic Weisbecker Cc: Ingo Molnar Signed-off-by: Punit Agrawal --- drivers/thermal/thermal_core.c | 1 + include/trace/events/thermal.h | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 6b32391..c74c78d 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1291,6 +1291,7 @@ void thermal_cdev_update(struct thermal_cooling_device *cdev) mutex_unlock(&cdev->lock); cdev->ops->set_cur_state(cdev, target); cdev->updated = true; + trace_cdev_update(cdev, target); dev_dbg(&cdev->device, "set to state %lu\n", target); } EXPORT_SYMBOL(thermal_cdev_update); diff --git a/include/trace/events/thermal.h b/include/trace/events/thermal.h index 8c5ca96..894a79e 100644 --- a/include/trace/events/thermal.h +++ b/include/trace/events/thermal.h @@ -32,6 +32,25 @@ TRACE_EVENT(thermal_temperature, __entry->temp) ); +TRACE_EVENT(cdev_update, + + TP_PROTO(struct thermal_cooling_device *cdev, unsigned long target), + + TP_ARGS(cdev, target), + + TP_STRUCT__entry( + __string(type, cdev->type) + __field(unsigned long, target) + ), + + TP_fast_assign( + __assign_str(type, cdev->type); + __entry->target = target; + ), + + TP_printk("type=%s target=%lu", __get_str(type), __entry->target) +); + #endif /* _TRACE_THERMAL_H */ /* This part must be outside protection */