Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp7977424rwl; Thu, 23 Mar 2023 10:59:01 -0700 (PDT) X-Google-Smtp-Source: AKy350aM8leWwn0NJZUXoVGdM+WMdvgRG0HEqXJovRFW8ETVzWq0zJJy9LFt/WWxyd54h6ZfUs0J X-Received: by 2002:aa7:c490:0:b0:4fa:315a:cb55 with SMTP id m16-20020aa7c490000000b004fa315acb55mr277303edq.21.1679594340882; Thu, 23 Mar 2023 10:59:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679594340; cv=none; d=google.com; s=arc-20160816; b=ECAV4Nuj5gyK/guTKeTExJxXnVQSakOoDQBexvIDfaG35sKo1Mcu9OXgvpqEU15/6r UCgjW4mHxgZAVKR9N8di48YPxbnKLFBskKju19eJ0g4arxdsC7ftrr9eoEU5uPmUCbNd r/CDlhIT+d2IVl1+FBieNkIrWdfcL2s29iNqww4HIjuPpBdyTpbIU5Vv47q7ZqqUFGG2 y/6M+ahg1kirGRf2+0JZ7TMIRrq+WhGutYVRD+903aNRAV2QMLzJTQNIgyc/ctRGWDbm 18u6Yvie9QHlEOOrQAsbGUPg2l4b1Vls2XinV8EIsMy3Yao21+TWlXgs4V5adndVd6+r e/ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=9GICq/h/MURGsfZd6vbMZr4HCdVPlBgQP5GFfo+dlg8=; b=DRaxxzlxXvbmVkQsIRp4n0fBldzOVaSYfu3WJwoEdHQFE09MlPdYZ54eSsi8XQPDyu AC8R0BpYaXmMMlilzlzmkV/E4HP8q03GMuFnatayMZweCNI4gCWvd57/s6oBcv7qb0Nu b3yU8oyKwXV+4P/xJFsN112dHNoPbCn57JRe7uRwGZ1YDjRQp+Ub5Y65BheN3r+1m84X AJnyMqCmzfYy8DjSzLbGNIPxZKEP/DXUP3j2F1iSZXRhVzTgWcOe1U/mDw1vhJg8G/+H lgi/BG2qHCqtmfXgehsHcvOBTvvT8qE8iES21f/N9eaCLCHWlXEF6OzZBMZTmEUjbCWF yokQ== 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 c19-20020aa7df13000000b004acbd4990e5si20335208edy.158.2023.03.23.10.58.08; Thu, 23 Mar 2023 10:59:00 -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 S229873AbjCWRvo (ORCPT + 99 others); Thu, 23 Mar 2023 13:51:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229800AbjCWRvm (ORCPT ); Thu, 23 Mar 2023 13:51:42 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B1BD03250B; Thu, 23 Mar 2023 10:51:41 -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 7EA162F4; Thu, 23 Mar 2023 10:52:25 -0700 (PDT) Received: from FVFF77S0Q05N.cambridge.arm.com (FVFF77S0Q05N.cambridge.arm.com [10.1.31.167]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 85E133F766; Thu, 23 Mar 2023 10:51:39 -0700 (PDT) Date: Thu, 23 Mar 2023 17:51:36 +0000 From: Mark Rutland To: wangxiaolei Cc: will@kernel.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, jolsa@kernel.org, namhyung@kernel.org, irogers@google.com, linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: perf record -e branch-misses ls > /dev/null Message-ID: References: <08994540-d132-6e49-f6a0-82d8dfd1f3f0@windriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <08994540-d132-6e49-f6a0-82d8dfd1f3f0@windriver.com> X-Spam-Status: No, score=-2.3 required=5.0 tests=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 Wed, Mar 08, 2023 at 03:56:41PM +0800, wangxiaolei wrote: > hi > > When I use the perf tool on nxp-imx6sx, the CPU is armv7 cortex-A9 to test, > I execute the perf record -e branch-misses ls > /dev/null command, but the > perf report result is indeed: > perf report > Error: > The perf.data data has no samples! > # To display the perf.data header info, please use --header/--header-only > options. Which kernel version are you seeing this with? Is anything printed regarding the PMU in dmesg? > root@nxp-imx6:~# perf list hardware > > List of pre-defined events (to be used in -e): > >    branch-instructions OR branches [Hardware event] >    branch-misses [Hardware event] >    bus-cycles [Hardware event] >    cache-misses [Hardware event] >    cache-references [Hardware event] >    cpu-cycles OR cycles [Hardware event] >    instructions [Hardware event] That's just listing the generic HW events; does the PMU actually show up under sysfs? What do you see if you run: $ ls /sys/bus/event_source/devices/ > And not only this one hardware event, only cycles are working normally in > the following supported hardware time, other hardware events are not > interrupted and reported Can you explain what you mean by "not interrupted and reported"? Do you mean the PMU interrupt isn't firing? > , and the value in the read PMXEVCNTR register is > always -1, and the PMCR register E, bit[0 ] it will be written to 0 before > reading the PMXEVCNTR register. How are you reading PMXEVCNTR? Have you instrumented the PMU driver, or are you using other code? > I don’t know if the value in the PMXEVCNTR register is always -1 for this > reason. Does anyone have any good suggestions for debugging this problem? There are a number of potential reasons for this; if you can answer some of my questions above it'd help to narrow this down. Thanks, Mark.