Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp1972074lqb; Mon, 27 May 2024 03:59:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWfuCzHKY9Ms2XeDKaGz8NNSL566jahO3z15UyvPfKXZev3dQ3jVi7fxUBPg77IVgcZ3G7pLZFZOpfIIkSnlePx7/4Vv7Ob3awALQcoOQ== X-Google-Smtp-Source: AGHT+IFMGBX2HW797NQ1jtOXSp04lLU+6fZJ5bt69cjgd7q7H3ltqdEgpBGWZoYSJ0zt+3Qb6biL X-Received: by 2002:a05:6e02:20e4:b0:374:5d1b:826 with SMTP id e9e14a558f8ab-3745d1b0a61mr10794025ab.16.1716807541537; Mon, 27 May 2024 03:59:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716807541; cv=pass; d=google.com; s=arc-20160816; b=o2XT4D+nqSJdu+pwKjR0uD5qXL9QNbuIcwWSGtilZaC9wHfXJKskpRk6PWGWj/KBvO lERo71JeeEYw3gvKhz8A6xEFfCKAWX++2nOgT72j3qyoAoQXoXjjQ3uXknyWyijlsj+0 X2SuowXQ8llsKKLf7oN8RrhuYszeAoqmZ9cF6Z/laWMl3djP5fXmSoj4iesow/zjy31e qniJW9VArQAML2GAdmrVrKClaLbpyB33yK/SkHs9++J2gvzNVYAQR2/jtvqsoMASZ5uj Bjn/E7HJO/SLTWVyQjfD9Cw2cYuFzRDtKF525FT7aK/l4jXt3GblsQiP08HHl+yJlUAP bSTg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=qCSt2lfO79zGQqXQ6GqTg/xKbnT2Dp8Ua6SwahVXIwQ=; fh=jtaUhQXZ/SezkK9/xdmnDr4MrkqVff52+eM2yvrdgBQ=; b=AKZm8YfXsoFC6mhi06tl0r1xy70D957rYkj3bNObNq5zFtmU0nUfNKHbK5bFVTAR7q aJ21L3Z4UAQMOSoazb3ycQk5lbWP8USiMXr4jviAcgkpkiy5alff+Y9POG/iQsXqZ3De PiKgBQB96u9bwMWUJx1DyVTRCosBN3N8AyttBCXM5jYjY499j0PaI2zh0wY2DNwgxVSe Mn3KzSakL8U1Ak1Ajgja8WGI6a5oTIvNMrPrMo8P8cfgU2FnIZVfwXOZjIdw8kiMGXSx QhjIyBHICFv3XNaSMjcjyEl3ydJAlgvEjH1mDc9BBOqHPcILn476k39Jo619GOI5ufpL 4XgQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=CjhKL17R; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-190453-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190453-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6822ae57ecfsi6164363a12.821.2024.05.27.03.59.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 03:59:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-190453-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=CjhKL17R; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-190453-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190453-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 8BD4328469B for ; Mon, 27 May 2024 10:59:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A636F13BACE; Mon, 27 May 2024 10:58:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="CjhKL17R" Received: from out-172.mta1.migadu.com (out-172.mta1.migadu.com [95.215.58.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D096F13B792 for ; Mon, 27 May 2024 10:58:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716807535; cv=none; b=JNW5g0Z5HKb74x4/7qDKSJjjGc/bA8fCHoU5ngXG4lNJgJOzeO3jCEuyOAIi7RZamr6pblRxxulbPQzmCtVdRb7T3/q9Sl7LGMa6ysGWWSm882n7pbmyfNqqbC3ddbKXohRgbmivRZRlPypUZGg2bCmaLaXvoEC6xVFaz9pUx3Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716807535; c=relaxed/simple; bh=BggQ6WeR/VvO8wb95FnHBFaVo5F7rauqoxYgDuiL6do=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Wj/9LDRaKtAEZQVjlVozuXx9UbRTZ/OYlnbkEejZQJ/DvBeNtg9Gj640SEy9sRS9r5wl5s81hRq3gAtW1UqnDAbdRnYtGU0O25Ig/7XKyCrfLTdr/rAYxhhF73fAwaiPvZOSGYVkyNNeBb5AEA6estinRjJQjl1E1yFLVf2y7jc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=CjhKL17R; arc=none smtp.client-ip=95.215.58.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Envelope-To: torvalds@linux-foundation.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1716807531; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=qCSt2lfO79zGQqXQ6GqTg/xKbnT2Dp8Ua6SwahVXIwQ=; b=CjhKL17RlnwOw4OY2MkDLrsOc8LFenEpy6DV44i4imM+m3HwKgceHGw+ekqqA9yzSEsf8d a1YtFHeXUMJzqgB7IhnSznfWjUpnHdMX2GWk9/xQes5lzVrFwSLAnQPO2B8NmOcd+sxJ8R 4vxJTJkM0kPCqw3gKY2P5VLw/JvShVA= X-Envelope-To: irogers@google.com X-Envelope-To: peterz@infradead.org X-Envelope-To: mingo@redhat.com X-Envelope-To: acme@kernel.org X-Envelope-To: namhyung@kernel.org X-Envelope-To: mark.rutland@arm.com X-Envelope-To: alexander.shishkin@linux.intel.com X-Envelope-To: jolsa@kernel.org X-Envelope-To: adrian.hunter@intel.com X-Envelope-To: kan.liang@linux.intel.com X-Envelope-To: james.clark@arm.com X-Envelope-To: asmadeus@codewreck.org X-Envelope-To: linux-perf-users@vger.kernel.org X-Envelope-To: linux-kernel@vger.kernel.org Date: Mon, 27 May 2024 18:58:42 +0800 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Leo Yan To: Linus Torvalds Cc: Ian Rogers , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , Kan Liang , James Clark , Dominique Martinet , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1] perf evlist: Force adding default events only to core PMUs Message-ID: <20240527105842.GB33806@debian-dev> References: <20240525152927.665498-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT On Sat, May 25, 2024 at 02:14:26PM -0700, Linus Torvalds wrote: > On Sat, 25 May 2024 at 09:43, Linus Torvalds > wrote: > > > > This makes 'perf record' work for me again. > > Oh, wait, no it doesn't. > > It makes just the plain "perf record" without any arguments work, > which was what I was testing because I was lazy. > > So now > > $ perf record sleep 1 > > works fine. But > > $ perf record -e cycles:pp sleep 1 > > is still completely broken (with or without ":p" and ":pp"). Seems to me that this patch fails to check if a PMU is a core-attached PMU that can support common hardware events. Therefore, we should consider adding the following check. diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 30f958069076..bc1822c2f3e3 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -1594,6 +1594,9 @@ int parse_events_multi_pmu_add(struct parse_events_state *parse_state, while ((pmu = perf_pmus__scan(pmu)) != NULL) { bool auto_merge_stats; + if (hw_config != PERF_COUNT_HW_MAX && !pmu->is_core) + continue; + if (parse_events__filter_pmu(parse_state, pmu)) continue; To be clear, I only compiled this change but I have no chance to test it. @Ian, could you confirm this? Thanks, Leo > So no. That still needs to be fixed, or the whole "prefer sysfs/JSON > by default" needs to be reverted.