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.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 00417C33CB1 for ; Thu, 16 Jan 2020 09:05:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CA6C3207FF for ; Thu, 16 Jan 2020 09:05:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="gLjc4dSS" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730623AbgAPJF2 (ORCPT ); Thu, 16 Jan 2020 04:05:28 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:35002 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730613AbgAPJF1 (ORCPT ); Thu, 16 Jan 2020 04:05:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579165525; 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=Y2sHZjFM/LF4FSRl9k3ji7wAimUlmv4VENghwEoHHns=; b=gLjc4dSSBSChSzyhSVVEEPe0NDlIrnGAntClMr31LNz68cbkHU0Qq13Sbg2sXsTpZ9ohYc bYfgnrdTk9k+rJyagOoX/6NrabMcrmrxQ3ebaVMUCC28D1aQFbKqw1LKrSlWdXI9PufmtC UEbFZHaf4psDN4FHI1P2nwTUMrg8kh0= Received: from mail-lf1-f72.google.com (mail-lf1-f72.google.com [209.85.167.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-2-M1AzeaXQNmqH1VwHdhH62g-1; Thu, 16 Jan 2020 04:05:24 -0500 X-MC-Unique: M1AzeaXQNmqH1VwHdhH62g-1 Received: by mail-lf1-f72.google.com with SMTP id y21so3723356lfl.11 for ; Thu, 16 Jan 2020 01:05:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=Y2sHZjFM/LF4FSRl9k3ji7wAimUlmv4VENghwEoHHns=; b=Okj+A5f+Ad6dEjzcTZagnVDZU4jtylRLgPEiD5WqIkmNih54BmWytItv8hXFa1lf84 ftgHbMf1AMUiGHhN6yVyv0Ft9SY9gs0m9fS4McTn+Rzv2CnO8fipu8RoS86gewVbVimS iKciJD0rBFy2594nEE3ucdKMfZWy1n+bAa+NW5WgPCniy0df5UozJycrZnvWny1VBUT/ Vk3DEgR4uVhixzoPZE6nmveZmQh5v2/hCbHFIOaQYPJDHrdTrzx0QuH6JtK7jmWAMmHz 4Uw86iGnWwUQNsShKcJ1Thg6Fz40gF6eMYxa2iLU+kefk2oapwALbXcTjqw9nKyhE5Sf UBWw== X-Gm-Message-State: APjAAAXoqT+4c0369gofzG1Luy1yKOuO5ZLFgWJHITICWkytRXeyhTA3 K1VH989Ojhnw4nTEBgAY9UWaFSuwkNmn4g+RoDwp0BI4Ky/ssIw/C0jrPNdhhEicojOeUjn/4qN 4tb8m3C0TjUKkJqaGnkkSsA== X-Received: by 2002:a19:84d:: with SMTP id 74mr1827732lfi.122.1579165522780; Thu, 16 Jan 2020 01:05:22 -0800 (PST) X-Google-Smtp-Source: APXvYqxtYKtFhKWeWSmtkAXlwptUVTHXo0/PpHdSJDlJjU/1gqMfUwxDd/orLS0cMSYGbPmKFM/PCA== X-Received: by 2002:a19:84d:: with SMTP id 74mr1827704lfi.122.1579165522538; Thu, 16 Jan 2020 01:05:22 -0800 (PST) Received: from alrua-x1.borgediget.toke.dk ([45.145.92.2]) by smtp.gmail.com with ESMTPSA id a14sm9871321lfh.50.2020.01.16.01.05.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jan 2020 01:05:20 -0800 (PST) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 579641804D6; Thu, 16 Jan 2020 10:05:19 +0100 (CET) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: Andrii Nakryiko 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 Subject: Re: [PATCH bpf-next v2 02/10] tools/bpf/runqslower: Fix override option for VMLINUX_BTF In-Reply-To: References: <157909756858.1192265.6657542187065456112.stgit@toke.dk> <157909757089.1192265.9038866294345740126.stgit@toke.dk> <87v9pctlvn.fsf@toke.dk> X-Clacks-Overhead: GNU Terry Pratchett Date: Thu, 16 Jan 2020 10:05:19 +0100 Message-ID: <87a76nu5yo.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org 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 B= TF >> >> from. The build fails with an error message to override the location = by >> >> setting the VMLINUX_BTF variable if autodetection fails. However, the >> >> Makefile doesn't actually work with that override - the error message= is >> >> still emitted. >> > >> > Do you have example command with VMLINUX_BTF override that didn't work >> > (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 help > 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 ex= plicitly". Stop. $ make VMLINUX_BTF=3D~/build/linux/vmlinux V=3D1 Makefile:18: *** "Can't detect kernel BTF, use VMLINUX_BTF to specify it ex= plicitly". 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 explicitl= y") 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... :) -Toke