Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2317619ybc; Wed, 13 Nov 2019 12:26:54 -0800 (PST) X-Google-Smtp-Source: APXvYqylRGPIViFfWaTpSARY6OErLtvh/gyM9XL2TRvZezj1+f00EoPQvcwilcRV4f1UXxHZonp7 X-Received: by 2002:aa7:d2cf:: with SMTP id k15mr5805406edr.267.1573676814358; Wed, 13 Nov 2019 12:26:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573676814; cv=none; d=google.com; s=arc-20160816; b=h310Nx/HuoBbf/jcHF4qodSelr4d0rT7zf2MV/VuSjJJNTpJB2cXBXcLjmZ0Sd8jIX /e3IMzk8sW5W803xmtLJpmSYvrMvqmWkt9toErWKXhmmdMZ3+mnR/9PJNuAJSM8Pdh8l kMdQddz9oNxCuaZntX0sVd0ZzmfZKOFhgq0QefQgNZfpcJ9QCsTLjAeLsFBi5BUDSFFf MwQruISF0W2FhbkhtFXw7SGH5PiIrT03mZzvPx8V+Os7lOtPCNMHGb6ZX9TNdEs0HAFx VWugyPN0KKRMzrhc5zEFXoHZpQHFO+3uNeHptv2L9+7a/PeWUu3VU9eGjIiSbnZTxOfz HpWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=X4MIeTf1x8zF3kgTx0tJMWa9XkQ5kUzM5YM4cQUxtH0=; b=OxezgxZSXn0CPHxHCNsXLS2uPR7BXAFliogagekadDVfVcyO3coEI0egPR6hDYW5D1 30Aw7aPZflpDea8Y+3j55KnHFMz0T2ZcU2yrHyiBH3/7U44e5l3bIoCpT9tjieux7wBQ EapVeA9V1nzGynn5VKNi7TMQsFFqtaGJHO7w2VHhzEn5jNj8dTBRxHpbad4eKhXg9JZL Crp+iTC9mBeeZ45fSu5p+KTlyW6eQln/B+dUs91ItpQukRpJTlG+J8tcT6Myb2iP/rp0 VQXpGDIDnRSn9KTxqtjrJJoy1pAha+WoK2AIVSKeEooLRxvqw89wgtAgEnqt24WkW1Ma 4qTA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b37si2406608edf.186.2019.11.13.12.26.30; Wed, 13 Nov 2019 12:26:54 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726590AbfKMUXV (ORCPT + 99 others); Wed, 13 Nov 2019 15:23:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:50292 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726179AbfKMUXV (ORCPT ); Wed, 13 Nov 2019 15:23:21 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A19FA206EC; Wed, 13 Nov 2019 20:23:19 +0000 (UTC) Date: Wed, 13 Nov 2019 15:23:17 -0500 From: Steven Rostedt To: Georgi Djakov Cc: linux-pm@vger.kernel.org, mingo@redhat.com, bjorn.andersson@linaro.org, vincent.guittot@linaro.org, daidavid1@codeaurora.org, okukatla@codeaurora.org, evgreen@chromium.org, mka@chromium.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 3/3] interconnect: Add basic tracepoints Message-ID: <20191113152317.00318ad8@gandalf.local.home> In-Reply-To: <20191101130031.27996-4-georgi.djakov@linaro.org> References: <20191101130031.27996-1-georgi.djakov@linaro.org> <20191101130031.27996-4-georgi.djakov@linaro.org> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 1 Nov 2019 15:00:31 +0200 Georgi Djakov wrote: > diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c > index df44ef713db5..15e11e22ddf7 100644 > --- a/drivers/interconnect/core.c > +++ b/drivers/interconnect/core.c > @@ -26,6 +26,9 @@ static LIST_HEAD(icc_providers); > static DEFINE_MUTEX(icc_lock); > static struct dentry *icc_debugfs_dir; > > +#define CREATE_TRACE_POINTS > +#include > + > static void icc_summary_show_one(struct seq_file *s, struct icc_node *n) > { > if (!n) > @@ -435,6 +438,8 @@ int icc_set_bw(struct icc_path *path, u32 avg_bw, u32 peak_bw) > > /* aggregate requests for this node */ > aggregate_requests(node); > + > + trace_icc_set_bw(path, node, i, avg_bw, peak_bw); > } > > ret = apply_constraints(path); > @@ -453,6 +458,8 @@ int icc_set_bw(struct icc_path *path, u32 avg_bw, u32 peak_bw) > > mutex_unlock(&icc_lock); > > + trace_icc_set_bw_end(path, ret); > + > return ret; > } > EXPORT_SYMBOL_GPL(icc_set_bw); > diff --git a/include/trace/events/interconnect.h b/include/trace/events/interconnect.h > new file mode 100644 > index 000000000000..64b646aa7bd3 > --- /dev/null > +++ b/include/trace/events/interconnect.h > @@ -0,0 +1,81 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +/* > + * Copyright (c) 2019, Linaro Ltd. > + * Author: Georgi Djakov > + */ > + > +#if !defined(_TRACE_INTERCONNECT_H) || defined(TRACE_HEADER_MULTI_READ) > +#define _TRACE_INTERCONNECT_H > + > +#include > + > +#undef TRACE_SYSTEM > +#define TRACE_SYSTEM interconnect > + > +#include "../../../drivers/interconnect/internal.h" Ug. I would recommend placing this file in with drivers/interconnect, and call it simply trace.h, or interconnect_trace.h. Then you can include "internal.h" nicely. To do so, you need to add to drivers/interconnect/Makefile: CFLAGS_core.o := -I$(src) To have core.c include this file. Rest looks fine. -- Steve > + > +TRACE_EVENT(icc_set_bw, > + > + TP_PROTO(struct icc_path *p, struct icc_node *n, int i, > + u32 avg_bw, u32 peak_bw), > + > + TP_ARGS(p, n, i, avg_bw, peak_bw), > + > + TP_STRUCT__entry( > + __string(path_name, p->name) > + __string(dev, dev_name(p->reqs[i].dev)) > + __string(node_name, n->name) > + __field(u32, avg_bw) > + __field(u32, peak_bw) > + __field(u32, node_avg_bw) > + __field(u32, node_peak_bw) > + ), > + > + TP_fast_assign( > + __assign_str(path_name, p->name); > + __assign_str(dev, dev_name(p->reqs[i].dev)); > + __assign_str(node_name, n->name); > + __entry->avg_bw = avg_bw; > + __entry->peak_bw = peak_bw; > + __entry->node_avg_bw = n->avg_bw; > + __entry->node_peak_bw = n->peak_bw; > + ), > + > + TP_printk("path=%s dev=%s node=%s avg_bw=%u peak_bw=%u agg_avg=%u agg_peak=%u", > + __get_str(path_name), > + __get_str(dev), > + __get_str(node_name), > + __entry->avg_bw, > + __entry->peak_bw, > + __entry->node_avg_bw, > + __entry->node_peak_bw) > +); > + > +TRACE_EVENT(icc_set_bw_end, > + > + TP_PROTO(struct icc_path *p, int ret), > + > + TP_ARGS(p, ret), > + > + TP_STRUCT__entry( > + __string(path_name, p->name) > + __string(dev, dev_name(p->reqs[0].dev)) > + __field(int, ret) > + ), > + > + TP_fast_assign( > + __assign_str(path_name, p->name); > + __assign_str(dev, dev_name(p->reqs[0].dev)); > + __entry->ret = ret; > + ), > + > + TP_printk("path=%s dev=%s ret=%d", > + __get_str(path_name), > + __get_str(dev), > + __entry->ret) > +); > + > +#endif /* _TRACE_INTERCONNECT_H */ > + > +/* This part must be outside protection */ > +#include