Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4364793ybc; Tue, 26 Nov 2019 07:50:21 -0800 (PST) X-Google-Smtp-Source: APXvYqxk+tXttVQWqsQVhxhftAJPXli01RjA2WNNkXBJQInMkcrJ1/ummgB3dnBJwm1UsTahqSnM X-Received: by 2002:a17:906:601:: with SMTP id s1mr44477558ejb.287.1574783421419; Tue, 26 Nov 2019 07:50:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574783421; cv=none; d=google.com; s=arc-20160816; b=OMrFVaKqowj+y5fZhcvqY6/N09hRnDGi9S4zeFsER9Dp/nXWrYpSVVhCkG4TFPOmbb 1rnB2uhwFRlAnZM6jXZCSn59EJJww2TQbJ0Q3jV/2l/V5sOJSCY1DTixGKQGR1zUwAbG ouDY8En7ZLLWwQVM/qqJrz55PTN7m5RKrxXOLe5UdqUT4KH48mSX+jKm3z3OemPAz842 J2hxMU7w6XtqBA+HEuaaHevTUSo1dSvKNU+c27+XkYX17I8JUvf3fCyAB/Adm9A0oeO2 RldwFmcnZ3baqaOxGX8Kky4cf7M5UVg7yeWWeLZJXjQfT6Uj6qJH9JMylFpYPLwCIofU LmGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:date:from:dkim-signature; bh=HboSwltjR5muBc5SJne7q7ifN5p3DeZfc4hjWq0BaeQ=; b=I3jO4Hlv0sh6Mj0M6x1j4lyZi/8/fpKDkJso3xTIWOwMeXvtOVEjn4e3qqbyKbgKR2 Uw8zGUl+r7CviUJ2UVe4qUAxE3+7q7u03NkmWkVUJWy2Bw7SnoAeJ5/0Mip2JRmcBGT2 hHYYsRNd6X6JFdNWR7o1y2RqtZMsgayBjU08O/QrIISy2QZyGfdbQtmfaoBVVoq7tKfv cpCEGVil5jSkeqOvm7nwjO6lMhPv4c0oDJCstXLteJ16gWbTcb7MWlHzRq43e0NAgxMf 61Ga38CQTcJyGZKYtcGWdUqSSBC12s+OSJLIwbX/0RUHNh2sUp7AB77cNXzuO9DxxbuU hotg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="kaAQET/u"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e1si7117024ejt.319.2019.11.26.07.49.56; Tue, 26 Nov 2019 07:50:21 -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=@gmail.com header.s=20161025 header.b="kaAQET/u"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727756AbfKZNiL (ORCPT + 99 others); Tue, 26 Nov 2019 08:38:11 -0500 Received: from mail-qk1-f194.google.com ([209.85.222.194]:32947 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727498AbfKZNiK (ORCPT ); Tue, 26 Nov 2019 08:38:10 -0500 Received: by mail-qk1-f194.google.com with SMTP id c124so11653076qkg.0; Tue, 26 Nov 2019 05:38:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=HboSwltjR5muBc5SJne7q7ifN5p3DeZfc4hjWq0BaeQ=; b=kaAQET/uWDIp4XmDhynu68XPANBorFLgucUiLEyK+yr9/2kmkc4Kd+cq0aUIBiQRSo RF4uUBx3+s2FHriY6FH/MosauvA8k0uwUSVyu4NGMq1nAe6BoyGedOJOvJenCISv174x ETPOrdDbWUuw0FKlgFAESR0WZXTbIVSOeTrpr2cNbY898M5HrRwPY7du5gb8XzTUlhaB Qq4o/R+yjk9e/4lboS6Z2OfriqJ3BJr0ui4rSx6z0+p8XPHZKjcGd2u8mZ0ebj2D2UNV BkSpPH6urxm2QEKaX2beyu9HGvDP7p04GCy5BLBmFHt9WeAScEQ0ckTnP8pcM9tHPSqA +MQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=HboSwltjR5muBc5SJne7q7ifN5p3DeZfc4hjWq0BaeQ=; b=RiuIlF2uTLwsteMKUmUEWpvlOFfEIEq5SemmJ8a6wGa/kOKOuwxWbAka9mzaGTQt4M l+0/26ZLs05LIGdObaiLrUzeAbEtNQGh+0rMXClLQyzDECUqHyCLWmEGAMk0YNcUYQAu +jnQnP2C4psmBAMQ017j1HFTW6Iu0ptFFGR0cIH1Xx4OGsP20tVSzOcMPNFvFthi3Ozc ym/vWIsyU1dL+VuUQKZVAWSXrYpA3e9KJQXdieoYVV+LqRLAXcKqKx+XqmE43oB9ow+I A2CuN/IKrw3VbbxTZl9hNAPA3CDMcCHdoxMcjGM4ThPhEE7t7ru/HtWnyHE56lSlRr+c rKbg== X-Gm-Message-State: APjAAAUA2hpAWLEVNIX7xcXYm226iVwPTeGCdcMwNCLUsw//5SO86UCA 2/sKsCFBtRvoOGUOn2+3ILo= X-Received: by 2002:a37:8285:: with SMTP id e127mr16293219qkd.62.1574775489596; Tue, 26 Nov 2019 05:38:09 -0800 (PST) Received: from quaco.ghostprotocols.net ([179.97.35.50]) by smtp.gmail.com with ESMTPSA id y24sm5069214qki.104.2019.11.26.05.38.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2019 05:38:08 -0800 (PST) From: Arnaldo Carvalho de Melo X-Google-Original-From: Arnaldo Carvalho de Melo Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id B579A40D3E; Tue, 26 Nov 2019 10:38:06 -0300 (-03) Date: Tue, 26 Nov 2019 10:38:06 -0300 To: Jiri Olsa Cc: lkml , netdev@vger.kernel.org, bpf@vger.kernel.org, Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan , Toke =?iso-8859-1?Q?H=F8iland-J=F8rgensen?= , Jesper Dangaard Brouer , Daniel Borkmann , Alexei Starovoitov , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko Subject: Re: [PATCH] perf tools: Allow to link with libbpf dynamicaly Message-ID: <20191126133806.GA19483@kernel.org> References: <20191126121253.28253-1-jolsa@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191126121253.28253-1-jolsa@kernel.org> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Tue, Nov 26, 2019 at 01:12:53PM +0100, Jiri Olsa escreveu: > Currently we support only static linking with kernel's > libbpf (tools/lib/bpf). This patch adds libbpf package > detection and support to link perf with it dynamically. > > The libbpf package status is displayed with: > > $ make VF=1 > Auto-detecting system features: > ... > ... libbpf: [ on ] > > It's not checked by default, because it's quite new. > Once it's on most distros we can switch it on. > > For the same reason it's not added to the test-all check. > > Perf does not need advanced version of libbpf, so we can > check just for the base bpf_object__open function. > > Adding new compile variable to detect libbpf package and > link bpf dynamically: > > $ make LIBBPF_DYNAMIC=1 > ... > LINK perf > $ ldd perf | grep bpf > libbpf.so.0 => /lib64/libbpf.so.0 (0x00007f46818bc000) > > If libbpf is not installed, build stops with: > > Makefile.config:486: *** Error: No libbpf devel library found,\ > please install libbpf-devel. Stop. Thanks, tested with how I build it: $ make LIBBPF_DYNAMIC=1 -C tools/perf O=/tmp/build/perf make: Entering directory '/home/acme/git/perf/tools/perf' BUILD: Doing 'make -j8' parallel build Makefile.config:493: *** Error: No libbpf devel library found, please install libbpf-devel. Stop. make[1]: *** [Makefile.perf:225: sub-make] Error 2 make: *** [Makefile:70: all] Error 2 make: Leaving directory '/home/acme/git/perf/tools/perf' $ works as well as advertised, applied. - Arnaldo