Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2555914ybl; Mon, 20 Jan 2020 05:14:47 -0800 (PST) X-Google-Smtp-Source: APXvYqzjBW0L1KMs0J8XQKxqvksO28986dIkx25olzvUUjqaRsaAxYN6vTXBwnVd8piwWxmcYRI7 X-Received: by 2002:a9d:7984:: with SMTP id h4mr16331941otm.297.1579526087633; Mon, 20 Jan 2020 05:14:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579526087; cv=none; d=google.com; s=arc-20160816; b=UONX79Fh7xZFQ2p34lo3MptKUnAeJRm3atWaDTj8lkKwVrNSq4Ns2YJjiM6Xx4dCcH IFmGVpUcE3AMjzsIcs9XMjcKuZjQs4S09dq4gjaT8m4RPm7EMLtm3cWkGlADumf/dbIY thWV9fTuv8Xx2bzO8PRHSwQzHapxvuu97GW9SNaA3X8uqQTYKYvkbDuGcjFNdFrIrZD0 8TIl2LXHenOOTkiAOCS6VwS2+fesTrL4iANWR/EkCXsn/rexIY38JrtM+Asyx+I9cYtQ hdZhlRfug3S9THYYJgTcteR85zYJSJDHjgjGRFWIHx23Jpo51Cm9qFLZKrdJKQ3Q8zyJ qgUg== 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:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:dkim-signature; bh=7nX6gCvToHh/M+ufmuZNkVcVbY/LiP2p5Z5znXTQZT8=; b=HXKI7pYmu1MUcnhPW/d0Bw+HeVARcsx3WV1zZAMTBZg81O1CVH1wJlsMBlyMt0f88c Vmw/Fau/P+ZyCh70nTDln3j2AbSKbhOGPOt+wzelZk52k3XXstVt/zqS+QG6Q2fJ5UgW Yzwn9Qov0t9mRiCnGP6QPEbDOBHHxlHwMQ2EQjXh9Oez5zlr+7tgbAjt257muL3UP5he Vkw9j6v/E2o6Hi4zgd/puCeKfo6lREq11gTqEQu4w1crbEmFEmFIZ4GzApcYqJwFuxno YSx8SPYuBv93IIS1xW4Gs1BD3gNfpfMST6y0o+mpb3vsSx2FQ0xSf+gd80qUNTO1KGQw ooZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=P4wtEJaw; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k84si17764541oib.46.2020.01.20.05.14.35; Mon, 20 Jan 2020 05:14:47 -0800 (PST) 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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=P4wtEJaw; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728767AbgATNN2 (ORCPT + 99 others); Mon, 20 Jan 2020 08:13:28 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:51710 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727740AbgATNN0 (ORCPT ); Mon, 20 Jan 2020 08:13:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579526005; 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=7nX6gCvToHh/M+ufmuZNkVcVbY/LiP2p5Z5znXTQZT8=; b=P4wtEJawlku4ISmhdMp/g/gAQSkarssDjVlc1V5LD4kyzRliEOmLc5QrSecem6CG/bpJWK mDsnICKX10miuF+UV3mOCDyYQgQETGjCLG7Cv8r5o49+Mb1Hs8EMeiWCSuZ9yq7T9tHxau Tjw6oQLXlp2jrAUaRvIAus5oyC58o84= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-226-5jpL76AaNhaH3DLGvS9_IQ-1; Mon, 20 Jan 2020 08:13:24 -0500 X-MC-Unique: 5jpL76AaNhaH3DLGvS9_IQ-1 Received: by mail-ed1-f72.google.com with SMTP id n18so21821859edo.17 for ; Mon, 20 Jan 2020 05:13:23 -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=7nX6gCvToHh/M+ufmuZNkVcVbY/LiP2p5Z5znXTQZT8=; b=rmHPCPYvAMFTFj78qKDhgxU6WZOMIDz1BG9q+u+IfM9DB4P9RBEwEn5ekRETuV27/7 hYuqvtC5Kodpf5B2P5xQMcNkIymlPQUoe8MRDkZpjO6ZaXnCc7CW5OMQSD+YheeDQa9P JoLpcAEqYwfyFd5jcHN108bNWFHQh5H6PcNdQGNwmikxWPDU3BELdRkXkY9cov086C/Y BEfpWn23Z5yHS5tu+k5E58Yb8BEr26VsyMAmMqEDXQULMVHZfRo0gUSlv6tE4Z3e5QhH 4IQh6IJcqj25XiiXLOfq2n8oAc+42a1Z63YwS81dTPtZtLpkePax020FF3GH0y54rBR8 KbQQ== X-Gm-Message-State: APjAAAW46+70zNydz3kqTtRiblUtk+Ua+M75EsstT3taMcdKb3UmNsjQ 9hZsFXIDAyzqQteRqiVbYWHqLrTLpUi/3U6jqloY/2oMCmrZ6cF35kQwGAOlbE4MMAKjoXc4VDw s6wOTXrBRSnaL1nQOA2hyfDVY X-Received: by 2002:a17:906:7c5a:: with SMTP id g26mr19565117ejp.249.1579525999573; Mon, 20 Jan 2020 05:13:19 -0800 (PST) X-Received: by 2002:a05:651c:8f:: with SMTP id 15mr13842833ljq.109.1579525998002; Mon, 20 Jan 2020 05:13:18 -0800 (PST) Received: from alrua-x1.borgediget.toke.dk ([85.204.121.218]) by smtp.gmail.com with ESMTPSA id z3sm16867876ljh.83.2020.01.20.05.13.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2020 05:13:16 -0800 (PST) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 709ED1804D6; Mon, 20 Jan 2020 14:06:51 +0100 (CET) Subject: [PATCH bpf-next v5 10/11] runsqslower: Support user-specified libbpf include and object paths 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:51 +0100 Message-ID: <157952561135.1683545.5660339645093141381.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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Toke Høiland-Jørgensen This adds support for specifying the libbpf include and object paths as arguments to the runqslower Makefile, to support reusing the libbpf version built as part of the selftests. Signed-off-by: Toke Høiland-Jørgensen --- tools/bpf/runqslower/Makefile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/bpf/runqslower/Makefile b/tools/bpf/runqslower/Makefile index b90044caf270..faf5418609ea 100644 --- a/tools/bpf/runqslower/Makefile +++ b/tools/bpf/runqslower/Makefile @@ -6,7 +6,9 @@ LLVM_STRIP := llvm-strip DEFAULT_BPFTOOL := $(OUTPUT)/sbin/bpftool BPFTOOL ?= $(DEFAULT_BPFTOOL) LIBBPF_SRC := $(abspath ../../lib/bpf) -INCLUDES := -I$(OUTPUT) -I$(abspath ../../lib) +BPFOBJ := $(OUTPUT)/libbpf.a +BPF_INCLUDE := $(OUTPUT) +INCLUDES := -I$(BPF_INCLUDE) -I$(OUTPUT) -I$(abspath ../../lib) CFLAGS := -g -Wall # Try to detect best kernel BTF source @@ -37,7 +39,7 @@ clean: $(call msg,CLEAN) $(Q)rm -rf $(OUTPUT) runqslower -$(OUTPUT)/runqslower: $(OUTPUT)/runqslower.o $(OUTPUT)/libbpf.a +$(OUTPUT)/runqslower: $(OUTPUT)/runqslower.o $(BPFOBJ) $(call msg,BINARY,$@) $(Q)$(CC) $(CFLAGS) -lelf -lz $^ -o $@ @@ -50,7 +52,7 @@ $(OUTPUT)/%.skel.h: $(OUTPUT)/%.bpf.o | $(BPFTOOL) $(call msg,GEN-SKEL,$@) $(Q)$(BPFTOOL) gen skeleton $< > $@ -$(OUTPUT)/%.bpf.o: %.bpf.c $(OUTPUT)/libbpf.a | $(OUTPUT) +$(OUTPUT)/%.bpf.o: %.bpf.c $(BPFOBJ) | $(OUTPUT) $(call msg,BPF,$@) $(Q)$(CLANG) -g -O2 -target bpf $(INCLUDES) \ -c $(filter %.c,$^) -o $@ && \ @@ -73,9 +75,9 @@ $(OUTPUT)/vmlinux.h: $(VMLINUX_BTF_PATH) | $(OUTPUT) $(BPFTOOL) fi $(Q)$(BPFTOOL) btf dump file $(VMLINUX_BTF_PATH) format c > $@ -$(OUTPUT)/libbpf.a: | $(OUTPUT) +$(BPFOBJ): | $(OUTPUT) $(Q)$(MAKE) $(submake_extras) -C $(LIBBPF_SRC) \ - OUTPUT=$(abs_out)/ $(abs_out)/libbpf.a + OUTPUT=$(abspath $(dir $@))/ $(abspath $@) $(DEFAULT_BPFTOOL): $(Q)$(MAKE) $(submake_extras) -C ../bpftool \