Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8234823ybl; Thu, 16 Jan 2020 13:04:09 -0800 (PST) X-Google-Smtp-Source: APXvYqxjGO00IJxIoEih4GjSxaCtbFXyuKtpTnT+oMAEaK2eOLQfbb6dCasqb8UVqfOBxsnvq2Gr X-Received: by 2002:a05:6830:15ca:: with SMTP id j10mr3652163otr.190.1579208649242; Thu, 16 Jan 2020 13:04:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579208649; cv=none; d=google.com; s=arc-20160816; b=yyzNCxVkY+TtsMT/BEv9Lrs/YNTpxvNW3FP3vVFBKCoFIk72KN4nzA+ixgTX0ogTtg 5zPjTX2JzwRwjo1VrJKEwFmVaUDhwLN1EvGzMP9WkLXLi1XCkwcIYaNUfZmCWVlVDDFE qJAKLb8jeHAc6Jb9hX2hL3tUBAwdfJWeLUCDvAc9hqe/1nNiwscIXdpCevI3DaCaSObA cuha4oZhLaDTNCC8PNJwVDIiKohm2f5d8aOWI17jFAX+suOSWa1+Lz5PSpDN/OMdymH1 q6zJOuOJw+sdj7a5mZiPzDnVKhQGM4lqvIak+Q0FQo7diQGkk5axZictaCMugTvtyRw4 YUcA== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=qbPesbI6+o4JGTWaTpLZljTSTXaCbDPO7M6CK9Z7jy0=; b=m3ArapbOIb8hZmd8mVRpTQ7VasKQssIokcBLiVEe2cY59dTkJWEDYzgLvBzfbulAuf HV9pWcbGjCbAFxLGP9GjjyoZhzXfFpHFnDHfNx3SbFG1pLorsBnmfv9HqUx3jET8yPET 9ucpJMHzQL7QF72fM8SkgDdyLFbiZsd+CDJ185WwlnjOSeDlInbScvC5KT1ryar18xKE kgXX48Nog7KqFxA+I72XhD03RcY/6hgyf1+4btNZCQBASH1PU0CcOXci/6TxgRpr5w4f R7vZbToLjrDxhKPf7vIFHQSByb0Pqf0oTDZUtgYsBJTZKJyK3Uh9luB/iuSt6shQreSG OdrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DujDkG5W; 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 s6si13123073otp.126.2020.01.16.13.03.56; Thu, 16 Jan 2020 13:04:09 -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=DujDkG5W; 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 S2391135AbgAPRPI (ORCPT + 99 others); Thu, 16 Jan 2020 12:15:08 -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-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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 >