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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 395A0C433F5 for ; Mon, 4 Oct 2021 12:29:36 +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 0144461269 for ; Mon, 4 Oct 2021 12:29:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0144461269 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=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=8HG+VTYoVM/FTUumR5doxkGJHmfGkKlevV+OA+hnOEI=; b=sIBH07FLLmwt1f 9ZuYMj8Pe/q8YMNaMK93MeYloCMTNzlhs1fbJLJkYWJGIhIvA1OeBck/4lKDabZ2D5yKRtpnyvJBJ OWkILzbCI4HuNOCczd/oSitKglBit7EM15WYxlefAMI2RCMsjh4Lo1/N9PktqSB6+QVQ+GQKP5T8q zdAsT2SfH3jLb/LoqBsGK9qXWfcaeUG+dt9o1o38MxAwbYY4L8tIFNq2TNaCWY4UroqesNT6cUgGj lnAzO07F+oMQjnKVwPip3TiEZ318NwA1fL5NAeoLpP4ZxjiGh+hDZXzma9X0TxplVXdnB5yByYyia TNfEsrjNvYa6jxgqxhiw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mXN4B-006RK3-Ec; Mon, 04 Oct 2021 12:27:35 +0000 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mXN48-006RIU-16 for linux-arm-kernel@lists.infradead.org; Mon, 04 Oct 2021 12:27:33 +0000 Received: by mail-pl1-x634.google.com with SMTP id y5so10986540pll.3 for ; Mon, 04 Oct 2021 05:27:31 -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=seqv46vapK3LYSUO+3R1zuCP1rybYVvrFT5pZqlDw1A=; b=B9th5UxPPKH4IGJzAy4GbFFVV9wEb9q8pYukvEGqowKB/vV/l4UpjJGJxuTbaoHg78 P4NiaoBGoOFxqlL0UNnjgC5fCNf64+LIK7RDQyDYplmsBwZnz/23MGV4Va31cqrB4+Wa Ffgtj4gp3UnvQcsgDLmIKLmyIBzXcBqq3aI1hVE8un2jvArUCE+O+wW3fa3zRijAO539 0VrjxTo80cRcLs12HoHBba8Z23DkdeNiNrQq2Y/KyZsVjLoLzpbNTDp7JVMuIV/Xu8xJ GmTuBmqDI+tjQujcjTfiUd+06nxInO6B49btOoTnfGuRFWX1t8cQ3sWU6U7mxaAOEm0O h+nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=seqv46vapK3LYSUO+3R1zuCP1rybYVvrFT5pZqlDw1A=; b=1LN0sqE70fh7RHpBRefkLZtXvGTR6CYgK1CL5Q9sXfIw7nn+jWrfDAj35LSjCcDiIv wZ0iQyUx3iMuDbYQhrA5OAXKVUgE4BFcnRx8wF2cbw+fYor+2yZlgFzizTt/ZZCn2HmL KPxfwdkBJE87O57zeXX6DBVDtm7lJTwHsN61pFNt5Ebe6+nyTTFl1C14aoYdN413lqss e5Wc/SSJy40wvAYmRCvhu3Nvx8280Pv5NgQZfOX5kPwtszkoYvmDMDJZ56nU9xaANHAm SXfAbCROPRQL2pY3A+VmLOewSrXWcUenit3e4zi0aG4+ani7Htelk2fSpg75Hqpiqc0Q KETg== X-Gm-Message-State: AOAM533EVqo5//MTMtccn/O4WURgk5DbnG1pjjjJEQETH8t5ef/2+sEV ySiKUHZqPBIs55AFgefMDHRDsw== X-Google-Smtp-Source: ABdhPJxMgsnpiosCKhuEpLJjE3CB+I+h06iBCRwJEbbQ+Z59Ytp3hnFa5B/efn+C3/yQFI4hUws3Ig== X-Received: by 2002:a17:90a:f0c4:: with SMTP id fa4mr2614890pjb.245.1633350450588; Mon, 04 Oct 2021 05:27:30 -0700 (PDT) Received: from leoy-ThinkPad-X240s ([204.124.181.210]) by smtp.gmail.com with ESMTPSA id a10sm14423232pgd.91.2021.10.04.05.27.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Oct 2021 05:27:30 -0700 (PDT) Date: Mon, 4 Oct 2021 20:27:24 +0800 From: Leo Yan To: German Gomez Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, John Garry , Will Deacon , Mathieu Poirier , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Mike Leach , linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org Subject: Re: [PATCH 4/5] perf arm-spe: Implement find_snapshot callback Message-ID: <20211004122724.GC174271@leoy-ThinkPad-X240s> References: <20210916154635.1525-1-german.gomez@arm.com> <20210916154635.1525-4-german.gomez@arm.com> <20210923135016.GG400258@leoy-ThinkPad-X240s> <20210923144048.GB603008@leoy-ThinkPad-X240s> <1c6a3a73-27dc-6673-7fe7-34bc7fcb0a68@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1c6a3a73-27dc-6673-7fe7-34bc7fcb0a68@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211004_052732_128285_FC1B990E X-CRM114-Status: GOOD ( 21.09 ) 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 German, On Thu, Sep 30, 2021 at 01:26:15PM +0100, German Gomez wrote: [...] > The patch is indeed based on that commit. The reason behind it is that the > values for *head are being wrapped in the driver side (see the macro > PERF_IDX2OFF which is used at various points in > /drivers/perf/arm_spe_pmu.c). Yes, I noted that Arm SPE driver doesn't use monotonical increasing for AUX head. > If this callback is not to be added, I believe the driver needs to be > updated > first so that the head pointer monotonically increases like in cs-etm. Do > you think this makes sense for SPE? Please note, there have two cases should be handled for snapshot mode: - Wrap-around case, somehow function __auxtrace_mmap__read() has handled this case, see [1]; - It's possible that there have overrun case for snapshot mode, e.g. the kernel space receives multiple signals and take snapshot to save Arm SPE trace data into AUX buffer for multiple times, but the userspace tool cannot catch up to save AUX data into perf.data file. Thus the AUX head might be wrapped around for multiple times, for this case, I think monotonically increasing AUX head is the right solution to handle overrun issue. So simply say, I think the head pointer monotonically increasing is the right thing to do in Arm SPE driver. > (note that the patch will skip the wrap-around detection if this is the > case, > in order to handle both cases in the userspace perf tool). Almost agree, I read multiple times but have no idea what's the "both cases" in the last sentence. Please let me know if anything is not clear. Thanks, Leo [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/perf/util/auxtrace.c#n1804 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel