Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp7544130rwp; Tue, 18 Jul 2023 17:44:44 -0700 (PDT) X-Google-Smtp-Source: APBJJlEHr9oxuiRc4svxLwyUwAJhXe8zLtyNqxlppcO1deyK5YHxYD2lRVR48andjrR7mwk7IBVf X-Received: by 2002:a17:906:6701:b0:98e:a54:42e3 with SMTP id a1-20020a170906670100b0098e0a5442e3mr875221ejp.54.1689727483921; Tue, 18 Jul 2023 17:44:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689727483; cv=none; d=google.com; s=arc-20160816; b=hds1xRoGKJEhD7i+oJEuXAdUAs403DvbUWC1VFCqAOvELX+OJJwVGh8jxDatX1Qz8e S0cae8XXEUBtsp4DwxiRRhOnrHXHAo9syzXt4uW5CaFb4kHfOHk1RmT/5H2k1S0iA+Jr NQNaM9lySaX+ZTiNMvNI8o1xyddrywVUsbWnusQGlcDDIE+P9KcxmNXZfkBMKO4CkR8o ks6oU4snRoHWRMZD687GwCsiyOi9BWnIllKLgNaZer9lMPPnuqgQgvTSQI/OeNbAMFOG fwx/Co9BEXmJCZkuHGeeNTITrELfwd8XJNVieHeFu2REmRDZt7DjgM496DqjoLMCurbF U4cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:subject:mime-version:message-id:date :dkim-signature; bh=3OvYnUXhgex75QX5U1PzD5o/QrwcqmO5OIHxzMjFjqo=; fh=sOu+iwA5un5ra1EPsd80GAsuEGJuyePFqtR+0T7xytE=; b=XMSsosCgPhxLXt4FEoHDHx94EfwoHnbSiiYbyNOYV5dmJLn377VgWffeN+DKZ9pKIB ODTMdn25OX/ae7zq5vLtMpgOA54GF9ra6hd0lZ6iOflWdSIhLtDdDU8JBIqMa/rbp4Es GYSrAym1SeA0iAegrpaeUwoOPXFdFculMe6v8WFKBSa5cD7PWrYLIsJszKrVApYd1lqY MaUfCoPLrVu1dWwaVkoFvkUnD28ODCe0+K5/7iQTHvo+Qz2F8BGsORPiS5hUds2FInL1 YFoAPddt3jT/57N/Aglfpa1qXhWeVDNF6i+roe+Q8v9y2fwTuPo81BdQlr67/lirDoik 8KUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=PiKNCRuZ; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y3-20020a170906470300b009929566f00asi1797683ejq.467.2023.07.18.17.44.16; Tue, 18 Jul 2023 17:44:43 -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=@google.com header.s=20221208 header.b=PiKNCRuZ; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229475AbjGSASn (ORCPT + 99 others); Tue, 18 Jul 2023 20:18:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjGSASm (ORCPT ); Tue, 18 Jul 2023 20:18:42 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F372139 for ; Tue, 18 Jul 2023 17:18:41 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-c6dd0e46a52so5482678276.2 for ; Tue, 18 Jul 2023 17:18:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1689725920; x=1692317920; h=to:from:subject:mime-version:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=3OvYnUXhgex75QX5U1PzD5o/QrwcqmO5OIHxzMjFjqo=; b=PiKNCRuZgqEfYgPlOs9Lx4w3rfFPcZ/ikLGlk/Jr/HMX9FPypQNcJqBvpOjrdpBEF9 6gp17GYCae05BZ3qR/b8xWAiwVQRypbpnyx7xnhTnN0IZvuWyT3qtNmsnm8VEA6e1XwA us3xnQkmRH6P8grbzAGN5urVi8svcz+OUVzVEl8rzsIV52TMeDyhbuYHd1lnouILzJJN br2Z7oUyIp0xvL6MQL7z+IoXceo+jrpc7PPDOWpiHmklTYViTH+udyBAUe7Ijsk8r0qv /eNN9k2QZdGPo5IYyc43N5LSMhfiqVKjmn+G+xuAVwVaQtMlrfsW9WRHc5OxYqBTjbgG Hx9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689725920; x=1692317920; h=to:from:subject:mime-version:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=3OvYnUXhgex75QX5U1PzD5o/QrwcqmO5OIHxzMjFjqo=; b=f7ibh4g24UXysas27M7ZFtsZ2D7QIQBc0Hzseq+nV/LnU6bqYoJRNb5KNxk4f+frPk +3bjaJopxs+wScl9xlg/HXTjZUj0xy7rxYz7uWoA/iwirk5kA8pBQqMeydCI1urA+QL7 08b4feVjJAiac9yCOmGv/eBp3iZewlLvDcIS1S5zHdHsOAB3f4FhwgPbcFWqOQEq4gcE OywOlEbX5a28/CV+hA5mL6oKG6hrQeonppbabsn6CbpKAg8DSluVwsIIFxo9nQWIX+Uy suFegj37XRd3FRlinfYnmAPxlBrFrv9Q5QtmAVGezpjbqk4BZP4LJYkLBnNuSXRKQGXF 3WYQ== X-Gm-Message-State: ABy/qLbQ+yY+T+2xSben/6WTznQZz+K/xj+sJLseqfiMSHEC8Xlo3yyj 26fIRuMY5CUWiVoV0WPcGjvxVecvIsww X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:c587:348f:a079:d876]) (user=irogers job=sendgmr) by 2002:a05:6902:1746:b0:cea:ef04:1c61 with SMTP id bz6-20020a056902174600b00ceaef041c61mr12142ybb.1.1689725920315; Tue, 18 Jul 2023 17:18:40 -0700 (PDT) Date: Tue, 18 Jul 2023 17:18:33 -0700 Message-Id: <20230719001836.198363-1-irogers@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog Subject: [PATCH v1 0/3] Parse event sort/regroup fixes From: Ian Rogers To: Andi Kleen , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , Kan Liang , Zhengjun Xing , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL 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 Patch 1, fix: perf stat -e cycles,slots,topdown-fe-bound so that cycles isn't made a group leader (failure caused by PMUs matching). Previously this event list would fail so not necessarily a regression over previous perf release. Patch 2, when regrouping events the leader needs to be updated due to sorting. This fix causes larger event groups that then regress at least the tigerlake metric test as the kernel PMU driver fails to break the weak groups. This is a fix for a bug but the consequence of fixing the bug is to make a passing test fail due to the kernel PMU driver. Patch 3, don't alter the list position of events without a group if they don't need forcing into a group. Analysis showed this was the cause of the issue reported by Andi Kleen: https://lore.kernel.org/linux-perf-users/ZLBgbHkbrfGygM%2Fu@tassilo/ Due to the test regression in patch 2, follow up patches may be necessary for Icelake+ Intel vendor metrics to add METRIC_NO_GROUP to avoid the kernel PMU driver issue. Ian Rogers (3): perf parse-events: Extra care around force grouped events perf parse-events: When fixing group leaders always set the leader perf parse-events: Only move force grouped evsels when sorting tools/perf/util/parse-events.c | 58 +++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 22 deletions(-) -- 2.41.0.487.g6d72f3e995-goog