From patchwork Tue Dec 13 23:26:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 13072571 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2CE1C4332F for ; Tue, 13 Dec 2022 23:27:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237063AbiLMX1X (ORCPT ); Tue, 13 Dec 2022 18:27:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236710AbiLMX1Q (ORCPT ); Tue, 13 Dec 2022 18:27:16 -0500 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0E11BE1F for ; Tue, 13 Dec 2022 15:27:15 -0800 (PST) Received: by mail-yb1-xb49.google.com with SMTP id b4-20020a253404000000b006fad1bb09f4so18414856yba.1 for ; Tue, 13 Dec 2022 15:27:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=aIVRe/cOjz9L4S8nY/UBbQxzSd/MuoYQzSglM53rsyM=; b=MpdcS79Frn7RTmMinJubNMYt88+6lL4Cqi6ZXslqSjEcj3Cc+ffaIF61e32yPrqXKr oEEqe5WgQXYXZIwaecs50menBnE+KS4PInPrB6VEHfGFllC3dcUZC0AjLUmtokz7oV3/ RhB14QI8hD+y2MaD0x09hL0YwxrlvEqzZQhSdQkJ66qn7bh41UNsjNYQ7gEdWFbaCi8b tXu8U1lQ///G1A7PA4TPQ5zf42wdDIUAdN19sx5NEmRQrmaqgG7w95voh5PLKyRm/2QZ IrA88MyZRV0FXu4tk++gTPp87PNt4e1V5zu0CGP6d4B3B7TJdjLJUdI6eQBowjNRtpwJ Ftsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=aIVRe/cOjz9L4S8nY/UBbQxzSd/MuoYQzSglM53rsyM=; b=E+jjfBICOiOWD7kne8h9T4X+bXQK8+YK4RKbAeDxD6wMADgLDtWqs0ytjuKjXn5HYl v7FP+tcx0OfGTOgNpQqr2QbaVPW37B6BnuSE9wdsOhP/wu0QJxA0MjN9DLENEB795NKL nP7SEEoIjPzKy6Upk/4BYeOxvdIQ6z6ndxRluVAsiThV0v8er3JwUqzCUoAUf2yxL3JS cSyBWgYZfbnJSUSGUQRrUbJSithV3ZzkvjOvbG+G1T0P6Mz8eB5ign2kexvvXNWAnwzu M++NuC9krcn/FWN4kki49bcXdHW1/HHIzpN/pY2CHwUxf5DI9sTS+kkCgwuQyMpiycZP 7hcA== X-Gm-Message-State: ANoB5plq0qn4hHdiAo9Y1WIrgJAEejqJDOT+K12GAo3+KFY32YtDsU/b dIW5scufXxn566GxP2XKTuNwyvS/fJHD X-Google-Smtp-Source: AA0mqf4ivmvAS6D5iJ1XqzGr6XWwaMuvq3r8JjefQy94X3aXoM7+6W4WRDSUNklgvLh5Ob22rdse41dAXKme X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:6268:b448:f7f4:4c2]) (user=irogers job=sendgmr) by 2002:a81:4e09:0:b0:370:202b:f085 with SMTP id c9-20020a814e09000000b00370202bf085mr26434974ywb.502.1670974035210; Tue, 13 Dec 2022 15:27:15 -0800 (PST) Date: Tue, 13 Dec 2022 15:26:47 -0800 In-Reply-To: <20221213232651.1269909-1-irogers@google.com> Message-Id: <20221213232651.1269909-2-irogers@google.com> Mime-Version: 1.0 References: <20221213232651.1269909-1-irogers@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Subject: [PATCH v1 1/5] perf build: Fix python/perf.so library's name From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Alexey Bayduraev , Adrian Hunter , Anshuman Khandual , Andi Kleen , James Clark , Sandipan Das , German Gomez , Leo Yan , Timothy Hayes , Kan Liang , Xing Zhengjun , Kim Phillips , Riccardo Mancini , Sean Christopherson , shaomin Deng , Eelco Chaudron , Athira Jajeev , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, bpf@vger.kernel.org Cc: Stephane Eranian , Ian Rogers Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org Since Python 3.3 extensions have a suffix encoding platform and version information. For example, the perf extension was previously perf.so but now maybe perf.cpython-310-x86_64-linux-gnu.so. Compute the extension using Python and then use this in the target name. Doing this avoids the "perf.so" target always being rebuilt. Signed-off-by: Ian Rogers --- tools/perf/Makefile.config | 4 +++- tools/perf/Makefile.perf | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 52a4dc029111..83ed969b95b4 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -871,6 +871,7 @@ define disable-python_code NO_LIBPYTHON := 1 endef +PYTHON_EXTENSION_SUFFIX := '.so' ifdef NO_LIBPYTHON $(call disable-python,Python support disabled by user) else @@ -889,7 +890,8 @@ else else LDFLAGS += $(PYTHON_EMBED_LDFLAGS) EXTLIBS += $(PYTHON_EMBED_LIBADD) - LANG_BINDINGS += $(obj-perf)python/perf.so + PYTHON_EXTENSION_SUFFIX := $(shell $(PYTHON) -c 'from importlib import machinery; print(machinery.EXTENSION_SUFFIXES[0])') + LANG_BINDINGS += $(obj-perf)python/perf$(PYTHON_EXTENSION_SUFFIX) CFLAGS += -DHAVE_LIBPYTHON_SUPPORT $(call detected,CONFIG_LIBPYTHON) endif diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 98f629bbd1aa..9b7886ce0674 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -647,7 +647,7 @@ all: shell_compatibility_test $(ALL_PROGRAMS) $(LANG_BINDINGS) $(OTHER_PROGRAMS) # Create python binding output directory if not already present _dummy := $(shell [ -d '$(OUTPUT)python' ] || mkdir -p '$(OUTPUT)python') -$(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS) $(LIBPERF) +$(OUTPUT)python/perf$(PYTHON_EXTENSION_SUFFIX): $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS) $(LIBPERF) $(QUIET_GEN)LDSHARED="$(CC) -pthread -shared" \ CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' \ $(PYTHON_WORD) util/setup.py \ From patchwork Tue Dec 13 23:26:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 13072572 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E865C10F1B for ; Tue, 13 Dec 2022 23:27:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237009AbiLMX1e (ORCPT ); Tue, 13 Dec 2022 18:27:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237051AbiLMX1Z (ORCPT ); Tue, 13 Dec 2022 18:27:25 -0500 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 108AF19C1F for ; Tue, 13 Dec 2022 15:27:24 -0800 (PST) Received: by mail-yb1-xb49.google.com with SMTP id y66-20020a25c845000000b00733b5049b6fso713316ybf.3 for ; Tue, 13 Dec 2022 15:27:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=Nto1ePcvoNdo0gJd4FRIsAa3aTl5xw4C0we0lXrYi4o=; b=oaxFlW2ge9haPbT6hCAVVmPuTox9DW+MdJNbZ0iwTokh/4XBkQYtfdusDGVsroQCBm 9cjRzTm2cTtoTugbzyCsz2kAHTjET5PTm0Qk0Vytd93WKj/92dwBthyYMEWpJ4MTqXXZ Kgspw5ZoKtAmQTgags/2mTbzHSF1im/xe5z7xwqmMxY+MpgtR2QCiepGpC+pSAjeR62r af+wkR/DSxLYLJ6v8UzQYo8yEedKseMcvnt7JbQHB+veoq0VjssEp6Vl9Tr9PuxO2F17 A3OnHm0NqQzzvD7NNSu2YgWdnWtZRBASIIw6rkBU4yPgO0G6Iw9CrmSsI4xx9udJ5Lje 3Bjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Nto1ePcvoNdo0gJd4FRIsAa3aTl5xw4C0we0lXrYi4o=; b=eY0lAeu9SoL3EcwPccFQrEGTbVaIg65Tn+bgLnlVzf9FUd8Q9uB30P8kbzY8mVSSfC PXOjJDIbFAxHBciUuhY8x1XgRNES4XScmVeWrMKI9dKbqU8OZ0/y4l3Ka7oG6vUfdJJQ B905r2rDGs21Kuh8tPZv4O9nNivnVONaeuDs+fmPi92ofvzo0LkBVx0yZTzLPz/WN0ej qKrIl2WyFqWED9C2vgIAeTSTKdqjapjH4WbgtyUhA5Ie9ywcEpo+eDpgY8yuND+yW2vh 6NlgQju7/7+YNRmnVB3KDFsDDSSwSTE6KCYNv/mdTXPebKISDjj/2eMS45v4TQdpkG8D Mpaw== X-Gm-Message-State: ANoB5pl3uuCl6BVwu6NQytpRxXtZCXUUne+nHxIQq2xfQpB1Cw1AKJas Ecp2h3NTRnh2MHC0ePhp8bBRGwg852oW X-Google-Smtp-Source: AA0mqf7zKBCVtwi4aB0KEabefvL0KR/RBin8ahJp49ddNoCoU3ThDFo9mNYaPbpMu1R7lGgciCKfGEWA/gYy X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:6268:b448:f7f4:4c2]) (user=irogers job=sendgmr) by 2002:a5b:f42:0:b0:6fd:e4ef:5b1d with SMTP id y2-20020a5b0f42000000b006fde4ef5b1dmr25692919ybr.99.1670974043252; Tue, 13 Dec 2022 15:27:23 -0800 (PST) Date: Tue, 13 Dec 2022 15:26:48 -0800 In-Reply-To: <20221213232651.1269909-1-irogers@google.com> Message-Id: <20221213232651.1269909-3-irogers@google.com> Mime-Version: 1.0 References: <20221213232651.1269909-1-irogers@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Subject: [PATCH v1 2/5] perf trace-event: Add libtraceevent version tools to header From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Alexey Bayduraev , Adrian Hunter , Anshuman Khandual , Andi Kleen , James Clark , Sandipan Das , German Gomez , Leo Yan , Timothy Hayes , Kan Liang , Xing Zhengjun , Kim Phillips , Riccardo Mancini , Sean Christopherson , shaomin Deng , Eelco Chaudron , Athira Jajeev , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, bpf@vger.kernel.org Cc: Stephane Eranian , Ian Rogers Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org Allow comparisons like: \#if MAKE_LIBTRACEEVENT_VERSION(1, 3, 0) <= LIBTRACEEVENT_VERSION Based on previously reverted: https://lore.kernel.org/linux-perf-users/20210923001024.550263-4-irogers@google.com/ Signed-off-by: Ian Rogers --- tools/perf/util/trace-event.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/perf/util/trace-event.h b/tools/perf/util/trace-event.h index add6c5d9531c..1fbf4c3f8809 100644 --- a/tools/perf/util/trace-event.h +++ b/tools/perf/util/trace-event.h @@ -6,6 +6,19 @@ #include #include +#ifdef HAVE_LIBTRACEEVENT +#include +#endif + +#define MAKE_LIBTRACEEVENT_VERSION(a, b, c) ((a)*255*255+(b)*255+(c)) +#ifndef LIBTRACEEVENT_VERSION +/* + * If LIBTRACEEVENT_VERSION wasn't computed then set to version 1.1.0 that + * previously shipped with the Linux kernel tools. + */ +#define LIBTRACEEVENT_VERSION MAKE_LIBTRACEEVENT_VERSION(1, 1, 0) +#endif + struct evlist; struct machine; struct perf_sample; From patchwork Tue Dec 13 23:26:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 13072573 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E376C4332F for ; Tue, 13 Dec 2022 23:27:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237098AbiLMX1q (ORCPT ); Tue, 13 Dec 2022 18:27:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237034AbiLMX1c (ORCPT ); Tue, 13 Dec 2022 18:27:32 -0500 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4F6126AEA for ; Tue, 13 Dec 2022 15:27:31 -0800 (PST) Received: by mail-yb1-xb49.google.com with SMTP id f11-20020a5b01cb000000b0070374b66537so18672477ybp.14 for ; Tue, 13 Dec 2022 15:27:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=4KcsU/b3XyH2KQ+Ac23wDexbNZ59qO2HtUAGBc5g3Tc=; b=YVUOxAG2O4vexzafaKXiqxFFq6XVXzwPJABTGqUVVbEO9apyo7c/MsJRdgasjmAOpn px3ls4XPbyNqxVp2FxeVFfhvR/RSSY0c0A7dpd267nqfHdSr8ATTYXNxVhUx+UFadA9v 8gBH/HDiTN26ymg8IoNZTUnKQYjwBM1iLgXqISO8HS+d/7lZW8hfu012CgiKRwFM85oc A/Kt/oFb9yD39482tBKuQAwP299lhwt6kxTPuBOwu9ckvzJllGkPvxHodK+j8iQ+KoAQ ICf00f6PzpWGIWBKySR4+xb5XTL/wG622Fw670ZKbKSye5v59hTvDxMqVeoUepsaddp6 RpLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4KcsU/b3XyH2KQ+Ac23wDexbNZ59qO2HtUAGBc5g3Tc=; b=AUcFu9MpTJvCVo/7JVqRCBgL084z58/r//udIVoiUMdi1Zpt/gQ9JqLx4CViR9jRpk YFu+tKhQ6f3s5Wdo0RWM44Ip3tH/rTI+WXoCPICdcVUfhEVhpaVA3BFafyXh8NGwOurJ nc+k+RkfFdP+yh4bnXfWDW+2fTWtLxqFuNwHG3wcMqkx6+2GQeBRxrBcTlRRmzZx0riE ebHg8ODN69f9a5KE2PIjARGGniWSI66gHFwSVzwrStXdCQQsQ4L9Ii2eP4IAhpIIV2lD t1dellidU9atezwDm7uBWsppsoAfd0OpLDcSNUq7dMicDG4TwMkz+AcNGVRQU3KG0ZzN A9JA== X-Gm-Message-State: ANoB5plJfVtPJBCbK1bBH/KiAMb17yiJm3LVYprGHyUurSvq1PqyUcF1 99IwslPokp7X/zI08E21dHV7v7CI92dC X-Google-Smtp-Source: AA0mqf7lGZZ4v31cMvNVbWsuRcdcUu/G5Qr1dJkHBTXk6p+od9IpIkYZyFFTc5zjUM888sTF5CpaDWTtO2s5 X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:6268:b448:f7f4:4c2]) (user=irogers job=sendgmr) by 2002:a05:690c:a01:b0:3b2:cbaa:6f2a with SMTP id cg1-20020a05690c0a0100b003b2cbaa6f2amr2927724ywb.500.1670974051035; Tue, 13 Dec 2022 15:27:31 -0800 (PST) Date: Tue, 13 Dec 2022 15:26:49 -0800 In-Reply-To: <20221213232651.1269909-1-irogers@google.com> Message-Id: <20221213232651.1269909-4-irogers@google.com> Mime-Version: 1.0 References: <20221213232651.1269909-1-irogers@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Subject: [PATCH v1 3/5] libtraceevent: Increase libtraceevent logging when verbose From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Alexey Bayduraev , Adrian Hunter , Anshuman Khandual , Andi Kleen , James Clark , Sandipan Das , German Gomez , Leo Yan , Timothy Hayes , Kan Liang , Xing Zhengjun , Kim Phillips , Riccardo Mancini , Sean Christopherson , shaomin Deng , Eelco Chaudron , Athira Jajeev , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, bpf@vger.kernel.org Cc: Stephane Eranian , Ian Rogers Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org libtraceevent has added more levels of debug printout and with changes like: https://lore.kernel.org/linux-trace-devel/20210507095022.1079364-3-tz.stoyanov@gmail.com previously generated output like "registering plugin" is no longer displayed. This change makes it so that if perf's verbose debug output is enabled then the debug and info libtraceevent messages can be displayed. The code is conditionally enabled based on the libtraceevent version as discussed in the RFC: https://lore.kernel.org/lkml/20210610060643.595673-1-irogers@google.com/ Based on previously reverted change: https://lore.kernel.org/linux-perf-users/20210923001024.550263-4-irogers@google.com/ that was reverted due to -Itools/lib being in CFLAGS meaning the traceevent headers couldn't be properly used from the system. Signed-off-by: Ian Rogers --- tools/perf/util/debug.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/perf/util/debug.c b/tools/perf/util/debug.c index 65e6c22f38e4..cd575460818f 100644 --- a/tools/perf/util/debug.c +++ b/tools/perf/util/debug.c @@ -22,6 +22,7 @@ #include "ui/helpline.h" #include "ui/ui.h" #include "util/parse-sublevel-options.h" +#include "util/trace-event.h" #include @@ -228,6 +229,15 @@ int perf_debug_option(const char *str) /* Allow only verbose value in range (0, 10), otherwise set 0. */ verbose = (verbose < 0) || (verbose > 10) ? 0 : verbose; +#if MAKE_LIBTRACEEVENT_VERSION(1, 3, 0) <= LIBTRACEEVENT_VERSION + if (verbose == 1) + tep_set_loglevel(TEP_LOG_INFO); + else if (verbose == 2) + tep_set_loglevel(TEP_LOG_DEBUG); + else if (verbose >= 3) + tep_set_loglevel(TEP_LOG_ALL); +#endif + return 0; } From patchwork Tue Dec 13 23:26:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 13072574 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DEE69C4167B for ; Tue, 13 Dec 2022 23:28:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237146AbiLMX2I (ORCPT ); Tue, 13 Dec 2022 18:28:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237093AbiLMX1l (ORCPT ); Tue, 13 Dec 2022 18:27:41 -0500 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF49E108B for ; Tue, 13 Dec 2022 15:27:39 -0800 (PST) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-40306a5a42cso185524517b3.1 for ; Tue, 13 Dec 2022 15:27:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=72onBX7/v3Mkh3/F3ClgCmK3zR5kHyTFpk5uwdtwCSs=; b=T/Fv+q4wWPE3/uQotDdRijKFH3wyVwQbQ6gc3o+vcrxcGxHU3t678lqjpd5hs2LAm1 x0WiDtolBdP9LLUfuShpATfqnEM94gWbBXa1GmMyuT8d3lyAz/XUjWRfuk9UDQJGWFJp CUgd8NywSesnjHsYKs9Z65pnqjEbDYgfgUWchjy/cUREjNsxMwwVCzR/SYJLIzw896hf nFXYYMdtkAJ0Yh8KfQBTZpXWI6ldCqpSDI2nY1kztBwuG8Bvg+cPgFOi0p+ba8eADjM6 Gvhb3Ho2ZAHZ5Z9qTC73tqXlombRlG5MIm+fUTNKbEhSc6QgcgebKoPsHl7IVhnx1uHE Isyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=72onBX7/v3Mkh3/F3ClgCmK3zR5kHyTFpk5uwdtwCSs=; b=OeO578a8/eo3Pkwa6CfKgMeIz0z03k+QPVueTQqZkFnrTd7qNmSSklanz/LrTCLkm+ fx90FRiyZPwauc9lHgq/fi/uyXVEyQ7eRC8bCwPn0rCHb3oFWpd46LMiJXvNFSRe8bsj Pow+k8XjM3kbd77rZgxrVrgRszwZB2aKSgUNirqtVgtgh2ga2BE7q7Ow3Qgy3q38/67Z t381MTYWU46p8mcpSnY/yALws7rDizWCF4wGW1o4ny1biSoLc0s282B79mXo5NVkIQ77 C7ZFaFBcXqyMec96w72k5byKQE4BK9z2THsYuTVnPUyjSYkooj6AdjXV6/8K3RJe92FR Wi3w== X-Gm-Message-State: ANoB5pmLujIcFmeOsEUjBjP5pV9Vo7HL/+I/ftGH+2ngkr+NP6my6aFH ju3SeB1EUtRl0pxfQeQrPdbuoJN5y9jJ X-Google-Smtp-Source: AA0mqf6FWf6mxEZmcY8v7SJOvXLGF/9RX9lRdm2kMd2lzjJY4Fdw/47j4qf7w0vBcY89VCUqD7mYsoFMgwy0 X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:6268:b448:f7f4:4c2]) (user=irogers job=sendgmr) by 2002:a81:8343:0:b0:36f:d5d4:7e0c with SMTP id t64-20020a818343000000b0036fd5d47e0cmr27799444ywf.122.1670974059011; Tue, 13 Dec 2022 15:27:39 -0800 (PST) Date: Tue, 13 Dec 2022 15:26:50 -0800 In-Reply-To: <20221213232651.1269909-1-irogers@google.com> Message-Id: <20221213232651.1269909-5-irogers@google.com> Mime-Version: 1.0 References: <20221213232651.1269909-1-irogers@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Subject: [PATCH v1 4/5] perf trace-event: Use version check to avoid 1 define From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Alexey Bayduraev , Adrian Hunter , Anshuman Khandual , Andi Kleen , James Clark , Sandipan Das , German Gomez , Leo Yan , Timothy Hayes , Kan Liang , Xing Zhengjun , Kim Phillips , Riccardo Mancini , Sean Christopherson , shaomin Deng , Eelco Chaudron , Athira Jajeev , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, bpf@vger.kernel.org Cc: Stephane Eranian , Ian Rogers Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org Remove HAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE by using a version check against 1.5.0. Signed-off-by: Ian Rogers --- tools/perf/Makefile.config | 4 ---- tools/perf/builtin-trace.c | 2 +- tools/perf/util/data-convert-bt.c | 3 ++- tools/perf/util/evsel.c | 2 +- tools/perf/util/python.c | 2 +- tools/perf/util/scripting-engines/trace-event-perl.c | 2 +- tools/perf/util/scripting-engines/trace-event-python.c | 2 +- tools/perf/util/sort.c | 3 ++- 8 files changed, 9 insertions(+), 11 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 83ed969b95b4..9a71d8659efc 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -1199,10 +1199,6 @@ ifneq ($(NO_LIBTRACEEVENT),1) LIBTRACEEVENT_VERSION_CPP := $(shell expr $(LIBTRACEEVENT_VERSION_1) \* 255 \* 255 + $(LIBTRACEEVENT_VERSION_2) \* 255 + $(LIBTRACEEVENT_VERSION_3)) CFLAGS += -DLIBTRACEEVENT_VERSION=$(LIBTRACEEVENT_VERSION_CPP) $(call detected,CONFIG_LIBTRACEEVENT) - LIBTRACEEVENT_VERSION_WITH_TEP_FIELD_IS_RELATIVE := $(shell expr 1 \* 255 \* 255 + 5 \* 255 + 0) # 1.5.0 - ifeq ($(shell test $(LIBTRACEEVENT_VERSION_CPP) -gt $(LIBTRACEEVENT_VERSION_WITH_TEP_FIELD_IS_RELATIVE); echo $$?),0) - CFLAGS += -DHAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE - endif else dummy := $(warning Warning: libtraceevent is missing limiting functionality, please install libtraceevent-dev/libtraceevent-devel) endif diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index c9802ab549d7..2c8a213e0bc3 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -2729,7 +2729,7 @@ static size_t trace__fprintf_tp_fields(struct trace *trace, struct evsel *evsel, offset = format_field__intval(field, sample, evsel->needs_swap); syscall_arg.len = offset >> 16; offset &= 0xffff; -#ifdef HAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE +#if MAKE_LIBTRACEEVENT_VERSION(1, 5, 0) <= LIBTRACEEVENT_VERSION if (field->flags & TEP_FIELD_IS_RELATIVE) offset += field->offset + field->size; #endif diff --git a/tools/perf/util/data-convert-bt.c b/tools/perf/util/data-convert-bt.c index b842273458b8..7ec0d13fb470 100644 --- a/tools/perf/util/data-convert-bt.c +++ b/tools/perf/util/data-convert-bt.c @@ -36,6 +36,7 @@ #include "util/sample.h" #ifdef HAVE_LIBTRACEEVENT +#include "util/trace-event.h" #include #endif @@ -322,7 +323,7 @@ static int add_tracepoint_field_value(struct ctf_writer *cw, offset = tmp_val; len = offset >> 16; offset &= 0xffff; -#ifdef HAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE +#if MAKE_LIBTRACEEVENT_VERSION(1, 5, 0) <= LIBTRACEEVENT_VERSION if (flags & TEP_FIELD_IS_RELATIVE) offset += fmtf->offset + fmtf->size; #endif diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 77b2cf5a214e..6e623d5541e9 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -2784,7 +2784,7 @@ void *evsel__rawptr(struct evsel *evsel, struct perf_sample *sample, const char if (field->flags & TEP_FIELD_IS_DYNAMIC) { offset = *(int *)(sample->raw_data + field->offset); offset &= 0xffff; -#ifdef HAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE +#if MAKE_LIBTRACEEVENT_VERSION(1, 5, 0) <= LIBTRACEEVENT_VERSION if (field->flags & TEP_FIELD_IS_RELATIVE) offset += field->offset + field->size; #endif diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c index 7320f7f777fe..1d0cf72506a6 100644 --- a/tools/perf/util/python.c +++ b/tools/perf/util/python.c @@ -442,7 +442,7 @@ tracepoint_field(struct pyrf_event *pe, struct tep_format_field *field) offset = val; len = offset >> 16; offset &= 0xffff; -#ifdef HAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE +#if MAKE_LIBTRACEEVENT_VERSION(1, 5, 0) <= LIBTRACEEVENT_VERSION if (field->flags & TEP_FIELD_IS_RELATIVE) offset += field->offset + field->size; #endif diff --git a/tools/perf/util/scripting-engines/trace-event-perl.c b/tools/perf/util/scripting-engines/trace-event-perl.c index c097b7934fd4..1062629d13c2 100644 --- a/tools/perf/util/scripting-engines/trace-event-perl.c +++ b/tools/perf/util/scripting-engines/trace-event-perl.c @@ -393,7 +393,7 @@ static void perl_process_tracepoint(struct perf_sample *sample, if (field->flags & TEP_FIELD_IS_DYNAMIC) { offset = *(int *)(data + field->offset); offset &= 0xffff; -#ifdef HAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE +#if MAKE_LIBTRACEEVENT_VERSION(1, 5, 0) <= LIBTRACEEVENT_VERSION if (field->flags & TEP_FIELD_IS_RELATIVE) offset += field->offset + field->size; #endif diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c index e930f5f1f36d..e294a13c399d 100644 --- a/tools/perf/util/scripting-engines/trace-event-python.c +++ b/tools/perf/util/scripting-engines/trace-event-python.c @@ -994,7 +994,7 @@ static void python_process_tracepoint(struct perf_sample *sample, offset = val; len = offset >> 16; offset &= 0xffff; -#ifdef HAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE +#if MAKE_LIBTRACEEVENT_VERSION(1, 5, 0) <= LIBTRACEEVENT_VERSION if (field->flags & TEP_FIELD_IS_RELATIVE) offset += field->offset + field->size; #endif diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index 0ecc2cb13792..b929cc5eb8cf 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c @@ -32,6 +32,7 @@ #include #ifdef HAVE_LIBTRACEEVENT +#include "trace-event.h" #include #endif @@ -2568,7 +2569,7 @@ static int64_t __sort__hde_cmp(struct perf_hpp_fmt *fmt, tep_read_number_field(field, a->raw_data, &dyn); offset = dyn & 0xffff; size = (dyn >> 16) & 0xffff; -#ifdef HAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE +#if MAKE_LIBTRACEEVENT_VERSION(1, 5, 0) <= LIBTRACEEVENT_VERSION if (field->flags & TEP_FIELD_IS_RELATIVE) offset += field->offset + field->size; #endif From patchwork Tue Dec 13 23:26:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 13072575 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D21BC10F1B for ; Tue, 13 Dec 2022 23:28:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237118AbiLMX2Q (ORCPT ); Tue, 13 Dec 2022 18:28:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237116AbiLMX2C (ORCPT ); Tue, 13 Dec 2022 18:28:02 -0500 Received: from mail-pg1-x54a.google.com (mail-pg1-x54a.google.com [IPv6:2607:f8b0:4864:20::54a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1B091DDC1 for ; Tue, 13 Dec 2022 15:27:53 -0800 (PST) Received: by mail-pg1-x54a.google.com with SMTP id c9-20020a63da09000000b0047954824506so744940pgh.5 for ; Tue, 13 Dec 2022 15:27:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=jsNAerQT5Rq7PxpPFaFCKhUoi37tiOPWmIWVWeQhySU=; b=TjHoSn2U8lDg144iLpuyk2HJOrSlP187XCJAFaGy0+hrwSBKWJ3wh8JG66DD7i1gDQ ZgztgmeF9Df/PxUAgnRI0hH84CbQ4WvKgaS7gqNUQbQhuzQZoidjvO+Py3beHDDx+oVQ s+29WyXVCyxJ+JXwkVeBfdg2ek0uTf5Qa2El0G7Sc2R0upj2qGRZBfrEyDk2Uq52elzO +ZcUsH4GW4l3HPyvu01kVCC/dhW45uS49+UvL1BCeXw8V0+TUmyNIcLh7Kd+uEbiu9w5 dLjsSkXr0utbhBNt1pOv48usCdYhLhFSsitFB7ukAqoEzixNsrHS+HPEYpxdvjfHpm3n vRAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jsNAerQT5Rq7PxpPFaFCKhUoi37tiOPWmIWVWeQhySU=; b=3xnHcfcQs6lePQuoRHhCxcmbme903va761en7ghWwboar48y0TQr3v4aoJHZaPKD7B rkO1c61eSS4Tkg26JjTmhbUJjo3/DeYQ4UY/l1zmsqhGv/hutdzh/zYKzKvcp4yuefFv dofOBL4j4AEJpmMkGaxsZcuZlOjvi6B7vhN1Mt44x+V63zYm2FUOKzhSqBOhLPqmC+cd S17lhPK7TguLucRgSYzfBJas0wWHcN0WVzZz8xSCRSMZB/ZEZ7ENzmnfLpf/+RUYbHqC g4LOhZcrRSJ//4V35ZtITsa2MdMEC5vj1y7wGGKUPUCVqVpba0FxyFVEytOqxpbTMVld bskA== X-Gm-Message-State: ANoB5pkBqpxjgUv3EbX2vxRbVuelgYogbIaGG5vRqKEG6+4CmYLF8/38 cxB3YSInxNIgZpbW+g3188BBrL03vXPU X-Google-Smtp-Source: AA0mqf43yzdM19XpgSfbOcQ5oTi2CxgaY/OK0eD4s8Z6AfwEx+DIMZnN7s/kzE3zHMvqRxe+Ez3Z+0XeTVvJ X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:6268:b448:f7f4:4c2]) (user=irogers job=sendgmr) by 2002:a62:6d46:0:b0:563:54fd:3638 with SMTP id i67-20020a626d46000000b0056354fd3638mr99686672pfc.44.1670974072765; Tue, 13 Dec 2022 15:27:52 -0800 (PST) Date: Tue, 13 Dec 2022 15:26:51 -0800 In-Reply-To: <20221213232651.1269909-1-irogers@google.com> Message-Id: <20221213232651.1269909-6-irogers@google.com> Mime-Version: 1.0 References: <20221213232651.1269909-1-irogers@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Subject: [PATCH v1 5/5] perf evlist: Remove group option. From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Alexey Bayduraev , Adrian Hunter , Anshuman Khandual , Andi Kleen , James Clark , Sandipan Das , German Gomez , Leo Yan , Timothy Hayes , Kan Liang , Xing Zhengjun , Kim Phillips , Riccardo Mancini , Sean Christopherson , shaomin Deng , Eelco Chaudron , Athira Jajeev , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, bpf@vger.kernel.org Cc: Stephane Eranian , Ian Rogers Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org The group option predates grouping events using curly braces added in commit 89efb029502d ("perf tools: Add support to parse event group syntax") The --group option was retained for legacy support (in August 2012) but keeping it adds complexity. Signed-off-by: Ian Rogers --- tools/perf/Documentation/perf-record.txt | 4 ---- tools/perf/Documentation/perf-top.txt | 7 ++----- tools/perf/builtin-record.c | 2 -- tools/perf/builtin-stat.c | 6 ------ tools/perf/builtin-top.c | 2 -- tools/perf/tests/attr/README | 2 -- tools/perf/tests/attr/test-record-group | 22 ---------------------- tools/perf/tests/attr/test-stat-group | 17 ----------------- tools/perf/util/evlist.c | 2 +- tools/perf/util/evlist.h | 2 -- tools/perf/util/python.c | 8 -------- tools/perf/util/record.c | 7 ------- tools/perf/util/record.h | 1 - 13 files changed, 3 insertions(+), 79 deletions(-) delete mode 100644 tools/perf/tests/attr/test-record-group delete mode 100644 tools/perf/tests/attr/test-stat-group diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt index 5f9fa07b3dde..ff815c2f67e8 100644 --- a/tools/perf/Documentation/perf-record.txt +++ b/tools/perf/Documentation/perf-record.txt @@ -238,10 +238,6 @@ OPTIONS Also, by adding a comma, the number of mmap pages for AUX area tracing can be specified. ---group:: - Put all events in a single event group. This precedes the --event - option and remains only for backward compatibility. See --event. - -g:: Enables call-graph (stack chain/backtrace) recording for both kernel space and user space. diff --git a/tools/perf/Documentation/perf-top.txt b/tools/perf/Documentation/perf-top.txt index c1fdba26bf53..e534d709cc5a 100644 --- a/tools/perf/Documentation/perf-top.txt +++ b/tools/perf/Documentation/perf-top.txt @@ -51,9 +51,6 @@ Default is to monitor all CPUS. --count-filter=:: Only display functions with more events than this. ---group:: - Put the counters into a counter group. - --group-sort-idx:: Sort the output by the event at the index n in group. If n is invalid, sort by the first event. It can support multiple groups with different @@ -313,10 +310,10 @@ use '-e e1 -e e2 -G foo,foo' or just use '-e e1 -e e2 -G foo'. perf top -e cycles,probe:icmp_rcv --switch-on=probe:icmp_rcv - Alternatively one can ask for --group and then two overhead columns + Alternatively one can ask for a group and then two overhead columns will appear, the first for cycles and the second for the switch-on event. - perf top --group -e cycles,probe:icmp_rcv --switch-on=probe:icmp_rcv + perf top -e '{cycles,probe:icmp_rcv}' --switch-on=probe:icmp_rcv This may be interesting to measure a workload only after some initialization phase is over, i.e. insert a perf probe at that point and use the above diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 7e17374f6c1a..8ecffa696ce3 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -3380,8 +3380,6 @@ static struct option __record_options[] = { OPT_CALLBACK(0, "mmap-flush", &record.opts, "number", "Minimal number of bytes that is extracted from mmap data pages (default: 1)", record__mmap_flush_parse), - OPT_BOOLEAN(0, "group", &record.opts.group, - "put the counters into a counter group"), OPT_CALLBACK_NOOPT('g', NULL, &callchain_param, NULL, "enables call-graph recording" , &record_callchain_opt), diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index d040fbcdcc5a..2808f2aa9a82 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -181,7 +181,6 @@ static bool topdown_run = false; static bool smi_cost = false; static bool smi_reset = false; static int big_num_opt = -1; -static bool group = false; static const char *pre_cmd = NULL; static const char *post_cmd = NULL; static bool sync_run = false; @@ -781,9 +780,6 @@ static int __run_perf_stat(int argc, const char **argv, int run_idx) child_pid = evsel_list->workload.pid; } - if (group) - evlist__set_leader(evsel_list); - if (!cpu_map__is_dummy(evsel_list->core.user_requested_cpus)) { if (affinity__setup(&saved_affinity) < 0) return -1; @@ -1192,8 +1188,6 @@ static struct option stat_options[] = { #endif OPT_BOOLEAN('a', "all-cpus", &target.system_wide, "system-wide collection from all CPUs"), - OPT_BOOLEAN('g', "group", &group, - "put the counters into a counter group"), OPT_BOOLEAN(0, "scale", &stat_config.scale, "Use --no-scale to disable counter scaling for multiplexing"), OPT_INCR('v', "verbose", &verbose, diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index bb5bd241246b..d4b5b02bab73 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -1471,8 +1471,6 @@ int cmd_top(int argc, const char **argv) "dump the symbol table used for profiling"), OPT_INTEGER('f', "count-filter", &top.count_filter, "only display functions with more events than this"), - OPT_BOOLEAN(0, "group", &opts->group, - "put the counters into a counter group"), OPT_BOOLEAN('i', "no-inherit", &opts->no_inherit, "child tasks do not inherit counters"), OPT_STRING(0, "sym-annotate", &top.sym_filter, "symbol name", diff --git a/tools/perf/tests/attr/README b/tools/perf/tests/attr/README index eb3f7d4bb324..4066fec7180a 100644 --- a/tools/perf/tests/attr/README +++ b/tools/perf/tests/attr/README @@ -49,7 +49,6 @@ Following tests are defined (with perf commands): perf record --call-graph dwarf kill (test-record-graph-dwarf) perf record --call-graph fp kill (test-record-graph-fp) perf record --call-graph fp kill (test-record-graph-fp-aarch64) - perf record --group -e cycles,instructions kill (test-record-group) perf record -e '{cycles,instructions}' kill (test-record-group1) perf record -e '{cycles/period=1/,instructions/period=2/}:S' kill (test-record-group2) perf record -D kill (test-record-no-delay) @@ -66,6 +65,5 @@ Following tests are defined (with perf commands): perf stat -d kill (test-stat-detailed-1) perf stat -dd kill (test-stat-detailed-2) perf stat -ddd kill (test-stat-detailed-3) - perf stat --group -e cycles,instructions kill (test-stat-group) perf stat -e '{cycles,instructions}' kill (test-stat-group1) perf stat -i -e cycles kill (test-stat-no-inherit) diff --git a/tools/perf/tests/attr/test-record-group b/tools/perf/tests/attr/test-record-group deleted file mode 100644 index 6c1cff8aae8b..000000000000 --- a/tools/perf/tests/attr/test-record-group +++ /dev/null @@ -1,22 +0,0 @@ -[config] -command = record -args = --no-bpf-event --group -e cycles,instructions kill >/dev/null 2>&1 -ret = 1 - -[event-1:base-record] -fd=1 -group_fd=-1 -sample_type=327 -read_format=4|20 - -[event-2:base-record] -fd=2 -group_fd=1 -config=1 -sample_type=327 -read_format=4|20 -mmap=0 -comm=0 -task=0 -enable_on_exec=0 -disabled=0 diff --git a/tools/perf/tests/attr/test-stat-group b/tools/perf/tests/attr/test-stat-group deleted file mode 100644 index e15d6946e9b3..000000000000 --- a/tools/perf/tests/attr/test-stat-group +++ /dev/null @@ -1,17 +0,0 @@ -[config] -command = stat -args = --group -e cycles,instructions kill >/dev/null 2>&1 -ret = 1 - -[event-1:base-stat] -fd=1 -group_fd=-1 -read_format=3|15 - -[event-2:base-stat] -fd=2 -group_fd=1 -config=1 -disabled=0 -enable_on_exec=0 -read_format=3|15 diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 590d4e77effc..817df2504a1e 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -230,7 +230,7 @@ int __evlist__set_tracepoints_handlers(struct evlist *evlist, return err; } -void evlist__set_leader(struct evlist *evlist) +static void evlist__set_leader(struct evlist *evlist) { perf_evlist__set_leader(&evlist->core); } diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h index e5b84ead566c..01fa9d592c5a 100644 --- a/tools/perf/util/evlist.h +++ b/tools/perf/util/evlist.h @@ -221,8 +221,6 @@ void evlist__set_selected(struct evlist *evlist, struct evsel *evsel); int evlist__create_maps(struct evlist *evlist, struct target *target); int evlist__apply_filters(struct evlist *evlist, struct evsel **err_evsel); -void evlist__set_leader(struct evlist *evlist); - u64 __evlist__combined_sample_type(struct evlist *evlist); u64 evlist__combined_sample_type(struct evlist *evlist); u64 evlist__combined_branch_type(struct evlist *evlist); diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c index 1d0cf72506a6..a19d3983e69a 100644 --- a/tools/perf/util/python.c +++ b/tools/perf/util/python.c @@ -1142,14 +1142,6 @@ static PyObject *pyrf_evlist__open(struct pyrf_evlist *pevlist, PyObject *args, PyObject *kwargs) { struct evlist *evlist = &pevlist->evlist; - int group = 0; - static char *kwlist[] = { "group", NULL }; - - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OOii", kwlist, &group)) - return NULL; - - if (group) - evlist__set_leader(evlist); if (evlist__open(evlist) < 0) { PyErr_SetFromErrno(PyExc_OSError); diff --git a/tools/perf/util/record.c b/tools/perf/util/record.c index 7b58f6c7c69d..9eb5c6a08999 100644 --- a/tools/perf/util/record.c +++ b/tools/perf/util/record.c @@ -99,13 +99,6 @@ void evlist__config(struct evlist *evlist, struct record_opts *opts, struct call bool use_comm_exec; bool sample_id = opts->sample_id; - /* - * Set the evsel leader links before we configure attributes, - * since some might depend on this info. - */ - if (opts->group) - evlist__set_leader(evlist); - if (perf_cpu_map__cpu(evlist->core.user_requested_cpus, 0).cpu < 0) opts->no_inherit = true; diff --git a/tools/perf/util/record.h b/tools/perf/util/record.h index 4269e916f450..46212bf020cf 100644 --- a/tools/perf/util/record.h +++ b/tools/perf/util/record.h @@ -13,7 +13,6 @@ struct option; struct record_opts { struct target target; - bool group; bool inherit_stat; bool no_buffering; bool no_inherit;