Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp391381lqm; Wed, 1 May 2024 04:07:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVG7dI2VbANvcjAT/8ot46CkVB/xOAyM6plqLQYjxGa+64zXIZDir2GjFrs6WYcYS7MQVE3VXSnoWOxZDgMrLeYwevW7wQS9+6Oku1EkQ== X-Google-Smtp-Source: AGHT+IEgMWhWLzKC006/gXdrHlIbrOFBO6E0+awd+3QJbO4Bi/cJ831ryxZBxgtwcbf9OtWU0gmR X-Received: by 2002:a17:902:dacc:b0:1eb:2fb3:f9fd with SMTP id q12-20020a170902dacc00b001eb2fb3f9fdmr1732424plx.14.1714561668742; Wed, 01 May 2024 04:07:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714561668; cv=pass; d=google.com; s=arc-20160816; b=zZ7lbADVdEOHV1Fq3KquzSClnT1YIE1rFNsqEktA21f3xA8K81uNM6VCIQvr2Xzf5R P2G94qakMWBY/VrJxcaHI/pON2xyiR+sTCWyNXcoFwRF0XJezVoPIFME0DARf1BBcOuH 0lYSZtrrIqrDsThzIY0bPJS5f8wiNO3sykbpKJRaGSns/qCH1CtghGXJo8tI+vZ3jNLj n0m1T31o3NiMLslRiETnvOHdVCiFrFBjUoN7yFGjyOKHFy4J4B+lKb+/Z7ghMopVoA+n bN8uzr/JPPMyhqI0/KTuxZ+p6n4NJ95N/7fnJgJKkLxunq+8zEFvmBaPTjwOZuyd2k4m KDMg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=ek5F3YPIQaz7pVJGDrpZC6fIvMvYFFyBjkRJozj7mhk=; fh=ID1c3UkSK6WkWeXMGBWK/kXeCoebtvQAay5rZrQcLUU=; b=WeuPCego/2YPQaGgwWRLxHgPecMkisBabS0Pbfjzds+iue1y3QTD88lPeV2FAov1Oz Y/p3MAV/FgLkk4PxS3rCaLeHaGidFCThYdW7jtN8xBQGW44PtabGnN6BNWi2uRy31ox5 6Y3x0N1KN1zgcUHNoWE90liezHXZPTOTYf3L1jYd5KUonPZtJsVLTsY+ewRfGTnOkRsX B6F3N4VtXUj978PfsxDoICtO1VXLfP9rqq2+vfRmpLFDlXhzbo4GvMA5EWOfj1r+GwE1 G9JL12fgRafu0exV8qjEhX3zre+NF18zv+Koh3SC+0fCVFS7ApwPA+kSN+kCXPNKUGV9 K0mw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=B08lNSqO; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-165166-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165166-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d1-20020a170902654100b001eac2f94fcfsi11365002pln.168.2024.05.01.04.07.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 04:07:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-165166-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=B08lNSqO; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-165166-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165166-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 59B4E2858E8 for ; Wed, 1 May 2024 11:07:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F04BA56763; Wed, 1 May 2024 11:07:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="B08lNSqO" Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A2C4C5028F for ; Wed, 1 May 2024 11:07:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714561662; cv=none; b=mUQgXlofYequWEokn7ercl6Lj7oObZvjGdWTZ8noCRaRdOrWpn1shB0ZXsm7sC6U522k6DeeuTdiZ7pBG028V1kYNcwiXICoWkot53tWlnHpDsa+ElmwRKXFe0bAJTsS5Ujn9uSy40OwIsfai1SxNqIskj2UOaGe8Znnz7TPj2g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714561662; c=relaxed/simple; bh=PFvDOMRHeF4ceqtT1HoG5CTMOEV3p5eFI81RRqSaeRE=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=ubfk/cNqmH2uDWty1ma3+nNaar5Q8FfdGTJIZfSEc2tspSDmWxgGq7o2NDd0zj4oyU/xWz6VJd3A/xnlegwsBjOJueQK1QJAGVJOGk5ki55lX7CL0QAqgVspW7b2FGfWWxagJ48t2K1SXQgYfSsNxjxJNfGzIn+60a394sqSq1U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=B08lNSqO; arc=none smtp.client-ip=209.85.210.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-6ed32341906so6102471b3a.1 for ; Wed, 01 May 2024 04:07:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714561660; x=1715166460; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ek5F3YPIQaz7pVJGDrpZC6fIvMvYFFyBjkRJozj7mhk=; b=B08lNSqORCad23SG44rFFpG4gqe3jaITrZ3AG2hQ8xd6+9b3KwQc5XT2dU+g8f4dsj 5eJWFBMNshAiz04IUZeIhJy87m5GAMx+bxMFXiC1GuAAtp6T4m/o9Awu+rKCo06jWSBL 1iP0rIqF/FQX0bMlkgvPoY1zTUMeYETMCF0v6VcTV/6QLTXKKX5ek0YMVszrENtYjYIl HuWgJzEm4wTR/o7JRmATlhKLA2lDnE0KIq40jcb/9nnRU54w1DqyOJwR4KIgCyaU6tfT TGasvGS1NhgK7h/xlTkeN6R7TO3rDgHAuSiv9HD3m5gxBYrdFXfSGN3gJvDtu4xTXTls Eeng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714561660; x=1715166460; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ek5F3YPIQaz7pVJGDrpZC6fIvMvYFFyBjkRJozj7mhk=; b=p4XPFB0csaOlY79s19JzWfyRGEef/rkoG3+C6o19DAU1M0FKdv+LPMwSyKdIBpEOdC ylU8rmL0bcFrs1Y/C1V5ZgcCHKD8fBT/7w9jDJDj9DVbJm/+A+Ymv+eblFiMOXfLo0Mz iOuO2JKfeLa52ZA93W0hlSZpVcGWoHZqgnu8o1UE+6v5sgi8AK0n9qY8kGtGjmTdoLum TFQ0rP97tqeNcBsymK5mBwZ2nd75DVc4vNqT5/6RW165AWNPp2v7jFK7HEm+ZiZD0Q0J eDYoZFnO6syxwg7ALixfI8kGpO7ozVIRfZWvayMR3jE7wI3Z7lBz04pMpSuQi2KaXc7X N2Ew== X-Forwarded-Encrypted: i=1; AJvYcCVWMJRba6DM5Bu7f7bZvrjgNG3s00dZJ0MqLVTnfntuPrnmfn3K/vOiPBskB7b41JWZwfZphycwbrjSaSIfm3OKBkZYhruOC9DJKCpt X-Gm-Message-State: AOJu0Ywhb2SlvL5FktaTRJenzqTKZee+qjr6pEMjUna/BF8gxm85Bp4p iokAHR4aFAjOfoTzfWVLkVHxTq3QYigrNiOsHuOnJ71eo41zOA+dMCnyti2dAW2gBGuXWwsu6sN WElfexdmpEdpB+0fVA1j9k/22Eg7PKtG5gm44AA== X-Received: by 2002:a05:6a20:3213:b0:1a9:c757:a22d with SMTP id hl19-20020a056a20321300b001a9c757a22dmr2167796pzc.14.1714561659976; Wed, 01 May 2024 04:07:39 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240429152207.479221-1-james.clark@arm.com> <20240429152207.479221-10-james.clark@arm.com> In-Reply-To: <20240429152207.479221-10-james.clark@arm.com> From: Mike Leach Date: Wed, 1 May 2024 12:07:29 +0100 Message-ID: Subject: Re: [PATCH 09/17] coresight: Clarify comments around the PID of the sink owner To: James Clark Cc: linux-perf-users@vger.kernel.org, gankulkarni@os.amperecomputing.com, scclevenger@os.amperecomputing.com, coresight@lists.linaro.org, suzuki.poulose@arm.com, 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 Content-Type: text/plain; charset="UTF-8" On Mon, 29 Apr 2024 at 16:24, 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 > --- > 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. > -- > 2.34.1 > Reviewed-by: Mike Leach -- Mike Leach Principal Engineer, ARM Ltd. Manchester Design Centre. UK