From patchwork Fri Oct 18 14:02:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 176842 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp902758ill; Fri, 18 Oct 2019 07:02:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqyPw153XXMmXmkGVz97Px5mviMPsxh0qYp2xkNXrCx+cfmhiHaf80E7s59SMWoVmI+PCFOR X-Received: by 2002:a05:6402:21c7:: with SMTP id bi7mr9811429edb.205.1571407349577; Fri, 18 Oct 2019 07:02:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571407349; cv=none; d=google.com; s=arc-20160816; b=x/lzgHWbo37A0RIkv7VpkFYE0nhpjn4UfsXKu+Pzt7O+NIfsX0+0HZ36xJImDmvqE/ JgJ4yrEIfAWqCCGVDFw9j5VUWFZoaDy6pyBFkoyCRl4OPM4Vvb5RdFrp1p5BHlUZX6jN QwpLli1BoSKxIKvjXSSt9fm9/0xD/1fAdyTzNvFMdQTcs1UrsGxm5oZqj4V4gtWRINCE cyfOfTXQ5dLG0HpesLK16+vsm5w05k4tn1mfeAWWpTalEFxv/mV8yPW7RPOJrfhrSL0v k0QNGNZ8Cb7fITdA+T3VjSK04WUYIvCQ05C2Xc0gO4DMX7XnQA9x3ER8bBljhamtqYC5 OAmg== 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=D6yXMwYYNvrdm8V4I3CSs8jsgLA/qjn2h7BW4zx7IZR8rQryqkduyiZVU6lTwe2aLR k1xhbxcTJHayDBX8LizN9xKbPI7qX09DKKOEeQ6BGkxiO1Yy2O+iOW0j6/WM4lyqY9re znupmFjBaaCGPyd1+PjFNFLVrRdzhbgwbwltsQYWTqEa1EIQatqcyeonANElf8BUmy1U MQMbn4IYfxbb5RCSdMAri2choq7LzD4BIYILFmwXvwR2eAP+WbPizGU1of8N5CeXIUWy ivOXO5E8UHNTYcPa8NsDt1+aeXhh1HgGTSQ55/sJ7wo41yrDuukZVHcC9X5Ai+6ZvWX5 sREg== 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-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 i19si3616996ejf.247.2019.10.18.07.02.29; Fri, 18 Oct 2019 07:02:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-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-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S2393992AbfJROC3 (ORCPT + 15 others); Fri, 18 Oct 2019 10:02:29 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:54843 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393782AbfJROC2 (ORCPT ); Fri, 18 Oct 2019 10:02:28 -0400 Received: by mail-wm1-f67.google.com with SMTP id p7so6323122wmp.4 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=AYhRv4AIHxuqfKAvqUxOcbjAGR2srtBz+N5bnko1RnbwXNJdVr6KqFqiMcBJ9T67E2 rkPFAhTllFTQdj11yPV3d5idcWLLupcJjLDKqzMZgkqSczRGvZgtJt7Ns5hbLN7b5FC4 lWdFHGL6GdKVirwvEhQuuH/BpcN6pIS9yabzqkhLjFazuQaxwja2tb58x0lSVwo8NbUW atvldVISPwbW/tZSo47HEBWc1nNGAQCWrNZbvP0M920YmjvXER9W8/+8ahJX8r+Qhf10 410rweTXV23xRC6dpoR+9yFjmZ8GYHLsSHeEXZza88VsGtGGxyt9QSR4Nqz7HXXO/si8 aYxA== X-Gm-Message-State: APjAAAWSQwDTZ+7DYYmVh3APte1UwsMWYqj6vCbCPn7WLW5POmQgF0yk atJKTbrNpBmXYbXhubOBkVXbdg== 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 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 | 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