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=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 06B09C4708F for ; Tue, 1 Jun 2021 10:36:47 +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 A09A7610C9 for ; Tue, 1 Jun 2021 10:36:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A09A7610C9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9iI5EZvd8/9MdD8/4KuebZ+0QnZre2KEJZ/H0GCqGHc=; b=tpTCRBJUk+XbCZ uHHDQnKLBOrm2wfkT0GqEHBIxHb48qlynN4Q4iW4RHMmfa7cdd1qWgP/41VFmMumpZa84hijJ/62h 3sfIQl8LxgRKsGZor7bIDdaILjIqHe/mqG5RYgHqn1vxOtt6aLCcJgEaz2IGpNqpxX6MaTHCq56gy mxGNbfeWVqK7q2uI6SaGfx0ctM8uTkJJR+zV9kENgtpqPzmbRqnbjM3GmvqFNqpS+V0nnXYbHPxW2 c9Nij2obnsqyaKCt+JR99IRn9r29e3Vy1jI7LpA/pyI3LP055aBdoSfvpjju2vsbYP0TA3/shzumC s0jG7Hqgl6HXDv04l5+A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lo1jy-00Fyjf-8A; Tue, 01 Jun 2021 10:35:18 +0000 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lo1js-00Fyhg-68 for linux-arm-kernel@lists.infradead.org; Tue, 01 Jun 2021 10:35:15 +0000 Received: by mail-pl1-x62d.google.com with SMTP id x10so5711887plg.3 for ; Tue, 01 Jun 2021 03:35:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=MnCPCat+8RzDgHVFliR6RXd+HzHEqd+QggHet3nM5oE=; b=NBUZjHqTLUiH4rqxnKctMAsZGBPuEsu3kRBBU0dZMZR15h95rYZkCUszlyPv8iwWn8 vUAja/oQFPUqiln/Vz76/hamaUCMX+SbzQW/j2KccTS80R8onuWKpd8gvSj/KO346z9m j6nETjzX9cPAgJk5sOk4lmQZWsqKXjuqQ9e5RfVns9psjIG1CEWHEIm2LASGQUFEaym5 3Dgs54ljdN6vlqbWZwzoHmJA/lzcwsQ4QLoM8F5ZRLLjLlWPxx6+0YeG/98UFM9nwGZ5 DJRyA/vW8MK2jsQ4xkHaiCAd179zUm/yva6BVaBuuLec6Nx5y9RyvTX2WoR2Aqu8Qdln P9uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=MnCPCat+8RzDgHVFliR6RXd+HzHEqd+QggHet3nM5oE=; b=GXNccT8/kY+bmEqsmb5W8C0pYKStsTO2k8UKsqEZDWOSNhPXYK7jo3h1SQU9G50Rts 3rwsmuyDK6XcbjgquQej0i5/vYBxqFJMWaOOyslJt1fz+gpP6GItK5EDXLujPRLQKGt9 REoN1/zFgfVE1Vhty8fH3gEb3bMjZ9gC9AUzVG4HlQGUW1MBS3hWG3bLm/zVfcCkJtMI +izbHmmHZT5AAHuIhgMjEBXFIX9a1bLDjoMxmWnSDNO2fqsgrLvtC2dpDUF8QKhB/xY2 8EkJGuDKhi8IJkZpIoSJHiGbYqlWJmSgVZItDygQCXgWpFj8vn9uhgnbUuyQt02boaZH boSw== X-Gm-Message-State: AOAM530TZhG9IMQSV540m8YciCAcbrhgz7/SYFuDcZUW13d8QwBBUsSf 9k+zcQfoTrkV2CoNNrTu5aziUg== X-Google-Smtp-Source: ABdhPJwPJwJaRm3swpyOM0BG6qmPQF2bdJh3TwesErl7BWto5UaXid+zxZ1T/waRBfdZAbEi0U4jKg== X-Received: by 2002:a17:90a:7345:: with SMTP id j5mr4256420pjs.64.1622543710750; Tue, 01 Jun 2021 03:35:10 -0700 (PDT) Received: from leoy-ThinkPad-X240s (ec2-18-167-84-74.ap-east-1.compute.amazonaws.com. [18.167.84.74]) by smtp.gmail.com with ESMTPSA id c17sm14149797pgm.3.2021.06.01.03.35.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 03:35:10 -0700 (PDT) Date: Tue, 1 Jun 2021 18:35:04 +0800 From: Leo Yan To: James Clark 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 Subject: Re: [PATCH v1 1/3] coresight: etm-perf: Correct buffer syncing for snapshot Message-ID: <20210601103504.GC10026@leoy-ThinkPad-X240s> References: <20210528161552.654907-1-leo.yan@linaro.org> <20210528161552.654907-2-leo.yan@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210601_033512_272599_D98D906A X-CRM114-Status: GOOD ( 22.64 ) 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 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel