mbox series

[v4,0/3] interconnect: Add basic tracepoints

Message ID 20191128141818.32168-1-georgi.djakov@linaro.org
Headers show
Series interconnect: Add basic tracepoints | expand

Message

Georgi Djakov Nov. 28, 2019, 2:18 p.m. UTC
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.

v4:
- Move CREATE_TRACE_POINTS below all other headers and remove internal.h
  from trace.h
- Picked Steven's Reviewed-by.

v3: http://lore.kernel.org/r/20191122152712.19105-1-georgi.djakov@linaro.org
- In order to avoid #including a file with relative path, move the trace.h
  header into drivers/interconnect/. (Steven)

v2: https://lore.kernel.org/r/20191101130031.27996-1-georgi.djakov@linaro.org
- Moved dev_name() into TP_fast_assign() to reduce cache footprint. (Steven)
- Added path name to traces (Bjorn)
- Added trace for path, device and ret. (Bjorn)

v1: https://lore.kernel.org/r/20191018140224.15087-1-georgi.djakov@linaro.org

Georgi Djakov (3):
  interconnect: Move internal structs into a separate file
  interconnect: Add a name to struct icc_path
  interconnect: Add basic tracepoints

 drivers/interconnect/Makefile   |  1 +
 drivers/interconnect/core.c     | 55 +++++++++------------
 drivers/interconnect/internal.h | 42 ++++++++++++++++
 drivers/interconnect/trace.h    | 88 +++++++++++++++++++++++++++++++++
 4 files changed, 155 insertions(+), 31 deletions(-)
 create mode 100644 drivers/interconnect/internal.h
 create mode 100644 drivers/interconnect/trace.h

Comments

Bjorn Andersson Nov. 28, 2019, 6:08 p.m. UTC | #1
On Thu 28 Nov 06:18 PST 2019, Georgi Djakov wrote:

> 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.

> 


Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>


> Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>

> ---

>  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 1b811423020a..f30a326dc7ce 100644

> --- a/drivers/interconnect/core.c

> +++ b/drivers/interconnect/core.c

> @@ -19,39 +19,13 @@

>  #include <linux/of.h>

>  #include <linux/overflow.h>

>  

> +#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 <georgi.djakov@linaro.org>

> + */

> +

> +#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