Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1019071pxu; Thu, 8 Oct 2020 00:43:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwugAAsi0GRtMkq1n5TzPzX2hIBSIih0tv1ejTdoR9VGu0wZFbH7PrXvSgUuLeHfS9xwuFJ X-Received: by 2002:a17:906:8293:: with SMTP id h19mr7014749ejx.130.1602142986865; Thu, 08 Oct 2020 00:43:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602142986; cv=none; d=google.com; s=arc-20160816; b=NBuFJg3LJADJWsujCPVtOfHCWoSgswxSUfgIrSuRIs9OSgQp6/OlBGdgzXUZt/AafK h65mdSJS/1vy1VIATucS7RSYNemtZqO1QLdCgpw0K6qugX4dKsBL6jEfBgKBaD84godH XvsvBqMUv6dbEVlIOaR83xmOTB2tWc4LhHudPvo3PnVxwEToYRUOALGHUt+o4QudRaj4 YF3/fS8LY7TS3xDTjJyHxNtqNJc8lGw9WNr4W42ULRg1LFmO5aSzMcQp2JNScHW4GzJV bn/hhf0lNz6LxQKEco+9HPo7p27OsW8+2rHUq+me6EuqoUIJwi4fd0OjGyL61ZzWOvZf VFaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:dlp-filter:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=MCtneW5ZW/xmqkxzmXsjRSEsnWZHb9ZS23VNZRV6ibc=; b=VIHSJHgDLKIm/1lU0wOjI8GbrZeNXz48rIKXkHESPeCMJWmWqeZC1jh5NUFSMr7h5s 5V436iM68rUGHHLkBRopnSHvJxRkBPoSsfJ+cSklEZRqGtZctKyt4LEOwpw19pF9jJVi vx5y8aLhKvChX9A/MQThGZi5HLUwQzl2I5JSnEPO/0xvu4VgBFzg8Zbyk1seSSJcVP1g kCHOdhXkUxOnEqmhQYqVd0s2g9jjL3dfJFAEMDWGNTgtcIdb5zfNGFWajtCFyO6Xj3XV JATVIWFcleBFHwW/LbmP/bZ9x362oOciuUu0TldpYnSXPlUDtCKCyaeuUCgYKZ3glEAS eacQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=n+VbEf0a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bt13si3417445ejb.259.2020.10.08.00.42.43; Thu, 08 Oct 2020 00:43:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=n+VbEf0a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728083AbgJHHkt (ORCPT + 99 others); Thu, 8 Oct 2020 03:40:49 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:53659 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727172AbgJHHkt (ORCPT ); Thu, 8 Oct 2020 03:40:49 -0400 Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20201008074045epoutp02034d30c325075840b02276fc7f2a43a2~79G3p2wnu0252902529epoutp02D for ; Thu, 8 Oct 2020 07:40:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20201008074045epoutp02034d30c325075840b02276fc7f2a43a2~79G3p2wnu0252902529epoutp02D 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+SC2CLyrbJSE1MSS1SSM1Lzk/JzEu3VfIOjneONzUzMNQ1tLQwV1LI S8xNtVVy8QnQdcvMAbpKSaEsMacUKBSQWFyspG9nU5RfWpKqkJFfXGKrlFqQklNgWaBXnJhb XJqXrpecn2tlaGBgZApUmJCdMf12F0vBFOGKyQsnMTcwLhDoYuTkkBAwkVh04yJLFyMXh5DA DkaJn53/mSGcT4wSF7e9Z4RwPjNKHFhxgRGm5dTkQ2wQiV2MEuvnHGOHcL4wSsw7ehqsik1A S2L/ixtsILaIgJXE6f8dYHOZBeYzSvy9+xOsSFjAXeLZqc1MXYwcHCwCqhL9F8RBwrxA9R0/ XrJBbJOXWL3hADOIzSlgLfH99A+wORICj9glfrzdwQpR5CJx+M0KJghbWO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8hKrNxxgBrE5Bawlvp/+AWYLAdWs3PeEaQIj3wJGhlWMkqkFxbnpucWGBUZ5qeV6xYm5 xaV56XrJ+bmbGMEBqaW1g3HPqg96hxiZOBgPMUpwMCuJ8KZ718QL8aYkVlalFuXHF5XmpBYf YpTmYFES5/06a2GckEB6YklqdmpqQWoRTJaJg1OqgWn6k5jwoy52hlPnxOw/tvdHWMsslWv7 VBhnsroVfIhgvbhq3dEXzZc+lGoZSfUVlpxuv6S0+oGM04+Vl3czFmQlhFy5YX9/l63nY+ub jb4L7SdzKxZ8UHpWMlGm3npOyUwj0Sv232Z+9foyu1OtNLBur/HHh+FyFgoFLQfkjkadYT// 50Xo+bXS5iun97SWfXl2+i/38wTb5B+zlB4F9LhN2ubaufNOq6XTnKa/Tl+LmyM5XknOZ2ZJ /c625ZJ5pXL3bcEd1gYnFlsxfIpQ33vF7uB9wfOpD1wmKU3v0DbeJjdpokFItPHrsPoC7fdy 1tr7Pb0Mhbjnuf7NrJY4wLeVf3GSqOsr5sSfVnveJCqxFGckGmoxFxUnAgCEz+sHtwIAAA== X-CMS-MailID: 20201008074041epcas1p4d2b9c36c5b3fef5c10db602b9d90c2aa X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: SVC_REQ_APPROVE CMS-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-kernel@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), -- 2.17.1