Message ID | 20221109184914.1357295-1-irogers@google.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp504041wru; Wed, 9 Nov 2022 10:51:19 -0800 (PST) X-Google-Smtp-Source: AMsMyM7f+Fy32PC76wgd9vmRMf3f0MMlmGJVaISeUPt21KC/JiUpBFMqaWY0L+q9ZcP8cEq6NU/f X-Received: by 2002:a17:902:e888:b0:186:a6be:1106 with SMTP id w8-20020a170902e88800b00186a6be1106mr60960409plg.150.1668019879129; Wed, 09 Nov 2022 10:51:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668019879; cv=none; d=google.com; s=arc-20160816; b=QkLX/+7vWX8yLoBo85px0I+RVi1XacktOj9lFK4AYkj2RarcxT486n4R9KoII5OEhX CzePwemIxTIFkamfCDECMyZ1PmoOR1MZKr8v6jUqe7lbjNP4gNajfJYtNBJEGVBpkvIZ jy1T4hI/dFxJIihQNaPfgfoxYAbgc78+cZz61RQgBKAoB4D7wwI+qW4xPUg+q2K1yJrg nVCG2KZ+hPfj6q8FOWuMYyIOF1R8SEOppWQKMGNlHCu3uTv2yrXO6I8T0cVPcDsaNtrw hy2V/S/N2hKje56Vu3InVPNSPexVHG6Mk9tCkl32BiGLMEhsRaq4Pmj023k4VlXnVsf3 Q/sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :dkim-signature; bh=lkoognfiz4T0FO9qiJqVW8CCjbYEKiYWyfXc5YQhyvU=; b=IG2gvSIKrjmgL/7acnpKes2uxwk5w3jVWCVwY9Uy7Qo2kgtwZ7ib98xf87RqfE9gBd GOgfO8PMw6KRNvED0doKkc66AiReB1BGxVZyFalnjDIeOYkrwlo0RjTjJcMqGfARXTXG QdrdRiNqRUiykoitqzfTC0lVt9YoCRpn9p1jZs+Eqt541kgSf9/DWbjIUFF2sndgMoUu Tl4cwF1HeEUvly5pqNElAUgroixKo/cWbtZhy/QLDt2CVLVhZepxm3+tU5W4U4lKSB1H gjoBmk0SaiGh1ZHBhtpaiRvQ26+11tMAwJ5uRUynGCCdNRQNBsYjtGIzJgKEZ0AB6Q+6 jpkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=j69pt3b6; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id je4-20020a170903264400b00186db024863si16116643plb.612.2022.11.09.10.51.05; Wed, 09 Nov 2022 10:51:19 -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=@google.com header.s=20210112 header.b=j69pt3b6; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231589AbiKISt3 (ORCPT <rfc822;dexuan.linux@gmail.com> + 99 others); Wed, 9 Nov 2022 13:49:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230019AbiKISt1 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 9 Nov 2022 13:49:27 -0500 Received: from mail-pj1-x104a.google.com (mail-pj1-x104a.google.com [IPv6:2607:f8b0:4864:20::104a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5618313F91 for <linux-kernel@vger.kernel.org>; Wed, 9 Nov 2022 10:49:26 -0800 (PST) Received: by mail-pj1-x104a.google.com with SMTP id nl16-20020a17090b385000b002138288fd51so1845477pjb.6 for <linux-kernel@vger.kernel.org>; Wed, 09 Nov 2022 10:49:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:mime-version:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=lkoognfiz4T0FO9qiJqVW8CCjbYEKiYWyfXc5YQhyvU=; b=j69pt3b65opmCrEUZi5UPc1HYd/XHA0eHlmdQQkHI+ARnwDXXgf8KRyvL4NEZd7ajs x4iit8Zps0gDdr4HFiP8+viZ/HZYB2E9C874CDUbvquklngUPsMre2ujqhCQOnPfb0NF AxFGGgIDYJkTyPmwnMSwmPFdxZr/CgABD5SeaRHK17Y7N1wduXBq7rnqSSSulFHRSycz BRbFDhGcBNLAwNcZK3uAa5So2ICT5ZKA125taXxkT6I3R86sG6irVFVe5c8jJu3rl0F+ 4h3Uj8aQO4jCE+CZJwDhlhj+iKyr3mv2du7I1hmGySLgFGoANhaL+gHzt9tBPiII78ZQ Fp6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:mime-version:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=lkoognfiz4T0FO9qiJqVW8CCjbYEKiYWyfXc5YQhyvU=; b=rCRujObvykJimRqaaxkwyJ1ssqC1qGEL/lO2Nw/NmWHwNzRxz94rL/XzxLxrDfn3ii 8F6B+cFNaM0u8K7XZVulFlo0Z5OYGYSbP0AD/PwhNOVazzPIHmhcUk6zVXONRPlJgHrf kP6Ijx2UGp1A+uX8BaCnGrqK3QBrOpKuqsR/AauOvecev+MYkImaIi4Ag3hltgaU+vhq 8ES1ZK+3E5jdvzl+Lr7JdDXqMdVxFOsqNK0Un3PreCzMI4XGcy/9GkcgtiN2TWaewWQa Ih1G/evaRgkFqAPuKVA6iLc5oBHXqRTNJQiP1WeNfTZKUAexygMhn5BxTNLxnqzzKxHr zwng== X-Gm-Message-State: ANoB5pmAkuswXvG37FeT3PYmmhe7KqZLLYS9aeVnVRYiYS2nZvT0/ous 5DfdGS0SA/AOAOqY8QNf4eZhlkFEHwoa X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:b06f:a254:5ce9:c442]) (user=irogers job=sendgmr) by 2002:a17:90b:4003:b0:20a:fee1:8f69 with SMTP id ie3-20020a17090b400300b0020afee18f69mr55292pjb.0.1668019765401; Wed, 09 Nov 2022 10:49:25 -0800 (PST) Date: Wed, 9 Nov 2022 10:49:00 -0800 Message-Id: <20221109184914.1357295-1-irogers@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.38.1.431.g37b22c650d-goog Subject: [PATCH v2 00/14] Fix perf tools/lib includes From: Ian Rogers <irogers@google.com> To: Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, Arnaldo Carvalho de Melo <acme@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>, Masahiro Yamada <masahiroy@kernel.org>, Nicolas Schier <nicolas@fjasle.eu>, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, bpf@vger.kernel.org, Nick Desaulniers <ndesaulniers@google.com>, Andrii Nakryiko <andrii.nakryiko@gmail.com> Cc: Stephane Eranian <eranian@google.com>, Ian Rogers <irogers@google.com> Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749045613073207220?= X-GMAIL-MSGID: =?utf-8?q?1749045613073207220?= |
Series |
Fix perf tools/lib includes
|
|
Message
Ian Rogers
Nov. 9, 2022, 6:49 p.m. UTC
The previous build would add -Itools/lib and get dependencies for libtraceevent, libsubcmd, libsymbol, libapi and libbpf meaning that overriding these libraries would change the link time dependency but the headers would erroneously come from tools/lib. Fix the build to install headers and then depend on these. To reduce exposing internal headers/APIs some clean up is performed. tools/lib/symbol has a Makefile added, while tools/lib/api and tools/lib/subcmd have install targets added. The pattern used for the dependencies in Makefile.perf is modelled on libbpf. The problem and solution were motivated by this issue and discussion: https://lore.kernel.org/lkml/CAEf4BzbbOHQZUAe6iWaehKCPQAf3VC=hq657buqe2_yRKxaK-A@mail.gmail.com/ v2. Fix a MANIFEST issue for the source tar ball. Add dependencies for the installed header files so that the build doesn't overtake building these dependencies. Both issues reported by Arnaldo Carvalho de Melo <acme@kernel.org>. Ian Rogers (14): tools lib api: Add install target tools lib subcmd: Add install target perf build: Install libsubcmd locally when building perf build: Install libapi locally when building perf build: Install libperf locally when building perf build: Install libtraceevent locally when building tools lib api: Add missing install headers tools lib perf: Add missing install headers tool lib symbol: Add Makefile/Build perf build: Install libsymbol locally when building perf expr: Tidy hashmap dependency perf thread_map: Reduce exposure of libperf internal API perf cpumap: Tidy libperf includes perf build: Use tools/lib headers from install path tools/lib/api/Makefile | 52 +++++ tools/lib/perf/Makefile | 10 +- tools/lib/subcmd/Makefile | 49 +++++ tools/lib/symbol/Build | 1 + tools/lib/symbol/Makefile | 115 +++++++++++ tools/perf/.gitignore | 7 +- tools/perf/MANIFEST | 3 +- tools/perf/Makefile.config | 2 - tools/perf/Makefile.perf | 192 ++++++++++++++---- tools/perf/builtin-stat.c | 1 + tools/perf/builtin-trace.c | 4 +- tools/perf/tests/cpumap.c | 2 +- tools/perf/tests/expr.c | 1 + tools/perf/tests/openat-syscall.c | 1 + tools/perf/tests/pmu-events.c | 1 + tools/perf/tests/thread-map.c | 1 + tools/perf/util/Build | 5 - tools/perf/util/auxtrace.h | 2 +- tools/perf/util/bpf-loader.c | 4 - tools/perf/util/bpf_counter.c | 2 +- tools/perf/util/cpumap.c | 1 + tools/perf/util/cpumap.h | 2 +- tools/perf/util/evsel.c | 5 +- tools/perf/util/evsel.h | 2 - tools/perf/util/expr.c | 1 + tools/perf/util/expr.h | 7 +- tools/perf/util/metricgroup.c | 1 + tools/perf/util/python.c | 6 +- .../scripting-engines/trace-event-python.c | 2 +- tools/perf/util/stat-shadow.c | 1 + tools/perf/util/stat.c | 4 - tools/perf/util/thread_map.c | 1 + tools/perf/util/thread_map.h | 2 - 33 files changed, 402 insertions(+), 88 deletions(-) create mode 100644 tools/lib/symbol/Build create mode 100644 tools/lib/symbol/Makefile
Comments
Hi Ian, On Wed, Nov 9, 2022 at 10:49 AM Ian Rogers <irogers@google.com> wrote: > > The previous build would add -Itools/lib and get dependencies for > libtraceevent, libsubcmd, libsymbol, libapi and libbpf meaning that > overriding these libraries would change the link time dependency but > the headers would erroneously come from tools/lib. Fix the build to > install headers and then depend on these. To reduce exposing internal > headers/APIs some clean up is performed. tools/lib/symbol has a > Makefile added, while tools/lib/api and tools/lib/subcmd have install > targets added. The pattern used for the dependencies in Makefile.perf > is modelled on libbpf. > > The problem and solution were motivated by this issue and discussion: > https://lore.kernel.org/lkml/CAEf4BzbbOHQZUAe6iWaehKCPQAf3VC=hq657buqe2_yRKxaK-A@mail.gmail.com/ > > v2. Fix a MANIFEST issue for the source tar ball. Add dependencies for > the installed header files so that the build doesn't overtake > building these dependencies. Both issues reported by Arnaldo > Carvalho de Melo <acme@kernel.org>. > > Ian Rogers (14): > tools lib api: Add install target > tools lib subcmd: Add install target > perf build: Install libsubcmd locally when building > perf build: Install libapi locally when building > perf build: Install libperf locally when building > perf build: Install libtraceevent locally when building > tools lib api: Add missing install headers > tools lib perf: Add missing install headers > tool lib symbol: Add Makefile/Build > perf build: Install libsymbol locally when building > perf expr: Tidy hashmap dependency > perf thread_map: Reduce exposure of libperf internal API > perf cpumap: Tidy libperf includes > perf build: Use tools/lib headers from install path Acked-by: Namhyung Kim <namhyung@kernel.org> Thanks, Namhyung > > tools/lib/api/Makefile | 52 +++++ > tools/lib/perf/Makefile | 10 +- > tools/lib/subcmd/Makefile | 49 +++++ > tools/lib/symbol/Build | 1 + > tools/lib/symbol/Makefile | 115 +++++++++++ > tools/perf/.gitignore | 7 +- > tools/perf/MANIFEST | 3 +- > tools/perf/Makefile.config | 2 - > tools/perf/Makefile.perf | 192 ++++++++++++++---- > tools/perf/builtin-stat.c | 1 + > tools/perf/builtin-trace.c | 4 +- > tools/perf/tests/cpumap.c | 2 +- > tools/perf/tests/expr.c | 1 + > tools/perf/tests/openat-syscall.c | 1 + > tools/perf/tests/pmu-events.c | 1 + > tools/perf/tests/thread-map.c | 1 + > tools/perf/util/Build | 5 - > tools/perf/util/auxtrace.h | 2 +- > tools/perf/util/bpf-loader.c | 4 - > tools/perf/util/bpf_counter.c | 2 +- > tools/perf/util/cpumap.c | 1 + > tools/perf/util/cpumap.h | 2 +- > tools/perf/util/evsel.c | 5 +- > tools/perf/util/evsel.h | 2 - > tools/perf/util/expr.c | 1 + > tools/perf/util/expr.h | 7 +- > tools/perf/util/metricgroup.c | 1 + > tools/perf/util/python.c | 6 +- > .../scripting-engines/trace-event-python.c | 2 +- > tools/perf/util/stat-shadow.c | 1 + > tools/perf/util/stat.c | 4 - > tools/perf/util/thread_map.c | 1 + > tools/perf/util/thread_map.h | 2 - > 33 files changed, 402 insertions(+), 88 deletions(-) > create mode 100644 tools/lib/symbol/Build > create mode 100644 tools/lib/symbol/Makefile > > -- > 2.38.1.431.g37b22c650d-goog >
Em Thu, Nov 10, 2022 at 10:10:18AM -0800, Namhyung Kim escreveu: > Hi Ian, > > On Wed, Nov 9, 2022 at 10:49 AM Ian Rogers <irogers@google.com> wrote: > > > > The previous build would add -Itools/lib and get dependencies for > > libtraceevent, libsubcmd, libsymbol, libapi and libbpf meaning that > > overriding these libraries would change the link time dependency but > > the headers would erroneously come from tools/lib. Fix the build to > > install headers and then depend on these. To reduce exposing internal > > headers/APIs some clean up is performed. tools/lib/symbol has a > > Makefile added, while tools/lib/api and tools/lib/subcmd have install > > targets added. The pattern used for the dependencies in Makefile.perf > > is modelled on libbpf. > > > > The problem and solution were motivated by this issue and discussion: > > https://lore.kernel.org/lkml/CAEf4BzbbOHQZUAe6iWaehKCPQAf3VC=hq657buqe2_yRKxaK-A@mail.gmail.com/ > > > > v2. Fix a MANIFEST issue for the source tar ball. Add dependencies for > > the installed header files so that the build doesn't overtake > > building these dependencies. Both issues reported by Arnaldo > > Carvalho de Melo <acme@kernel.org>. > > > > Ian Rogers (14): > > tools lib api: Add install target > > tools lib subcmd: Add install target > > perf build: Install libsubcmd locally when building > > perf build: Install libapi locally when building > > perf build: Install libperf locally when building > > perf build: Install libtraceevent locally when building > > tools lib api: Add missing install headers > > tools lib perf: Add missing install headers > > tool lib symbol: Add Makefile/Build > > perf build: Install libsymbol locally when building > > perf expr: Tidy hashmap dependency > > perf thread_map: Reduce exposure of libperf internal API > > perf cpumap: Tidy libperf includes > > perf build: Use tools/lib headers from install path > > Acked-by: Namhyung Kim <namhyung@kernel.org> 'make -C tools/perf build-test' is failing, looks like parallelization woes again: ⬢[acme@toolbox perf]$ getconf _NPROCESSORS_ONLN 32 ⬢[acme@toolbox perf]$ ⬢[acme@toolbox perf]$ git log --oneline -1 ; time make -C tools/perf build-test 9f22d36a1dd0297a (HEAD -> perf/core) perf build: Use tools/lib headers from install path make: Entering directory '/var/home/acme/git/perf/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . make_static: cd . && make LDFLAGS=-static NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 NO_JVMTI=1 -j32 DESTDIR=/tmp/tmp.i0kUDsiQbV make_with_gtk2: cd . && make GTK2=1 -j32 DESTDIR=/tmp/tmp.MNcgfeG07c cd . && make GTK2=1 -j32 DESTDIR=/tmp/tmp.MNcgfeG07c BUILD: Doing 'make -j32' parallel build HOSTCC fixdep.o HOSTLD fixdep-in.o LINK fixdep Warning: Kernel ABI header at 'tools/arch/arm64/include/uapi/asm/perf_regs.h' differs from latest version at 'arch/arm64/include/uapi/asm/perf_regs.h' diff -u tools/arch/arm64/include/uapi/asm/perf_regs.h arch/arm64/include/uapi/asm/perf_regs.h Warning: Kernel ABI header at 'tools/arch/arm64/include/asm/cputype.h' differs from latest version at 'arch/arm64/include/asm/cputype.h' diff -u tools/arch/arm64/include/asm/cputype.h arch/arm64/include/asm/cputype.h Warning: Kernel ABI header at 'tools/perf/arch/powerpc/entry/syscalls/syscall.tbl' differs from latest version at 'arch/powerpc/kernel/syscalls/syscall.tbl' diff -u tools/perf/arch/powerpc/entry/syscalls/syscall.tbl arch/powerpc/kernel/syscalls/syscall.tbl Auto-detecting system features: ... dwarf: [ on ] ... dwarf_getlocations: [ on ] ... glibc: [ on ] ... libbfd: [ on ] ... libbfd-buildid: [ on ] ... libcap: [ on ] ... libelf: [ on ] ... libnuma: [ on ] ... numa_num_possible_cpus: [ on ] ... libperl: [ on ] ... libpython: [ on ] ... libcrypto: [ on ] ... libunwind: [ on ] ... libdw-dwarf-unwind: [ on ] ... zlib: [ on ] ... lzma: [ on ] ... get_cpuid: [ on ] ... bpf: [ on ] ... libaio: [ on ] ... libzstd: [ on ] GEN common-cmds.h CC perf-read-vdso32 CC dlfilters/dlfilter-test-api-v0.o CC dlfilters/dlfilter-show-cycles.o CC jvmti/libjvmti.o CC jvmti/jvmti_agent.o CC jvmti/libstring.o CC jvmti/libctype.o CC ui/gtk/browser.o CC ui/gtk/hists.o CC ui/gtk/setup.o CC ui/gtk/util.o GEN pmu-events/pmu-events.c CC ui/gtk/helpline.o LINK dlfilters/dlfilter-show-cycles.so CC ui/gtk/progress.o CC ui/gtk/annotate.o CC ui/gtk/zalloc.o LINK dlfilters/dlfilter-test-api-v0.so INSTALL headers CC /var/home/acme/git/perf/tools/perf/libsubcmd/exec-cmd.o CC /var/home/acme/git/perf/tools/perf/libsubcmd/help.o CC /var/home/acme/git/perf/tools/perf/libsubcmd/pager.o CC /var/home/acme/git/perf/tools/perf/libsubcmd/parse-options.o CC /var/home/acme/git/perf/tools/perf/libsubcmd/run-command.o In file included from ui/gtk/hists.c:2: /var/home/acme/git/perf/tools/perf/util/include/../evlist.h:9:10: fatal error: api/fd/array.h: No such file or directory 9 | #include <api/fd/array.h> | ^~~~~~~~~~~~~~~~ compilation terminated. make[6]: *** [/var/home/acme/git/perf/tools/build/Makefile.build:97: ui/gtk/hists.o] Error 1 make[6]: *** Waiting for unfinished jobs.... CC /var/home/acme/git/perf/tools/perf/libsubcmd/sigchain.o make -f /var/home/acme/git/perf/tools/build/Makefile.build dir=. obj=libsymbol V=1 In file included from ui/gtk/browser.c:2: /var/home/acme/git/perf/tools/perf/util/include/../evsel.h:10:10: fatal error: internal/evsel.h: No such file or directory 10 | #include <internal/evsel.h> | ^~~~~~~~~~~~~~~~~~ compilation terminated. make[6]: *** [/var/home/acme/git/perf/tools/build/Makefile.build:97: ui/gtk/browser.o] Error 1 INSTALL headers CC /var/home/acme/git/perf/tools/perf/libtraceevent/event-parse.o
Em Mon, Nov 14, 2022 at 05:16:57PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Thu, Nov 10, 2022 at 10:10:18AM -0800, Namhyung Kim escreveu: > > Hi Ian, > > > > On Wed, Nov 9, 2022 at 10:49 AM Ian Rogers <irogers@google.com> wrote: > > > > > > The previous build would add -Itools/lib and get dependencies for > > > libtraceevent, libsubcmd, libsymbol, libapi and libbpf meaning that > > > overriding these libraries would change the link time dependency but > > > the headers would erroneously come from tools/lib. Fix the build to > > > install headers and then depend on these. To reduce exposing internal > > > headers/APIs some clean up is performed. tools/lib/symbol has a > > > Makefile added, while tools/lib/api and tools/lib/subcmd have install > > > targets added. The pattern used for the dependencies in Makefile.perf > > > is modelled on libbpf. > > > > > > The problem and solution were motivated by this issue and discussion: > > > https://lore.kernel.org/lkml/CAEf4BzbbOHQZUAe6iWaehKCPQAf3VC=hq657buqe2_yRKxaK-A@mail.gmail.com/ > > > > > > v2. Fix a MANIFEST issue for the source tar ball. Add dependencies for > > > the installed header files so that the build doesn't overtake > > > building these dependencies. Both issues reported by Arnaldo > > > Carvalho de Melo <acme@kernel.org>. > > > > > > Ian Rogers (14): > > > tools lib api: Add install target > > > tools lib subcmd: Add install target > > > perf build: Install libsubcmd locally when building > > > perf build: Install libapi locally when building > > > perf build: Install libperf locally when building > > > perf build: Install libtraceevent locally when building > > > tools lib api: Add missing install headers > > > tools lib perf: Add missing install headers > > > tool lib symbol: Add Makefile/Build > > > perf build: Install libsymbol locally when building > > > perf expr: Tidy hashmap dependency > > > perf thread_map: Reduce exposure of libperf internal API > > > perf cpumap: Tidy libperf includes > > > perf build: Use tools/lib headers from install path > > > > Acked-by: Namhyung Kim <namhyung@kernel.org> > > 'make -C tools/perf build-test' is failing, looks like parallelization > woes again: It's all at the perf/tools-libs-includes branch in my tree. - Arnaldo > ⬢[acme@toolbox perf]$ getconf _NPROCESSORS_ONLN > 32 > ⬢[acme@toolbox perf]$ > > ⬢[acme@toolbox perf]$ git log --oneline -1 ; time make -C tools/perf build-test > 9f22d36a1dd0297a (HEAD -> perf/core) perf build: Use tools/lib headers from install path > make: Entering directory '/var/home/acme/git/perf/tools/perf' > - tarpkg: ./tests/perf-targz-src-pkg . > make_static: cd . && make LDFLAGS=-static NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 NO_JVMTI=1 -j32 DESTDIR=/tmp/tmp.i0kUDsiQbV > make_with_gtk2: cd . && make GTK2=1 -j32 DESTDIR=/tmp/tmp.MNcgfeG07c > cd . && make GTK2=1 -j32 DESTDIR=/tmp/tmp.MNcgfeG07c > BUILD: Doing 'make -j32' parallel build > HOSTCC fixdep.o > HOSTLD fixdep-in.o > LINK fixdep > Warning: Kernel ABI header at 'tools/arch/arm64/include/uapi/asm/perf_regs.h' differs from latest version at 'arch/arm64/include/uapi/asm/perf_regs.h' > diff -u tools/arch/arm64/include/uapi/asm/perf_regs.h arch/arm64/include/uapi/asm/perf_regs.h > Warning: Kernel ABI header at 'tools/arch/arm64/include/asm/cputype.h' differs from latest version at 'arch/arm64/include/asm/cputype.h' > diff -u tools/arch/arm64/include/asm/cputype.h arch/arm64/include/asm/cputype.h > Warning: Kernel ABI header at 'tools/perf/arch/powerpc/entry/syscalls/syscall.tbl' differs from latest version at 'arch/powerpc/kernel/syscalls/syscall.tbl' > diff -u tools/perf/arch/powerpc/entry/syscalls/syscall.tbl arch/powerpc/kernel/syscalls/syscall.tbl > > Auto-detecting system features: > ... dwarf: [ on ] > ... dwarf_getlocations: [ on ] > ... glibc: [ on ] > ... libbfd: [ on ] > ... libbfd-buildid: [ on ] > ... libcap: [ on ] > ... libelf: [ on ] > ... libnuma: [ on ] > ... numa_num_possible_cpus: [ on ] > ... libperl: [ on ] > ... libpython: [ on ] > ... libcrypto: [ on ] > ... libunwind: [ on ] > ... libdw-dwarf-unwind: [ on ] > ... zlib: [ on ] > ... lzma: [ on ] > ... get_cpuid: [ on ] > ... bpf: [ on ] > ... libaio: [ on ] > ... libzstd: [ on ] > > GEN common-cmds.h > CC perf-read-vdso32 > CC dlfilters/dlfilter-test-api-v0.o > CC dlfilters/dlfilter-show-cycles.o > CC jvmti/libjvmti.o > CC jvmti/jvmti_agent.o > CC jvmti/libstring.o > CC jvmti/libctype.o > CC ui/gtk/browser.o > CC ui/gtk/hists.o > CC ui/gtk/setup.o > CC ui/gtk/util.o > GEN pmu-events/pmu-events.c > CC ui/gtk/helpline.o > LINK dlfilters/dlfilter-show-cycles.so > CC ui/gtk/progress.o > CC ui/gtk/annotate.o > CC ui/gtk/zalloc.o > LINK dlfilters/dlfilter-test-api-v0.so > INSTALL headers > CC /var/home/acme/git/perf/tools/perf/libsubcmd/exec-cmd.o > CC /var/home/acme/git/perf/tools/perf/libsubcmd/help.o > CC /var/home/acme/git/perf/tools/perf/libsubcmd/pager.o > CC /var/home/acme/git/perf/tools/perf/libsubcmd/parse-options.o > CC /var/home/acme/git/perf/tools/perf/libsubcmd/run-command.o > In file included from ui/gtk/hists.c:2: > /var/home/acme/git/perf/tools/perf/util/include/../evlist.h:9:10: fatal error: api/fd/array.h: No such file or directory > 9 | #include <api/fd/array.h> > | ^~~~~~~~~~~~~~~~ > compilation terminated. > make[6]: *** [/var/home/acme/git/perf/tools/build/Makefile.build:97: ui/gtk/hists.o] Error 1 > make[6]: *** Waiting for unfinished jobs.... > CC /var/home/acme/git/perf/tools/perf/libsubcmd/sigchain.o > make -f /var/home/acme/git/perf/tools/build/Makefile.build dir=. obj=libsymbol V=1 > In file included from ui/gtk/browser.c:2: > /var/home/acme/git/perf/tools/perf/util/include/../evsel.h:10:10: fatal error: internal/evsel.h: No such file or directory > 10 | #include <internal/evsel.h> > | ^~~~~~~~~~~~~~~~~~ > compilation terminated. > make[6]: *** [/var/home/acme/git/perf/tools/build/Makefile.build:97: ui/gtk/browser.o] Error 1 > INSTALL headers > CC /var/home/acme/git/perf/tools/perf/libtraceevent/event-parse.o