Bug 12482

Summary: perf: Add PACKAGECONFIGs for auto-detected features such as libaudit
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Randy MacLeod <randy.macleod>
Component: kernelAssignee: Unassigned <unassigned>
Status: RESOLVED OBSOLETE QA Contact:
Severity: enhancement    
Priority: Medium CC: anh.nguyen.pv, anilrath51, cody.yu, david.reyna, nayakksanjay, richard.purdie, tom.zanussi, yoann.congal
Version: 2.5   
Target Milestone: 5.99   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know
Attachments:
Description Flags
Anil's libaudit patch none

Description Randy MacLeod 2018-01-15 03:13:25 UTC
Perf can be optionally build with many features:

Auto-detecting system features:
...                         dwarf: [ on  ]
...            dwarf_getlocations: [ on  ]
...                         glibc: [ on  ]
...                          gtk2: [ OFF ]
...                      libaudit: [ OFF ]
...                        libbfd: [ on  ]
...                        libelf: [ on  ]
...                       libnuma: [ OFF ]
...        numa_num_possible_cpus: [ OFF ]
...                       libperl: [ on  ]
...                     libpython: [ on  ]
...                      libslang: [ on  ]
...                     libcrypto: [ on  ]
...                     libunwind: [ on  ]
...            libdw-dwarf-unwind: [ on  ]
...                          zlib: [ on  ]
...                          lzma: [ on  ]
...                     get_cpuid: [ OFF ]
...                           bpf: [ on  ]


The perf recipe has partial PACKAGECONFIG feature support.

Investigate and if needed add support for libaudit, *numa*, get_cpuid.
Comment 1 Bruce Ashfield 2019-05-22 20:54:20 UTC
Although perf is a bit complex, this could be a beginner/intro bug.
Comment 2 K Sanjay Nayak 2024-03-17 15:43:06 UTC
Hi Randy/Bruce,

I've noticed that this issue has been raised quite some time ago.

Below is the most recent log of auto-detection from the do_compile process in perf.

Auto-detecting system features:
...                                   dwarf: [ on  ]
...                      dwarf_getlocations: [ on  ]
...                                   glibc: [ on  ]
...                                  libbfd: [ on  ]
...                          libbfd-buildid: [ on  ]
...                                  libcap: [ on  ]
...                                  libelf: [ on  ]
...                                 libnuma: [ OFF ]
...                  numa_num_possible_cpus: [ OFF ]
...                                 libperl: [ OFF ]
...                               libpython: [ on  ]
...                               libcrypto: [ on  ]
...                               libunwind: [ on  ]
...                      libdw-dwarf-unwind: [ on  ]
...                                    zlib: [ on  ]
...                                    lzma: [ on  ]
...                               get_cpuid: [ on  ]
...                                     bpf: [ on  ]
...                                  libaio: [ on  ]
...                                 libzstd: [ on  ]
...                               backtrace: [ on  ]
...                                 eventfd: [ on  ]
...                          fortify-source: [ on  ]
...                    get_current_dir_name: [ on  ]
...                                  gettid: [ on  ]
...                       libelf-getphdrnum: [ on  ]
...                     libelf-gelf_getnote: [ on  ]
...                    libelf-getshdrstrndx: [ on  ]
...                                libslang: [ on  ]
...                 libslang-include-subdir: [ OFF ]
...                           libtraceevent: [ on  ]
...                              libtracefs: [ OFF ]
...             pthread-attr-setaffinity-np: [ on  ]
...                         pthread-barrier: [ on  ]
...                            reallocarray: [ on  ]
...                      stackprotector-all: [ on  ]
...                                 timerfd: [ on  ]
...                               scandirat: [ on  ]
...                            sched_getcpu: [ on  ]
...                                     sdt: [ OFF ]
...                                   setns: [ on  ]
...                  disassembler-four-args: [ on  ]
...                disassembler-init-styled: [ on  ]
...                             file-handle: [ on  ]
...                                  bionic: [ OFF ]
...                              compile-32: [ OFF ]
...                             compile-x32: [ OFF ]
...                          cplus-demangle: [ OFF ]
...                            cxa-demangle: [ on  ]
...                                    gtk2: [ OFF ]
...                            gtk2-infobar: [ OFF ]
...                                   hello: [ OFF ]
...                           libbabeltrace: [ OFF ]
...                          libbfd-liberty: [ OFF ]
...                        libbfd-liberty-z: [ OFF ]
...                              libopencsd: [ OFF ]
...                           libunwind-x86: [ OFF ]
...                        libunwind-x86_64: [ OFF ]
...                           libunwind-arm: [ OFF ]
...                       libunwind-aarch64: [ OFF ]
...                   libunwind-debug-frame: [ OFF ]
...               libunwind-debug-frame-arm: [ OFF ]
...           libunwind-debug-frame-aarch64: [ OFF ]
...                                     cxx: [ OFF ]
...                                    llvm: [ OFF ]
...                            llvm-version: [ OFF ]
...                                   clang: [ OFF ]
...                                  libbpf: [ OFF ]
...      libbpf-btf__load_from_kernel_by_id: [ OFF ]
...                    libbpf-bpf_prog_load: [ OFF ]
...         libbpf-bpf_object__next_program: [ OFF ]
...             libbpf-bpf_object__next_map: [ OFF ]
...           libbpf-bpf_program__set_insns: [ OFF ]
...                   libbpf-bpf_create_map: [ OFF ]
...                                 libpfm4: [ OFF ]
...                           libdebuginfod: [ on  ]
...                         clang-bpf-co-re: [ OFF ]

Do we need to add support for once with "OFF" in Autodetect ?

Thanks
Sanjay :)
Comment 3 Anh Nguyen 2024-03-18 03:39:18 UTC
Hi all,

I am a new comer and I would like to investigate this ticket.
But I don't know how to list out the "Auto-detecting system features:" as your comment.

I tried "bitbake -f -c compile perf -DDD"
Could you please share me the command to list out the "Auto-detecting system features:"

Thank you
Anh
Comment 4 Randy MacLeod 2024-03-19 00:41:20 UTC
Anil has worked on the libaudit change and has a patch mostly ready to review.

Anil, Please post the patch to the oe-core list and CC people asking about it here. 

Anil asked about how to test that perf is supporting libaudit and unfortunately, I don't know off-hand. If you want to compare to a perf that seems to support libaudit, check out the debian perf: https://packages.debian.org/bullseye/linux-perf-5.10
Comment 5 Randy MacLeod 2024-03-19 18:23:13 UTC
Created attachment 5032 [details]
Anil's libaudit patch

I attached Anil's patch that he sent to me privately in Jan 2024.
I hope you don't mind me sharing it Anil.
Comment 6 Randy MacLeod 2025-02-06 16:25:28 UTC
Needs some kernel knowledge. 
If anyone wants to work on this please ask for help from me and I'll try to make time.
Comment 7 Randy MacLeod 2025-09-18 14:55:44 UTC
It has been a while and no one has implemented this enhancment.
I can only conclude that it's a 'nice-to-have' feature rather than a real need.

If anyone has a real need to enhance how perf is configure, 
they can send a patch.