Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7545085ybl; Thu, 16 Jan 2020 01:15:36 -0800 (PST) X-Google-Smtp-Source: APXvYqxpPRX85G8CeUBVr0UwL7wjeKR6jUF9rueYUwh5Qo1YMgWJLAS9JQQaZ/6Tcylx9unc1tA0 X-Received: by 2002:aca:45c1:: with SMTP id s184mr3423388oia.158.1579166135976; Thu, 16 Jan 2020 01:15:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579166135; cv=none; d=google.com; s=arc-20160816; b=VlpFY76SkKsEoW4K2GVIWuCeDbjS/hOAUSvwIfS03PuJh47JmLKD4TrZmFws/GXeBO //dhWpbwfzo40xDflqxHYMz3RBbxIC6/fN6UhdLydMTJJQfzvNOZpKE5AC50guB1XGVv 68rXIZx9A3Nro7nhmR28CgQuJYP+Px39r63ie2MNMEKsV4EGoTBFgNudrNBmJKg6qPsz qrrY+D2kFnzbPFpGXHvE1V0P7lrpoCuECA5OR+0FLcqa6sIXSSPQMmOSvYCGzogkb59m TkUvsoWWk4LuwXmBFFCcNeZHPsIPt+RTO4WKCPG8PWTB6/i6QfLH9Nhyo1LYIh7//Iw7 r8lA== 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 :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=Y2sHZjFM/LF4FSRl9k3ji7wAimUlmv4VENghwEoHHns=; b=fd4NnESF1dOyCr3yJdSkrFZ8kgzqUAZYonR3llUW2UpPWnli218IN8fufaTzmZUDzc hSkkB1ia+8AbUdODmQ8gTvOsP+K7SMz87jXv3oWBJB+U8JRYavOwR+ahh6VtWOeBfek6 8X2FzojBQ/C276FJucyik0TuSs2rztjt5B/xNvrhTegPyBXfJRAE4pKYQoDm64DhdTzt L1/1C4G+c/FhlW/RWFqFrkLrtZpjqhOU0EeJVvSMDcyRPEiwdNza949lPGQW9KLMgy4T ODj7tQqSMbgbko21JidHAQs3jh36PGp8p2qkIIM23ECNjOy3MF4hitl5e5TAttqmrkMQ CWNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gLjc4dSS; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d20si12393469otq.157.2020.01.16.01.15.23; Thu, 16 Jan 2020 01:15:35 -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=@redhat.com header.s=mimecast20190719 header.b=gLjc4dSS; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730731AbgAPJF3 (ORCPT + 99 others); Thu, 16 Jan 2020 04:05:29 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:31089 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730627AbgAPJF1 (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-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-350-KRtKEoJ9OV27gZgd9m7XPw-1; Thu, 16 Jan 2020 04:05:24 -0500 X-MC-Unique: KRtKEoJ9OV27gZgd9m7XPw-1 Received: by mail-lf1-f70.google.com with SMTP id f22so3744333lfh.4 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=mMRHMHmmWCIxkTr1P3amOwpaFN6MgtOJiXUwc61Lw+40Q5mRY95ceTui9kc13b5q2O A+oioNCMQJot4HUntqfL8XfuROz1NCYHZRdmiAnbdya+0s8mY524FcCmzNABF3l8iFYZ iZX5BTC/h3R01CzBnbshkdQ7hl2U4TawV+aPj85vohxh4Avh0g3XAh5ob3S9o0SOwf2k 51szw8Dda34F9yTi6p0aKBEQeXWp7v+AwSOYPIZLFeNpzBZcSa98ISaPcrnMOvCKPU8y RY7Qqb40l86row10/DloCNX6oFInU1VUzAHxi7KCluXWvJah2AMAe1YfhAaHDy5QyDVK DF4A== X-Gm-Message-State: APjAAAVP3bpMfR0y7OZdA8K+Mqzf6kGk/KP5OQ3Onh5TWQc7+dTSlBXq 7TfS2JFJOlUZ0wqvsLJm1e+x/1liwCRMlVzcHuf91axnoMEjX7m1SEWHVu7X3kbkV4Zb+35/3TZ 7QGeIggfRxJ44bWYUo8O3E2Ft X-Received: by 2002:a19:84d:: with SMTP id 74mr1827723lfi.122.1579165522741; Thu, 16 Jan 2020 01:05:22 -0800 (PST) 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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