Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1740503ybg; Sat, 19 Oct 2019 01:29:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqyrcrXLyHcbD8n6yw2MlUSsX6tJk0UdXP9YNmMrgnvqP78LxfxXMbQb4DZVb5+JWAdN5dih X-Received: by 2002:a17:906:a986:: with SMTP id jr6mr12380021ejb.158.1571473763603; Sat, 19 Oct 2019 01:29:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571473763; cv=none; d=google.com; s=arc-20160816; b=VW37WB5QlFd0SxIpIWrSKzMOgAama+seYPxsJDIs7qvLkEDbtvlTXLYJRWdqDuYABU 3Xi7cEwmVhqg/IKtODDlzYf0/400IoSo6Jx7c05UcUvcnVzxQyaOCOYuf+eWvxk5v5MQ BVPHB22tezdSrDV2a1+DjvfoyEECQ3SjzNX31VXqJ4QjJGBm1SXw2ARGRkagkDZRYAjZ zFHj8Mae6az1y9Av+FNa0TT3HfwEu9f68UWLSrXGAj3v/J2wqbW989P7BrmQxcB2JeVD 6waw+oMYbBAAF4BzQjXCLOr2aJYF9Xxma9PLJxvaQdFxKxBnVxy/OHWBD9izDPdO+UVS MDrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=RDn754hJYJ5LXSqXyPnQWWQyanYkEGiwZFxOe9DtcOE=; b=hZtwWf/WkFtivjvGElX6ZRi1mmThrbpESO4rKQGUPAh33Fa9Ix8ZsWWcudVoVHWl3f JtJ1pQ6s6mCOekLLTvsAjX5wh0vdKNFRunUCgF1tLS0ejtaUNqk9bCmcUPMKrp/Q+5Ym oEJxKblYKYNRNDkMFDcimk/JHq5YjXRwd5foSTC6SJMvBFP+NUA43grOKZBFqENGpLC3 xFF68O1Ghg+yzh864VeFoAhEHPDd2ZGPYPdlq6lEqYSHLqCP9zIHbFC9wPiAPR+joOEy iEifWJAqN7QGwp68MV/yoVVU4XIdwXLEywwy1Yz1N4/zSe1/M5uf2eVhV/VnwAfxWPpZ oNcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AH91Q1Xf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id b4si5235280edq.221.2019.10.19.01.29.00; Sat, 19 Oct 2019 01:29:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AH91Q1Xf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S2394047AbfJROC3 (ORCPT + 99 others); Fri, 18 Oct 2019 10:02:29 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:35712 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393984AbfJROC2 (ORCPT ); Fri, 18 Oct 2019 10:02:28 -0400 Received: by mail-wm1-f66.google.com with SMTP id n124so2537333wmf.0 for ; Fri, 18 Oct 2019 07:02:27 -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:mime-version :content-transfer-encoding; bh=RDn754hJYJ5LXSqXyPnQWWQyanYkEGiwZFxOe9DtcOE=; b=AH91Q1XfnZCl/d/15l+fjFcQuHg1w75bjEGEkukNimRFUCp87vXsuwuSrKVy4gmdUQ uaTBX6DuofdOwaI6pOsr3HL4lwXbYY4+CFY4NMtyKFas4QTX9j/GRY28MFHpm6dV6hTW oZ7K0OtoHtM0rVADGSP1taKaliCFr1hNV0Qiu1F9HSyr1IZiwZM0Ayq+xcM77jaHpswu vkGlwvlCNm3NkWS0P0NFZk1aRYlnwtCOGd+32EmH5l7tPNxzIMIu4dTiacvpNH1bP4fH vl2VJ8b2XJb4ppVtXE/cqed1xOFVA/zKgW6J12DyOlZjboI5BYS1hb+0I/U297mmEl1n spZw== 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:mime-version :content-transfer-encoding; bh=RDn754hJYJ5LXSqXyPnQWWQyanYkEGiwZFxOe9DtcOE=; b=Kx6ZwfkU2RCmmlcnllvlq1iDZuBlCwCvMthieppkyvg3w5Ny8mMDK5yIbQ/bY+7+pO M5XHvBQVgkh2ATAryRXUwjH4Ub3xRTgaVoTFp2DD0VAsAozcMtPSk5ZRh2zaQtebrq81 AS+OIwlPaSjOBbmdkCQsThK8Q/iuIIQTUJrI6yPVlMNOb1Yxa2iu9s9fEs4/Hfaqdp79 5aRorMCSY1O+pnZ97vyVj2yPmtG2hCbxNHFnEm8oE+sIzF5e8MCZMxZVPnCsUcdlk14e U1evn0Kt0eBokbIvwFTkrIy3ZXZUS+giQqivMYr9o5f+YLI52HMNCsIV44b2hCefz5Ej iDsA== X-Gm-Message-State: APjAAAV/QV+EPYurPS8MEJ4SCcfrZkJo7PG/9DtrOfJd2DtxnSIqegR8 AW/F6pxtKvJOPl6cyXHVEjoFhw== X-Received: by 2002:a7b:c44f:: with SMTP id l15mr7774951wmi.121.1571407346358; Fri, 18 Oct 2019 07:02:26 -0700 (PDT) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id 26sm5192909wmf.20.2019.10.18.07.02.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 Oct 2019 07:02:25 -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] interconnect: Add basic tracepoints Date: Fri, 18 Oct 2019 17:02:24 +0300 Message-Id: <20191018140224.15087-1-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 | 9 +++++ include/trace/events/interconnect.h | 52 +++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 include/trace/events/interconnect.h diff --git a/MAINTAINERS b/MAINTAINERS index 55199ef7fa74..c307c4b8f677 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8526,6 +8526,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 7b971228df38..e24092558c29 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -24,6 +24,9 @@ static LIST_HEAD(icc_providers); static DEFINE_MUTEX(icc_lock); static struct dentry *icc_debugfs_dir; +#define CREATE_TRACE_POINTS +#include + /** * struct icc_req - constraints that are attached to each node * @req_node: entry in list of requests for the particular @node @@ -449,6 +452,9 @@ 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(node, dev_name(path->reqs[i].dev), + avg_bw, peak_bw); } ret = apply_constraints(path); @@ -461,6 +467,9 @@ int icc_set_bw(struct icc_path *path, u32 avg_bw, u32 peak_bw) path->reqs[i].avg_bw = old_avg; path->reqs[i].peak_bw = old_peak; aggregate_requests(node); + + trace_icc_set_bw(node, dev_name(path->reqs[i].dev), + old_avg, old_peak); } apply_constraints(path); } diff --git a/include/trace/events/interconnect.h b/include/trace/events/interconnect.h new file mode 100644 index 000000000000..8e001382e9b0 --- /dev/null +++ b/include/trace/events/interconnect.h @@ -0,0 +1,52 @@ +/* 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 + +struct icc_node; + +TRACE_EVENT(icc_set_bw, + + TP_PROTO(struct icc_node *n, const char *cdev, u32 avg_bw, u32 peak_bw), + + TP_ARGS(n, cdev, avg_bw, peak_bw), + + TP_STRUCT__entry( + __string(node_name, n->name) + __field(u32, node_avg_bw) + __field(u32, node_peak_bw) + __string(cdev, cdev) + __field(u32, avg_bw) + __field(u32, peak_bw) + ), + + TP_fast_assign( + __assign_str(node_name, n->name); + __entry->node_avg_bw = n->avg_bw; + __entry->node_peak_bw = n->peak_bw; + __assign_str(cdev, cdev); + __entry->avg_bw = avg_bw; + __entry->peak_bw = peak_bw; + ), + + TP_printk("%s avg_bw=%u peak_bw=%u cdev=%s avg_bw=%u peak_bw=%u", + __get_str(node_name), + __entry->node_avg_bw, + __entry->node_peak_bw, + __get_str(cdev), + __entry->avg_bw, + __entry->peak_bw) +); +#endif /* _TRACE_INTERCONNECT_H */ + +/* This part must be outside protection */ +#include