Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3643319pxb; Mon, 9 Nov 2020 17:22:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJzNTmlmdE+ZEt2FfABnE9egYDBoBuk9BWNaOi4mKyDtk+Tnj4roON+V6cl/lLocJGcNRFUo X-Received: by 2002:a17:906:6409:: with SMTP id d9mr17605180ejm.344.1604971363473; Mon, 09 Nov 2020 17:22:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604971363; cv=none; d=google.com; s=arc-20160816; b=RzW/Fu/emY4bJUhzHZ9vfit3NuT3N256r+w1OLg/l+FOF+MSfjED8C1wlUDjsWT1ER 6B0FO1mpeqA94k8arRzNcVWjoMonwZKxnC/NkC86gUEJjyT0uChLcmojvojdE5XjgRjD sgakbzq5ajCXq1FWOPuHXJt+RYjbyNUD/jPDe/pE8DOIdYJPj7LRWZfqdYjfcYjKk4ja DReoDVS3l3z6CMvJzAJyeLzXltOW5Qj1Ug8YPMscb75c578Z2fsYdajRh56KocbwJM1U H46R8HMw2SsYDL3ZRPfludD+2skGIr7D2rpTLAZFX3h00ZgG4HzkMeCw/AuMMgzQ8pC8 tQ1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dmarc-filter:sender:dkim-signature; bh=9MKIGQAXp8A+ozocsGiZTvpM0KLLijTmFPwS8EuPCoc=; b=h+fobgW4Z/k7XtyqwXO29fae5bSe3eU/H/5G3sfIlVGrrXke8TrMH15g9aehcjS229 FAK0EsK/kGexToCGJvuh6GVLNfezNqdFLVqZHPvzs7M+LG8luIbPb8AHqm9K0Cvp2pxf ZodYgHfCW/0IgSGtQJcXg6bpmijlEl+J+0ys9NxnuBsYDNzc8YNLBj7UluO7/eW+GVyK uR706ddEpr+sBsy6SNTiG/I9D821zVxq9ci0Ty7ypw9ftIUNnjuLEPXiDFhzjrJDw2jP kvUDjPvf0ReNVWZVIQTc35e3lnqxyf55llGBJqFt7vQWj6OYiOHBea1slOqSXQ/OX9eH f2WA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b="oV2zrv/w"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x3si8992729eds.522.2020.11.09.17.22.20; Mon, 09 Nov 2020 17:22:43 -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=@mg.codeaurora.org header.s=smtp header.b="oV2zrv/w"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730910AbgKJBUv (ORCPT + 99 others); Mon, 9 Nov 2020 20:20:51 -0500 Received: from m42-4.mailgun.net ([69.72.42.4]:60204 "EHLO m42-4.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727311AbgKJBUv (ORCPT ); Mon, 9 Nov 2020 20:20:51 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1604971250; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=9MKIGQAXp8A+ozocsGiZTvpM0KLLijTmFPwS8EuPCoc=; b=oV2zrv/wjN+8LsEnwEpT1MFEv8oVFjeJuV841nltfZM5D5Tu5g3yc7O9UQxrquIDvBLvc8SV N9QzJjosrj8YFNYTceYUH0aNA7ark7c/iNm87NXvt3WQo2TlRA2Rh1cmlz8jjNcwoOWvsd6Z hcXssHiojRt73AM/QheKoavHsxM= X-Mailgun-Sending-Ip: 69.72.42.4 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n04.prod.us-east-1.postgun.com with SMTP id 5fa9eaf20fe4be3f43593144 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 10 Nov 2020 01:20:50 GMT Sender: rishabhb=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 90C51C433FF; Tue, 10 Nov 2020 01:20:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from rishabhb-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: rishabhb) by smtp.codeaurora.org (Postfix) with ESMTPSA id 9888BC433CB; Tue, 10 Nov 2020 01:20:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 9888BC433CB Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=rishabhb@codeaurora.org From: Rishabh Bhatnagar To: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: bjorn.andersson@linaro.org, tsoni@codeaurora.org, psodagud@codeaurora.org, sidgup@codeaurora.org, Rishabh Bhatnagar Subject: [PATCH 1/2] soc: qcom: Add tracepoints to mdt loader Date: Mon, 9 Nov 2020 17:20:40 -0800 Message-Id: <1604971241-29000-2-git-send-email-rishabhb@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1604971241-29000-1-git-send-email-rishabhb@codeaurora.org> References: <1604971241-29000-1-git-send-email-rishabhb@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add trace events to the mdt loader driver. These events can help us trace the region where we are loading the segments and the time it takes to initialize the image and setup the memory region. Signed-off-by: Rishabh Bhatnagar --- drivers/soc/qcom/mdt_loader.c | 8 ++++++ include/trace/events/mdt_loader.h | 57 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 include/trace/events/mdt_loader.h diff --git a/drivers/soc/qcom/mdt_loader.c b/drivers/soc/qcom/mdt_loader.c index 24cd193..df69e23 100644 --- a/drivers/soc/qcom/mdt_loader.c +++ b/drivers/soc/qcom/mdt_loader.c @@ -17,6 +17,9 @@ #include #include +#define CREATE_TRACE_POINTS +#include + static bool mdt_phdr_valid(const struct elf32_phdr *phdr) { if (phdr->p_type != PT_LOAD) @@ -169,6 +172,7 @@ static int __qcom_mdt_load(struct device *dev, const struct firmware *fw, goto out; } + trace_memory_setup("pas_init_image", fw_name); ret = qcom_scm_pas_init_image(pas_id, metadata, metadata_len); kfree(metadata); @@ -196,8 +200,10 @@ static int __qcom_mdt_load(struct device *dev, const struct firmware *fw, if (relocate) { if (pas_init) { + trace_memory_setup("pas_mem_setup", fw_name); ret = qcom_scm_pas_mem_setup(pas_id, mem_phys, max_addr - min_addr); + if (ret) { dev_err(dev, "unable to setup relocation\n"); goto out; @@ -232,6 +238,8 @@ static int __qcom_mdt_load(struct device *dev, const struct firmware *fw, ptr = mem_region + offset; + trace_regions(ptr, phdr->p_filesz, i); + if (phdr->p_filesz && phdr->p_offset < fw->size) { /* Firmware is large enough to be non-split */ if (phdr->p_offset + phdr->p_filesz > fw->size) { diff --git a/include/trace/events/mdt_loader.h b/include/trace/events/mdt_loader.h new file mode 100644 index 0000000..6299f65 --- /dev/null +++ b/include/trace/events/mdt_loader.h @@ -0,0 +1,57 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (c) 2020, The Linux Foundation. All rights reserved. + */ + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM mdt_loader + +#if !defined(_TRACE_MDT_LOADER_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_MDT_LOADER_H + +#include +#include + +TRACE_EVENT(memory_setup, + + TP_PROTO(const char *event, char *fw_name), + + TP_ARGS(event, fw_name), + + TP_STRUCT__entry( + __string(event, event) + __string(fw_name, fw_name) + ), + + TP_fast_assign( + __assign_str(event, event); + __assign_str(fw_name, fw_name); + ), + + TP_printk("doing %s for %s", __get_str(event), __get_str(fw_name)) +); + +TRACE_EVENT(regions, + + TP_PROTO(void *region_start, size_t region_size, int i), + + TP_ARGS(region_start, region_size, i), + + TP_STRUCT__entry( + __field(void *, region_start) + __field(size_t, region_size) + __field(int, index) + ), + + TP_fast_assign( + __entry->region_start = region_start; + __entry->region_size = region_size; + __entry->index = i; + ), + + TP_printk("segment %d: region start=%pK size=%zx", __entry->index, + __entry->region_start, __entry->region_size) +); + +#endif +#include -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project