Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1934332rwl; Thu, 30 Mar 2023 03:44:58 -0700 (PDT) X-Google-Smtp-Source: AKy350bjcnZxE3FkxXIcuPegRJci7//EHx5qg8wmSxZhmdj+7xcOXrXY2FOtv2ts7s9A+e65LfSP X-Received: by 2002:a17:902:da88:b0:19d:2a3:f019 with SMTP id j8-20020a170902da8800b0019d02a3f019mr1864167plx.1.1680173098465; Thu, 30 Mar 2023 03:44:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680173098; cv=none; d=google.com; s=arc-20160816; b=LyHZMM/pbenjwYK6Hg9lfYsS5LZJpFMdaYENPhRq7Phf4IyE4cgErWhURTl2cxXLli QnzH94+rpijA0E2AeY+dwfo+BYvW3Sfq21kaCTVV0EhsMYT8MilXjtqN6AFFzZrPf431 t4ScGOAtsvuy2fltA7nS+y4bLNmFmavbDf+2E2jkzDyEJbNnzuAOgoqwpR4syD9UZNZs 4F16c51S6LYOywbuM7t35UcipLZHHiKf9ox1nYu2mHZ/Lcr10/OgJEhv6r5nzq/+Ww+Z sYs69AEVC2Q/lDLrox3zv/65V0+Q28YTJLFo6r6Sax+c/77yotnJaRJUAC2VUocdAZNz xrqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :content-language:references:cc:to:from:subject:user-agent :mime-version:date:message-id; bh=utt5QaDhaTJ7ZKdXInkVhfjdUWjpv6yL66wnYip4R0k=; b=m+xowp6SRbYuda0s1AhIUUKpoeBmJw4yX+tT38gc9CXdnUhwztF3SyO7NUjXSDVIPp jch0cXKuA6hTSNZ02IHt1XueNWeFKLBcZWMfUXZr0ZbUeE9HE4fzNgze9BqLF6+YKNZh v0/oq7oXpNlbpgd59ni7uF+PspgI5UJqq8NIf0RlY5STPtYGr/OyDAqmZFgzZvVhXvzB 5aNChfC/RoKT2ixhFbcuirzhdbhHgkacV3TvAt+mGauxD2opxX83v5efHlyRy6ihKOe3 VfS445PRr/TXD3HkUkZaRs2TdIaiWytXhF0yfHE1Rgxt7ysnYrcmolw4Kt1BRn6L18+I T6QA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q9-20020a170902dac900b001947ba0ac92si36906699plx.350.2023.03.30.03.44.41; Thu, 30 Mar 2023 03:44:58 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231144AbjC3KhH (ORCPT + 99 others); Thu, 30 Mar 2023 06:37:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230015AbjC3KhF (ORCPT ); Thu, 30 Mar 2023 06:37:05 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4CC867ED9; Thu, 30 Mar 2023 03:36:57 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B11DD2F4; Thu, 30 Mar 2023 03:37:41 -0700 (PDT) Received: from [10.57.21.28] (unknown [10.57.21.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 97BFD3F663; Thu, 30 Mar 2023 03:36:55 -0700 (PDT) Message-ID: <5dc10954-d1ad-e8f8-deff-fd237df48ecb@arm.com> Date: Thu, 30 Mar 2023 11:36:54 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [BUG] perf: No samples found when using kcore + coresight From: James Clark To: Leo Yan , Yang Shi Cc: 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 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> Content-Language: en-US In-Reply-To: <6dcf83ad-bfbc-7e59-7c86-bed334bd09e8@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.3 required=5.0 tests=NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE 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 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 other > issues to do with ordering and timestamps as well and I wanted to fix it > 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=Z and it works the same as it did before. For example: perf report --itrace=Zi1000i The reason is that the new text poke event was added with timestamps enabled. The Coresight decoder slightly incorrectly assumed that no timestamps == per-thread mode so when it sees the new event it goes into 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.