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=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 758FEC49361 for ; Mon, 28 Jun 2021 12:14:33 +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 3E28261A2B for ; Mon, 28 Jun 2021 12:14:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3E28261A2B 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=mTbSqQ5hXOQRIF6ux1fUiydN4wMZN2GKs0ysATq0ySk=; b=wlqc4H8HRG23jP 6Ij6msxllO1pJQYvfETs3+MhOA/WIZPwil/wJBf7VM3WmiVLekSfaRQpCvgNJeEoFuqNYcSeeWOOr ioB8/bRH9RgznD9tYLhyURiIsXlb8rMQb7RahlW3t7POZVprBTbHIZF6TG9nKeqDRxEiNb57T0mNP 2AdyU7FLxYzrmDAH6IUpiMGMO0un6YH++DVQrH4wJ1wtsBIDGXkbZ4nfBxnZSZzA+q0a3lcU3VLgV I9+x9CdVGSpMT3gRruG3f6Tud3wkU8YJF8IYL5tKl104qejJ5lgsY/iBV9xm5kR2YK881Y60H+lnF vTeh0qQ3s0Kw5OzXxvPg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lxq7o-007tM1-VW; Mon, 28 Jun 2021 12:12:29 +0000 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lxq7l-007tL9-8c for linux-arm-kernel@lists.infradead.org; Mon, 28 Jun 2021 12:12:26 +0000 Received: by mail-pj1-x1033.google.com with SMTP id mn20-20020a17090b1894b02901707fc074e8so1495271pjb.0 for ; Mon, 28 Jun 2021 05:12:24 -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=2xcGOgP/yg1u7n803j0UADdqFly0YaxV+TsFk8YNqGg=; b=q0XtAxQCldYUjMpu+SY9e/g2ItjBE0+iCawDmqpGlnW9tg1QZoxU1EerpByITcNWpo dYYERIGvOrhKWkz68obNn4RVU/T6Vn7ARfiLc9xK8sI+djcHH8LTkBtwf1IuK3ZX9q7m TfVz9UOi881d1rqWEIxZpFFpPdzqknoSGGszEtdO9IDm8V2EjYmJ4EZlHK8WK5EfIbKi HTtzL7Md3RkabxkmtU+Hd5AG+oheb+jkOs+1F+sEO/uncvw8yS53OsiNeDoXMguaZMcB yBGuqzS5L70IluQiN3qJ8EUc75jnbvDeTnDufd3tJ1hKp4lnAXQAxofN2vkO8GRPJwUi gEeg== 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=2xcGOgP/yg1u7n803j0UADdqFly0YaxV+TsFk8YNqGg=; b=JboHqJWKiSbFWWOtfkbSRmIWy+ejHWTHdTzIQwT+5e+P4k3NN16aCGN9ygxLmWCT7g 5HUE3AIN6NSecNi32MYOjFUpnkuYKja3C992DyPF68DNCxlUTjrIbPtq6jzsvcL2F/+r KiVn2EUwtzSkWv+KgtzioCbxBVNLfmeUG4pMKITEKHR4TJW+6FeX0VZru4ycf9ND6Ogi e3dTbvE7h+juJ8+tJJ1UWStv1opMSEwhIczKjosvoTGOmdYKhcvM67wStWxbBsdL1v1/ //2tZG7ITCab0mWbMkM5z/v7CQvUmEb4vEW0aMq2i1Z+EiGwh6wdJM9n6iKzYicN3bG9 GrEQ== X-Gm-Message-State: AOAM531aZixCBAczxlS8wW05Jnv4WEAquiLTng3wUgNcumu3GCTccdvS AkmXSuZqpo1K7u+r1H7kqozIpw== X-Google-Smtp-Source: ABdhPJy3t88iPCr1uRgXPIlJRE1hWIf9EVjMlvHN4QcQ52KFGeWoAA5vxIvilcuwAN6yuVxJVewSOw== X-Received: by 2002:a17:902:e04f:b029:eb:66b0:6d08 with SMTP id x15-20020a170902e04fb02900eb66b06d08mr22425677plx.50.1624882343334; Mon, 28 Jun 2021 05:12:23 -0700 (PDT) Received: from leoy-ThinkPad-X240s ([202.155.204.36]) by smtp.gmail.com with ESMTPSA id b22sm6140182pfp.20.2021.06.28.05.12.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Jun 2021 05:12:22 -0700 (PDT) Date: Mon, 28 Jun 2021 20:12:17 +0800 From: Leo Yan To: James Clark Cc: Arnaldo Carvalho de Melo , John Garry , Will Deacon , Mathieu Poirier , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Dave Martin , Al Grant , linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 5/5] perf arm-spe: Don't wait for PERF_RECORD_EXIT event Message-ID: <20210628121217.GD200044@leoy-ThinkPad-X240s> References: <20210519071939.1598923-1-leo.yan@linaro.org> <20210519071939.1598923-6-leo.yan@linaro.org> <369fd454-d94d-daa1-ead4-b42645ec4282@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <369fd454-d94d-daa1-ead4-b42645ec4282@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210628_051225_358879_7CC4BCCC X-CRM114-Status: GOOD ( 26.94 ) 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 Fri, Jun 25, 2021 at 02:25:15PM +0100, James Clark wrote: > > > On 19/05/2021 08:19, Leo Yan wrote: > > When decode Arm SPE trace, it waits for PERF_RECORD_EXIT event (the last > > perf event) for processing trace data, which is needless and even might > > cause logic error, e.g. it might fail to correlate perf events with Arm > > SPE events correctly. > > > > So this patch removes the condition checking for PERF_RECORD_EXIT event. > > > > Signed-off-by: Leo Yan > > --- > > tools/perf/util/arm-spe.c | 6 +----- > > 1 file changed, 1 insertion(+), 5 deletions(-) > > > > diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c > > index 5c5b438584c4..58b7069c5a5f 100644 > > --- a/tools/perf/util/arm-spe.c > > +++ b/tools/perf/util/arm-spe.c > > @@ -717,11 +717,7 @@ static int arm_spe_process_event(struct perf_session *session, > > sample->time); > > } > > } else if (timestamp) { > > - if (event->header.type == PERF_RECORD_EXIT) { > > - err = arm_spe_process_queues(spe, timestamp); > > - if (err) > > - return err; > > - } > > + err = arm_spe_process_queues(spe, timestamp); > > } > > > > return err; > > > > For the whole set: > Reviewed-by: James Clark > Tested-by: James Clark > I see a big improvement in decoding involving multiple processes because the timestamps are now > correlated with the comm and mmap events. > > For example perf-exec samples are visible right before the exec is done, and on an > application that forks, samples are visible from all processes. For example: > > perf record -e arm_spe// -- bash -c "stress -c 1" > perf script > > perf-exec 4502 [003] 259755.050409: 1 l1d-access: ffff80001014b840 sched_clock+0x40 ([kernel.kallsyms]) > perf-exec 4502 [003] 259755.050409: 1 tlb-access: ffff80001014b840 sched_clock+0x40 ([kernel.kallsyms]) > perf-exec 4502 [003] 259755.050409: 1 memory: ffff80001014b840 sched_clock+0x40 ([kernel.kallsyms]) > perf-exec 4502 [003] 259755.050411: 1 tlb-access: ffff800010120fb8 __rcu_read_lock+0x0 ([kernel.kallsyms]) > bash 4502 [003] 259755.050411: 1 branch-miss: ffff8000105b2a40 memcpy+0x80 ([kernel.kallsyms]) > bash 4502 [003] 259755.050411: 1 tlb-access: 0 [unknown] ([unknown]) > ... > stress 4502 [003] 259755.051468: 1 l1d-access: ffff800010259a24 __vma_adjust+0x1f4 ([kernel.kallsyms]) > stress 4502 [003] 259755.051468: 1 tlb-access: ffff800010259a24 __vma_adjust+0x1f4 ([kernel.kallsyms]) > stress 4502 [003] 259755.051468: 1 memory: ffff800010259a24 __vma_adjust+0x1f4 ([kernel.kallsyms]) > > Previously samples were only attributed to 'stress', which was obviously wrong. Thanks a lot for the review and testing, James! Hi Arnaldo, I confirmed this patch set can be cleanly applied on the latest acme/perf/core branch, so could you pick up this patch set? Thanks, Leo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel