From patchwork Fri Jul 12 10:20:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Clark X-Patchwork-Id: 13731587 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 4B5E5C3DA4A for ; Fri, 12 Jul 2024 10:25:36 +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=cmWH7agSbHonx/R3+MefD7iRtWhdpwSVOkyLggPVZz8=; b=aVros/gQ7iRrLtkfdWOVLWSCIK EWWNWos4/2aqoRwMTkyKGIDxqX4eL8zNkOUSvfwIgVG6ZvGsE5AVkNNaEKwalkEEyabYMcIGZoUnK CXRehf/5iJ1+UKYqnwqXSNctmSC+z3V7cQeyWAvrm9rApXGUKjZLK8nZ0Sla3iCAqnAf9sF9SFwaH SOJtlXhbs94Ijlta3Jb67GsH9jVfqZwip7t7TGcyaJs85HGbwZsVjrT/5bLi4HxX5hOexQqQWedJf MJz/VJgGS7QUBOjgPDuky7bSQlhGWoYcIRZbBZNujcQC0U1eD58BOzM5QuFD2QxbZdwW42mCOKMUd RfsThKBw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSDSv-0000000HIPh-0gCJ; Fri, 12 Jul 2024 10:25:25 +0000 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSDQW-0000000HHG3-27TN for linux-arm-kernel@lists.infradead.org; Fri, 12 Jul 2024 10:22:57 +0000 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-367a081d1cdso976889f8f.1 for ; Fri, 12 Jul 2024 03:22:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720779775; x=1721384575; 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=cmWH7agSbHonx/R3+MefD7iRtWhdpwSVOkyLggPVZz8=; b=Mhcse4Be61n8D6JTZ5m9U9LFPV3YtExn4rFid+BnTU3GB4fjM8wqGu0GOoPFZtp5kZ On56tUFkN+4XKgx8wPzd0WDE8UkkqlTAYJO6UM6+8h8cID+HdwFjrFUvImgiicCXNn2Q Skh1KBOsXbHodMtLYZK5foo879obuzxU1q8Go7L+YvZY5nw/H1y8Wx6c0iEHK6LCmc6N etCsva2DawaX924C+KuC6wdHvwQJL7m47SJ5nun7bB9gDaSQLifUnokv0BAT/bLS7bYN F7X+pT+OySG5C3imQ6S+TlGo6M6Gj0lnMX/jOZ+A9Tw5PbL98K4/O8RiGhXhmT6CbD9X 5Oqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720779775; x=1721384575; 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=cmWH7agSbHonx/R3+MefD7iRtWhdpwSVOkyLggPVZz8=; b=rOfWoIjx7laoTwsSErTh/XzoJ3ac4tKzi/bZXC/pKc5VcJR7lb9uTFycBy40Tmoeu1 anUGTOHt6HvD7TN/oHss6+6TuUo109PkMFHI2qlOhkpSSfM0xFhY25nxiKd7eAQ1ab+1 kX2OmZ2m17jLnQz8RdCDbM7O7pD8TdepCjHI5qNqWkMXEddWwBxvzLDxL5bupji1CDIK OKJ2bWD/p54xqp/FspMan3zn7BWyXQIIzk2g+TqiHkkLCs1DWBpoQY8vCi3NwfIp2odd di8XEleR0b/0l55LaR+yQxUc6Mgl3CMa6/iPU39pEAhf/aNiZL/z0LBEHf8PwpI2sEKc dSUw== X-Forwarded-Encrypted: i=1; AJvYcCXjHLqiyoRyYqvHAtr1+oRS5c6YK/2b6/ta0EM20Ux8Vs+xrrgw7tqiA76hv09k95M2cX/Aa1WsD720JtDpf+O23P7ldf6kmoRatW9dI0HuzYz14Kk= X-Gm-Message-State: AOJu0YxsNQ5LGEVWKQVj2j536z/MycyTLF3nqMzJI50k/SyVhQVofveF SRjUArQtnxv5gBhM9xR7Bm7ZouesYH1MYutM9L5RuYizAp9J1HdKwKsi79UxZ+Q= X-Google-Smtp-Source: AGHT+IEcDju9t6NYw7w2pn4HE1UlUqGJVIFxet+KybGAhZdj2K7aQZy/5dyu5Tg/5qQTcXTwx+bEdQ== X-Received: by 2002:adf:b30b:0:b0:366:df65:8763 with SMTP id ffacd0b85a97d-367cea8f94emr7440282f8f.34.1720779775028; Fri, 12 Jul 2024 03:22:55 -0700 (PDT) Received: from localhost.localdomain ([89.47.253.130]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-367cde89164sm9911058f8f.63.2024.07.12.03.22.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jul 2024 03:22:54 -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 , 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 v5 10/17] coresight: Clarify comments around the PID of the sink owner Date: Fri, 12 Jul 2024 11:20:19 +0100 Message-Id: <20240712102029.3697965-11-james.clark@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240712102029.3697965-1-james.clark@linaro.org> References: <20240712102029.3697965-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-20240712_032256_573663_2952B475 X-CRM114-Status: GOOD ( 19.20 ) 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 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.