From patchwork Mon Jan 20 13:06:43 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: 11342131 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9171717EA for ; Mon, 20 Jan 2020 13:07:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6FEAF22525 for ; Mon, 20 Jan 2020 13:07:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="h6N1aw1u" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728803AbgATNGv (ORCPT ); Mon, 20 Jan 2020 08:06:51 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:27545 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728708AbgATNGu (ORCPT ); Mon, 20 Jan 2020 08:06:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579525608; 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=MkLSYm3mzAZXDQgD2SVlnhnv45Ao3CBk7NzaRvQfH7U=; b=h6N1aw1ubvrOW7G/ysDHROfT28oEufwwPWGsJlAh84H+szBE/QZp2vaYy3MgJtFDPzapAx p26sOUz2hIzznXG3QbFzfehKKEFkYg74WSn4Gw2v/+tPy4Y4h6+yWLbTRdjZ2bad+cD8/Y Yd65urD5zM7fvSl8FoxX0bPVQIrKBOo= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-387-zO4KzQlUOSeXvA0K9egmQA-1; Mon, 20 Jan 2020 08:06:47 -0500 X-MC-Unique: zO4KzQlUOSeXvA0K9egmQA-1 Received: by mail-lf1-f71.google.com with SMTP id v10so6207865lfa.14 for ; Mon, 20 Jan 2020 05:06:47 -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=MkLSYm3mzAZXDQgD2SVlnhnv45Ao3CBk7NzaRvQfH7U=; b=ra08rEvjWSllcCpi0rS5EfAYeRDRF/m+Ct6P6hKSp4MgMi46jZi4Qp71HKFng7ZG+L iMfb5ztVgnkShm0f4x5rKeaglgXKZSSDpuCfdB70uBIeQpnL5zH78dxa0/qSDOM8U2Yb As4Iq+znjTrDlRpgQP4/w2Tkh2DuWcuL7BvWmdGseDeBvLyBZ1rGq+GYHmGnZmFU3Vb2 PoGhgUUXR+yhYuj8ykYArZMg4vcWTMeTDnwD4XXG/FlJHEzv30n02bK2W5Qyl02J2DcE wReg7XsJuAAfeBXDACLCOwZIXP/zrCrMiBFm/91ZdGGKVXoFp4evo+/drnGRm6mYQHAQ w3AQ== X-Gm-Message-State: APjAAAWtEYutuG/2e+ctmf6AA1EwmVz0S4B2+asGmlWSBNIzH5bnSIEx gMaocm08LFRJkxYq9s4BWuRDlgWFh5Ey/XLIj5hWlyT6YhZOjIOPdXDdCgoDlywl9kuPhO0VeG0 b+sXeyYy0pglWL5kAlIQHIQ== X-Received: by 2002:ac2:5e2e:: with SMTP id o14mr7404731lfg.198.1579525605663; Mon, 20 Jan 2020 05:06:45 -0800 (PST) X-Google-Smtp-Source: APXvYqxxFiThs7woU8NNE+Z3Xi+dI52IZDR8cAEXZMjePibrZkF51mtKKwxYoZzZkPgd0sMDCRYfMg== X-Received: by 2002:ac2:5e2e:: with SMTP id o14mr7404688lfg.198.1579525605362; Mon, 20 Jan 2020 05:06:45 -0800 (PST) Received: from alrua-x1.borgediget.toke.dk ([85.204.121.218]) by smtp.gmail.com with ESMTPSA id b22sm20503583lji.99.2020.01.20.05.06.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2020 05:06:44 -0800 (PST) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 89C7B1804D7; Mon, 20 Jan 2020 14:06:43 +0100 (CET) Subject: [PATCH bpf-next v5 03/11] selftests: Pass VMLINUX_BTF to runqslower Makefile 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: Mon, 20 Jan 2020 14:06:43 +0100 Message-ID: <157952560344.1683545.2723631988771664417.stgit@toke.dk> In-Reply-To: <157952560001.1683545.16757917515390545122.stgit@toke.dk> References: <157952560001.1683545.16757917515390545122.stgit@toke.dk> User-Agent: StGit/0.21 MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Toke Høiland-Jørgensen Add a VMLINUX_BTF variable with the locally-built path when calling the runqslower Makefile from selftests. This makes sure a simple 'make' invocation in the selftests dir works even when there is no BTF information for the running kernel. Do a wildcard expansion and include the same paths for BTF for the running kernel as in the runqslower Makefile, to make it possible to build selftests without having a vmlinux in the local tree. Also fix the make invocation to use $(OUTPUT)/tools as the destination directory instead of $(CURDIR)/tools. Fixes: 3a0d3092a4ed ("selftests/bpf: Build runqslower from selftests") Acked-by: Andrii Nakryiko Signed-off-by: Toke Høiland-Jørgensen --- tools/testing/selftests/bpf/Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 246d09ffb296..8240282aef7f 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -124,10 +124,14 @@ $(OUTPUT)/test_stub.o: test_stub.c $(call msg,CC,,$@) $(CC) -c $(CFLAGS) -o $@ $< +VMLINUX_BTF_PATHS := $(abspath ../../../../vmlinux) \ + /sys/kernel/btf/vmlinux \ + /boot/vmlinux-$(shell uname -r) +VMLINUX_BTF:= $(firstword $(wildcard $(VMLINUX_BTF_PATHS))) .PHONY: $(OUTPUT)/runqslower $(OUTPUT)/runqslower: force - $(Q)$(MAKE) $(submake_extras) -C $(TOOLSDIR)/bpf/runqslower \ - OUTPUT=$(CURDIR)/tools/ + $(Q)$(MAKE) $(submake_extras) -C $(TOOLSDIR)/bpf/runqslower \ + OUTPUT=$(OUTPUT)/tools/ VMLINUX_BTF=$(VMLINUX_BTF) BPFOBJ := $(OUTPUT)/libbpf.a