Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp554537rdb; Thu, 2 Nov 2023 11:00:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFDoPjZCZBkOMrukOWc4U80Mg7L4bwxKDiiLkbjxoT8wLrLXu9fRuasSxszTRBNXY+ukrS3 X-Received: by 2002:a17:903:244b:b0:1cc:787f:fd2 with SMTP id l11-20020a170903244b00b001cc787f0fd2mr5897038pls.49.1698948047392; Thu, 02 Nov 2023 11:00:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698948047; cv=none; d=google.com; s=arc-20160816; b=C13l75vAXESzL4eTzXZSbmvlT7qddBGKo3kESuFdYmJG5Xjjq+0RECbekMBjosdfqK eKDbdAZlYDG+OLcfvYSb9IC3U7V3bPKtn6UPCfTJdor7qSmP0HnE6zGPm5aw/XpS1e0L KHxyCqdPbP+ynO5bnuI6PzbaITJLjc0ieEx5RsktWngyFj8M5d6m/zxYetr75YqNJv5K aqrJiXi5JqG7oAzweiuo65kjWcF/5UpJ7pNBjKMLt+6Rj5AlgXaDIRnIwILb82WA5sNk tmfF5aNLT26B6mt9uLnYAKNDZfSdEYECZybmSxXIHW9G5C8CxXJvkcCUjwDe8dacX06X hbbA== 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=UGESJj7au1uXJ8rgsZ7Z2SvkHL285HgbRjBBhgb6nnY=; fh=z1KcSqUpYQ9oC4uLSeIkhAYTnJ2bvP0QbNW2xqV5NqA=; b=DIAT9bE9OdWOG0mglqR+k+MRHZoL5k4gtRmwib7I6ryx3/pp/aJbi5J53wixtaQN7+ gvlFph+cuGCXC9cOhnsfb7tyO57mf/BW7vW9GFm0ESmXro7Ql4sIUIrx9dFV6S6RFYcJ 8E+GW17x4XaaYZPkuBEaSzolT1mqo/yH/FBQU/xc/resYpEcuFyXr66pUiB9HqhBoXRm roaGA3kuprCDQ4qY3/Xd2XOXIm8Gv+nzoec1Lo8QZoyQ88wLdMdCXPJRjnMR+dAU/L+m mavpymXUsteoSmL3s33p5NAi4lJ/8owfN5mpb3dnAIqIrOv35UMSFwqARCTl4Y/WzmsJ zFxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=J+CD5JIn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id b11-20020a170903228b00b001c32d285db8si55777plh.308.2023.11.02.11.00.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 11:00:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=J+CD5JIn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id DA27480C59BC; Thu, 2 Nov 2023 11:00:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377167AbjKBR7U (ORCPT + 99 others); Thu, 2 Nov 2023 13:59:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345507AbjKBR6j (ORCPT ); Thu, 2 Nov 2023 13:58:39 -0400 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 797EA10DE for ; Thu, 2 Nov 2023 10:58:24 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-da3dd6a72a7so1444654276.0 for ; Thu, 02 Nov 2023 10:58:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698947903; x=1699552703; 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=UGESJj7au1uXJ8rgsZ7Z2SvkHL285HgbRjBBhgb6nnY=; b=J+CD5JInXbg2x05frrOkZwqLOYhF9KK9Jx8eWgEGvnJFgtUVK576cYF9cAuNQeNkDK jlCcooaAlZR4Jlz0PMe0J47QZ8FJq7nSxBtFUEEm+nHuxevxENK+d/J0l6pNHT9gt5Zo kXU3P4tDZYpWHjanA8SB99TGGF8bPbTSbBIr9584NcmCOKFB3SXoiH+J2ZXhTK1h7naa okFH+pmsYYjb32sviv87h7DARwy98ZenGMgl4NJKYhcIe6sLEe+rd9wgZxVZdHGq5hgI PBBkZ0o0t05pkERktEF+r9WYj77FUh3RZqVlo9gTs2cO00+ERKCBr/dhTqGrBLnykIJ1 xiBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698947903; x=1699552703; 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=UGESJj7au1uXJ8rgsZ7Z2SvkHL285HgbRjBBhgb6nnY=; b=fCWSqWObfbH/WlS/LSHTy0biKwClQ8ycRX+Vle9XLkjlLrjJg9ngd0Yk4BuSNmh3YC mu3nFVogAD1SzUGnZtl6t5RLH/yTt8uqyT/aygj2pnptXNMHc7rTKamhM3MAI+I28MFE JcGe6t3S4k5QbpWfQpfLPLC2Th6Xaels7S5hOG8SBbZlIRkWMOVuBJDVRCblmHAYunm4 BsufB/k0X98AmQd+pfAw3J/OJ1ATN7Hm2KxWWJzToOVQouY5Ong1Uv8DQhCyEScxz380 zLjb9XWJM9Pvpuf5RRCBnlJufJrVQxMcrOtOSbQToU0ORAnhbH0i+hQTYHOyrXzZXNkf Q8ag== X-Gm-Message-State: AOJu0YzIWkPqgWDdbHhJ5DUUPhPd46kupapHkoA/HwMGpk2IDDsEMlnJ 06vRJBVBUQc/ZMQilG7895qgvkz0z7Q7 X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:bb34:df9c:836c:afca]) (user=irogers job=sendgmr) by 2002:a25:2083:0:b0:da0:c584:def4 with SMTP id g125-20020a252083000000b00da0c584def4mr359850ybg.1.1698947903463; Thu, 02 Nov 2023 10:58:23 -0700 (PDT) Date: Thu, 2 Nov 2023 10:56:54 -0700 In-Reply-To: <20231102175735.2272696-1-irogers@google.com> Message-Id: <20231102175735.2272696-13-irogers@google.com> Mime-Version: 1.0 References: <20231102175735.2272696-1-irogers@google.com> X-Mailer: git-send-email 2.42.0.869.gea05f2083d-goog Subject: [PATCH v4 12/53] 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 , Kajol Jain , Athira Rajeev , Huacai Chen , Masami Hiramatsu , Vincent Whitchurch , "Steinar H. Gunderson" , Liam Howlett , Miguel Ojeda , Colin Ian King , Dmitrii Dolgov <9erthalion6@gmail.com>, Yang Jihong , Ming Wang , James Clark , K Prateek Nayak , Sean Christopherson , Leo Yan , Ravi Bangoria , German Gomez , Changbin Du , Paolo Bonzini , Li Dong , Sandipan Das , liuwenyu , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Thu, 02 Nov 2023 11:00:20 -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.869.gea05f2083d-goog