From mboxrd@z Thu Jan 1 00:00:00 1970 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=-0.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 AA41EC33CB6 for ; Thu, 16 Jan 2020 17:15:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7B3C1246B2 for ; Thu, 16 Jan 2020 17:15:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DujDkG5W" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391104AbgAPRPA (ORCPT ); Thu, 16 Jan 2020 12:15:00 -0500 Received: from mail-qk1-f196.google.com ([209.85.222.196]:43600 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391101AbgAPRO7 (ORCPT ); Thu, 16 Jan 2020 12:14:59 -0500 Received: by mail-qk1-f196.google.com with SMTP id t129so19796598qke.10; Thu, 16 Jan 2020 09:14:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=qbPesbI6+o4JGTWaTpLZljTSTXaCbDPO7M6CK9Z7jy0=; b=DujDkG5W3ILpYM8qyT0dAcZJClk1ACfv/flsghX/egJkq4WsWkCtz+kypqB1mcFslN uDXKIvfdULD4F80JGgtROcDeW1eHH825VujncNlxJoLvi91ZMb7rGYi6KoVPXitLX6ty u90XUpHcsUCTK0dKYWhkjIb6zzFW7fRHX5we0nzj8d/clbEcl4H3OrL3VGB1gXmxorEK KYfP0As9yW35L0kqcdFLDRmRNbtk0tdGhY5Dkni8Pv2sjPewW92s1Vl0SKCEQiEkkYZI aQEnAchcYdP+TGnVTg0I81U5jTnEQj3onFKb9erpdMhab2+L4nNJXpnIewRzpj+eFbsQ 0CLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=qbPesbI6+o4JGTWaTpLZljTSTXaCbDPO7M6CK9Z7jy0=; b=EdVXhet3OBYS+raDRU+w0vw7BHT6JkYr+Z/760/yxGUPWp1S+vvd9sA40D3i2FaDJr 0MxD19pPOdSBjmj1cfSVPt2stTGenOZxrUMh2c8YEJGVGN5EFXy9U6uvuhN0SrngvVvl ecvly5J14MBF9XeR9gWtYAlMbyljGc+dPULe3aCFfi6BRBribLPv/uthlHKw97X2S3lc Wbj0K2lWAdshNLLtxFmCCG5LsQuchA7TbYlVn8yI0DzHo/HuWwP66ifekuVAImQAPJZL mm6vDiJzxiNhHmrVr0clRaS6R3+X16Jf8IVU7eLY+j1Tz3hLlNWF/V/JbkLyMtQNLTCz C8gg== X-Gm-Message-State: APjAAAUBNF+Ur4sOO6yAvDQr2mKsdWlAIx5t/V9o9xO97pgKhn8O5pWf PVAQKdsZVq6i6QUM1bvwOyYHWonPacr+ITcD+j0= X-Google-Smtp-Source: APXvYqye2xzTJ5xPc92metlBwExlrGUNWRrkmB/ybM14ARqiI3YrIFXjSAmln3PIxwPT0fU+QKgzeO269EhwuJ8/F3g= X-Received: by 2002:a05:620a:5ae:: with SMTP id q14mr29954210qkq.437.1579194898228; Thu, 16 Jan 2020 09:14:58 -0800 (PST) MIME-Version: 1.0 References: <157909756858.1192265.6657542187065456112.stgit@toke.dk> <157909757089.1192265.9038866294345740126.stgit@toke.dk> <87v9pctlvn.fsf@toke.dk> <87a76nu5yo.fsf@toke.dk> In-Reply-To: <87a76nu5yo.fsf@toke.dk> From: Andrii Nakryiko Date: Thu, 16 Jan 2020 09:14:47 -0800 Message-ID: Subject: Re: [PATCH bpf-next v2 02/10] tools/bpf/runqslower: Fix override option for VMLINUX_BTF To: =?UTF-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= Cc: Alexei Starovoitov , 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 , Networking , bpf , open list , linux-rdma@vger.kernel.org, "open list:KERNEL SELFTEST FRAMEWORK" , clang-built-linux@googlegroups.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On Thu, Jan 16, 2020 at 1:05 AM Toke H=C3=B8iland-J=C3=B8rgensen wrote: > > Andrii Nakryiko writes: > > > On Wed, Jan 15, 2020 at 2:06 PM Toke H=C3=B8iland-J=C3=B8rgensen wrote: > >> > >> Andrii Nakryiko writes: > >> > >> > On Wed, Jan 15, 2020 at 6:13 AM Toke H=C3=B8iland-J=C3=B8rgensen wrote: > >> >> > >> >> From: Toke H=C3=B8iland-J=C3=B8rgensen > >> >> > >> >> The runqslower tool refuses to build without a file to read vmlinux= BTF > >> >> from. The build fails with an error message to override the locatio= n by > >> >> setting the VMLINUX_BTF variable if autodetection fails. However, t= he > >> >> Makefile doesn't actually work with that override - the error messa= ge is > >> >> still emitted. > >> > > >> > Do you have example command with VMLINUX_BTF override that didn't wo= rk > >> > (and what error message was emitted)? > >> > >> Before this patch: > >> > >> $ cd ~/build/linux/tools/bpf/runqslower > >> $ make > >> Makefile:18: *** "Can't detect kernel BTF, use VMLINUX_BTF to specify = it explicitly". Stop. > >> > >> $ make VMLINUX_BTF=3D~/build/linux/vmlinux > >> Makefile:18: *** "Can't detect kernel BTF, use VMLINUX_BTF to specify = it explicitly". Stop. > > > > Ok, so this is strange. Try make clean and run with V=3D1, it might hel= p > > to debug this. This could happen if ~/build/linux/vmlinux doesn't > > exist, but I assume you double-checked that. It works for me just fine > > (Makefile won't do VMLINUX_BTF :=3D assignment, if it's defined through > > make invocation, so your change should be a no-op in that regard): > > > > $ make clean > > $ make VMLINUX_BTF=3D~/linux-build/default/vmlinux V=3D1 > > ... > > .output/sbin/bpftool btf dump file ~/linux-build/default/vmlinux > > format c > .output/vmlinux.h > > ... > > > > Wonder what your output looks like? > > $ make clean > Makefile:18: *** "Can't detect kernel BTF, use VMLINUX_BTF to specify it = explicitly". Stop. > $ make VMLINUX_BTF=3D~/build/linux/vmlinux V=3D1 > Makefile:18: *** "Can't detect kernel BTF, use VMLINUX_BTF to specify it = explicitly". Stop. > > Take another look at the relevant part of the makefile: > > ifneq ("$(wildcard /sys/kernel/btf/vmlinux)","") > VMLINUX_BTF :=3D /sys/kernel/btf/vmlinux > else ifneq ("$(wildcard /boot/vmlinux-$(KERNEL_REL))","") > VMLINUX_BTF :=3D /boot/vmlinux-$(KERNEL_REL) > else > $(error "Can't detect kernel BTF, use VMLINUX_BTF to specify it explici= tly") > endif > > That if/else doesn't actually consider the value of VMLINUX_BTF; so the > override only works if one of the files being considered by the > auto-detection actually exists... :) Ah, right, unconditional $(error), completely missed that few times, thanks= ! > > -Toke >