From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B4B1C47094 for ; Thu, 10 Jun 2021 14:56:22 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id D5DB1613DE for ; Thu, 10 Jun 2021 14:56:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D5DB1613DE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=XoUV0ttEpKP0b1ufiDxQiqROxzfgmPHQ2P0bpcH8U9A=; b=My6mO7N/tACRYGAvIWk0Z7dIAi Q7M4VZC3fXIjDGdPdoxwpJyJn2wmMhRGSfWbn+FHWsg4UwC0XV0s7ophYI8PEzse3CxHjykFbcZ4d iQKAl4VaT8kgVgkAfkxJV8k6GhEbv2xmHgxqcnwYYVPROYSZqOzH9uV/etm3zFylmyCsRkzLbxqcX 0BtFqX1p4FqrFbCUDaxkkP3uVyfi+F75VtmEGVqBQzcy9jhiaYDYxBh6sNAD3Gpi2TUZPn9HZyi6Q CEmTaG+1FfDfP4GU3tWXjgCpPqICXE9LqcNuivWHtgb7QHLJlALjOgXsy4ieCezQ9WF2dVINHuTDv jRgC+EHA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lrM4l-001FAX-4e; Thu, 10 Jun 2021 14:54:31 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lrM4h-001F9c-5H for linux-arm-kernel@lists.infradead.org; Thu, 10 Jun 2021 14:54:28 +0000 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 48FB3106F; Thu, 10 Jun 2021 07:54:24 -0700 (PDT) Received: from [10.57.5.44] (unknown [10.57.5.44]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DA2023F719; Thu, 10 Jun 2021 07:54:21 -0700 (PDT) Subject: Re: [PATCH v1 1/3] coresight: etm-perf: Correct buffer syncing for snapshot To: Leo Yan Cc: Arnaldo Carvalho de Melo , Mathieu Poirier , Suzuki K Poulose , Mike Leach , Alexander Shishkin , John Garry , Will Deacon , Peter Zijlstra , Ingo Molnar , Jiri Olsa , Namhyung Kim , Daniel Kiss , Denis Nikitin , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org References: <20210528161552.654907-1-leo.yan@linaro.org> <20210528161552.654907-2-leo.yan@linaro.org> <20210601103504.GC10026@leoy-ThinkPad-X240s> From: James Clark Message-ID: <71158b94-863d-97d3-323a-e2406b708db7@arm.com> Date: Thu, 10 Jun 2021 17:54:20 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210601103504.GC10026@leoy-ThinkPad-X240s> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210610_075427_282756_78138AEA X-CRM114-Status: GOOD ( 30.90 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 01/06/2021 13:35, Leo Yan wrote: > Hi James, > > On Tue, Jun 01, 2021 at 12:53:16PM +0300, James Clark wrote: > > [...] > >> Hi Leo, >> >> I was testing out snapshot mode (without your patch) and I noticed that it >> only ever collects from the last CPU. For example on a 4 core system, >> the CPU ID of the AUX records and the AUXTRACE buffers is always 3. >> >> This is with systemwide tracing, and running "stress -m 2 -c 2". >> Is this something that your patch fixes, or am I doing something wrong, or >> is it just a coincidence? > > No, I think it's quite likely caused by blow code: > > static unsigned long > tmc_update_etr_buffer(struct coresight_device *csdev, > struct perf_output_handle *handle, > void *config) > { > unsigned long flags, offset, size = 0; > > ... > > /* Don't do anything if another tracer is using this sink */ > if (atomic_read(csdev->refcnt) != 1) { > spin_unlock_irqrestore(&drvdata->spinlock, flags); > goto out; > } > > ... > > return size; > } > > When using the system wide tracing, it updates the AUX ring buffer > until the last tracer is stopped. Thus whis is why it only records > AUX ring buffer for the last CPU. > > But this makes sense for me, this is because the last CPU is used to > copy trace data to AUX ring buffer (so the perf event PERF_RECORD_AUX > occurs on CPU3), but when you decode the trace data, you should can > see the activities from other CPUs. > > Thanks, > Leo > I have one more issue around snapshot mode which I'd like to check if it's related to this patchset. In "[PATCH v5 0/1] perf cs-etm: Split Coresight decode by aux records", I added the warning for a missing AUXTRACE buffer as you suggested. Now this warning gets triggered on the last AUX record when using snapshot mode. I don't know if you are able to reproduce this. Thanks James _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel