Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2186990rda; Tue, 24 Oct 2023 15:30:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGyq+zp0Og/0rWFyHEjUncRvo/n6PhMTgXPhmI653+RNuAONe3ii1YARppGu7O1UUVGLEfd X-Received: by 2002:a17:90a:70f:b0:278:fa86:13d8 with SMTP id l15-20020a17090a070f00b00278fa8613d8mr10834382pjl.41.1698186601669; Tue, 24 Oct 2023 15:30:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698186601; cv=none; d=google.com; s=arc-20160816; b=Sqqn71lweMFHS+xtlCS2F771Ii9+gMbo510tdkL6A31KDxDWYNsGc1cim9sxka4b0L VxkyUuSUWHdtmgNyJn3ITNl5e6oU7djf+qVcHlzDHUBg4uwQhuqInM8siCKcWwuS5UIe 2CvO5AEt3l1XW6Vlw0a2ZEEHUvsqqEcbJYopsB//DrgR8PbYJ3g/pHx4r87ogZwVis22 7IMwx5bpX8uuV0QuZ1vv9sABgnnH/cXfZEC+5yOqYtdtX5nPpwRojx6c9rd+H8And8mt q+A20F9FyhZnpdeps+hQZCOIVftqxUI8a4MiUTpCfv+s+BpH2kEoWed+p3mtvMYzdxMs wHyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=4cZX6FOP9Id6EVCdgsB1n601UiMDcX5xk8Ugm2UBQtA=; fh=NAro5oTsDEB2Or99ABwb774QJkwQSkr6EoLVqn/Yde0=; b=IwnU/s5UD2e3qqSCDl+J2EoE2JRx2ZktivTFJy1QUzx8AY8hscR9wmvGb5zHIR8oC8 /k5YcDcS1lzZPIG5pl/fpK/HrqX0tCHTFBp9Y7P3jBBOkcwzKcb+9IPTIJtVllg3FU8B KmVyZsF0wErk6K8blJ+xHvr30/6p7YYAksBtcoBtJfClzsHC/5oXg0RCicgSObyrl5GB 09vFrNSrl5kXwPiupP6qTXbbqUCltDw7F53Xg6EEid8ItUyyXE5bOR7PskyASrY5bF13 sNPgmOFlEJ0l02tBqOLlSw9LqlQ6sOPenuZZYDOdCf+wpkiky627n7Dn3mW+irJ6UEOp 6hAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=fqBwKDGO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id me1-20020a17090b17c100b0027d15abe599si12189734pjb.143.2023.10.24.15.30.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 15:30:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=fqBwKDGO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id D9A518026ACD; Tue, 24 Oct 2023 15:30:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344484AbjJXW3z (ORCPT + 99 others); Tue, 24 Oct 2023 18:29:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344552AbjJXW3t (ORCPT ); Tue, 24 Oct 2023 18:29:49 -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 5D45D212E for ; Tue, 24 Oct 2023 15:25:03 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-d9a45e7e0f9so5775538276.0 for ; Tue, 24 Oct 2023 15:25:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698186302; x=1698791102; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=4cZX6FOP9Id6EVCdgsB1n601UiMDcX5xk8Ugm2UBQtA=; b=fqBwKDGOCT1JJF7Lj2boSkxpXCAnWxWXKUp8yd2xS3Fp0JFaquGdgMoicOfUwGuZDF H9K2FonFDUfPK9KHTBVqNSdRI5J9P/CEwWPO7qIhgfiC8e3OwPmla0U1dfiuuqfgq7ZO AE7BOhQdTTRK3YWK7TP8n/fq3518AsRJbk0TkhIidO7DNQ6b+BWJ+ZGrSePdW9bP4EB+ 1IrP29DhWSYktDWy5W8GtMGbDl4aKUPCIzHQQf378nGjo4OPuMWjFvZswvWiU5QEclte l/NGR7w4DGiSd72L1Hjl3IK5q76J9lMt3RV299d1aTqdLH56OASadjHKANAqmG/BM9Os buUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698186302; x=1698791102; h=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=4cZX6FOP9Id6EVCdgsB1n601UiMDcX5xk8Ugm2UBQtA=; b=iB/pm3m0bYUOSofhOikSYlU0t0PynQU5Kx2rW3IMq6CM7e1r5ASOVFk21BZ4xSs9QP xz6XqqdaY8/r5pFr0hLu5YLLbXj/q68gCSQOZBD3nkiAwbJlocVWmK1blJT9e4xsAdvZ eSsSPdcPqO5B6qR4CZjtBS27iSWiAGscYOI+DkKa48fetQGgNY2Z57piLNPfY5VvVpxJ H6wiTAqDTfj8wRNNxq3fDRNBeVxQPRvT1sxpzAv/sEZ8Ug6rPV12YTfiUebnTSpga9c8 jywmhvoZorpUMM/egUCh+DSjm1ypdi85lmYvZb7XkXbbrNZwbFt027XcpaXmGkqxYa1T KQOA== X-Gm-Message-State: AOJu0YzU/6TPswhqO0lHgB81ssaNB0Cqs6yHxTxfazm6nSyX1YDRQzL/ dcidkSVkTa+/Jn4Ifs922hDDMLWRm9GZ X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:93d2:18cc:4d63:45ba]) (user=irogers job=sendgmr) by 2002:a25:ad49:0:b0:d81:582b:4661 with SMTP id l9-20020a25ad49000000b00d81582b4661mr259838ybe.8.1698186302403; Tue, 24 Oct 2023 15:25:02 -0700 (PDT) Date: Tue, 24 Oct 2023 15:23:25 -0700 In-Reply-To: <20231024222353.3024098-1-irogers@google.com> Message-Id: <20231024222353.3024098-23-irogers@google.com> Mime-Version: 1.0 References: <20231024222353.3024098-1-irogers@google.com> X-Mailer: git-send-email 2.42.0.758.gaed0368e0e-goog Subject: [PATCH v3 22/50] perf bpf: Don't synthesize BPF events when disabled From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , Nick Terrell , Kan Liang , Andi Kleen , Leo Yan , Song Liu , Sandipan Das , James Clark , Anshuman Khandual , Miguel Ojeda , Liam Howlett , Yang Jihong , Athira Rajeev , Kajol Jain , K Prateek Nayak , Sean Christopherson , Yanteng Si , Ravi Bangoria , German Gomez , Changbin Du , Paolo Bonzini , Masami Hiramatsu , liuwenyu , linux-kernel@vger.kernel.org, linux-perf-users@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,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 24 Oct 2023 15:30:01 -0700 (PDT) If BPF sideband events are disabled on the command line, don't synthesize BPF events too. Signed-off-by: Ian Rogers --- tools/perf/util/bpf-event.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/perf/util/bpf-event.c b/tools/perf/util/bpf-event.c index 38fcf3ba5749..830711cae30d 100644 --- a/tools/perf/util/bpf-event.c +++ b/tools/perf/util/bpf-event.c @@ -386,6 +386,9 @@ int perf_event__synthesize_bpf_events(struct perf_session *session, int err; int fd; + if (opts->no_bpf_event) + return 0; + event = malloc(sizeof(event->bpf) + KSYM_NAME_LEN + machine->id_hdr_size); if (!event) return -1; -- 2.42.0.758.gaed0368e0e-goog