Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp290067lqh; Mon, 6 May 2024 21:25:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVntQp4CmEJoV2z/VTK04OSx8UvI9V7+UJGmBHof73KvYmJcbdIaLadXLjmTxtDePiIBJx32nImIjOVsdK+wNIKVdjGcph9F5jtitb4uQ== X-Google-Smtp-Source: AGHT+IF0jhQS/keWD4QGgoOPISX0qCpYBWYaJWIvL1SyfvK5oyFZC7OPePML9DxmAttqvP2GLp55 X-Received: by 2002:a50:d702:0:b0:572:404f:5199 with SMTP id t2-20020a50d702000000b00572404f5199mr7231540edi.5.1715055948452; Mon, 06 May 2024 21:25:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715055948; cv=pass; d=google.com; s=arc-20160816; b=KH3uD0zzI8mACc6dOjL6WDeACw2Hf/J4ONMu/Yu2iHq15t94JUHVUxi7+2NdBirMU2 H1V2dal66PshJ3HPm168DEufQRxKV23KD/4UwBn8I9bFwncpL8oYeg5O7uSDiSqMKav9 dtC/5OTNu6StbFwJRM5dR+UtwNf1/5iF6N2Py6hKmG5euxFTguVE6nKenaE7zqPDEpaZ Q85mTBT+uZu4ljfQxq4Z5UC8Ff4UByUSCT8/yQd2mtmHDOw3jb9wXnC2tDm2S7XtFhX7 66sTt3Z3WjrOGP18S6n8C7uBhtek5WYMhM47tY2kLEAg8wImlIl2VBXO+dAKTSMYMfSl e3WQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=R6hVorieUPotsu6CDcNd/u51OJ3Vz1BYSJJKQz/r/mk=; fh=VZwZbsQXtmVFpxvC7gcuhPF/zVY5sB/CE4c7obzPUYw=; b=sUfErl+tqNuYe4GH5pTeYO3ZjXyMAD3DU+B5esVCZy2iI4xhXlFjnElG03i0Ou47/Z Q537kykiEh/EUw+jUfXb7SlkMfTtoO8OyEg3ReNUu7pPIW3hCJVCWfC5mSaJl2KpXF2/ OmIup7iXOQjfT+0vXm6yBSuxfwfoc2WX/qiTi8jXKxqfrMDA/2ccmCeQwjGvZrMOqhlV WG0ocYr2pkDLZSPgS8Ca7YxRgky2ubBqOAaJhWk01O5u28SH7uH2xzWmWlqaPZ38O95Y Znmd8ANSS1b+X3qaNGNqhj7X+taK4scxB8Se1GihMKOVqohNAACLI7XZ6rXowYsiFPKj +5WQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-170648-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170648-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id b22-20020aa7d496000000b0056c3b60243bsi5347119edr.308.2024.05.06.21.25.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 21:25:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170648-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-170648-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170648-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 2E7A31F23E4C for ; Tue, 7 May 2024 04:25:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4B75F4F887; Tue, 7 May 2024 04:25:40 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EEA124A12; Tue, 7 May 2024 04:25:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715055939; cv=none; b=WE9Rar0UXpcPnr7mfmj2515myCkIyV+SGVl8cQqfon+vpqLVmEvNNtp0TsaUGhsyv0eNhW0MNNbrd//rDG1gMNfdkPr5H+s4tdDJyG9yO2/lUDhPdOpxH/kKa9hLm6irI5NEZ8soFstrf1oWhtBTF7DFaZx6x6GLmUkn9KPTe2g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715055939; c=relaxed/simple; bh=0DV+Xv8i2wS2RJP3zjqNPEMDxchETKTnTQyk0XX7Mk8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=SNzJVoR/v+1GTUvlh77/dJRGoD8iOSf+bSzKUk11wKTpFXtUmxTpo2WH2VVcazCs0eBq0iu/uEyZz0/KbD1W9U53Eo+2av7TzR+SzDnzVqKsf7hn4Lpfe3yD6jel25uro9yJKXqTUJkI05yqYo6KsG2h73Y84PiW57owwal1R6M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EAFD21042; Mon, 6 May 2024 21:26:02 -0700 (PDT) Received: from [10.163.33.37] (unknown [10.163.33.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D5A323F762; Mon, 6 May 2024 21:25:28 -0700 (PDT) Message-ID: <3fa5f992-b758-4928-9bf9-0c6e82db1f65@arm.com> Date: Tue, 7 May 2024 09:55:30 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 09/17] coresight: Clarify comments around the PID of the sink owner Content-Language: en-US To: James Clark , linux-perf-users@vger.kernel.org, gankulkarni@os.amperecomputing.com, scclevenger@os.amperecomputing.com, coresight@lists.linaro.org, suzuki.poulose@arm.com, mike.leach@linaro.org Cc: Alexander Shishkin , Maxime Coquelin , Alexandre Torgue , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Jiri Olsa , Ian Rogers , Adrian Hunter , John Garry , Will Deacon , Leo Yan , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com References: <20240429152207.479221-1-james.clark@arm.com> <20240429152207.479221-10-james.clark@arm.com> From: Anshuman Khandual In-Reply-To: <20240429152207.479221-10-james.clark@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 4/29/24 20:51, James Clark wrote: > "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. > > Signed-off-by: James Clark This indeed removes the ambiguity that the PID belongs to the perf session owner rather than the monitored or target process. Reviewed-by: Anshuman Khandual > --- > 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.