[SOLVED] Does Mageia have a bpftrace tool?

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

[SOLVED] Does Mageia have a bpftrace tool?

Postby alopez » Jun 6th, '21, 00:45

I'm trying to install bpftrace but I only found the packages bpftool and bcc-tools. None of them includes bpftrace.

Is bpftrace in some other package, maybe with a less evident name? Or it is not at all available in Mageia?
Last edited by alopez on Jun 6th, '21, 16:24, edited 1 time in total.
User avatar
alopez
 
Posts: 61
Joined: Aug 17th, '13, 18:26
Location: France

Re: Does Mageia have a bpftrace tool?

Postby doktor5000 » Jun 6th, '21, 14:33

No, it's not available. You could try the fedora packages.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 16798
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Does Mageia have a bpftrace tool?

Postby alopez » Jun 6th, '21, 14:40

Thanks. I'll do that.
User avatar
alopez
 
Posts: 61
Joined: Aug 17th, '13, 18:26
Location: France

Re: Does Mageia have a bpftrace tool?

Postby alopez » Jun 6th, '21, 16:23

I finally decided to build bpftrace instead of using Fedora's package because it depends on packages that don't have the same name in Mageia.

So this is how I did:
Code: Select all
dnf install lib64bcc-devel lib64elfutils-devel cmake bison flex systemtap-sdt-devel binutils-devel
git clone https://github.com/iovisor/bpftrace
cd bpftrace
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DENABLE_TEST_VALIDATE_CODEGEN=OFF -DLIBBFD_DISASM_FOUR_ARGS_SIGNATURE=y ..
make -j8
sudo make install


bpftrace will be installed in /usr/local. To change the destination, use -DCMAKE_INSTALL_PREFIX=<destination> in cmake.

If during make you get this error:
Code: Select all
[ 98%] Linking CXX executable bpftrace
/usr/bin/ld: /usr/lib64/libbfd.a(plugin.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
/usr/bin/ld: /usr/lib64/libdl.so.2: error al añadir símbolos: DSO faltante desde línea de orden
collect2: error: ld devolvió el estado de salida 1
make[2]: *** [src/CMakeFiles/bpftrace.dir/build.make:115: src/bpftrace] Error 1
make[1]: *** [CMakeFiles/Makefile2:438: src/CMakeFiles/bpftrace.dir/all] Error 2
make: *** [Makefile:149: all] Error 2

Apply this patch:
Code: Select all
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a32b5f5..7313c80 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -47,7 +47,7 @@ add_executable(${BPFTRACE}
 )

 install(TARGETS ${BPFTRACE} DESTINATION ${CMAKE_INSTALL_BINDIR})
-target_link_libraries(${BPFTRACE} libbpftrace)
+target_link_libraries(${BPFTRACE} libbpftrace ${CMAKE_DL_LIBS})

 if (BUILD_FUZZ)
   target_compile_options(${BPFTRACE} PUBLIC "-DFUZZ")
User avatar
alopez
 
Posts: 61
Joined: Aug 17th, '13, 18:26
Location: France

Re: [SOLVED] Does Mageia have a bpftrace tool?

Postby morgano » Jun 6th, '21, 16:27

Thank you for sharing the instruction.
Have you considered becoming a packager? :)
Mandriva since 2006, then Mageia since 2011 at home & work. Thinkpad T43 & T400, Dell M4400, Acer Aspire 7. Workstation using LVM, LUKS, VirtualBox, BOINC
morgano
 
Posts: 823
Joined: Jun 15th, '11, 17:51
Location: Kivik, Sweden

Re: [SOLVED] Does Mageia have a bpftrace tool?

Postby alopez » Jun 6th, '21, 18:08

For a moment it crossed my mind. I need to check how to become one.
User avatar
alopez
 
Posts: 61
Joined: Aug 17th, '13, 18:26
Location: France

Re: [SOLVED] Does Mageia have a bpftrace tool?

Postby doktor5000 » Jun 6th, '21, 20:11

Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 16798
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: [SOLVED] Does Mageia have a bpftrace tool?

Postby alopez » Jun 6th, '21, 22:37

Thanks. That's what Iḿ doing right now. :-)
User avatar
alopez
 
Posts: 61
Joined: Aug 17th, '13, 18:26
Location: France


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest