From patchwork Wed Jan 15 14:12:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= X-Patchwork-Id: 208960 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 67EA7C33CB2 for ; Wed, 15 Jan 2020 14:12:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3CF5E24671 for ; Wed, 15 Jan 2020 14:12:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="U8mwVOrc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729288AbgAOOM6 (ORCPT ); Wed, 15 Jan 2020 09:12:58 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:49942 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729275AbgAOOM6 (ORCPT ); Wed, 15 Jan 2020 09:12:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579097577; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tdkfMOU4O1JSYnyvWTMVAu0Pbml2FCrACzP/iFrbkaQ=; b=U8mwVOrcQ0wFH57DSFnxRKUN3Co5bbiBm8PRUjCoaNyIRHoTq7DN0R+tbY/IGU5zJtYqn+ Xo18lg49zQuot5qxgb5N2SzP8JqRczozzIp4wuJW6p/5hqzCZ5sCsPG8s0IY8dxlWsM4dQ r7PiTtdw2l4L3lCnqGMzHwCSh4wEM/0= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-98-k_0fHMVVOf6YOKT0JS25MQ-1; Wed, 15 Jan 2020 09:12:56 -0500 X-MC-Unique: k_0fHMVVOf6YOKT0JS25MQ-1 Received: by mail-lj1-f199.google.com with SMTP id o9so4192783ljc.6 for ; Wed, 15 Jan 2020 06:12:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=tdkfMOU4O1JSYnyvWTMVAu0Pbml2FCrACzP/iFrbkaQ=; b=ghDY3tv+9cmbefUX4DrvA+xaJdbhAGB2T+vRZIhIyzneLd32lmd5DRksz8e+eiB/Go iz8p9GOI1pqqSuqFzQ912B98UsrRF+fEmR5G34VMyY2yXVBWMVEWRaegzB7LvZ/eWAnc sEi3V7B4pl9WOINSUyi/NHzHNSeJ6ETkKeYb3/wXfDw1iZO6Ri8zpbGa4LX1FtxzSsnP KTg9HEMRuSQG9yhRyqOCYwGKRAhKkEfxwkG1EkS3YdBEzdRo+dKXMaEWjwneU5g1ucUZ q9UrxeYabqt5iEpzU6Z8cePMLSRxZVbyBcRtb1HBbXqXacKmXeGPtkA4yXHtAt0qstCV 38/w== X-Gm-Message-State: APjAAAWMZRoo0uuQjSMijqccMknKBKwCnpD+g/NLWFrL1Q3E7D+d7fnq tnncdKDgffHctTmhdPIcEP1pOSXCdkRp+3pgIKT9qSk9vTzxsGAluhu0Ec1mXDZryZb6QbLFG8w bXOR2tOKjHc604Lw+UdrzQFn/52IF X-Received: by 2002:ac2:58ea:: with SMTP id v10mr4813041lfo.202.1579097574934; Wed, 15 Jan 2020 06:12:54 -0800 (PST) X-Google-Smtp-Source: APXvYqyUFS3e2zIy8rA7HqNCGr/3h2PBROEBA0CL5i8AxlW9KAm7efsIsFDqmChe4488tRaJn+o0VQ== X-Received: by 2002:ac2:58ea:: with SMTP id v10mr4813000lfo.202.1579097574687; Wed, 15 Jan 2020 06:12:54 -0800 (PST) Received: from alrua-x1.borgediget.toke.dk ([2a0c:4d80:42:443::2]) by smtp.gmail.com with ESMTPSA id 195sm9156230ljj.55.2020.01.15.06.12.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jan 2020 06:12:53 -0800 (PST) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 149BD1804D6; Wed, 15 Jan 2020 15:12:52 +0100 (CET) Subject: [PATCH bpf-next v2 03/10] tools/runqslower: Use consistent include paths for libbpf From: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= To: Alexei Starovoitov Cc: Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , Doug Ledford , Jason Gunthorpe , "David S. Miller" , Jakub Kicinski , Jesper Dangaard Brouer , John Fastabend , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Shuah Khan , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kselftest@vger.kernel.org, clang-built-linux@googlegroups.com Date: Wed, 15 Jan 2020 15:12:52 +0100 Message-ID: <157909757197.1192265.9826436565959764419.stgit@toke.dk> In-Reply-To: <157909756858.1192265.6657542187065456112.stgit@toke.dk> References: <157909756858.1192265.6657542187065456112.stgit@toke.dk> User-Agent: StGit/0.21 MIME-Version: 1.0 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org From: Toke Høiland-Jørgensen Fix the runqslower tool to include libbpf header files with the bpf/ prefix, to be consistent with external users of the library. Also ensure that all includes of exported libbpf header files (those that are exported on 'make install' of the library) use bracketed includes instead of quoted. To not break the build, keep the old include path until everything has been changed to the new one; a subsequent patch will remove that. Fixes: 6910d7d3867a ("selftests/bpf: Ensure bpf_helper_defs.h are taken from selftests dir") Signed-off-by: Toke Høiland-Jørgensen --- tools/bpf/runqslower/Makefile | 5 +++-- tools/bpf/runqslower/runqslower.bpf.c | 2 +- tools/bpf/runqslower/runqslower.c | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/bpf/runqslower/Makefile b/tools/bpf/runqslower/Makefile index fb93ce2bf2fe..3b7ae76c8ec4 100644 --- a/tools/bpf/runqslower/Makefile +++ b/tools/bpf/runqslower/Makefile @@ -5,6 +5,7 @@ LLC := llc LLVM_STRIP := llvm-strip DEFAULT_BPFTOOL := $(OUTPUT)/sbin/bpftool BPFTOOL ?= $(DEFAULT_BPFTOOL) +LIBBPF_INCLUDE := -I$(abspath ../../lib) -I$(abspath ../../lib/bpf) LIBBPF_SRC := $(abspath ../../lib/bpf) CFLAGS := -g -Wall @@ -59,13 +60,13 @@ $(OUTPUT)/%.skel.h: $(OUTPUT)/%.bpf.o | $(BPFTOOL) $(OUTPUT)/%.bpf.o: %.bpf.c $(OUTPUT)/libbpf.a | $(OUTPUT) $(call msg,BPF,$@) - $(Q)$(CLANG) -g -O2 -target bpf -I$(OUTPUT) -I$(LIBBPF_SRC) \ + $(Q)$(CLANG) -g -O2 -target bpf -I$(OUTPUT) $(LIBBPF_INCLUDE) \ -c $(filter %.c,$^) -o $@ && \ $(LLVM_STRIP) -g $@ $(OUTPUT)/%.o: %.c | $(OUTPUT) $(call msg,CC,$@) - $(Q)$(CC) $(CFLAGS) -I$(LIBBPF_SRC) -I$(OUTPUT) -c $(filter %.c,$^) -o $@ + $(Q)$(CC) $(CFLAGS) $(LIBBPF_INCLUDE) -I$(OUTPUT) -c $(filter %.c,$^) -o $@ $(OUTPUT): $(call msg,MKDIR,$@) diff --git a/tools/bpf/runqslower/runqslower.bpf.c b/tools/bpf/runqslower/runqslower.bpf.c index 623cce4d37f5..48a39f72fadf 100644 --- a/tools/bpf/runqslower/runqslower.bpf.c +++ b/tools/bpf/runqslower/runqslower.bpf.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 // Copyright (c) 2019 Facebook #include "vmlinux.h" -#include +#include #include "runqslower.h" #define TASK_RUNNING 0 diff --git a/tools/bpf/runqslower/runqslower.c b/tools/bpf/runqslower/runqslower.c index 996f0e2c560e..d89715844952 100644 --- a/tools/bpf/runqslower/runqslower.c +++ b/tools/bpf/runqslower/runqslower.c @@ -6,8 +6,8 @@ #include #include #include -#include -#include +#include +#include #include "runqslower.h" #include "runqslower.skel.h" From patchwork Wed Jan 15 14:12:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= X-Patchwork-Id: 208957 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6E3BC33CB2 for ; Wed, 15 Jan 2020 14:15:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8BA992467E for ; Wed, 15 Jan 2020 14:15:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="LCJ9rwZh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729427AbgAOOP5 (ORCPT ); Wed, 15 Jan 2020 09:15:57 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:49718 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729393AbgAOONC (ORCPT ); Wed, 15 Jan 2020 09:13:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579097580; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=L2f/3xqMCvPgjOWRi/4hBoG4txZFOAtpty8CahkBiCk=; b=LCJ9rwZhZBhUQyyEowGvJOOpCRbfCJHqwYj1Vkwd8h9l1DmnAe0TpDb0GQbwldJj/Mmvpk jOdqPSwENct28kra+Wn1mjRF3QQrj7t3LpdaRQo4LB3IRH8SsP3ZYCzNbs2Wm7xZmOfjLy 8PZLFPdIVlFIwf6n+z/UX3Uyuvxr5DE= Received: from mail-lf1-f72.google.com (mail-lf1-f72.google.com [209.85.167.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-74-Ji9O-vKbNcm0m8GvqEZfDQ-1; Wed, 15 Jan 2020 09:12:59 -0500 X-MC-Unique: Ji9O-vKbNcm0m8GvqEZfDQ-1 Received: by mail-lf1-f72.google.com with SMTP id i5so3263152lfo.7 for ; Wed, 15 Jan 2020 06:12:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=L2f/3xqMCvPgjOWRi/4hBoG4txZFOAtpty8CahkBiCk=; b=E04FXhXK148WixmwOj0BQT+cBjXQvYupu8CT4OQY9KMBa+r68g8760HkmmAAJ8/Pdt 9mfB40CDZW1SGouHBr0b9sBN4UrMdEbAjcLqzlZB8e7QnWodupkInnlK7Y1kiRv0ZbQo G8JMQ8+MsQCSCBAM4j486bH4mHqXQW522Q+UNLpGJhjg+IrbbicDI/AK3es9/K8FZYvA qiypHkehcNeaFMwdWmMygI5c2elkNOM/lTT7xw93uTqtV8sGEe+yftWoya34Ec6rVxiV 9/nfdxf422kflyPhkWAMLGsCQRIN85YSAY0fY2qMRd0skPbJMHFNsQqezlFp9zXzl1vW WG+w== X-Gm-Message-State: APjAAAU9A7eauZKibB6LzB6TrQtdpHlJSmUx8sOKuuLu8OpXx/BgrAKO 8aMkGfJnCAgDBijI0j8U1YPzWajhcnkkllVYG4zPqBkqqwkA2BctoNYrd/IQw5uOMkYMmLp0yaa MNAbUxATZr0SwojuzUnEZJYLUSuNe X-Received: by 2002:a2e:9587:: with SMTP id w7mr1910166ljh.42.1579097577655; Wed, 15 Jan 2020 06:12:57 -0800 (PST) X-Google-Smtp-Source: APXvYqz/am/cdvueKyne+fGOGIHUIMVc0ISCYot7rVGpWw5I/QvHynTKT2v2M5koWXR3yS6NY44ANQ== X-Received: by 2002:a2e:9587:: with SMTP id w7mr1910116ljh.42.1579097577147; Wed, 15 Jan 2020 06:12:57 -0800 (PST) Received: from alrua-x1.borgediget.toke.dk ([45.145.92.2]) by smtp.gmail.com with ESMTPSA id t9sm8960034lfl.51.2020.01.15.06.12.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jan 2020 06:12:56 -0800 (PST) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 5F6421804D6; Wed, 15 Jan 2020 15:12:55 +0100 (CET) Subject: [PATCH bpf-next v2 06/10] perf: Use consistent include paths for libbpf From: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= To: Alexei Starovoitov Cc: Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , Doug Ledford , Jason Gunthorpe , "David S. Miller" , Jakub Kicinski , Jesper Dangaard Brouer , John Fastabend , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Shuah Khan , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kselftest@vger.kernel.org, clang-built-linux@googlegroups.com Date: Wed, 15 Jan 2020 15:12:55 +0100 Message-ID: <157909757530.1192265.16430056843174690136.stgit@toke.dk> In-Reply-To: <157909756858.1192265.6657542187065456112.stgit@toke.dk> References: <157909756858.1192265.6657542187065456112.stgit@toke.dk> User-Agent: StGit/0.21 MIME-Version: 1.0 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org From: Toke Høiland-Jørgensen Fix perf to include libbpf header files with the bpf/ prefix, to be consistent with external users of the library. Signed-off-by: Toke Høiland-Jørgensen --- tools/perf/examples/bpf/5sec.c | 2 +- tools/perf/examples/bpf/empty.c | 2 +- tools/perf/examples/bpf/sys_enter_openat.c | 2 +- tools/perf/include/bpf/pid_filter.h | 2 +- tools/perf/include/bpf/stdio.h | 2 +- tools/perf/include/bpf/unistd.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/perf/examples/bpf/5sec.c b/tools/perf/examples/bpf/5sec.c index b9c203219691..49f4f84da485 100644 --- a/tools/perf/examples/bpf/5sec.c +++ b/tools/perf/examples/bpf/5sec.c @@ -39,7 +39,7 @@ Copyright (C) 2018 Red Hat, Inc., Arnaldo Carvalho de Melo */ -#include +#include int probe(hrtimer_nanosleep, rqtp->tv_sec)(void *ctx, int err, long sec) { diff --git a/tools/perf/examples/bpf/empty.c b/tools/perf/examples/bpf/empty.c index 3776d26db9e7..7d7fb0c9fe76 100644 --- a/tools/perf/examples/bpf/empty.c +++ b/tools/perf/examples/bpf/empty.c @@ -1,3 +1,3 @@ -#include +#include license(GPL); diff --git a/tools/perf/examples/bpf/sys_enter_openat.c b/tools/perf/examples/bpf/sys_enter_openat.c index 9cd124b09392..c4481c390d23 100644 --- a/tools/perf/examples/bpf/sys_enter_openat.c +++ b/tools/perf/examples/bpf/sys_enter_openat.c @@ -14,7 +14,7 @@ * the return value. */ -#include +#include struct syscall_enter_openat_args { unsigned long long unused; diff --git a/tools/perf/include/bpf/pid_filter.h b/tools/perf/include/bpf/pid_filter.h index 6e61c4bdf548..607189a315b2 100644 --- a/tools/perf/include/bpf/pid_filter.h +++ b/tools/perf/include/bpf/pid_filter.h @@ -3,7 +3,7 @@ #ifndef _PERF_BPF_PID_FILTER_ #define _PERF_BPF_PID_FILTER_ -#include +#include #define pid_filter(name) pid_map(name, bool) diff --git a/tools/perf/include/bpf/stdio.h b/tools/perf/include/bpf/stdio.h index 316af5b2ff35..7ca6fa5463ee 100644 --- a/tools/perf/include/bpf/stdio.h +++ b/tools/perf/include/bpf/stdio.h @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 -#include +#include struct bpf_map SEC("maps") __bpf_stdout__ = { .type = BPF_MAP_TYPE_PERF_EVENT_ARRAY, diff --git a/tools/perf/include/bpf/unistd.h b/tools/perf/include/bpf/unistd.h index ca7877f9a976..d1a35b6c649d 100644 --- a/tools/perf/include/bpf/unistd.h +++ b/tools/perf/include/bpf/unistd.h @@ -1,6 +1,6 @@ // SPDX-License-Identifier: LGPL-2.1 -#include +#include static int (*bpf_get_current_pid_tgid)(void) = (void *)BPF_FUNC_get_current_pid_tgid; From patchwork Wed Jan 15 14:12:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= X-Patchwork-Id: 208959 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C9DFC33CB1 for ; Wed, 15 Jan 2020 14:15:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F15DF24681 for ; Wed, 15 Jan 2020 14:15:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="TB5DbnvF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729047AbgAOOPX (ORCPT ); Wed, 15 Jan 2020 09:15:23 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:32720 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729606AbgAOONH (ORCPT ); Wed, 15 Jan 2020 09:13:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579097587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IbqVpRR/8QBodrEx/nm52YtktIoV5thrDtYdJd8vMNo=; b=TB5DbnvFW4hWpT9H1NxzPaCZA2wsjr4pGnGS0IIxH9Z/By26gw4La97vZXI6zEBxrZ2PMH BF4gaUY9EXZqiNJ+yFbjoavQykv4IGvexPfT9G1L3j5JRMAwHRCxHA3xeSkGZeyYoWpeYU +ZRhHooMNzJEQBJoXGz5xJoGDIPqOWk= Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-429-VTgZdxUhNkSWuK9s8U06Jg-1; Wed, 15 Jan 2020 09:13:05 -0500 X-MC-Unique: VTgZdxUhNkSWuK9s8U06Jg-1 Received: by mail-lj1-f200.google.com with SMTP id a19so4191038ljp.15 for ; Wed, 15 Jan 2020 06:13:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=IbqVpRR/8QBodrEx/nm52YtktIoV5thrDtYdJd8vMNo=; b=hV5K5+XAkP1OxEY9YEaWEdfDxjj2F1CWlvRODsBwiyia2Lg+tW7LHMw6oHZ4dNZwR6 pWGdXawfDyr+BWXnb3+8lk4H+0Vpb5+a9TZ2b8nr5lRmQiJw9A3u99y6L8PKrgxGHpjZ wGPWBn3bX7FK0lam+xweklgv0pJUr7GhprYrESs9E6VtAyGrhXbGy9wwfy5DBElh8arA xJC3Ps99h+5l+cmX/6YdXOjxLs0+5gbXQZJEWRS0mB6j0SiAxTJ/nKg9Y6JRpPabz+Eh V33OuHXWCfO6pDVb9yHHRU/ugxfKJb/MuJohwM7mETnFcy3lCw9OgLwHlOmjlUzcj1AO wE2w== X-Gm-Message-State: APjAAAU/Am9+kKy2JfkByjKoT02cpt3t9cVyNCIeA1x0a+mtLHzM0XtQ FjYPD7AdrkcZYvXI38Hs4HHpOz2l2rkY89xWkTr1Q/cDdJRwiG7o/WBetuHvyZqNznErGgbaXhu W38yCxRY87y4swdnRg2ztMj2zH3ek X-Received: by 2002:a2e:97c1:: with SMTP id m1mr1938356ljj.270.1579097584146; Wed, 15 Jan 2020 06:13:04 -0800 (PST) X-Google-Smtp-Source: APXvYqxeIyk3JE8ypwVQPor3SVLXXAEfT2KWc9boLbeUl5AIb8BPG0kbZGTyLI5qwFLXqnWRk9pOSw== X-Received: by 2002:a2e:97c1:: with SMTP id m1mr1938317ljj.270.1579097583924; Wed, 15 Jan 2020 06:13:03 -0800 (PST) Received: from alrua-x1.borgediget.toke.dk ([45.145.92.2]) by smtp.gmail.com with ESMTPSA id t81sm8978733lff.25.2020.01.15.06.13.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jan 2020 06:13:03 -0800 (PST) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 941A11804D6; Wed, 15 Jan 2020 15:12:57 +0100 (CET) Subject: [PATCH bpf-next v2 08/10] libbpf: Fix include of bpf_helpers.h when libbpf is installed on system From: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= To: Alexei Starovoitov Cc: Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , Doug Ledford , Jason Gunthorpe , "David S. Miller" , Jakub Kicinski , Jesper Dangaard Brouer , John Fastabend , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Shuah Khan , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kselftest@vger.kernel.org, clang-built-linux@googlegroups.com Date: Wed, 15 Jan 2020 15:12:57 +0100 Message-ID: <157909757751.1192265.13380767037659864244.stgit@toke.dk> In-Reply-To: <157909756858.1192265.6657542187065456112.stgit@toke.dk> References: <157909756858.1192265.6657542187065456112.stgit@toke.dk> User-Agent: StGit/0.21 MIME-Version: 1.0 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org From: Toke Høiland-Jørgensen The change to use angled includes for bpf_helper_defs.h breaks compilation against libbpf when it is installed in the include path, since the file is installed in the bpf/ subdirectory of $INCLUDE_PATH. Fix this by adding the bpf/ prefix to the #include directive. Fixes: 6910d7d3867a ("selftests/bpf: Ensure bpf_helper_defs.h are taken from selftests dir") Signed-off-by: Toke Høiland-Jørgensen --- tools/lib/bpf/bpf_helpers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lib/bpf/bpf_helpers.h b/tools/lib/bpf/bpf_helpers.h index 050bb7bf5be6..fa43d649e7a2 100644 --- a/tools/lib/bpf/bpf_helpers.h +++ b/tools/lib/bpf/bpf_helpers.h @@ -2,7 +2,7 @@ #ifndef __BPF_HELPERS__ #define __BPF_HELPERS__ -#include +#include #define __uint(name, val) int (*name)[val] #define __type(name, val) typeof(val) *name From patchwork Wed Jan 15 14:12:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= X-Patchwork-Id: 208958 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2FABC33CB6 for ; Wed, 15 Jan 2020 14:15:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 994EA24681 for ; Wed, 15 Jan 2020 14:15:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="R5g7xoSg" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729525AbgAOOPd (ORCPT ); Wed, 15 Jan 2020 09:15:33 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:39959 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729524AbgAOONF (ORCPT ); Wed, 15 Jan 2020 09:13:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579097585; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DpxFK0rlkhyTfyqA9bHWu7DLL4byHWgLPixehsmQCkc=; b=R5g7xoSgaFNovKI/mI6d8SsgOXe0+8lwiDkGrRxZZuSSfry2jMIKAkbHp/qmK84G/ZLDZE 5i+d66u/WVIejuVY+YIPWTPEMHpSQyD67zME54aj7irepptIL4QQhjvetOuAttDDDt8KAP kLOtqQ9d5PCUC9cGfkkOLZZ6PY+G2dg= Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-28-VUbYNYZ4N3qpQ0-mQBGpww-1; Wed, 15 Jan 2020 09:13:03 -0500 X-MC-Unique: VUbYNYZ4N3qpQ0-mQBGpww-1 Received: by mail-lf1-f69.google.com with SMTP id f18so3264835lfm.2 for ; Wed, 15 Jan 2020 06:13:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=DpxFK0rlkhyTfyqA9bHWu7DLL4byHWgLPixehsmQCkc=; b=GiM6LJWo2H+bwgA+jTDIUxYWqW8zivuKPCu9vcr8vKFhLJhH5PNiv0aDJxwbz7VNSM 1A3PXOtpPblurrRR3RUZPon5U3TusngQz6Vs2yjkRI+OKwquWKBK5zUwX6iHPgvs+vKL 0JlhnEnZMx25oHXjECktyz657to56YdV208jsxgI5UiXB6JsuSPYxCaY8DCMqv2hGlNX SgEMu3IPClHvOd2dA/4RQFHPMUjGWGi+kTQ9XvLI6MPzT7gLA8oiOoCykS3aU18PgKSq SVpfMbk8P+dUOgPBq7ZJp4yZXJybnzbaS0G1HaYRe8zm0Kg4fZj7k38dzB0nlbXllKCx sQ7w== X-Gm-Message-State: APjAAAWKjZajzT/rkLvWP9NYSSYAkYdJMNVIL3gYr7wMaXDcgkfY7Sgd bieiU3NKvIwKhwRYikfMn6JvRUR0mcGoEclGWO8k9JldILalzQ6wbDBScElck0Hli1Si7fHUl03 hP5U11qy6un9hTlaZULqfHH3mK3pw X-Received: by 2002:a19:5e16:: with SMTP id s22mr4861211lfb.33.1579097581945; Wed, 15 Jan 2020 06:13:01 -0800 (PST) X-Google-Smtp-Source: APXvYqwHgcSMYdmq2Qpg+smezAqp82lJFIXNVeJddJhi4eCEV0/EIlNjNOhfqiJg4Hs1ey+YlIRk1g== X-Received: by 2002:a19:5e16:: with SMTP id s22mr4861193lfb.33.1579097581717; Wed, 15 Jan 2020 06:13:01 -0800 (PST) Received: from alrua-x1.borgediget.toke.dk ([2a0c:4d80:42:443::2]) by smtp.gmail.com with ESMTPSA id i17sm9293135ljd.34.2020.01.15.06.12.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jan 2020 06:13:01 -0800 (PST) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id AA90D1804D8; Wed, 15 Jan 2020 15:12:58 +0100 (CET) Subject: [PATCH bpf-next v2 09/10] selftests: Remove tools/lib/bpf from include path From: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= To: Alexei Starovoitov Cc: Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , Doug Ledford , Jason Gunthorpe , "David S. Miller" , Jakub Kicinski , Jesper Dangaard Brouer , John Fastabend , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Shuah Khan , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kselftest@vger.kernel.org, clang-built-linux@googlegroups.com Date: Wed, 15 Jan 2020 15:12:58 +0100 Message-ID: <157909757860.1192265.1725940708658939712.stgit@toke.dk> In-Reply-To: <157909756858.1192265.6657542187065456112.stgit@toke.dk> References: <157909756858.1192265.6657542187065456112.stgit@toke.dk> User-Agent: StGit/0.21 MIME-Version: 1.0 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org From: Toke Høiland-Jørgensen To make sure no new files are introduced that doesn't include the bpf/ prefix in its #include, remove tools/lib/bpf from the include path entirely, and use tools/lib instead. To fix the original issue with bpf_helper_defs.h being stale, change the Makefile rule to regenerate the file in the lib/bpf dir instead of having a local copy in selftests. Signed-off-by: Toke Høiland-Jørgensen --- tools/testing/selftests/bpf/.gitignore | 3 ++- tools/testing/selftests/bpf/Makefile | 16 ++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/tools/testing/selftests/bpf/.gitignore b/tools/testing/selftests/bpf/.gitignore index 1d14e3ab70be..17dd02651dee 100644 --- a/tools/testing/selftests/bpf/.gitignore +++ b/tools/testing/selftests/bpf/.gitignore @@ -33,10 +33,11 @@ libbpf.pc libbpf.so.* test_hashmap test_btf_dump +test_cgroup_attach +test_select_reuseport xdping test_cpp *.skel.h /no_alu32 /bpf_gcc /tools -bpf_helper_defs.h diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index cd98ae875e30..4889cc3ead4b 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -21,7 +21,7 @@ LLC ?= llc LLVM_OBJCOPY ?= llvm-objcopy BPF_GCC ?= $(shell command -v bpf-gcc;) CFLAGS += -g -Wall -O2 $(GENFLAGS) -I$(CURDIR) -I$(APIDIR) -I$(LIBDIR) \ - -I$(BPFDIR) -I$(GENDIR) -I$(TOOLSINCDIR) \ + -I$(GENDIR) -I$(TOOLSINCDIR) \ -Dbpf_prog_load=bpf_prog_test_load \ -Dbpf_load_program=bpf_test_load_program LDLIBS += -lcap -lelf -lz -lrt -lpthread @@ -129,7 +129,7 @@ $(OUTPUT)/runqslower: force $(Q)$(MAKE) $(submake_extras) -C $(TOOLSDIR)/bpf/runqslower \ OUTPUT=$(CURDIR)/tools/ -BPFOBJ := $(OUTPUT)/libbpf.a +BPFOBJ := $(BPFDIR)/libbpf.a $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED): $(OUTPUT)/test_stub.o $(BPFOBJ) @@ -155,17 +155,17 @@ force: DEFAULT_BPFTOOL := $(OUTPUT)/tools/sbin/bpftool BPFTOOL ?= $(DEFAULT_BPFTOOL) -$(DEFAULT_BPFTOOL): force +$(DEFAULT_BPFTOOL): force $(BPFOBJ) $(Q)$(MAKE) $(submake_extras) -C $(BPFTOOLDIR) \ prefix= DESTDIR=$(OUTPUT)/tools/ install $(BPFOBJ): force - $(Q)$(MAKE) $(submake_extras) -C $(BPFDIR) OUTPUT=$(OUTPUT)/ + $(Q)$(MAKE) $(submake_extras) -C $(BPFDIR) OUTPUT=$(BPFDIR)/ $(BPFOBJ) -BPF_HELPERS := $(OUTPUT)/bpf_helper_defs.h $(wildcard $(BPFDIR)/bpf_*.h) -$(OUTPUT)/bpf_helper_defs.h: $(BPFOBJ) +BPF_HELPERS := $(BPFDIR)/bpf_helper_defs.h $(wildcard $(BPFDIR)/bpf_*.h) +$(BPFDIR)/bpf_helper_defs.h: $(BPFOBJ) $(Q)$(MAKE) $(submake_extras) -C $(BPFDIR) \ - OUTPUT=$(OUTPUT)/ $(OUTPUT)/bpf_helper_defs.h + OUTPUT=$(BPFDIR)/ $(BPFDIR)/bpf_helper_defs.h # Get Clang's default includes on this system, as opposed to those seen by # '-target bpf'. This fixes "missing" files on some architectures/distros, @@ -186,7 +186,7 @@ MENDIAN=$(if $(IS_LITTLE_ENDIAN),-mlittle-endian,-mbig-endian) CLANG_SYS_INCLUDES = $(call get_sys_includes,$(CLANG)) BPF_CFLAGS = -g -D__TARGET_ARCH_$(SRCARCH) $(MENDIAN) \ -I$(OUTPUT) -I$(CURDIR) -I$(CURDIR)/include/uapi \ - -I$(APIDIR) -I$(LIBDIR) -I$(BPFDIR) -I$(abspath $(OUTPUT)/../usr/include) + -I$(APIDIR) -I$(LIBDIR) -I$(abspath $(OUTPUT)/../usr/include) CLANG_CFLAGS = $(CLANG_SYS_INCLUDES) \ -Wno-compare-distinct-pointer-types