Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp107382rwl; Thu, 30 Mar 2023 12:55:34 -0700 (PDT) X-Google-Smtp-Source: AKy350ZOgVv3tqmVFhi2GRf8mrl8pJ7z3ybHVrFq5V3z4esw33gRc90znBeWI3pt09tV1DwVZX0k X-Received: by 2002:a05:6402:4315:b0:502:616b:cbd5 with SMTP id m21-20020a056402431500b00502616bcbd5mr3955145edc.2.1680206134303; Thu, 30 Mar 2023 12:55:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680206134; cv=none; d=google.com; s=arc-20160816; b=ZyBepkF95VIsj0tasiyVrbHgudy7OZzTcoHez4F5iKOaZMfpc5t7LRX6axicvbnWpC 7mw5e/uyk7T761RYziBpOqxqQ0q+oG+ptU2ie89bCEHGrtLLDTIsacB3XRnLlcVFMEii raH8ywIeNsRmIHMKkqX4FHC28engrOnHMIDv5XD32Y1eGcbLSOpgO6oanqkK6qGH18Yl rf/pHTR7IrEqOLGxpiFdawSsaswwLk3u9DOVfq1sQ59JSUzlj731znu5cyr7MMEtLASC Vg/1HyW0eWXyoa+spd81iyItrkZuWE/RSL1XEpSnvHcteslgZ3PhTwBsJnNutjLwMov7 Pa/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=OzYl34qHqlnYZZkPFK+yoEyv37qx/dlfpjxFYKlTm4s=; b=wKn2WkDlK3BpVjXR7bBEU4/GBSYhgr8htt9itqj+xb2Zw8wbZD7DeL09t/aROx0tIB NUSW7NL4opcBWFyYwLvkk9oWUZ3Xo8efMm7Ad3lwtvicvt411u+nNWLZ6DSD9SVop0av 2MTQDKACgczGeTyfNN7eHQP0/bmGrjaySqE95E8XgqLU941MfKfalcHVTj54xFfBYcCP zt/h0kQPE0xEKHdNz2c61Oa7ATDBiEfLqSyDdSS1jK28clBdp+Sf+7gkMv4sCqk73L2v dvFhXb2/ukccg8iM+5OEArWINlzQLTE3CbMl5hY34rAGvqNUm8l+NY5OhiS4Mhw1cZi1 EJ9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mq2rnwbc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bq6-20020a170906d0c600b008d70b974e03si341948ejb.379.2023.03.30.12.55.09; Thu, 30 Mar 2023 12:55:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mq2rnwbc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231607AbjC3Tyj (ORCPT + 99 others); Thu, 30 Mar 2023 15:54:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231315AbjC3Tyi (ORCPT ); Thu, 30 Mar 2023 15:54:38 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9150B49E3; Thu, 30 Mar 2023 12:54:37 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id x15so18325008pjk.2; Thu, 30 Mar 2023 12:54:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680206077; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=OzYl34qHqlnYZZkPFK+yoEyv37qx/dlfpjxFYKlTm4s=; b=mq2rnwbci+RMgKDXaruFkc1XWydlzWeaZrArIDHiTdsDMtz7bv5e8qx9R9c23p8EL9 j74PfI7MfW0o4RfbePiuH53k+4iu3YyZQgUnhZAG9DncY9dkcWMLVC4XpDci7HOJ50Ds hxlH4mW72qYfOgHq66jZWGkG3foK4PBNKccmsWNVkYTbLOcs5COijXeRcBRvp3L9/na/ A10gv0aZFVz63PoE2AFhoPIvQqYfwjHSv1XPdahkTNqO+DdN1oA0NTth0DKzTSwxxxPf aqrU1zxYG8DO1960GuDUxfSUk875+12vTMipWq5SwhnM8AKdKU75yarkfM9Zbqtyclqv Dn+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680206077; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OzYl34qHqlnYZZkPFK+yoEyv37qx/dlfpjxFYKlTm4s=; b=73Mhj/EUs9+cKo14eobaqtVqH11vJ1A5q6bWb2fWX93jaLTNv6t5Sa+aWsaAaPG6UV UH6L/O+R/bO2F+D1TvHstIvTBFvRJh/LQSZucsvGFct3GKhHF9kvQiX7bSbGEk7CHH76 pEJYpS95iEPL7X0KgIoI6fa3mKk64Kahg+y4x2dRj7n5r4OO7Mkp9IZ3BwxJ5cz0hkQX fVykHWgdRwC4MQT4aknSEdGGysVeK+JaSKbhfjiQCm620npHGThlACymTcVxK67gMJJR TVC1B5lzHun0bJh4jSxtYdFeyN5XBkE85y2RaALWSsCHw22HhzhlI5HetcHnlUrDNyw3 +WQg== X-Gm-Message-State: AAQBX9clU6HRpNCgso3a9j8ICkWBuaYTiUcqMikO3zQR2cGvlWHxHaXA UXVFyE4KSiGiaGnEjOCRsHAK3KrceHH6H/LZpbCX6/RzokA= X-Received: by 2002:a17:903:2615:b0:1a0:561c:7276 with SMTP id jd21-20020a170903261500b001a0561c7276mr8652529plb.1.1680206077050; Thu, 30 Mar 2023 12:54:37 -0700 (PDT) MIME-Version: 1.0 References: <8ca2b07e-674e-afb6-ff12-87504f51f252@arm.com> <20230309113851.GF19253@leoy-yangtze.lan> <20230313121420.GB2426758@leoy-yangtze.lan> <20230314003610.GD2426758@leoy-yangtze.lan> <6dcf83ad-bfbc-7e59-7c86-bed334bd09e8@arm.com> <5dc10954-d1ad-e8f8-deff-fd237df48ecb@arm.com> In-Reply-To: <5dc10954-d1ad-e8f8-deff-fd237df48ecb@arm.com> From: Yang Shi Date: Thu, 30 Mar 2023 12:54:25 -0700 Message-ID: Subject: Re: [BUG] perf: No samples found when using kcore + coresight To: James Clark Cc: Leo Yan , linux-perf-users@vger.kernel.org, LAK , coresight@lists.linaro.org, Linux Kernel Mailing List , mathieu.poirier@linaro.org, adrian.hunter@intel.com, Jiri Olsa , acme@redhat.com, mike.leach@linaro.org, Will Deacon , suzuki.poulose@arm.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 30, 2023 at 3:36=E2=80=AFAM James Clark w= rote: > > > > On 29/03/2023 17:11, James Clark wrote: > > > > > > On 14/03/2023 00:36, Leo Yan wrote: > >> On Mon, Mar 13, 2023 at 11:15:44AM -0700, Yang Shi wrote: > >> > >> [...] > >> > >>>> Just a quick summary, here we have two issues: > >>>> > >>>> - With command: > >>>> perf record -e cs_etm/@tmc_etf63/k --kcore --per-thread \ > >>>> -- taskset --cpu-list 1 uname", > >>>> > >>>> perf doesn't enable "text poke" attribution. > >>> > >>> No, it enables "text poke" and perf fails to decode coresight trace > >>> data too. It doesn't matter whether "--kcore" is after or before "-e > >>> cs/etm/@tmc_etf63/k". > >> > >> Understand now. Thanks for correction, if so we can ignore this one. > >> > >> Leo > > > > To me it looks like it's only --per-thread and --kcore together that > > cause the issue. I can't see if that was mentioned previously in this > > thread. > > > > If it is --per-thread that's causing the issue then I think I have an > > idea why it might be. There are some assumptions and different paths > > taken in decoding in that mode that aren't correct. It causes some othe= r > > issues to do with ordering and timestamps as well and I wanted to fix i= t > > previously. I wouldn't say that the text-poke change has caused a > > regression, as decoding in this mode was always a bit buggy. > > > > Maybe this is another reason to fix it properly. > > Hi Yang, > > I found a temporary workaround to the issue. Whenever you use > --per-thread mode, force timeless mode when decoding with --itrace=3DZ an= d > it works the same as it did before. For example: > > perf report --itrace=3DZi1000i > > The reason is that the new text poke event was added with timestamps > enabled. The Coresight decoder slightly incorrectly assumed that no > timestamps =3D=3D per-thread mode so when it sees the new event it goes i= nto > the wrong decode mode. > > The assumption was never really correct so I will make a proper fix. But > in the mean time the workaround should be fine. Hi James, Thanks for figuring out the workaround. I tested both (using "-C" instead of "--per-thread" for record or using "--itrace=3DZ" for report) works. I think the workaround is fine before we have a proper fix. >