Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2329246rwb; Thu, 17 Nov 2022 09:19:08 -0800 (PST) X-Google-Smtp-Source: AA0mqf52bb3245E1Sr8hS1BsWYQ6k7LHUglGdzATwR1GhI0+PMh9rSVWOi8OMqKw8B19ejklhYNq X-Received: by 2002:a05:6402:1107:b0:463:9b53:cbf6 with SMTP id u7-20020a056402110700b004639b53cbf6mr3095650edv.173.1668705547938; Thu, 17 Nov 2022 09:19:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668705547; cv=none; d=google.com; s=arc-20160816; b=tiUcJ6IysSnGbkMCJ9SKbH03iAVgwwVlrQy5skQjy70OVZrQTylZRRd9LvX3dN4+48 N2I4ejw1LS1IpduXMoK17lA5LWkG6Vr11T9tm6eU8CHo5rRbn1GPubNCje6L37OxxFxb 6m93vvhwQEpIDHLnYSmTYtk5OXcGtnJB4S0lhvneaCAMdm45VGlRnsIUo9s/pkbztDMg iSvTOalmc1kQ1Mi4NlRX7u6UDZh98iPK4ZSde4AhCSXGah36WgCb8CgrCiwJimKwdM46 mjzm62oFcwQtmdsw1QapDIMuNk1d02FAtwjSXnjYdXxBv9XRUn931Nn66nKQY7UsHf3t PEhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Jd4p2I7yGB7uWXZ+VfF85da9wsvFoB37KC6Iup0lcCs=; b=qvi8c+fnYA+S+nfZad4zLIFDlExX5Y+/fGx+j8o8j74/ZL5bHmkA4MZr4JIkrav0hp 981DxviP2A+zd1oZjIdxcL59ShnGJXyBtPWLIMomT+6EKr+tMmhHM1d59bXj+7HtIbO9 h5lWcWk53UzXRgv4xSFG/6i3UhHelhEM8LnXZ3ApQzfY+wQ9vUBiEF763FEeYa5tXtmO OqU8NtZywAeOkXeFhknejbLbU5fa0xyBoEm2mEG3uXG1hHJUyvIsA0D/625Iz+3SQgIe lfY9nAnhWvnibL1pSXzfBhD2h9d8P6BjnVBTvKC9QzfZW22347KFfa+28D4hb0oB7/Wy hJTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mItNrmeK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eg23-20020a056402289700b00461b2c3c4acsi1112808edb.515.2022.11.17.09.18.44; Thu, 17 Nov 2022 09:19:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mItNrmeK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S240213AbiKQRAm (ORCPT + 93 others); Thu, 17 Nov 2022 12:00:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240176AbiKQRAe (ORCPT ); Thu, 17 Nov 2022 12:00:34 -0500 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0E6874AAE for ; Thu, 17 Nov 2022 09:00:27 -0800 (PST) Received: by mail-ed1-x536.google.com with SMTP id e13so3442711edj.7 for ; Thu, 17 Nov 2022 09:00:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Jd4p2I7yGB7uWXZ+VfF85da9wsvFoB37KC6Iup0lcCs=; b=mItNrmeKOWJic33I0H+R7Or2QVOdG/EUlgrUh0J+bFQbDVzXktteuvM/pncfMeeLln GgDUHHweavvIurNhrkVQ+ZTVLLKLc7v0G89NUj0FPZi7ciRWGEZQxBBfCEUNCvPDi7ai sudckKEcfF60Zxz++RhsyMWtwzjS9Owjyu9LBZSoxElgYJWFSjm1csNRrxJh2y+wDGua +0d5sQWVndemdjYSbFlnpxLKBFVUFiAqExuaQPu40+NqOjkaAzAQNyU0gK3OHQgPk5ib k3WitKkGTkRoMq36fblaqhKrsEYlAeT6ZV8tSgiDGp4zV3hvIqj1tu4FfHljRsAHkl6l t5qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Jd4p2I7yGB7uWXZ+VfF85da9wsvFoB37KC6Iup0lcCs=; b=Uya05r79rSZnsXHl3Ye8WddyH6tv4t2oeh0hT8m5iRBBbt3e5EM0RxPcT6Qw4PvekZ ydaXu7Tg2d9bWfYuzjGYWgaNhqzQq29lQOgNyyYh2DcNJ1D+HRcZOgYUiiCY2cg0Qwkg h9ipw668VrYD8A/+ugIgihfja5jyLrHQNXRMiFSD3kTNvRSxqN8hfXBunkl6Wiiy7XTx 0a04SVEu72zBVceAR/PeU1nVJiD7f29DGrX+NF6v4pbZ4jn5GppEg5raY3QtiLc60Akk N5SoW0kH9WzmT/k1e+Fu0nhzjGmMycuf7F1cbggUxbqs7dqw7UOsyUZTmkUFaNwu5CSL XcaA== X-Gm-Message-State: ANoB5pl2G7BO50K+Q28r3BH1DrAk+rTxlIeP0gmGA29zUdzNV4fHvdyI 0HOdCNiqwJ8qpgkbhXS4eqfhT/ncR1vqqhYrl9s= X-Received: by 2002:a05:6402:2421:b0:461:524f:a8f4 with SMTP id t33-20020a056402242100b00461524fa8f4mr1050230eda.260.1668704426099; Thu, 17 Nov 2022 09:00:26 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Andrii Nakryiko Date: Thu, 17 Nov 2022 09:00:14 -0800 Message-ID: Subject: Re: Building perf with BUILD_BPF_SKEL=1 To: Arnaldo Carvalho de Melo Cc: Namhyung Kim , Song Liu , Adrian Hunter , Ian Rogers , Jiri Olsa , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 17, 2022 at 5:11 AM Arnaldo Carvalho de Melo wrote: > > Hi guys, > > At some point we should switch to building with BPF skels by > default as there are many features that are implemented that way in > perf: > > =E2=AC=A2[acme@toolbox perf]$ ls -la tools/perf/util/bpf_skel/ > total 464 > drwxr-xr-x. 1 acme acme 334 Oct 14 10:28 . > drwxr-xr-x. 1 acme acme 7380 Nov 17 09:22 .. > -rw-r--r--. 1 acme acme 5581 Oct 14 10:28 bperf_cgroup.bpf.c > -rw-r--r--. 1 acme acme 1764 Mar 14 2022 bperf_follower.bpf.c > -rw-r--r--. 1 acme acme 1438 Mar 14 2022 bperf_leader.bpf.c > -rw-r--r--. 1 acme acme 285 Mar 14 2022 bperf_u.h > -rw-r--r--. 1 acme acme 2290 Mar 14 2022 bpf_prog_profiler.bpf.c > -rw-r--r--. 1 acme acme 2164 Mar 27 2022 func_latency.bpf.c > -rw-r--r--. 1 acme acme 53 Nov 6 2021 .gitignore > -rw-r--r--. 1 acme acme 9017 Sep 27 09:29 kwork_trace.bpf.c > -rw-r--r--. 1 acme acme 3691 Oct 6 08:03 lock_contention.bpf.c > -rw-r--r--. 1 acme acme 6102 Oct 4 08:55 off_cpu.bpf.c > =E2=AC=A2[acme@toolbox perf]$ > > > Since I'm finally using the Firefly ARM board the fine folks at > Librecomputer gave us at Kernel Recipes, I'm noticing issues as I go on > adding the components, for instance: > > /bin/sh: 2: llvm-strip: not found > make[2]: *** [Makefile.perf:1136: /tmp/build/perf/util/bpf_skel/.tmp/bper= f_follower.bpf.o] Error 127 > make[2]: *** Waiting for unfinished jobs.... > /bin/sh: 2: llvm-strip: not found > make[2]: *** [Makefile.perf:1136: /tmp/build/perf/util/bpf_skel/.tmp/bpf_= prog_profiler.bpf.o] Error 127 > /bin/sh: 2: llvm-strip: not found > make[2]: *** [Makefile.perf:1136: /tmp/build/perf/util/bpf_skel/.tmp/bper= f_leader.bpf.o] Error 127 > /bin/sh: 2: llvm-strip: not found > make[2]: *** [Makefile.perf:1136: /tmp/build/perf/util/bpf_skel/.tmp/func= _latency.bpf.o] Error 127 > /bin/sh: 2: llvm-strip: not found > make[2]: *** [Makefile.perf:1136: /tmp/build/perf/util/bpf_skel/.tmp/bper= f_cgroup.bpf.o] Error 127 > make[1]: *** [Makefile.perf:240: sub-make] Error 2 > make: *** [Makefile:113: install-bin] Error 2 > make: Leaving directory '/home/acme/git/perf/tools/perf' > > So this is just me taking notes, feel free to fix it if you want ;-) > > acme@roc-rk3399-pc:~/git/perf$ cat /etc/os-release > PRETTY_NAME=3D"Ubuntu 22.04.1 LTS" > NAME=3D"Ubuntu" > VERSION_ID=3D"22.04" > VERSION=3D"22.04.1 LTS (Jammy Jellyfish)" > VERSION_CODENAME=3Djammy > ID=3Dubuntu > ID_LIKE=3Ddebian > HOME_URL=3D"https://www.ubuntu.com/" > SUPPORT_URL=3D"https://help.ubuntu.com/" > BUG_REPORT_URL=3D"https://bugs.launchpad.net/ubuntu/" > PRIVACY_POLICY_URL=3D"https://www.ubuntu.com/legal/terms-and-policies/pri= vacy-policy" > UBUNTU_CODENAME=3Djammy > acme@roc-rk3399-pc:~/git/perf$ > > perf should check for that and give per-distro hints on how to overcome > those, for instance, on ubuntu I had to: there is no need to use llvm-strip anymore, if you use BPF static linking (even if for single .bpf.o file). We do `bpftool obj gen` and that effectively strips away DWARF. > > acme@roc-rk3399-pc:~/git/perf$ dpkg -L llvm-14 | grep strip > /usr/share/man/man1/llvm-strip-14.1.gz > /usr/bin/llvm-bitcode-strip-14 > /usr/bin/llvm-strip-14 > /usr/lib/llvm-14/bin/llvm-bitcode-strip > /usr/lib/llvm-14/bin/llvm-strip > acme@roc-rk3399-pc:~/git/perf$ export PATH=3D$PATH:/usr/lib/llvm-14/bin > > > and now: > [...]