Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5437696ybp; Mon, 14 Oct 2019 22:44:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqxbXH8AshNKQzFtZHcqIsEWEX8dZqu+LQN4qmWCvMbzwBuP/OGMnA7dC48oXbAB7R8VCYyN X-Received: by 2002:a17:906:49d8:: with SMTP id w24mr24543497ejv.264.1571118290199; Mon, 14 Oct 2019 22:44:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571118290; cv=none; d=google.com; s=arc-20160816; b=IJo+26hokng2/qwLN3fJz0iblki4I4D04PLHKkCbU1JtSTPicveRcuGIjPeJXTAm9o wOf3gtx/u3Rbii+T+QQdaJHGSqtGBX6+VjyNmhT67IBRsLz0GZw9ByNSC+K8Yh+1d/fy 6xDPxpY1g5dIax6iOSmorNM9Eizg1jwjcE/pDOnGrbjpprSNmBEK+In9CZBN0QF79wyu 7dApcYSRrl+XOkevUsl9ih0s4aAGtadjkjuw7OUbAi1z1xDERvh89ot5T1oiAe46T/yF mZtDNEE4AhpNWZsxt3OERzuFEeu2FM5UWw8j16fOP3KL7IriEzR4j/BVVWCRZ+a/6jhD dTdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=VibDcB3rvC87e6qHluAZjYvTrVCJsEiVbie7DPvS0GA=; b=hF4p3JZpPBe+pZV/zSHYKFAnl6I+JetyCIrLxjX9nlpnASofum+KWZ4vZ//1rkuaIw facwBUfeUP5wchKM1fmJ/cihZPgLjuGHjyLX60c5Nw+qTSifVGryY+5l7rP1scU2bXCQ qKbrVctmLdNrIwfnUpOcIn6P6DI3E/vBcNebswgbwZSZtvF9UbBFBOSUFSJvnOGZdoVN 2Haz543aunwWNt4R6nY3sycoA8V+N/hQt0QdxqMOjKDN0c2X14IdgDKBzwKEfge4QyDU ByTp/ncUoBHYUsroxk/n8SdITzbsnxK19SNr8UXS+g9pMtJb60BVrCf7txR3qiHeVM4a gQHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n2si11859289edt.408.2019.10.14.22.44.26; Mon, 14 Oct 2019 22:44:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728879AbfJOFcu convert rfc822-to-8bit (ORCPT + 99 others); Tue, 15 Oct 2019 01:32:50 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:42254 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728651AbfJOFcW (ORCPT ); Tue, 15 Oct 2019 01:32:22 -0400 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iKFRL-0000Qr-OZ; Tue, 15 Oct 2019 07:32:11 +0200 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id 53CD81C06CD; Tue, 15 Oct 2019 07:31:49 +0200 (CEST) Date: Tue, 15 Oct 2019 05:31:49 -0000 From: tip-bot2 for =?utf-8?q?Bj=C3=B6rn_T=C3=B6pel?= Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/core] perf tools: Make usage of test_attr__* optional for perf-sys.h Cc: =?utf-8?q?Bj=C3=B6rn_T=C3=B6pel?= , Song Liu , Adrian Hunter , Alexei Starovoitov , Daniel Borkmann , Jiri Olsa , Namhyung Kim , bpf@vger.kernel.org, netdev@vger.kernel.org, Arnaldo Carvalho de Melo , Ingo Molnar , Borislav Petkov , linux-kernel@vger.kernel.org In-Reply-To: <20191001113307.27796-2-bjorn.topel@gmail.com> References: <20191001113307.27796-2-bjorn.topel@gmail.com> MIME-Version: 1.0 Message-ID: <157111750919.12254.12122425573168365300.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8BIT X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the perf/core branch of tip: Commit-ID: 06f84d1989b7e58d56fa2e448664585749d41221 Gitweb: https://git.kernel.org/tip/06f84d1989b7e58d56fa2e448664585749d41221 Author: Björn Töpel AuthorDate: Tue, 01 Oct 2019 13:33:06 +02:00 Committer: Arnaldo Carvalho de Melo CommitterDate: Mon, 07 Oct 2019 12:22:17 -03:00 perf tools: Make usage of test_attr__* optional for perf-sys.h For users of perf-sys.h outside perf, e.g. samples/bpf/bpf_load.c, it's convenient not to depend on test_attr__*. After commit 91854f9a077e ("perf tools: Move everything related to sys_perf_event_open() to perf-sys.h"), all users of perf-sys.h will depend on test_attr__enabled and test_attr__open. This commit enables a user to define HAVE_ATTR_TEST to zero in order to omit the test dependency. Fixes: 91854f9a077e ("perf tools: Move everything related to sys_perf_event_open() to perf-sys.h") Signed-off-by: Björn Töpel Acked-by: Song Liu Cc: Adrian Hunter Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Jiri Olsa Cc: Namhyung Kim Cc: bpf@vger.kernel.org Cc: netdev@vger.kernel.org Link: http://lore.kernel.org/lkml/20191001113307.27796-2-bjorn.topel@gmail.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/perf-sys.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/perf/perf-sys.h b/tools/perf/perf-sys.h index 63e4349..15e458e 100644 --- a/tools/perf/perf-sys.h +++ b/tools/perf/perf-sys.h @@ -15,7 +15,9 @@ void test_attr__init(void); void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu, int fd, int group_fd, unsigned long flags); -#define HAVE_ATTR_TEST +#ifndef HAVE_ATTR_TEST +#define HAVE_ATTR_TEST 1 +#endif static inline int sys_perf_event_open(struct perf_event_attr *attr, @@ -27,7 +29,7 @@ sys_perf_event_open(struct perf_event_attr *attr, fd = syscall(__NR_perf_event_open, attr, pid, cpu, group_fd, flags); -#ifdef HAVE_ATTR_TEST +#if HAVE_ATTR_TEST if (unlikely(test_attr__enabled)) test_attr__open(attr, pid, cpu, fd, group_fd, flags); #endif