Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1566265ybl; Mon, 2 Dec 2019 05:20:52 -0800 (PST) X-Google-Smtp-Source: APXvYqw4cyWjta2SlrR1QgiWrSQLAEOIVlchvCnByWLbyuAnljRZGZ7lzvneoxEeBlDJljFd+Jf8 X-Received: by 2002:a17:906:2885:: with SMTP id o5mr4857064ejd.154.1575292852142; Mon, 02 Dec 2019 05:20:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575292852; cv=none; d=google.com; s=arc-20160816; b=jaxWTLxuO7Ut8Gh/rjy1q8SmlE8BDwZ737OT15xSeL9DLaVGs9uWyiB5BotNcuPf7J 6XrK9wXMMLa3bCfC/X6jTBS9U8RWr8oVu/V7q7Sd8LDYSRxB22KQME+/CS67v5u0PAnF 6GFV3U0I+cXkiYaCTGuYi1vwX0n/+yyP+UOyCU1NwbcGeYXHwmIgGjCTCeuz7oc4lrhu I9Dx0YR3H3JURxCNYhq0I8149EhuTm9kmSefjr4r2g8RLKaHJNY15sqTe7Df3nY4G19f yrwT+BYl7KMg8ni7/0ZBImSuvbgid8gPsfQm3MnuixbuH98AttjxBNmDntYt0R8s9iF5 8g/Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=v/OEC3ZhPlQAfkyvd3vSsIWV7gp6hI7m4rzo2EEfSDE=; b=uwXfo5U2JdGuV/RtLLB4pyOH8TO7fq+ZseeSAYHTt6XlERgpTdFPBSR0qdcUQRtPQB IYSNJh+BuRSaFA1UPUjMbiKlj847+pncqHndSBQT1OhHmnvRhrFm6c7I1SeYBZhkh/Vw fFtjGpjfh9LaxK9sY0KAII46Pe9L5mfwukM7f7EnxhGuPU9TaASxdjXc6LlO6xDktiSz GauaPnv7+VsgDNWfAxAVXYKH+U4Sp9d1O4M4jfwT4QymWjllVyq69Co8Wx2YmEsfDHVK Zbowx9bKeYl5PRk+XgfEXYCs1MS6p4MIVIhFiWlp84Bn6mmGWdsctkAsxhgCgjiRpDHt /YaQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e20si146491ejt.218.2019.12.02.05.20.26; Mon, 02 Dec 2019 05:20:52 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727521AbfLBNTF convert rfc822-to-8bit (ORCPT + 99 others); Mon, 2 Dec 2019 08:19:05 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:37209 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727398AbfLBNTE (ORCPT ); Mon, 2 Dec 2019 08:19:04 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-97-NRPZF_c0PLuMKmVQmC_W2A-1; Mon, 02 Dec 2019 08:19:02 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8CF7910054E3; Mon, 2 Dec 2019 13:18:59 +0000 (UTC) Received: from krava.redhat.com (unknown [10.43.17.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 26DB5600C8; Mon, 2 Dec 2019 13:18:55 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , netdev@vger.kernel.org, bpf@vger.kernel.org, Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan , =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= , Jesper Dangaard Brouer , Daniel Borkmann , Alexei Starovoitov , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , Quentin Monnet Subject: [PATCH 1/6] perf tools: Allow to specify libbpf install directory Date: Mon, 2 Dec 2019 14:18:41 +0100 Message-Id: <20191202131847.30837-2-jolsa@kernel.org> In-Reply-To: <20191202131847.30837-1-jolsa@kernel.org> References: <20191202131847.30837-1-jolsa@kernel.org> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: NRPZF_c0PLuMKmVQmC_W2A-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adding LIBBPF_DIR compile variable to allow linking with libbpf installed into specific directory: $ make -C tools/lib/bpf/ prefix=/tmp/libbpf/ install_lib install_headers $ make -C tools/perf/ LIBBPF_DYNAMIC=1 LIBBPF_DIR=/tmp/libbpf/ VF=1 It might be needed to clean build tree first because features framework does not detect the change properly: $ make -C tools/build/feature clean $ make -C tools/perf/ clean Signed-off-by: Jiri Olsa --- tools/perf/Makefile.config | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index c90f4146e5a2..eb9d9b70b7d3 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -22,6 +22,14 @@ include $(srctree)/tools/scripts/Makefile.arch $(call detected_var,SRCARCH) +ifndef lib + ifeq ($(SRCARCH)$(IS_64_BIT), x861) + lib = lib64 + else + lib = lib + endif +endif # lib + NO_PERF_REGS := 1 NO_SYSCALL_TABLE := 1 @@ -484,11 +492,22 @@ ifndef NO_LIBELF CFLAGS += -DHAVE_LIBBPF_SUPPORT $(call detected,CONFIG_LIBBPF) + # for linking with debug library run: + # make DEBUG=1 LIBBPF_DIR=/opt/libbpf + ifdef LIBBPF_DIR + LIBBPF_CFLAGS := -I$(LIBBPF_DIR)/include + LIBBPF_LDFLAGS := -L$(LIBBPF_DIR)/$(lib) + FEATURE_CHECK_CFLAGS-libbpf := $(LIBBPF_CFLAGS) + FEATURE_CHECK_LDFLAGS-libbpf := $(LIBBPF_LDFLAGS) + endif + # detecting libbpf without LIBBPF_DYNAMIC, so make VF=1 shows libbpf detection status $(call feature_check,libbpf) ifdef LIBBPF_DYNAMIC ifeq ($(feature-libbpf), 1) EXTLIBS += -lbpf + CFLAGS += $(LIBBPF_CFLAGS) + LDFLAGS += $(LIBBPF_LDFLAGS) else dummy := $(error Error: No libbpf devel library found, please install libbpf-devel); endif @@ -1037,13 +1056,6 @@ else sysconfdir = $(prefix)/etc ETC_PERFCONFIG = etc/perfconfig endif -ifndef lib -ifeq ($(SRCARCH)$(IS_64_BIT), x861) -lib = lib64 -else -lib = lib -endif -endif # lib libdir = $(prefix)/$(lib) # Shell quote (do not use $(call) to accommodate ancient setups); @@ -1108,6 +1120,7 @@ ifeq ($(VF),1) $(call print_var,LIBUNWIND_DIR) $(call print_var,LIBDW_DIR) $(call print_var,JDIR) + $(call print_var,LIBBPF_DIR) ifeq ($(dwarf-post-unwind),1) $(call feature_print_text,"DWARF post unwind library", $(dwarf-post-unwind-text)) -- 2.21.0