From patchwork Fri Nov 1 13:00:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 11223083 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 9E46A1668 for ; Fri, 1 Nov 2019 13:00:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7C67F21835 for ; Fri, 1 Nov 2019 13:00:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="m2c6kB/L" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726734AbfKANAh (ORCPT ); Fri, 1 Nov 2019 09:00:37 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:43372 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726620AbfKANAg (ORCPT ); Fri, 1 Nov 2019 09:00:36 -0400 Received: by mail-wr1-f68.google.com with SMTP id n1so9585031wra.10 for ; Fri, 01 Nov 2019 06:00:35 -0700 (PDT) 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=Zgv/LTWdUPNIRDPJwbY82R6L2iDmim3JZRo8TtTz+DY=; b=m2c6kB/LVRJSVWZHgdelDlqhnHhd5gEDgD5WOy08yss+OVxQy2bbNOOeJaFURNoD9b IY4afffJgN/frvFyhGmkcCMoq/UF7Sbh5NnoHOxAEsyVJ6bO68psGKCkJX9N0XRgRlFB JKW77qcnOQpcON/+CJ/eVyh8vtjYQYKpizevs/fyavmUpTrcFfLCi2L3t21CNocpfrDV nsTLEO0Q8YWTVScdy/et75XKbtTSLsjX7dIGEWdmjlf51ZUZYdZNgdOsgOVS99oZ8FvC j1GFB+IvgSxmIgZRtw4qnZPAaR0wfCueJW7nHNaAXt9B3G+5M0WSqI+G2nTMEfjvYRCz nugg== 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=Zgv/LTWdUPNIRDPJwbY82R6L2iDmim3JZRo8TtTz+DY=; b=d2TBOfs7jJTAwvYiXDODACtPEHgT5G8XhmcstNlGW5ctvHOHMe80eIrl1RM6nDVudt zaEeTNNmG0kBcq7V78V+w9+hfxyM1jEnF081umKdtckv24DXp9LFesG6YGZqgo2vV/gG vVvnqZYYONWRj7r8AP2OQfKR+X7L5sVs7ud7/smo1az0qbBlswS+dCE4ISQFRQsmr9T8 ivDMSuGocZRI88DuMgaDR7hPeV41/DCpLj6ZjUMEZcpc8VuIhy82acvR4YGJ99WvApFw zp2+5u5/5Lo0yPaAhYi6EOAlUI/v8rwpmslMykl6auE8ImmK3U4rGBulslbAf3+Ojufx N7tw== X-Gm-Message-State: APjAAAWeHUYeprVuTfiP+OpIeAFHbd4uqin4O5iyR4u/wvQj1q1zoCHH ZEMfq8b5flJnwhVqnqhuhY2auw== X-Google-Smtp-Source: APXvYqwVGRprB/tc1woV5aX/nx+Hv/+U5SrzfdXyQ9nfNAQlvzclYFxj361Z1IW2A+ySlxSqPA7lag== X-Received: by 2002:adf:e8cf:: with SMTP id k15mr18778wrn.256.1572613234712; Fri, 01 Nov 2019 06:00:34 -0700 (PDT) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id x7sm14208476wrg.63.2019.11.01.06.00.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 01 Nov 2019 06:00:34 -0700 (PDT) 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 Subject: [PATCH v2 1/3] interconnect: Move internal structs into a separate file Date: Fri, 1 Nov 2019 15:00:29 +0200 Message-Id: <20191101130031.27996-2-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191101130031.27996-1-georgi.djakov@linaro.org> References: <20191101130031.27996-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 56cc4bacea5b..86ca6245fe6e 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 1 13:00:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 11223093 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 6F330139A for ; Fri, 1 Nov 2019 13:00:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4C220217D9 for ; Fri, 1 Nov 2019 13:00:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="bUDJJG+2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726684AbfKANAl (ORCPT ); Fri, 1 Nov 2019 09:00:41 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:51694 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726651AbfKANAi (ORCPT ); Fri, 1 Nov 2019 09:00:38 -0400 Received: by mail-wm1-f66.google.com with SMTP id q70so9265486wme.1 for ; Fri, 01 Nov 2019 06:00:36 -0700 (PDT) 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=vdqefEnwwSmeWlyY7LqNRP7A0Jfu2xnxdFd7DKez+Eg=; b=bUDJJG+23eqX6KZQoGdk2sEHTjQPmMr4vkBJVUs/pZZ6o0jCph4R8XrVXBu/gFj7wV HMnq/tWuzBWdq03vu+Q4gElsm7hp19gQa5MO1ZQhlJ6B5MHT0myv4Td2qRUAqZ2IB5SN fV5sHTqmRmljG9kEh5StGOdn1iwfPalyjActElCE4kNs1Sq7NLZbV7K3Ckhl56sSmdAX ztUqts+ijvXVUx2Hhgy3p7XMATkLB/i+cyNMJCSVIAv+X/uVDJ4nK/DCrUSTY1QyyPW0 iUg++ah7iI3JRO9mKbHDVqRwtVzxXCMBAyQnuhd8fu3mAvVgO9lq5v1n5trX8KOkGukw +waA== 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=vdqefEnwwSmeWlyY7LqNRP7A0Jfu2xnxdFd7DKez+Eg=; b=ROcWKS9OO3YdVm5xe/u0adV6EAc9GIye0hS/Cjzr3uZmagYQgCnK5yuPDlVpreCfdH xJG8a5IdBwMtHTu/aFwqzYedfoTzNXqM2Oe482Ik+DLZ7NVE1w/DpPnEP4j+fD0tZxDu OMyPczsfWfhBoTVKIsVWLltB2wi9n8rtFxLnAJkvx5G0Dc8ZGd9RPMgkX8v8HTFnKjLA gv3utpRdbOxA4ZOEUgfYLXzX0p83lQ2rWf0AFbXUS3kBur998kl0RgZJTh3xkP3Lxffc tFvvBbYrNLbOaBxN65aVmIg6CDo8jh8Iqnd0Si0e8mfHc7Ua+rK6ygMpuUdYMx3iBh/x zgow== X-Gm-Message-State: APjAAAVO5bynx/boaW/DAkFFaXipJNTuhzQac3eB0WghlJx0drzbw6Zr KHkDaIEz/X6rFZ1GCOy/z5qwHw== X-Google-Smtp-Source: APXvYqxvhkfA4en93HsMZXZcrEg4ywjQHlN2xcKmJ6QSfkzisNRc1LTflF1kCytSr7J4643Kq4D8Rg== X-Received: by 2002:a05:600c:21c4:: with SMTP id x4mr9758411wmj.172.1572613236108; Fri, 01 Nov 2019 06:00:36 -0700 (PDT) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id x7sm14208476wrg.63.2019.11.01.06.00.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 01 Nov 2019 06:00:35 -0700 (PDT) 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 Subject: [PATCH v2 2/3] interconnect: Add a name to struct icc_path Date: Fri, 1 Nov 2019 15:00:30 +0200 Message-Id: <20191101130031.27996-3-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191101130031.27996-1-georgi.djakov@linaro.org> References: <20191101130031.27996-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 86ca6245fe6e..df44ef713db5 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 1 13:00:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 11223091 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 575F114E5 for ; Fri, 1 Nov 2019 13:00:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3598A21835 for ; Fri, 1 Nov 2019 13:00:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="CTKLIytn" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726932AbfKANAp (ORCPT ); Fri, 1 Nov 2019 09:00:45 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:35391 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726945AbfKANAm (ORCPT ); Fri, 1 Nov 2019 09:00:42 -0400 Received: by mail-wm1-f68.google.com with SMTP id 8so1989865wmo.0 for ; Fri, 01 Nov 2019 06:00:38 -0700 (PDT) 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=7ux6o8Ncrgfjd9hT9inKPay1u+1v9WsFB/qk1kBdey4=; b=CTKLIytn7ZTjITu7BzPyvUo9TrjzAxCK7D9g0LWLpfABh3mg3wOEt2dDeKYe3NC5K3 NDfD8U9F0Vc9h3bulWoAp8VdhDmNvDasPBFq3y2ENx9dC0ZpxuYi1OWuq+CVrFjetyj4 S6oLIS5rxMNIUGK9h1Noo0i1G4NAE8ZC8A/BoJJAl03Umjl8w3RWQCvW6T8tjVeHf7Lw ehGkVwo8laANr6Ilbmt+scU0l40+hY6LQ1vB4++/iaUb+H12OdoRfAQYvYAyi0xEJy6s vst3FbrJ+lD7d21A07SwpYnLXz09JHNbWyXn2spBIGM8C4WApvkB+F43M02X06oT9mZy ojaA== 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=7ux6o8Ncrgfjd9hT9inKPay1u+1v9WsFB/qk1kBdey4=; b=GFXz1A186NqV3wyW9ltp0er1/7v2tF5l5HY3IzC6NcxXoMaMtt8KkDt92wzjq6Br+x qGROe6MC/n4TLcTpOdwV/q9ZC6Krc/ebcrx+XCSPFnvJ8flDQOopF2a1gkL84pgGcYPi kS7YckBzgQxqdb7EWhrUOSbhwpy/rtvT+v4Hrjzm2ucoPZ1/KTMLGjQyO10UC1fKuQ5D soU9VNb+dhnorlHvaYx1rzFpQ9xiRptDvl5G25vKwJBEKg2nvWusd0yYEjV+m2S0/hcr DhTxhw6mIPyyYSP+ZHAyxLNPD/AR7Dhcwu9mZFMOHoT6NPUE1MEjDbOHPy/gc6ZwA4Qz C0wA== X-Gm-Message-State: APjAAAV926SlFT/yi6gF8UE+89gxk7LaeFbp2kXRzUCQHoqPM3AEYCF8 ikAj1nNCMMaYZAnLkDStJ/JgxQ== X-Google-Smtp-Source: APXvYqzcma1qwrrHm8nBTfaVgmdLBFM2hKith8MUY3GNBuouABkehfdmx4SI9jj3UBnwWNhoH/fJqA== X-Received: by 2002:a1c:c90c:: with SMTP id f12mr9719141wmb.97.1572613237769; Fri, 01 Nov 2019 06:00:37 -0700 (PDT) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id x7sm14208476wrg.63.2019.11.01.06.00.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 01 Nov 2019 06:00:36 -0700 (PDT) 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 Subject: [PATCH v2 3/3] interconnect: Add basic tracepoints Date: Fri, 1 Nov 2019 15:00:31 +0200 Message-Id: <20191101130031.27996-4-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191101130031.27996-1-georgi.djakov@linaro.org> References: <20191101130031.27996-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 --- MAINTAINERS | 1 + drivers/interconnect/core.c | 7 +++ include/trace/events/interconnect.h | 81 +++++++++++++++++++++++++++++ 3 files changed, 89 insertions(+) create mode 100644 include/trace/events/interconnect.h diff --git a/MAINTAINERS b/MAINTAINERS index a69e6db80c79..16f28fa515f2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8522,6 +8522,7 @@ F: drivers/interconnect/ F: include/dt-bindings/interconnect/ F: include/linux/interconnect-provider.h F: include/linux/interconnect.h +F: include/trace/events/interconnect.h INVENSENSE MPU-3050 GYROSCOPE DRIVER M: Linus Walleij 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" + +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