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 9E07BC433F5 for ; Wed, 20 Oct 2021 13:26:54 +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 5B4B46134F for ; Wed, 20 Oct 2021 13:26:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5B4B46134F 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=JtLMxOahAO1ixYlc+bzm46J+UAi8HShzpi4Neahtaf0=; b=iADabdxnFZOmm5 p2uxRkUcaieilFzHkvXqX1tvNP0nYIjYcAhcYvM3fwZymYuajyVXkeBBmbtK6WNuu0uCnwVAlid+t gb16QIEHlolux7LphD58MtJWyBE9e6yWy+J8Wxwg50Vtad9iY/v3haT5q3ih+3wRRfjPPwNpNbWAB tVCk6/bBTxbPTuM1MRe/syuSWUbtpzMCDJFYfIJqyNv9LpKsdRknyfmTYIwvj+pmfJjNhoNJIfQVY vUCv49N4yM4q7qoajCP7tZYHGaWixW/knNIpzo+MVqclBRdvVmewo60hT6hwhllcfjpfWj9S95qmn auZstMdp77T4zXV6TIRA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdBb6-004bWa-FZ; Wed, 20 Oct 2021 13:25:36 +0000 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdBb2-004bWF-AM for linux-arm-kernel@lists.infradead.org; Wed, 20 Oct 2021 13:25:33 +0000 Received: by mail-pg1-x52b.google.com with SMTP id g184so22508041pgc.6 for ; Wed, 20 Oct 2021 06:25: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=B33cnf023fQm3GVfpEJD0Q4Wbg7jf3ZnWq/afLUKi2A=; b=wtq043pENV9t71jU6dkXGp3JuoV+Tmxr/Twpug4Ft3MPuTLvL3Bu7U3R+2Qq2NCzmN C6pwIotvkI1FGaORnHRPRxp37eM/kjEt46WyTH/il93Xadfnf2hB1dCMDe8hDnl/VRH1 2dOnTQLlyGNikM3oncTi7YAs0RevhR9IfGJzlUQfPrwwHOp7XrRW+0VsmNuZjxsNhNiZ lvc9DnNq9eggcoKmhE0fHaP2nGXYaHYB4Imufa+7/CJZw3rb73+NNDwZsaqCRtl0+Tw4 giSnZaU8kvv7mQebGHnud2d4nunRfckiwdzuh9a+Z5XUPOGIgqWjuTMcaJmVwXOQy9Ia EkPw== 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=B33cnf023fQm3GVfpEJD0Q4Wbg7jf3ZnWq/afLUKi2A=; b=Ncy56z1GoXvLOBzWERrSat6gKoG4tAA9UZ7wNMOx4lAcgTVbWcIAqUQhkorvd1ihCf ZrHE2SvimBhiObUchQl54CHWq7Bae5KHEJATp0E5WBvjKUV4PgL/mXSTmBX9Wj9zv317 wUJQHjQe+pyqvsbmbxZ/gD2vTREFJawjy4fA7Bjv5Xc5DJxmR6SQKyeIdkz1bCBQpm4i 0z+/VUFJlLd1bd0ju/Q/pNQ1NcxzioGd3Asx3ZiluvDGm1M2e6zRNxffFvtgNvhvpncJ 09XUtEReD+bxN+m0SiszddFsT/I+CGtcg5ER8rOC0+Hie+C1zi0IlrXKwoQG96RqUv8y tu3A== X-Gm-Message-State: AOAM532hjwttXxTIRnEjJlQsQTqQsK5NCwWf7JqZME4oZK/1CoOF/s5x Ohrz516O0RR3IA44gpedgyWDaqghvbQsQc+PymftmA== X-Google-Smtp-Source: ABdhPJxoviIBSwiDcJEmG16PcZ8QdakQCFNojHcMiD05xwwnHTJx5SfEXyklwzSJ8KbWzjavaY4TPA== X-Received: by 2002:a05:6a00:1781:b0:44d:faef:f2c0 with SMTP id s1-20020a056a00178100b0044dfaeff2c0mr5651pfg.68.1634736331411; Wed, 20 Oct 2021 06:25:31 -0700 (PDT) Received: from leoy-ThinkPad-X240s ([134.195.101.46]) by smtp.gmail.com with ESMTPSA id oc8sm2718291pjb.15.2021.10.20.06.25.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Oct 2021 06:25:30 -0700 (PDT) Date: Wed, 20 Oct 2021 21:25:20 +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, James Clark Subject: Re: [PATCH 4/5] perf arm-spe: Implement find_snapshot callback Message-ID: <20211020132520.GH49614@leoy-ThinkPad-X240s> References: <20210916154635.1525-1-german.gomez@arm.com> <20210916154635.1525-4-german.gomez@arm.com> <20211017120546.GB130233@leoy-ThinkPad-X240s> <0661828d-f7d9-fd8f-2a57-19364d2e5218@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <0661828d-f7d9-fd8f-2a57-19364d2e5218@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211020_062532_390577_862C2605 X-CRM114-Status: GOOD ( 26.75 ) 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 Tue, Oct 19, 2021 at 06:34:24PM +0100, German Gomez wrote: > Hi Leo, > > On 17/10/2021 13:05, Leo Yan wrote: > > On Thu, Sep 16, 2021 at 04:46:34PM +0100, German Gomez wrote: > > > > [...] > > > > If run a test case (the test is pasted at the end of the reply), I > > can get quite different AUX trace data with passing different wait > > period before sending the first USR2 signal. > > > > # sh test_arm_spe_snapshot.sh 2 > > Couldn't synthesize bpf events. > > stress: info: [5768] dispatching hogs: 1 cpu, 0 io, 0 vm, 0 hdd > > [ perf record: Woken up 3 times to write data ] > > [ perf record: Captured and wrote 2.833 MB perf.data ] > > > > # sh test_arm_spe_snapshot.sh 10 > > Couldn't synthesize bpf events. > > stress: info: [5776] dispatching hogs: 1 cpu, 0 io, 0 vm, 0 hdd > > [ perf record: Woken up 3 times to write data ] > > [ perf record: Captured and wrote 24.356 MB perf.data ] > > > > The first command passes argument '2' so the test will wait for 2 > > seconds before send USR2 signal for snapshot, and the perf data file is > > 2.833 MB (so this means the Arm SPE trace data is about 2MB) for three > > snapshots. In the second command, the argument '10' means it will wait > > for 10 seconds before sending the USR2 signals, and every time it records > > the trace data from the full AUX buffer (8MB), at the end it gets 24MB > > AUX trace data. > > > > The issue happens in the second command, waiting for 10 seconds leads > > to the *full* AUX ring buffer is filled by Arm SPE, so the function > > arm_spe_buffer_has_wrapped() always return back true for this case. > > Afterwards, arm_spe_find_snapshot() doesn't respect the passed old > > header (from '*old') and assumes the trace data size is 'mm->len'. > > Returning the entire contents of the buffer once the first wrap-around > was detected was the intention of the patch, so I don't currently see it > as wrong. What were the values you were expecting to see in the test? I expect the second command takes three snapshots: the first time it should record AUX trace data with full buffer size (8MB) after waiting for 10 seconds, and later two times will take small AUX trace data since the interval (0.03s) is short and Arm SPE has not filled the full AUX buffer. > If the handling of snapshot mode by the perf tool can be improved after > upstreaming the changes to the driver, we could submit a followup patch > after that has been fixed. Okay, I understand now the main concern is for kernel driver changes, this patch for perf tool is fine for me: Reviewed-by: Leo Yan Tested-by: Leo Yan [...] > I will try these and the other driver changes and discuss them with the > team internally, thanks! Thanks a lot! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel