Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp487148pxu; Fri, 11 Dec 2020 07:05:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJx8jqmXF0xpF0acXiZAZZ4XgcQNRhwOy1Ss/FB1OatvKTCQMrGLvQ86ZXysmqBcQzheFyw6 X-Received: by 2002:a17:906:6693:: with SMTP id z19mr11168744ejo.376.1607699157266; Fri, 11 Dec 2020 07:05:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607699157; cv=none; d=google.com; s=arc-20160816; b=d1RBiNDFI1BWXknH7ADefpE81NRuw/a9jYC3hGXqy8Lhm7XPio7xX+3D/VSfrgUwTG PppngPsPwMN2jivUzqGVuTR3lUIOhgvCPAtFvmXzVTEUhU0O4mMgBMfWCF5nzqdELf96 PFvfL/2hlwek3uoJeT4TL4rEfl0egmrA4owT8AtWCY8ebK620SgqOAjhM7oqhu2qeLjz cEuj+O3CtfFuS4ejXgMWaDLUtDJ5MdpNvj7B6CBS5yH0hHPyRL162soLTFGhOtQdJlnG 2jaYkFOtIvm5lNgcXF3mvkIC+oVnb23VFDzb07HLWFBtve4NfsHxzfhLDU0Mq5gLTa8T 7iiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=0WIm/b5GDSiNvjX5ZdgOqsnZwxxISiPiAUIdEi8cV0Q=; b=H/li27L9T9ktXChPQ54yeHOmqWO4B78RuTH/CZWBz0Zy3W3gO3qfhfBEb4V+MLCoU5 FkA6diISQjcIcqld3sY1EII5B0XlApALL6qM2xqkPxhcVWdjS4CRSPrxM9EmT7ry2GWq V3t7+69pK+iCyPjHoxA9uu3jxFP9XtVNAhwUb86eTenDZBuhiGYdp7J2ylaCl4MWeI/H TjAWXOq/CdqjK3HxcgT5rLJhdaaPGF8FB6pwJd/9Lzb/FDLkFMwD9utp8m5A9jDJC2HO GgYKNKTFwsUFheSLDjlIUgm0gufdjSgEz4H6cjsEQxr9vmmOSQ0udukUNLkEwelLGQJP EPjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kjz8ekFy; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kt2si4461590ejb.124.2020.12.11.07.05.33; Fri, 11 Dec 2020 07:05:57 -0800 (PST) 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=@linaro.org header.s=google header.b=kjz8ekFy; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392552AbgLJRN3 (ORCPT + 99 others); Thu, 10 Dec 2020 12:13:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392280AbgLJRNM (ORCPT ); Thu, 10 Dec 2020 12:13:12 -0500 Received: from mail-oo1-xc42.google.com (mail-oo1-xc42.google.com [IPv6:2607:f8b0:4864:20::c42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AD7FC06179C for ; Thu, 10 Dec 2020 09:12:32 -0800 (PST) Received: by mail-oo1-xc42.google.com with SMTP id h10so1442632ooi.10 for ; Thu, 10 Dec 2020 09:12:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=0WIm/b5GDSiNvjX5ZdgOqsnZwxxISiPiAUIdEi8cV0Q=; b=kjz8ekFyK0bkeLDkpFqDpqDdx5h9rugLHulW3Ks14r6OvnK2pOB3FR7psYOHUvnKhJ T53OLETGFp7QzcmsU/1uHBMyTPDepy7HDXcN6kXGH6dFn0hzCHc826JcZWU80ukP1hew IGlzGb7lf1Yip/HjV6a+jElRh3azO0PecpJyt8gqTkIaLoSEP/KyxH4+DaK6CNz982vF 5Cj8Z+bmYUfO62tKC9MRFdy12aUkxjR3hyvQa7XRbsov32hIPvin/BCPmeQ6XFgZmIzh BCDw6hHEIxnq3V6sLzLel7ArWQ7R33hkKVF5FzOHvHwF4ZTie5OOMp2QldV6jx3CeNJ8 TGjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=0WIm/b5GDSiNvjX5ZdgOqsnZwxxISiPiAUIdEi8cV0Q=; b=sMSNb7QLjFAztF+Jx+0Y0rLok1W6vOygPM3zHLpP4bbaN2+OGczeh01PaTDL6slzsr 5YFHNwa4wLcbGBwb6Zaa9Rpzc8hDPkSH/FKx7jrOYj/i+WKaJyKi/ISVBzKv8KMmRzu1 W9nVGHCa2HUHPqBpxhdm2odLLu+tV8D6UC89H1p5amdt7izHARAuBe0rmvhrtagMpzK7 JMkGIxCug+BlrsrjHnwFsKicRkOKEaj7XiPldxFHoJSOPCEoK1z2OsE1/ePy2NA4zCgp qTbkfZY+wVWxDw1ALRMliRPfVNbCxMsy9C/yfkhIEkvDGUc1+5y7kig2wzmlBj9fP0+L 6taw== X-Gm-Message-State: AOAM532num5bMnZ4tegveushQEs+Myjl7dk3zdGx4JJDDqPe1SAc9Zrk J5WXMZt1q0LNLkfgZPhtOWqDbQ== X-Received: by 2002:a4a:d043:: with SMTP id x3mr6631894oor.19.1607620351334; Thu, 10 Dec 2020 09:12:31 -0800 (PST) Received: from builder.lan (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id b25sm1191416ooe.18.2020.12.10.09.12.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Dec 2020 09:12:30 -0800 (PST) Date: Thu, 10 Dec 2020 11:12:29 -0600 From: Bjorn Andersson To: Rishabh Bhatnagar Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, tsoni@codeaurora.org, psodagud@codeaurora.org, sidgup@codeaurora.org Subject: Re: [PATCH v2 2/3] firmware: scm: Add tracepoints to scm driver for pas calls Message-ID: References: <1605563084-30385-1-git-send-email-rishabhb@codeaurora.org> <1605563084-30385-3-git-send-email-rishabhb@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1605563084-30385-3-git-send-email-rishabhb@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 16 Nov 15:44 CST 2020, Rishabh Bhatnagar wrote: > Add trace events to the qcom_scm driver to trace pas calls. > These events can help us analyze the time impact for each scm > operation and can also serve as standard checkpoints in code. > > Signed-off-by: Rishabh Bhatnagar > --- > drivers/firmware/qcom_scm.c | 9 +++++++++ > include/trace/events/qcom_scm.h | 34 ++++++++++++++++++++++++++++++++++ > 2 files changed, 43 insertions(+) > create mode 100644 include/trace/events/qcom_scm.h > > diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c > index 7be48c1..5bc9b65 100644 > --- a/drivers/firmware/qcom_scm.c > +++ b/drivers/firmware/qcom_scm.c > @@ -19,6 +19,9 @@ > > #include "qcom_scm.h" > > +#define CREATE_TRACE_POINTS > +#include > + > static bool download_mode = IS_ENABLED(CONFIG_QCOM_SCM_DOWNLOAD_MODE_DEFAULT); > module_param(download_mode, bool, 0); > > @@ -442,6 +445,7 @@ int qcom_scm_pas_init_image(u32 peripheral, const void *metadata, size_t size) > }; > struct qcom_scm_res res; > > + trace_qcom_scm_call("Start scm_pas_init_image"); Please don't trace human readable strings into the trace buffer. Also, aren't you curious about at least which @peripheral this was? > /* > * During the scm call memory protection will be enabled for the meta > * data blob, so make sure it's physically contiguous, 4K aligned and > @@ -467,6 +471,7 @@ int qcom_scm_pas_init_image(u32 peripheral, const void *metadata, size_t size) > > free_metadata: > dma_free_coherent(__scm->dev, size, mdata_buf, mdata_phys); > + trace_qcom_scm_call("Complete scm_pas_init_image"); Wouldn't it be useful to know if this call succeeded? > > return ret ? : res.result[0]; > } > @@ -495,6 +500,7 @@ int qcom_scm_pas_mem_setup(u32 peripheral, phys_addr_t addr, phys_addr_t size) > }; > struct qcom_scm_res res; > > + trace_qcom_scm_call("Start scm_pas_mem_setup"); Wouldn't it be useful to know the @peripheral, @addr and @size here? > ret = qcom_scm_clk_enable(); > if (ret) > return ret; > @@ -502,6 +508,7 @@ int qcom_scm_pas_mem_setup(u32 peripheral, phys_addr_t addr, phys_addr_t size) > ret = qcom_scm_call(__scm->dev, &desc, &res); > qcom_scm_clk_disable(); > > + trace_qcom_scm_call("Complete scm_pas_mem_setup"); Ditto. > return ret ? : res.result[0]; > } > EXPORT_SYMBOL(qcom_scm_pas_mem_setup); > @@ -525,6 +532,7 @@ int qcom_scm_pas_auth_and_reset(u32 peripheral) > }; > struct qcom_scm_res res; > > + trace_qcom_scm_call("Start auth_and_reset"); Ditto. > ret = qcom_scm_clk_enable(); > if (ret) > return ret; > @@ -532,6 +540,7 @@ int qcom_scm_pas_auth_and_reset(u32 peripheral) > ret = qcom_scm_call(__scm->dev, &desc, &res); > qcom_scm_clk_disable(); > > + trace_qcom_scm_call("Complete auth_and_reset"); Ditto. > return ret ? : res.result[0]; > } > EXPORT_SYMBOL(qcom_scm_pas_auth_and_reset); > diff --git a/include/trace/events/qcom_scm.h b/include/trace/events/qcom_scm.h > new file mode 100644 > index 0000000..d918332 > --- /dev/null > +++ b/include/trace/events/qcom_scm.h > @@ -0,0 +1,34 @@ > +/* SPDX-License-Identifier: GPL-2.0-only */ > +/* > + * Copyright (c) 2020, The Linux Foundation. All rights reserved. > + */ > + > +#undef TRACE_SYSTEM > +#define TRACE_SYSTEM qcom_scm > + > +#if !defined(_TRACE_QCOM_SCM_H) || defined(TRACE_HEADER_MULTI_READ) > +#define _TRACE_QCOM_SCM_H > + > +#include > +#include > + > +TRACE_EVENT(qcom_scm_call, > + > + TP_PROTO(const char *event), > + > + TP_ARGS(event), > + > + TP_STRUCT__entry( > + __string(event, event) > + ), > + > + TP_fast_assign( > + __assign_str(event, event); > + ), > + > + TP_printk("qcom_scm_call event:%s", __get_str(event)) We already know that this is the qcom_scm_call trace event, so no need to include that in the trace data. Regards, Bjorn > +); > + > +#endif > +#include > + > -- > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > a Linux Foundation Collaborative Project >