Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1208229imj; Thu, 14 Feb 2019 03:01:42 -0800 (PST) X-Google-Smtp-Source: AHgI3IYZ4CKDuI53qUu+b31cnEoI7jKhwM9t8GdJWPixAYFLD0pSxe4hAktmEnAU5msYCMFbStup X-Received: by 2002:a62:864c:: with SMTP id x73mr3406770pfd.49.1550142102467; Thu, 14 Feb 2019 03:01:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550142102; cv=none; d=google.com; s=arc-20160816; b=LEE95vJfRk53jcL1O01J4h+bReKRfwH+KpFg89its2wMUUp2MSV+uao4GCCCi2v5oc ndJL8uGyW2NjPziQ4cZZocJ3I6Mj6ALP11kgTqbyP84GtTThg1YQNwD7HOGAhX8XOfrf q0U8duCqd6HhybCpIlk7jCWB4NVgaKadlR6ZSDV9jbWsIi69HHDGyXyu4xw3mwmqG+oY vwxyTsIex83QQdpFs8ylIVi1y85inOCpIUIVG/01rbsgPSX4y4tSDsnBnW7gO1e6qIyZ Vj/zILGEIP8hvg65HGilJOeeLWl27ZB3RagI//uK+u8OoyoG1UKbQsjFUarodIdwOzAL WBGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:dlp-filter:cms-type :content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:organization:from:cc:to:subject :dkim-signature:dkim-filter; bh=jDA70eQaicai9JsUYh1vmLN778BbVHBl4FFTfnLvFIU=; b=dFXO9hwQZr3AZxtYoM+QyWjblnAVMhwmmAdNNzeR5DCUpbCWpuEWbDgc4LyCsU+ifl fqvRk/0IU7x4CBy6Kd34V9dbvdAo3yD4mjEJ2gI2IX3ouQC0+ziqoaEKG6kB5cad1Jf9 d2XMsa8ROdVIbHD5HsMRQiy6g6qaLhGdBLGvjudoPlI7LPInyetnfFXzt2jx0sqFnl7x g1k0z11d5BPE74BZwFzHoDjAbn7Rl1isnuTP2OcAYoqQayFOQgoAho8K2iPhhMQ+1Xbb /98bi4wAU3hZaLn4upgZTrARD1s5XgC6T62SJL734BMQ/r3rW1/l2XLmRKDpjGYmfl3P J8Qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=EVwaLG5k; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id s5si2141070pfk.97.2019.02.14.03.01.21; Thu, 14 Feb 2019 03:01:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=EVwaLG5k; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726602AbfBNFCB (ORCPT + 99 others); Thu, 14 Feb 2019 00:02:01 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:49257 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726535AbfBNFCB (ORCPT ); Thu, 14 Feb 2019 00:02:01 -0500 Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20190214050159epoutp03d065b057c75abf020ead34c168287f9c~DImY0FfAa0034100341epoutp03a for ; Thu, 14 Feb 2019 05:01:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20190214050159epoutp03d065b057c75abf020ead34c168287f9c~DImY0FfAa0034100341epoutp03a DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1550120519; bh=jDA70eQaicai9JsUYh1vmLN778BbVHBl4FFTfnLvFIU=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=EVwaLG5kks70UlFpXcsoZLUc/zS66uuUq9rmxiQolLBcnA68i3BZfw72IzbeJ0Zdb 4jU80aeZK2AINv5jfDFP9l1htle+r6QZ0H+8ScCmhHydLngAWOb12zuLs6nnDuBoxB cK83uKBg0O5VZWmdmSZ0oEaPXbgk5KHrCEvjRluk= Received: from epsmges1p4.samsung.com (unknown [182.195.40.154]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20190214050155epcas1p26aef811aa934bb0fe2452a7d704e052f~DImVItCNd1566315663epcas1p2H; Thu, 14 Feb 2019 05:01:55 +0000 (GMT) Received: from epcas1p2.samsung.com ( [182.195.41.46]) by epsmges1p4.samsung.com (Symantec Messaging Gateway) with SMTP id EF.4E.04288.346F46C5; Thu, 14 Feb 2019 14:01:55 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas1p2.samsung.com (KnoxPortal) with ESMTPA id 20190214050154epcas1p2d03b2794217738362b46666e83871dda~DImUnOABF3136831368epcas1p22; Thu, 14 Feb 2019 05:01:54 +0000 (GMT) Received: from epsmgms1p2new.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20190214050154epsmtrp2516c24b920786fa7b6d900a6a7707c62~DImUchtzR1630016300epsmtrp2B; Thu, 14 Feb 2019 05:01:54 +0000 (GMT) X-AuditID: b6c32a38-c0fff700000010c0-4c-5c64f643f7e5 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 7C.8D.03601.246F46C5; Thu, 14 Feb 2019 14:01:54 +0900 (KST) Received: from [10.113.221.102] (unknown [10.113.221.102]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20190214050154epsmtip2b03a2c499f8857cf51770278e8b5226d~DImUIwFqv0808008080epsmtip2W; Thu, 14 Feb 2019 05:01:54 +0000 (GMT) Subject: Re: [PATCH v3 6/7] trace: events: add devfreq trace event file To: Lukasz Luba , Steven Rostedt Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, b.zolnierkie@samsung.com, myungjoo.ham@samsung.com, kyungmin.park@samsung.com, m.szyprowski@samsung.com, s.nawrocki@samsung.com, joel@joelfernandes.org, chris.diamand@arm.com, mka@chromium.org, mingo@redhat.com From: Chanwoo Choi Organization: Samsung Electronics Message-ID: <3e44ca8a-a72b-8bdd-e702-00c927bd3c06@samsung.com> Date: Thu, 14 Feb 2019 14:01:53 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrHJsWRmVeSWpSXmKPExsWy7bCmnq7zt5QYg+/HWSw2zljPajHt02UW i2UNqhZnm96wW9xqkLG4vGsOm8Xn3iOMFmuP3GW3uHRgAZPF5w2PGS1uN65gs9jX8YDJ4vCb dlYHXo8189YwesxuuMji0bLvFrvHwk9fWT0OvtvD5PF+31U2j74tqxg9Pm+SC+CIyrbJSE1M SS1SSM1Lzk/JzEu3VfIOjneONzUzMNQ1tLQwV1LIS8xNtVVy8QnQdcvMAbpYSaEsMacUKBSQ WFyspG9nU5RfWpKqkJFfXGKrlFqQklNgWaBXnJhbXJqXrpecn2tlaGBgZApUmJCd0bTuL0vB HdmKj98WsDUw/hPvYuTkkBAwkWg78ZWpi5GLQ0hgB6NE381F7BDOJ0aJuds/QznfGCVezvjH DNNyfcMlJhBbSGAvo8SbT24QRe8ZJW693wpWJCzgLrH56gEWEFtEIESi+f9ENhCbWWAak8Ss CYkgNpuAlsT+FzfA4vwCihJXfzxm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NK2AncfvRJDaQbSwCqhKTHjmChEUF IiQ+Pt3HBFEiKHFy5hOwZZxAi38dmg42hllAXeLPvEvMELa4xK0n85kgbHmJ5q2zmScwCs9C 0j4LScssJC2zkLQsYGRZxSiZWlCcm55bbFhglJdarlecmFtcmpeul5yfu4kRHKVaWjsYT5yI P8QowMGoxMOrIJASI8SaWFZcmXuIUYKDWUmEV/EjUIg3JbGyKrUoP76oNCe1+BCjNAeLkjiv fP6xSCGB9MSS1OzU1ILUIpgsEwenVAOjGvc5U60uvRnt3okav3o3cFl1xx/Oyf3TXXDN6nDS k0eHK3f1JR7QTZqqYXRjnu7aeUcXtR5s1hS5mNwj3s3wxlBTf4WMUgDvVoaQf4YyZk3b/A5z 8zRdCwqY387RddLo4ZPKspu9f5uW75WICrp/pCN+D6P5z/OO7UsMGWdXeT/yur7L54cSS3FG oqEWc1FxIgAQTd5RzgIAAA== X-CMS-MailID: 20190214050154epcas1p2d03b2794217738362b46666e83871dda X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20190212222437eucas1p198db6fca1f1ba3056d93c57327dd48ed References: <1550010238-24002-1-git-send-email-l.luba@partner.samsung.com> <1550010238-24002-7-git-send-email-l.luba@partner.samsung.com> <20190212181415.1156e542@gandalf.local.home> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Lukasz, On 19. 2. 13. 오후 10:35, Lukasz Luba wrote: > Hi Steven, > > On 2/13/19 12:14 AM, Steven Rostedt wrote: >> On Tue, 12 Feb 2019 23:23:57 +0100 >> Lukasz Luba wrote: >> >>> The patch adds a new file for with trace events for devfreq >>> framework. They are used for performance analysis of the framework. >>> It also contains updates in MAINTAINERS file adding new entry for >>> devfreq maintainers. >>> >>> Signed-off-by: Lukasz Luba >>> --- >>> MAINTAINERS | 1 + >>> include/trace/events/devfreq.h | 39 +++++++++++++++++++++++++++++++++++++++ >>> 2 files changed, 40 insertions(+) >>> create mode 100644 include/trace/events/devfreq.h >>> >>> diff --git a/MAINTAINERS b/MAINTAINERS >>> index 9919840..c042fda 100644 >>> --- a/MAINTAINERS >>> +++ b/MAINTAINERS >>> @@ -4447,6 +4447,7 @@ S: Maintained >>> F: drivers/devfreq/ >>> F: include/linux/devfreq.h >>> F: Documentation/devicetree/bindings/devfreq/ >>> +F: include/trace/events/devfreq.h >>> >>> DEVICE FREQUENCY EVENT (DEVFREQ-EVENT) >>> M: Chanwoo Choi >>> diff --git a/include/trace/events/devfreq.h b/include/trace/events/devfreq.h >>> new file mode 100644 >>> index 0000000..fec9304 >>> --- /dev/null >>> +++ b/include/trace/events/devfreq.h >>> @@ -0,0 +1,39 @@ >>> +/* SPDX-License-Identifier: GPL-2.0 */ >>> +#undef TRACE_SYSTEM >>> +#define TRACE_SYSTEM devfreq >>> + >>> +#if !defined(_TRACE_DEVFREQ_H) || defined(TRACE_HEADER_MULTI_READ) >>> +#define _TRACE_DEVFREQ_H >>> + >>> +#include >>> +#include >>> + >>> +TRACE_EVENT(devfreq_monitor, >>> + TP_PROTO(const char *dev_name, unsigned long freq, >>> + unsigned int polling_ms, unsigned long busy_time, >>> + unsigned long total_time), >>> + >>> + TP_ARGS(dev_name, freq, polling_ms, busy_time, total_time), >>> + >>> + TP_STRUCT__entry( >>> + __string(dev_name, dev_name) >>> + __field(unsigned long, freq) >>> + __field(unsigned int, polling_ms) >>> + __field(unsigned int, load) >>> + ), >>> + >>> + TP_fast_assign( >>> + __assign_str(dev_name, dev_name); >>> + __entry->freq = freq; >>> + __entry->polling_ms = polling_ms; >>> + __entry->load = (100 * busy_time) / total_time; >> >> How critical is the code that this trace event is called in. If it is >> not that critical (it is a slow path), then this is fine, but if this >> is not a slow path (something triggered 100 HZ or less), then I would >> recommend moving the above calculation to TP_printk(). A divide is a >> slow operation, and is best to do that in the post processing. The >> current location does the divide at the time of the tracepoint is >> called. > I wasn't aware of these two stages, good to know. > I will move it to TP_printk(). >> >> I would also have a check to make sure that total_time is not zero >> here, otherwise that could be bad. >> >> __entry->busy_time = busy_time; >> __entry->total_time = total_time; >> > >>> + ), >>> + >>> + TP_printk("dev_name=%s freq=%lu polling_ms=%u load=%u", >> >> >>> + __get_str(dev_name), __entry->freq, __entry->polling_ms, >> >> __entry->total_time == 0 ? 100 : >> __entry->busy_time / __entry->total_time) > Thank you for the review. > I will add this check. > > Regards, > Lukasz >> >> -- Steve >> >>> + __entry->load) >>> +); >>> +#endif /* _TRACE_DEVFREQ_H */ >>> + >>> +/* This part must be outside protection */ >>> +#include >> >> >> > > I agree that trace point is necessary for devfreq framework. Reviewed-by: Chanwoo Choi -- Best Regards, Chanwoo Choi Samsung Electronics