From patchwork Mon Jul 22 10:11:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Clark X-Patchwork-Id: 13738641 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 552F2C3DA5D for ; Mon, 22 Jul 2024 10:16:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9CvKA9Oo8oUAGLDUMUBH2byBqwwnuDLfYbLv1IHZER0=; b=gAPF+EcmqQkzADdQQW1zBduulP Y5Bf92oF/cycvrMdTmQoEE+KCYnt3VMHuGB0Bf49coDwutRXm/bOdlDUNAyk3mo+bW/EzGRanLc6F oJvF5qhYYY7kwJtWXc/mqF3fDIfHshr9+cs0zmQsuXpgtGsGGDTxOhoBpvtQGKWDcsAL1P5Mt1e9S 1+AKDTNGgF4wXQCetyQPoj9+SeH5d/qBYeDdcf4qkKChq11mbHFXj8CWzMreCZC5Q5Vrdb2Pcz1Mf VUr9I9F7h/fBB+DvgCUW/96EXUEV6BgtZJ4rsQpWGwN3E/ixboLpu8xNnC0FCTGfJuae24Ytaa+yb +4LDQDsw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sVq5y-00000009DfO-32tX; Mon, 22 Jul 2024 10:16:43 +0000 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sVq2h-00000009CQ8-0Egu for linux-arm-kernel@lists.infradead.org; Mon, 22 Jul 2024 10:13:20 +0000 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-427cede1e86so28794715e9.0 for ; Mon, 22 Jul 2024 03:13:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721643197; x=1722247997; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9CvKA9Oo8oUAGLDUMUBH2byBqwwnuDLfYbLv1IHZER0=; b=WPpmIP8iaDCeOnRZ/mp3OeZeJbOEf2o5e5C87QpwLB2z4IglXXM8hyyqnJ4tjn5/Gv 9i0iLJiwQUjJdy1lYA6nCKoQxGHA16rXIV3LJMKmhTzTAavMRLzSMRDYni0KsZI24STp 8QqjDV9RBTeW7oHvh4CNrj3b4Luk5iZ2ZgjkuhLIurrtOso+eOsz68F1MFNz5c+NmIOR 6HByHF94ZYjPGEW87DDd9tttKp/2X94hlL62ghX8gJDSUViFqdjV0B2pAK/20j0EsI3p FLhdZ7fEc0/aRLDyCtMFNO9xRVszFPhzVzZniDCytvvK6oH+zqaEVx6F+qp0ZpP2Xsv4 m6+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721643197; x=1722247997; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9CvKA9Oo8oUAGLDUMUBH2byBqwwnuDLfYbLv1IHZER0=; b=qsyHnzWScnQm38ifeGasrPtdTiFOTN6/K7BTXiXEHvr5GyT7aVZ8pKbJSqwIAIVgWN Xu4XGGo0qWHhhMZBntq+tuDdHzk5kTZZbETbz9M//gA73GjcDE5wVFTpIewikxRrDZZw fQWNjguQi46a59G3mUgD8JaQnoml0kOPnPjp8bXehHDPR3IARLMUd2XgXx1jKLZA7yA9 BZ2aKZj9lADt80dmqQHwZPEMS0GHkccYmURPvevosPVSlPb0c7DNcR7NZu5ojelSDXEK 5sL2Xw6QP4aNWOTwvzek2IzknGikwdQ46tS09NrNVovMfM7MtkNHa4H9mzaxfd0iTK+v iqpA== X-Forwarded-Encrypted: i=1; AJvYcCV5noVJu+sVP22mQERMzDmsWfwx8UuTQpqKcLZjwy01FM8wEjjkhuXLEgGL4FubM/XG9qY4ZO9PbMOHktGbpH22Wt/e+ycBptWeQXvqcZx/Hvdwx/U= X-Gm-Message-State: AOJu0YyLRT6jBQC3gXebWE6fz0uGbkEYepbqpUleDuFMPRIUvfhw1g62 RlsInHoaz3UWwIsMuvCwe0U3pSqRDX0PxVoJ0IrGO0HQBho7szXcaDilmvKutxA= X-Google-Smtp-Source: AGHT+IF7qS/l5dBLpir4Vw8LPazyz0x8s3+xWgLLeI6+jb9MqA3mHfayIPDgC0IjLcyLxDckxJt5aw== X-Received: by 2002:a05:600c:35d4:b0:426:593c:9361 with SMTP id 5b1f17b1804b1-427dc569cb0mr43200815e9.26.1721643197578; Mon, 22 Jul 2024 03:13:17 -0700 (PDT) Received: from localhost.localdomain ([89.47.253.130]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427d2a8e436sm147993865e9.33.2024.07.22.03.13.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 03:13:17 -0700 (PDT) From: James Clark To: coresight@lists.linaro.org, suzuki.poulose@arm.com, gankulkarni@os.amperecomputing.com, mike.leach@linaro.org, leo.yan@linux.dev, anshuman.khandual@arm.com Cc: James Clark , Leo Yan , James Clark , Alexander Shishkin , Maxime Coquelin , Alexandre Torgue , John Garry , Will Deacon , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Jiri Olsa , Ian Rogers , Adrian Hunter , "Liang, Kan" , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-perf-users@vger.kernel.org Subject: [PATCH v6 10/17] coresight: Clarify comments around the PID of the sink owner Date: Mon, 22 Jul 2024 11:11:52 +0100 Message-Id: <20240722101202.26915-11-james.clark@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240722101202.26915-1-james.clark@linaro.org> References: <20240722101202.26915-1-james.clark@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240722_031319_166369_814CEC75 X-CRM114-Status: GOOD ( 19.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: James Clark "Process being monitored" and "pid of the process to monitor" imply that this would be the same PID if there were two sessions targeting the same process. But this is actually the PID of the process that did the Perf event open call, rather than the target of the session. So update the comments to make this clearer. Reviewed-by: Anshuman Khandual Reviewed-by: Mike Leach Signed-off-by: James Clark Tested-by: Leo Yan Tested-by: Ganapatrao Kulkarni Signed-off-by: James Clark --- drivers/hwtracing/coresight/coresight-tmc-etr.c | 5 +++-- drivers/hwtracing/coresight/coresight-tmc.h | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c index e75428fa1592..8962fc27d04f 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etr.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c @@ -36,7 +36,8 @@ struct etr_buf_hw { * etr_perf_buffer - Perf buffer used for ETR * @drvdata - The ETR drvdaga this buffer has been allocated for. * @etr_buf - Actual buffer used by the ETR - * @pid - The PID this etr_perf_buffer belongs to. + * @pid - The PID of the session owner that etr_perf_buffer + * belongs to. * @snaphost - Perf session mode * @nr_pages - Number of pages in the ring buffer. * @pages - Array of Pages in the ring buffer. @@ -1662,7 +1663,7 @@ static int tmc_enable_etr_sink_perf(struct coresight_device *csdev, void *data) goto unlock_out; } - /* Get a handle on the pid of the process to monitor */ + /* Get a handle on the pid of the session owner */ pid = etr_perf->pid; /* Do not proceed if this device is associated with another session */ diff --git a/drivers/hwtracing/coresight/coresight-tmc.h b/drivers/hwtracing/coresight/coresight-tmc.h index c77763b49de0..2671926be62a 100644 --- a/drivers/hwtracing/coresight/coresight-tmc.h +++ b/drivers/hwtracing/coresight/coresight-tmc.h @@ -171,8 +171,9 @@ struct etr_buf { * @csdev: component vitals needed by the framework. * @miscdev: specifics to handle "/dev/xyz.tmc" entry. * @spinlock: only one at a time pls. - * @pid: Process ID of the process being monitored by the session - * that is using this component. + * @pid: Process ID of the process that owns the session that is using + * this component. For example this would be the pid of the Perf + * process. * @buf: Snapshot of the trace data for ETF/ETB. * @etr_buf: details of buffer used in TMC-ETR * @len: size of the available trace for ETF/ETB.