From patchwork Thu Oct 8 07:54:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanwoo Choi X-Patchwork-Id: 11822291 X-Patchwork-Delegate: cw00.choi@samsung.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9D28B6CA for ; Thu, 8 Oct 2020 07:40:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 72F8A21924 for ; Thu, 8 Oct 2020 07:40:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="gPIJsZyC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727224AbgJHHkx (ORCPT ); Thu, 8 Oct 2020 03:40:53 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:53694 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727318AbgJHHku (ORCPT ); Thu, 8 Oct 2020 03:40:50 -0400 Received: from epcas1p2.samsung.com (unknown [182.195.41.46]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20201008074047epoutp027e40f07952ab29f7ab2bd46e2bc8f445~79G5XcoDe0252902529epoutp02H for ; Thu, 8 Oct 2020 07:40:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20201008074047epoutp027e40f07952ab29f7ab2bd46e2bc8f445~79G5XcoDe0252902529epoutp02H DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1602142847; bh=R6fv09mNOqfqOl9fbsB3SRUWydTcHfWetpFYSlcV4zU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gPIJsZyCSqDxW+rKdRvokg6Tg+mkdNIAvs3fb8fYBdRhdwxUq3sIk8r+s2EDcUFNy vmdTRajni40wbGq0qGT5c9KUxDyv2/4SezleJ/b2ehGuUEsH6/b3LA0uefb5PUAvlI K1O77Kk1PlPXKvMnDq+ZyKRzFh/MpxuOQCKsPtAM= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20201008074046epcas1p1e0c825f8a14b582d2570e532f4346137~79G4zMsKa1555315553epcas1p1z; Thu, 8 Oct 2020 07:40:46 +0000 (GMT) Received: from epsmges1p4.samsung.com (unknown [182.195.40.155]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4C6NRG028fzMqYm2; Thu, 8 Oct 2020 07:40:42 +0000 (GMT) Received: from epcas1p4.samsung.com ( [182.195.41.48]) by epsmges1p4.samsung.com (Symantec Messaging Gateway) with SMTP id 9C.7B.10463.972CE7F5; Thu, 8 Oct 2020 16:40:41 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas1p4.samsung.com (KnoxPortal) with ESMTPA id 20201008074041epcas1p4b369a0bf9f2207a2d6e878385e23187b~79Gz4pU-F2048920489epcas1p4S; Thu, 8 Oct 2020 07:40:41 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201008074041epsmtrp22615185a72f3f4b345221b7ace5f965f~79Gz37eKN0843908439epsmtrp2I; Thu, 8 Oct 2020 07:40:41 +0000 (GMT) X-AuditID: b6c32a38-f11ff700000028df-51-5f7ec27907f7 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id EC.5D.08745.972CE7F5; Thu, 8 Oct 2020 16:40:41 +0900 (KST) Received: from localhost.localdomain (unknown [10.113.221.102]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201008074041epsmtip1062d198531397ce8c88e35a6c63e13a3~79GzotpF63022630226epsmtip1b; Thu, 8 Oct 2020 07:40:41 +0000 (GMT) From: Chanwoo Choi To: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: mka@chromium.org, rostedt@goodmis.org, mingo@redhat.com, cw00.choi@samsung.com, chanwoo@kernel.org, myungjoo.ham@samsung.com, kyungmin.park@samsung.com Subject: [PATCH 1/3] trace: events: devfreq: Use fixed indentation size to improve readability Date: Thu, 8 Oct 2020 16:54:01 +0900 Message-Id: <20201008075403.26181-2-cw00.choi@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201008075403.26181-1-cw00.choi@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrLKsWRmVeSWpSXmKPExsWy7bCmgW7lobp4gw0PLSwm3rjCYnH9y3NW i7NNb9gtLu+aw2bxufcIo8WlAwuYLD5veMxocbtxBZvFvo4HTA6cHrMbLrJ4tOy7xe6xaVUn m8f7fVfZPPq2rGL0+LxJLoAtKtsmIzUxJbVIITUvOT8lMy/dVsk7ON453tTMwFDX0NLCXEkh LzE31VbJxSdA1y0zB+gqJYWyxJxSoFBAYnGxkr6dTVF+aUmqQkZ+cYmtUmpBSk6BZYFecWJu cWleul5yfq6VoYGBkSlQYUJ2xuoVrSwFv9kqVt6ZxNrA+Iu1i5GTQ0LARGLCimNsXYxcHEIC OxglPrT0MkI4nxglDt7ezQThfGaUWHL3PBNMy5u1h6BadjFKdK7ezQ7hfGGU+HTlDAtIFZuA lsT+FzfYQGwRASuJ0/87mEGKmAXmM0r8vfuTESQhLJAgsXblDbCxLAKqEov+fQFr4AVqOPFp CdSF8hKrNxxgBrE5Bawlvp/+ATZIQuAWu8Tyte1ARRxAjovE7g9hEPXCEq+Ob2GHsKUkPr/b ywZhV0usPHmEDaK3g1Fiy/4LUAuMJfYvncwEModZQFNi/S59iLCixM7fc8HuZBbgk3j3tQdq Fa9ER5sQRImyxOUHd6GhIimxuL0TapWHxOxZb6Dh2McocXrVH+YJjHKzEDYsYGRcxSiWWlCc m55abFhgghxnmxjB6U7L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Hnavc/z/Hh1T323/8YvI3Xz pMxh6UtN/+0Lb+c+cf2dlJBeZuPx17kptk9PoZ6lXPr3GtO+IKOnNxrcxf3mO76wdr3kZHTo fuaf6bpdR9VYDGe86efvXXVwc4/6phrZ1Zu1Hjsofg599DDynsa/TaG954SbK1jftNgbn479 0y0br+1qpvz22fldcbJlX5bPtndeHnQo6DfHbu37PVGJLBVz3YKObwm5t2OF73GeT1sYAuIe tjzedczD1l5R9O1NUZWVK/ZttOg1qZVuEVugY69qXujZ/mX7VXHukNrEZVZHrjUHxJhbiPQ/ rzEJOT/dVpjJPzlQ+Wv8NwkhiUvfT8YskFJiKc5INNRiLipOBAAb3UzquAIAAA== X-CMS-MailID: 20201008074041epcas1p4b369a0bf9f2207a2d6e878385e23187b X-Msg-Generator: CA X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20201008074041epcas1p4b369a0bf9f2207a2d6e878385e23187b References: <20201008075403.26181-1-cw00.choi@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Each tracepoint infromation consist of the different size value. So, in order to improve the readability, use the fixed indentation size. Signed-off-by: Chanwoo Choi --- include/trace/events/devfreq.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/trace/events/devfreq.h b/include/trace/events/devfreq.h index cf5b8772175d..bd36d28d16bc 100644 --- a/include/trace/events/devfreq.h +++ b/include/trace/events/devfreq.h @@ -29,7 +29,7 @@ TRACE_EVENT(devfreq_monitor, __assign_str(dev_name, dev_name(&devfreq->dev)); ), - TP_printk("dev_name=%s freq=%lu polling_ms=%u load=%lu", + TP_printk("dev_name=%-30s freq=%-12lu polling_ms=%-3u load=%-2lu", __get_str(dev_name), __entry->freq, __entry->polling_ms, __entry->total_time == 0 ? 0 : (100 * __entry->busy_time) / __entry->total_time) From patchwork Thu Oct 8 07:54:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanwoo Choi X-Patchwork-Id: 11822293 X-Patchwork-Delegate: cw00.choi@samsung.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3771E6CA for ; Thu, 8 Oct 2020 07:40:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0FEDD21924 for ; Thu, 8 Oct 2020 07:40:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="bsj9ZzPR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725979AbgJHHkz (ORCPT ); Thu, 8 Oct 2020 03:40:55 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:29362 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728054AbgJHHkx (ORCPT ); Thu, 8 Oct 2020 03:40:53 -0400 Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20201008074048epoutp03edfc86a14f86fb029cd8b6129b3b4d56~79G6j7bZu2827028270epoutp03Q for ; Thu, 8 Oct 2020 07:40:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20201008074048epoutp03edfc86a14f86fb029cd8b6129b3b4d56~79G6j7bZu2827028270epoutp03Q DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1602142848; bh=39e6ExivY2mFstp/IgohV18Cb7Qm5EgUQCntjmAe8+s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bsj9ZzPReUZTKw9CBh2ooxPwvclVYxAtOapJxp3WJUVwjGvTMI6ZYlAiE+fQ0G4IA 1M+ECzB9m36XcIZyfhqPAChjdU633ENvdcEovLyi6u1QfqPTsOXyv7B/f78Vu0Bdtp DdFxj5L/OgB/uKglzEyz7vbdnRoevqbwwPg0nsKQ= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20201008074048epcas1p403bfb934b10db239fad69ab0663949ee~79G6If4vk2325723257epcas1p4W; Thu, 8 Oct 2020 07:40:48 +0000 (GMT) Received: from epsmges1p4.samsung.com (unknown [182.195.40.155]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4C6NRK3MfKzMqYkf; Thu, 8 Oct 2020 07:40:45 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p4.samsung.com (Symantec Messaging Gateway) with SMTP id BC.7B.10463.972CE7F5; Thu, 8 Oct 2020 16:40:41 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p3.samsung.com (KnoxPortal) with ESMTPA id 20201008074041epcas1p33c3d6c73cf926f6d38d498e7dc15ea04~79G0BeMWJ0764107641epcas1p3N; Thu, 8 Oct 2020 07:40:41 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201008074041epsmtrp17f3a00e7fc78162887e0edb72401fd73~79G0AdJZW2784427844epsmtrp14; Thu, 8 Oct 2020 07:40:41 +0000 (GMT) X-AuditID: b6c32a38-efbff700000028df-53-5f7ec279e97f Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 85.AB.08604.972CE7F5; Thu, 8 Oct 2020 16:40:41 +0900 (KST) Received: from localhost.localdomain (unknown [10.113.221.102]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201008074041epsmtip153f27c707580b9be0b1492f3efe09928~79GzyNcCQ3068830688epsmtip1R; Thu, 8 Oct 2020 07:40:41 +0000 (GMT) From: Chanwoo Choi To: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: mka@chromium.org, rostedt@goodmis.org, mingo@redhat.com, cw00.choi@samsung.com, chanwoo@kernel.org, myungjoo.ham@samsung.com, kyungmin.park@samsung.com Subject: [PATCH 2/3] PM / devfreq: Unify frequency change to devfreq_update_target func Date: Thu, 8 Oct 2020 16:54:02 +0900 Message-Id: <20201008075403.26181-3-cw00.choi@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201008075403.26181-1-cw00.choi@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrLKsWRmVeSWpSXmKPExsWy7bCmrm7lobp4g0X/bCwm3rjCYnH9y3NW i7NNb9gtLu+aw2bxufcIo8WlAwuYLD5veMxocbtxBZvFvo4HTA6cHrMbLrJ4tOy7xe6xaVUn m8f7fVfZPPq2rGL0+LxJLoAtKtsmIzUxJbVIITUvOT8lMy/dVsk7ON453tTMwFDX0NLCXEkh LzE31VbJxSdA1y0zB+gqJYWyxJxSoFBAYnGxkr6dTVF+aUmqQkZ+cYmtUmpBSk6BZYFecWJu cWleul5yfq6VoYGBkSlQYUJ2xpPnC1gLtqpVXNi6j7GB8bN8FyMnh4SAicS199eZuxi5OIQE djBK7LvUyAjhfGKUmH53CTuE841RorXvFRtMy7x5W1hBbCGBvYwSF/YGQRR9YZR4dH8nO0iC TUBLYv+LG2ANIgJWEqf/d4DtYBaYzyjx9+5PRpCEsECkxI2LS1lAbBYBVYkDG7cxgdi8QA19 q1qZILbJS6zecIAZxOYUsJb4fvoH2CAJgUfsElt/72OHKHKRmHvyEtR5whKvjm+BiktJvOxv g7KrJVaePMIG0dzBKLFl/wVWiISxxP6lk4G2cQCdpymxfpc+RFhRYufvuWCHMgvwSbz72sMK UiIhwCvR0SYEUaIscfnBXag7JSUWt3dCneAhcXbLMmg49jFKzLzQxTSBUW4WwoYFjIyrGMVS C4pz01OLDQtMkONsEyM43WlZ7GCc+/aD3iFGJg7GQ4wSHMxKIrzp3jXxQrwpiZVVqUX58UW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Vth9P99+zXMGctXDCnynadSJ/UwtO3BDe1NB402mnk6OA adkMaZGLl45e6nbf52d/hiH/NHuu3ed9rGZ/j1w8vviVRMzRe9snTM1xLuZw9ZZNtv8neuuq uNvKZxbeGi18HL8fr57tuuSMl97Sf1PNGxsXTt7E9pbD5PmTJW7ba+zOh79daqO0ojT64tFX X9IML3/3adjhe1jw2ZXS44rpi62YZ8VP0e56toZ3Tkv46gMMKxXsLp0XEb6WnRdjKmfylicy +/oze3tl5VrLqyL/fzxdZNmoO+3Er/RfOzJuFf99c0WJpTgj0VCLuag4EQD8SDKOuAIAAA== X-CMS-MailID: 20201008074041epcas1p33c3d6c73cf926f6d38d498e7dc15ea04 X-Msg-Generator: CA X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20201008074041epcas1p33c3d6c73cf926f6d38d498e7dc15ea04 References: <20201008075403.26181-1-cw00.choi@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The update_devfreq() and update_passive_devfreq() have the duplicate code when changing the target frequency on final stage. So, unify frequency change code to devfreq_update_target() to remove the duplicate code and to centralize the frequency change code. Signed-off-by: Chanwoo Choi --- drivers/devfreq/devfreq.c | 29 ++++++++++++++++----- drivers/devfreq/governor.h | 1 + drivers/devfreq/governor_passive.c | 42 +++++++----------------------- 3 files changed, 33 insertions(+), 39 deletions(-) diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index 379aaaabf25d..5b069a8a1026 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -384,18 +384,19 @@ static int devfreq_set_target(struct devfreq *devfreq, unsigned long new_freq, return err; } -/* Load monitoring helper functions for governors use */ - /** - * update_devfreq() - Reevaluate the device and configure frequency. + * devfreq_update_target() - Reevaluate the device and configure frequency + * on the final stage. * @devfreq: the devfreq instance. + * @freq: the new frequency of parent device. This argument + * is only used for devfreq device using passive governor. * - * Note: Lock devfreq->lock before calling update_devfreq - * This function is exported for governors. + * Note: Lock devfreq->lock before calling devfreq_update_target. This function + * should be only used by both update_devfreq() and devfreq governors. */ -int update_devfreq(struct devfreq *devfreq) +int devfreq_update_target(struct devfreq *devfreq, unsigned long freq) { - unsigned long freq, min_freq, max_freq; + unsigned long min_freq, max_freq; int err = 0; u32 flags = 0; @@ -420,7 +421,21 @@ int update_devfreq(struct devfreq *devfreq) } return devfreq_set_target(devfreq, freq, flags); +} +EXPORT_SYMBOL(devfreq_update_target); + +/* Load monitoring helper functions for governors use */ +/** + * update_devfreq() - Reevaluate the device and configure frequency. + * @devfreq: the devfreq instance. + * + * Note: Lock devfreq->lock before calling update_devfreq + * This function is exported for governors. + */ +int update_devfreq(struct devfreq *devfreq) +{ + return devfreq_update_target(devfreq, 0L); } EXPORT_SYMBOL(update_devfreq); diff --git a/drivers/devfreq/governor.h b/drivers/devfreq/governor.h index eb6392d397b3..871150be4391 100644 --- a/drivers/devfreq/governor.h +++ b/drivers/devfreq/governor.h @@ -85,6 +85,7 @@ int devfreq_add_governor(struct devfreq_governor *governor); int devfreq_remove_governor(struct devfreq_governor *governor); int devfreq_update_status(struct devfreq *devfreq, unsigned long freq); +int devfreq_update_target(struct devfreq *devfreq, unsigned long freq); static inline int devfreq_update_stats(struct devfreq *df) { diff --git a/drivers/devfreq/governor_passive.c b/drivers/devfreq/governor_passive.c index 432a4cc683f7..8deb071d5d26 100644 --- a/drivers/devfreq/governor_passive.c +++ b/drivers/devfreq/governor_passive.c @@ -92,36 +92,6 @@ static int devfreq_passive_get_target_freq(struct devfreq *devfreq, return ret; } -static int update_devfreq_passive(struct devfreq *devfreq, unsigned long freq) -{ - int ret; - - if (!devfreq->governor) - return -EINVAL; - - mutex_lock_nested(&devfreq->lock, SINGLE_DEPTH_NESTING); - - ret = devfreq->governor->get_target_freq(devfreq, &freq); - if (ret < 0) - goto out; - - ret = devfreq->profile->target(devfreq->dev.parent, &freq, 0); - if (ret < 0) - goto out; - - if (devfreq->profile->freq_table - && (devfreq_update_status(devfreq, freq))) - dev_err(&devfreq->dev, - "Couldn't update frequency transition information.\n"); - - devfreq->previous_freq = freq; - -out: - mutex_unlock(&devfreq->lock); - - return 0; -} - static int devfreq_passive_notifier_call(struct notifier_block *nb, unsigned long event, void *ptr) { @@ -131,17 +101,25 @@ static int devfreq_passive_notifier_call(struct notifier_block *nb, struct devfreq *parent = (struct devfreq *)data->parent; struct devfreq_freqs *freqs = (struct devfreq_freqs *)ptr; unsigned long freq = freqs->new; + int ret = 0; + mutex_lock_nested(&devfreq->lock, SINGLE_DEPTH_NESTING); switch (event) { case DEVFREQ_PRECHANGE: if (parent->previous_freq > freq) - update_devfreq_passive(devfreq, freq); + ret = devfreq_update_target(devfreq, freq); + break; case DEVFREQ_POSTCHANGE: if (parent->previous_freq < freq) - update_devfreq_passive(devfreq, freq); + ret = devfreq_update_target(devfreq, freq); break; } + mutex_unlock(&devfreq->lock); + + if (ret < 0) + dev_warn(&devfreq->dev, + "failed to update devfreq using passive governor\n"); return NOTIFY_DONE; } From patchwork Thu Oct 8 07:54:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanwoo Choi X-Patchwork-Id: 11822289 X-Patchwork-Delegate: cw00.choi@samsung.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 495CB109B for ; Thu, 8 Oct 2020 07:40:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1EE0C2193E for ; Thu, 8 Oct 2020 07:40:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="n+VbEf0a" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727611AbgJHHks (ORCPT ); Thu, 8 Oct 2020 03:40:48 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:46033 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727213AbgJHHks (ORCPT ); Thu, 8 Oct 2020 03:40:48 -0400 Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20201008074045epoutp01ef05c8dd71abdcf9eb14d085ec46fc20~79G3zoyIi1021010210epoutp01I for ; Thu, 8 Oct 2020 07:40:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20201008074045epoutp01ef05c8dd71abdcf9eb14d085ec46fc20~79G3zoyIi1021010210epoutp01I DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1602142845; bh=MCtneW5ZW/xmqkxzmXsjRSEsnWZHb9ZS23VNZRV6ibc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n+VbEf0aSLLGfrngWsKOd01UpzqHgyKL3pAeHoqRKD0VaunNfhM3dP36BA+xiVE5z vkGzNsJHULcpF4rUDx8WTSNb7YXd1eUiH0JNMVR62LjsXb96RMuqD0jwlmbBOSSk9H fR/VHgs1pDg2nglIWj7ox6NiYUVK6/WbOlbb/sUw= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20201008074044epcas1p434b3e3a72e061d241efb67191e9be50b~79G3F1xJS2323723237epcas1p40; Thu, 8 Oct 2020 07:40:44 +0000 (GMT) Received: from epsmges1p3.samsung.com (unknown [182.195.40.158]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4C6NRG1Pk5zMqYkx; Thu, 8 Oct 2020 07:40:42 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p3.samsung.com (Symantec Messaging Gateway) with SMTP id 58.BC.09582.972CE7F5; Thu, 8 Oct 2020 16:40:42 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas1p4.samsung.com (KnoxPortal) with ESMTPA id 20201008074041epcas1p4d2b9c36c5b3fef5c10db602b9d90c2aa~79G0E4tq42323723237epcas1p4t; Thu, 8 Oct 2020 07:40:41 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201008074041epsmtrp268fbdd1dc89a06c212a1749305d634b4~79G0D4AYR0844008440epsmtrp2-; Thu, 8 Oct 2020 07:40:41 +0000 (GMT) X-AuditID: b6c32a37-899ff7000000256e-c9-5f7ec279fc14 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 8D.5D.08745.972CE7F5; Thu, 8 Oct 2020 16:40:41 +0900 (KST) Received: from localhost.localdomain (unknown [10.113.221.102]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201008074041epsmtip1ad808c752984c3329a97746b32478c0f~79Gz3hu3j3022330223epsmtip1r; Thu, 8 Oct 2020 07:40:41 +0000 (GMT) From: Chanwoo Choi To: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: mka@chromium.org, rostedt@goodmis.org, mingo@redhat.com, cw00.choi@samsung.com, chanwoo@kernel.org, myungjoo.ham@samsung.com, kyungmin.park@samsung.com Subject: [PATCH 3/3] PM / devfreq: Add tracepoint for frequency changes Date: Thu, 8 Oct 2020 16:54:03 +0900 Message-Id: <20201008075403.26181-4-cw00.choi@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201008075403.26181-1-cw00.choi@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrLKsWRmVeSWpSXmKPExsWy7bCmrm7Vobp4g/52RouJN66wWFz/8pzV 4mzTG3aLy7vmsFl87j3CaHHpwAImi88bHjNa3G5cwWaxr+MBkwOnx+yGiyweLftusXtsWtXJ 5vF+31U2j74tqxg9Pm+SC2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MS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20201008074041epcas1p4d2b9c36c5b3fef5c10db602b9d90c2aa References: <20201008075403.26181-1-cw00.choi@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Matthias Kaehlcke Add a tracepoint for frequency changes of devfreq devices and use it. Signed-off-by: Matthias Kaehlcke [cw00.choi: Move print position of tracepoint and add more information] Signed-off-by: Chanwoo Choi --- drivers/devfreq/devfreq.c | 8 ++++++++ include/trace/events/devfreq.h | 28 ++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index 5b069a8a1026..d4c4aa050efa 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -369,6 +369,14 @@ static int devfreq_set_target(struct devfreq *devfreq, unsigned long new_freq, return err; } + /* + * Print devfreq_frequency trace information between DEVFREQ_PRECHANGE + * and DEVFREQ_POSTCHANGE because for showing the correct frequency + * change order of between devfreq device and passive devfreq device. + */ + if (trace_devfreq_frequency_enabled() && new_freq != cur_freq) + trace_devfreq_frequency(devfreq, new_freq, cur_freq); + freqs.new = new_freq; devfreq_notify_transition(devfreq, &freqs, DEVFREQ_POSTCHANGE); diff --git a/include/trace/events/devfreq.h b/include/trace/events/devfreq.h index bd36d28d16bc..7627c620bbda 100644 --- a/include/trace/events/devfreq.h +++ b/include/trace/events/devfreq.h @@ -8,6 +8,34 @@ #include #include +TRACE_EVENT(devfreq_frequency, + TP_PROTO(struct devfreq *devfreq, unsigned long freq, + unsigned long prev_freq), + + TP_ARGS(devfreq, freq, prev_freq), + + TP_STRUCT__entry( + __string(dev_name, dev_name(&devfreq->dev)) + __field(unsigned long, freq) + __field(unsigned long, prev_freq) + __field(unsigned long, busy_time) + __field(unsigned long, total_time) + ), + + TP_fast_assign( + __assign_str(dev_name, dev_name(&devfreq->dev)); + __entry->freq = freq; + __entry->prev_freq = prev_freq; + __entry->busy_time = devfreq->last_status.busy_time; + __entry->total_time = devfreq->last_status.total_time; + ), + + TP_printk("dev_name=%-30s freq=%-12lu prev_freq=%-12lu load=%-2lu", + __get_str(dev_name), __entry->freq, __entry->prev_freq, + __entry->total_time == 0 ? 0 : + (100 * __entry->busy_time) / __entry->total_time) +); + TRACE_EVENT(devfreq_monitor, TP_PROTO(struct devfreq *devfreq),