From patchwork Fri Nov 22 15:27:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 11258085 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7564A1390 for ; Fri, 22 Nov 2019 15:27:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 482072073F for ; Fri, 22 Nov 2019 15:27:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="NaRspV1i" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727254AbfKVP1S (ORCPT ); Fri, 22 Nov 2019 10:27:18 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:40484 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726736AbfKVP1S (ORCPT ); Fri, 22 Nov 2019 10:27:18 -0500 Received: by mail-wr1-f68.google.com with SMTP id 4so5772358wro.7 for ; Fri, 22 Nov 2019 07:27:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uArUv8vdpySZgh7Lm5Xr7vRuWHgZ37E7MwLwkpMIDCE=; b=NaRspV1i9R/2DSgO46P3hMCkjk1YhaYl/30P0KnMRJ4U2uvFGg3fyz0Adr5Jvd2tOs eN0cW4S1Frgb4REXIEtg2D0LYumT1r8ky//58cBQQ3nZGGPeaxEo0lCTHngODV8isvfq W82UlSHKhkNGQOOq36treKn6APbHFSpLG+0dFlmrZZSujY7v8yE9lKTGkPRnL6nseJWm 01BumRD7UQxFXWoLol0hM1dgiNFU9P+mFr3MudOfVmKMxprhxWd5tWk789FwO7mK6Igz lOJRq6RcGGB1vWLC8Blp6UdSHvoICayQN2/Iz4s7GX/jXbDRLUPGeLRU8uCjFc2ygEvF vIGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uArUv8vdpySZgh7Lm5Xr7vRuWHgZ37E7MwLwkpMIDCE=; b=Hin95r0g4hXNdRyvQii2oFadgKm6BJjDBFjl4sbX3P6R1l9lLHgVvsUjwF/q5hhgZk b4nf1RmpdGvgE3JmVg9AemJnr2Bq8Z2k9zGHrOTbsHg3z2V+F1Qg7qUbuRi8Ehx+9Pec 8PVTqkxTrV54epkeWCltTc9tooEh0GnW7uhZGdXkNOHW7XqonjPEUDIKf3NuPbYzm5IE yim0gLLGeUaAKGgjnUc6j9jZt4ouNpMxUnK6s1OMy3xEDFwZoJdpP4xoVKGA0dLhDUbp LUBTshhDmfckimaKGT4ombg88LHdkA8whrCbiylD/wOKfPDl8JsKf+DJWeuYe6H/W1uq VRuA== X-Gm-Message-State: APjAAAXBoM6ZP/BTA/6y0y2A/zCkIo9a99o6ArzRbAElRxjKVgpYU3Xh I8nvk3X1NZk0Cm4lihjsd7qIUA== X-Google-Smtp-Source: APXvYqxpsLMTp4Sdlls7Ue49+WvdlWM7+fPYuN826F9zWH2JGbW4mESQKUt8w3gc6nmveBI8y85HEg== X-Received: by 2002:adf:fad1:: with SMTP id a17mr17735327wrs.328.1574436435728; Fri, 22 Nov 2019 07:27:15 -0800 (PST) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id a206sm4061081wmf.15.2019.11.22.07.27.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Nov 2019 07:27:15 -0800 (PST) From: Georgi Djakov To: linux-pm@vger.kernel.org, rostedt@goodmis.org, mingo@redhat.com Cc: 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, georgi.djakov@linaro.org Subject: [PATCH v3 1/3] interconnect: Move internal structs into a separate file Date: Fri, 22 Nov 2019 17:27:10 +0200 Message-Id: <20191122152712.19105-2-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191122152712.19105-1-georgi.djakov@linaro.org> References: <20191122152712.19105-1-georgi.djakov@linaro.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Move the interconnect framework internal structs into a separate file, so that it can be included and used by ftrace code. This will allow us to expose some more useful information in the traces. Signed-off-by: Georgi Djakov --- drivers/interconnect/core.c | 30 ++----------------------- drivers/interconnect/internal.h | 40 +++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 28 deletions(-) create mode 100644 drivers/interconnect/internal.h diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index c498796adc07..b06ed180bae3 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -19,39 +19,13 @@ #include #include +#include "internal.h" + static DEFINE_IDR(icc_idr); static LIST_HEAD(icc_providers); static DEFINE_MUTEX(icc_lock); static struct dentry *icc_debugfs_dir; -/** - * struct icc_req - constraints that are attached to each node - * @req_node: entry in list of requests for the particular @node - * @node: the interconnect node to which this constraint applies - * @dev: reference to the device that sets the constraints - * @tag: path tag (optional) - * @avg_bw: an integer describing the average bandwidth in kBps - * @peak_bw: an integer describing the peak bandwidth in kBps - */ -struct icc_req { - struct hlist_node req_node; - struct icc_node *node; - struct device *dev; - u32 tag; - u32 avg_bw; - u32 peak_bw; -}; - -/** - * struct icc_path - interconnect path structure - * @num_nodes: number of hops (nodes) - * @reqs: array of the requests applicable to this path of nodes - */ -struct icc_path { - size_t num_nodes; - struct icc_req reqs[]; -}; - static void icc_summary_show_one(struct seq_file *s, struct icc_node *n) { if (!n) diff --git a/drivers/interconnect/internal.h b/drivers/interconnect/internal.h new file mode 100644 index 000000000000..5853e8faf223 --- /dev/null +++ b/drivers/interconnect/internal.h @@ -0,0 +1,40 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Interconnect framework internal structs + * + * Copyright (c) 2019, Linaro Ltd. + * Author: Georgi Djakov + */ + +#ifndef __DRIVERS_INTERCONNECT_INTERNAL_H +#define __DRIVERS_INTERCONNECT_INTERNAL_H + +/** + * struct icc_req - constraints that are attached to each node + * @req_node: entry in list of requests for the particular @node + * @node: the interconnect node to which this constraint applies + * @dev: reference to the device that sets the constraints + * @tag: path tag (optional) + * @avg_bw: an integer describing the average bandwidth in kBps + * @peak_bw: an integer describing the peak bandwidth in kBps + */ +struct icc_req { + struct hlist_node req_node; + struct icc_node *node; + struct device *dev; + u32 tag; + u32 avg_bw; + u32 peak_bw; +}; + +/** + * struct icc_path - interconnect path structure + * @num_nodes: number of hops (nodes) + * @reqs: array of the requests applicable to this path of nodes + */ +struct icc_path { + size_t num_nodes; + struct icc_req reqs[]; +}; + +#endif From patchwork Fri Nov 22 15:27:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 11258093 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4930014DB for ; Fri, 22 Nov 2019 15:27:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 296FB20730 for ; Fri, 22 Nov 2019 15:27:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Ee4cbJHq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727258AbfKVP1T (ORCPT ); Fri, 22 Nov 2019 10:27:19 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:37353 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727197AbfKVP1T (ORCPT ); Fri, 22 Nov 2019 10:27:19 -0500 Received: by mail-wr1-f67.google.com with SMTP id t1so9107193wrv.4 for ; Fri, 22 Nov 2019 07:27:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eweICdklgtftJBxCro04D547skXpMw40lN0wG851Q8Y=; b=Ee4cbJHqmAb7pyy2MpzCOQm8pAD4EZdA9GpnkGAu00Qo6T6NoW6AyF8/fgzxC/5slv 5iRVO0Wr82T9F1XXz/1vTI6AXz7ta3qUDkp3B41/q5RJAta1wKh73G9ySad/CPZzyX3v UVkshIEEiIb11rkciVTahVMKB7z4j6t6tZzhd5g4qDIVQWlHLYBBr1FMgw4ZlF3JOK3S BFHI4O+1kJ5kAfn1NqotmKfJc2wMtESn9EB7YSvPnGFIq5VcJBLG8FOsQorCvFCWehrw IzioRR4M860jpSOOiFt6ZmMiH5a1a1Fjh/7qum6Civz6CPeLoH19PWCGWpWJWFThANtg AqYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eweICdklgtftJBxCro04D547skXpMw40lN0wG851Q8Y=; b=FGnvp+4AWClACewmtLqyr/1ND8FATFWQqWcrTMPt7SIyrcKt82/hgG/6fOygwbli8h lYjOiuOhbb8y/ZbPlZb1BsJFL0Q9nfhp2Rl61ZG7DmSNJM1LZZz9qaSyFPaG7CkqAP+a 4rAsSOl6Rfs3erKArANBOZiRkkCkB4cvVVvAAhRrHFUw4MhLSKoC25SpXKPQyAiBuFJF xhF1GcGYo0xpyxThmFLyegWq3nuFnWD4UPOB4X8ge+oN0MhyvRXjsdfnyqvRA7mmNtrF lgIjNJpLv6rbLmDQN4zA7EoE4a2knYwAaSXYENPZlGX2RfPZGV6xc3EN52ZqUlKVrGXF 0R5g== X-Gm-Message-State: APjAAAVfpwxQp5A64nVWP9Djj2cbhUY2KimyCjZfRiy0acP758uTknoj 4l52BHCXe4Zpdd5cXhjhrt3b0Q== X-Google-Smtp-Source: APXvYqxyLgrpG1CNItLEZ8lsMfMwN8Lz3v0Z8pAzTXjVib3+blzMHQx9v9FBAhIYDtIgyEIu2HLh8g== X-Received: by 2002:adf:e911:: with SMTP id f17mr19085504wrm.300.1574436437060; Fri, 22 Nov 2019 07:27:17 -0800 (PST) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id a206sm4061081wmf.15.2019.11.22.07.27.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Nov 2019 07:27:16 -0800 (PST) From: Georgi Djakov To: linux-pm@vger.kernel.org, rostedt@goodmis.org, mingo@redhat.com Cc: 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, georgi.djakov@linaro.org Subject: [PATCH v3 2/3] interconnect: Add a name to struct icc_path Date: Fri, 22 Nov 2019 17:27:11 +0200 Message-Id: <20191122152712.19105-3-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191122152712.19105-1-georgi.djakov@linaro.org> References: <20191122152712.19105-1-georgi.djakov@linaro.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org When debugging interconnect things, it turned out that saving the path name and including it in the traces is quite useful, especially for devices with multiple paths. For the path name we use the one specified in DT, or if we use platform data, the name is based on the source and destination node names. Suggested-by: Bjorn Andersson Signed-off-by: Georgi Djakov --- drivers/interconnect/core.c | 18 +++++++++++++++--- drivers/interconnect/internal.h | 2 ++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index b06ed180bae3..1ddad8ef3cf0 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -356,9 +356,17 @@ struct icc_path *of_icc_get(struct device *dev, const char *name) mutex_lock(&icc_lock); path = path_find(dev, src_node, dst_node); - if (IS_ERR(path)) - dev_err(dev, "%s: invalid path=%ld\n", __func__, PTR_ERR(path)); mutex_unlock(&icc_lock); + if (IS_ERR(path)) { + dev_err(dev, "%s: invalid path=%ld\n", __func__, PTR_ERR(path)); + return path; + } + + if (name) + path->name = kstrdup(name, GFP_KERNEL); + else + path->name = kasprintf(GFP_KERNEL, "%s-%s", + src_node->name, dst_node->name); return path; } @@ -481,9 +489,12 @@ struct icc_path *icc_get(struct device *dev, const int src_id, const int dst_id) goto out; path = path_find(dev, src, dst); - if (IS_ERR(path)) + if (IS_ERR(path)) { dev_err(dev, "%s: invalid path=%ld\n", __func__, PTR_ERR(path)); + goto out; + } + path->name = kasprintf(GFP_KERNEL, "%s-%s", src->name, dst->name); out: mutex_unlock(&icc_lock); return path; @@ -519,6 +530,7 @@ void icc_put(struct icc_path *path) } mutex_unlock(&icc_lock); + kfree(path->name); kfree(path); } EXPORT_SYMBOL_GPL(icc_put); diff --git a/drivers/interconnect/internal.h b/drivers/interconnect/internal.h index 5853e8faf223..bf18cb7239df 100644 --- a/drivers/interconnect/internal.h +++ b/drivers/interconnect/internal.h @@ -29,10 +29,12 @@ struct icc_req { /** * struct icc_path - interconnect path structure + * @name: a string name of the path (useful for ftrace) * @num_nodes: number of hops (nodes) * @reqs: array of the requests applicable to this path of nodes */ struct icc_path { + const char *name; size_t num_nodes; struct icc_req reqs[]; }; From patchwork Fri Nov 22 15:27:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 11258089 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 18C1B14DB for ; Fri, 22 Nov 2019 15:27:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ECE8E20730 for ; Fri, 22 Nov 2019 15:27:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="QSk14tTR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727299AbfKVP1V (ORCPT ); Fri, 22 Nov 2019 10:27:21 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:39331 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726568AbfKVP1V (ORCPT ); Fri, 22 Nov 2019 10:27:21 -0500 Received: by mail-wr1-f67.google.com with SMTP id y11so5982496wrt.6 for ; Fri, 22 Nov 2019 07:27:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hEkNkSrp8km0CreoucFi1BgIya/dvxAxyWgm3O9Oa4A=; b=QSk14tTRm3kPhwN6nMGxS2I+AOA5Yl5RN2zUYTGICyoS2r9hGYszK6D+SeVAFo5k/E rZg5dQhJeMELMLUnot7FxpdB3tvbuncb16aLcyDf9TXGIZaAJ2JMHmY/odWmuX7XGiHx j5wzKu8913t98T0zibWM+lYRjiaZrw73nDpenqq6+8FPBd9arcSxRuPX145b9U7tU2Ms FnWatqUXBw3z14nvMiybYtO3SyScaMZhmCO1JrNfwQQFsaM2uozdSmHRRFzLghUwRZBe qscpyU8Bg/mHWr3AYzCpkkttdkI/CeGHFIQawqX7VhHU+ZkuSwXVj/1b8tGNnk4gNmF2 hD1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hEkNkSrp8km0CreoucFi1BgIya/dvxAxyWgm3O9Oa4A=; b=SEVqfZtR8vdg6UE1NdJL5Y7JYMdU1foSDKNF1Sh9jKjsfxhIHm6j8dbJjLKBkxF65G YKjL4Aacz1XdgdgOHH3DiMjgCX61rYb0KW3Qtn1nQhUXnnidhIlTeGRaEVaY+X2vXduC XHwBOwE8WvLZSUW2yooTH0U9SK/V7gr/Pi1fXDjC1jy7gEO1iPjdpAX8IB/j/bqB9fUs r+a5hEQd8+p4AWaJWpwURzmNatBHdI4UnSXTjQfyGCoI4zQYIjmoyOlyfSgp8iTFas74 AhliUXcpfTrVlf5peoWiiX27+2VFFJXAmDCP5blJIocENLE6wXqlSS+aB9VBKEYqE/cg YW3w== X-Gm-Message-State: APjAAAVcrc1/XJ8Sp1w7ZbnXc5eA5vEvAAgq9C/43BUssel5TV1GnXXn 3g+PVlNzBUmvbt1eOEyrFStOEQ== X-Google-Smtp-Source: APXvYqzisXnUeVOdqP1dS2D+LXMimH6hbmBWtHQ0u9pukgly+38mDbFsbQyPNY45Eg2lEr3tB7fKRQ== X-Received: by 2002:adf:f987:: with SMTP id f7mr18326940wrr.284.1574436438619; Fri, 22 Nov 2019 07:27:18 -0800 (PST) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id a206sm4061081wmf.15.2019.11.22.07.27.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Nov 2019 07:27:17 -0800 (PST) From: Georgi Djakov To: linux-pm@vger.kernel.org, rostedt@goodmis.org, mingo@redhat.com Cc: 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, georgi.djakov@linaro.org Subject: [PATCH v3 3/3] interconnect: Add basic tracepoints Date: Fri, 22 Nov 2019 17:27:12 +0200 Message-Id: <20191122152712.19105-4-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191122152712.19105-1-georgi.djakov@linaro.org> References: <20191122152712.19105-1-georgi.djakov@linaro.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The tracepoints can help with understanding the system behavior of a given interconnect path when the consumer drivers change their bandwidth demands. This might be interesting when we want to monitor the requested interconnect bandwidth for each client driver. The paths may share the same nodes and this will help to understand "who and when is requesting what". All this is useful for subsystem drivers developers and may also provide hints when optimizing the power and performance profile of the system. Signed-off-by: Georgi Djakov Reviewed-by: Steven Rostedt (VMware) --- drivers/interconnect/Makefile | 1 + drivers/interconnect/core.c | 7 +++ drivers/interconnect/trace.h | 90 +++++++++++++++++++++++++++++++++++ 3 files changed, 98 insertions(+) create mode 100644 drivers/interconnect/trace.h diff --git a/drivers/interconnect/Makefile b/drivers/interconnect/Makefile index 28f2ab0824d5..725029ae7a2c 100644 --- a/drivers/interconnect/Makefile +++ b/drivers/interconnect/Makefile @@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 +CFLAGS_core.o := -I$(src) icc-core-objs := core.o obj-$(CONFIG_INTERCONNECT) += icc-core.o diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index 1ddad8ef3cf0..b218a2609f6b 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -19,6 +19,9 @@ #include #include +#define CREATE_TRACE_POINTS +#include "trace.h" + #include "internal.h" static DEFINE_IDR(icc_idr); @@ -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/drivers/interconnect/trace.h b/drivers/interconnect/trace.h new file mode 100644 index 000000000000..d2421bf7b389 --- /dev/null +++ b/drivers/interconnect/trace.h @@ -0,0 +1,90 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Interconnect framework tracepoints + * Copyright (c) 2019, Linaro Ltd. + * Author: Georgi Djakov + */ + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM interconnect + +#if !defined(_TRACE_INTERCONNECT_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_INTERCONNECT_H + +#include +#include + +#include "internal.h" + +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 */ + +#undef TRACE_INCLUDE_PATH +#define TRACE_INCLUDE_PATH . + +#undef TRACE_INCLUDE_FILE +#define TRACE_INCLUDE_FILE trace + +#include