Rui Ribeiro Posted March 30, 2016 Posted March 30, 2016 Been trying to compile the handy sysdig util in armbian. Installed it with: apt-get install -t jessie-backports sysdig sysdig-dkms After the normal install that worked, but when running gave this error: error opening device /dev/sysdig0. Make sure you have root credentials and that the sysdig-probe module is loaded. I tried: /usr/lib/dkms/dkms_autoinstaller start One of the compilation errors I manage to correct commenting the include of asm-offsets.h in /var/lib/dkms/sysdig/0.5.1/build/main.c I also managed to solve the complaints about the lack of fixdep with: make fixdep make bin2c However now when trying to compile it with /usr/lib/dkms/dkms_autoinstaller start if fails with: /bin/sh: 1: scripts/mod/modpost: not found scripts/Makefile.modpost:91: recipe for target '__modpost' failed make[1]: *** [__modpost] Error 127 Makefile:1387: recipe for target 'modules' failed make: *** [modules] Error 2 make: Leaving directory '/usr/src/linux-headers-4.4.1-sunxi' It seems I need to do make modules_prepare either in the linux source or headers directory. I do not have the linux source installed, and it is giving this error in the headers directory: oot@ruir:/usr/src# cd linux-headers-4.4.1-sunxi/ root@ruir:/usr/src/linux-headers-4.4.1-sunxi# make modules_prepare CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h CHK include/generated/utsrelease.h make[1]: *** No rule to make target 'arch/arm/tools/gen-mach-types', needed by 'include/generated/mach-types.h'. Stop. arch/arm/Makefile:313: recipe for target 'archprepare' failed make: *** [archprepare] Error 2 Any idea? TIA, Rui
zador.blood.stained Posted March 30, 2016 Posted March 30, 2016 Please try executing make scripts in your kernel headers directory (/usr/src/linux-headers-4.4.1-sunxi) 1
Rui Ribeiro Posted March 30, 2016 Author Posted March 30, 2016 Thanks, now it compiles. Now I just have to find out why it thinks it is version 4.4.1 and not 4.4.1-sunxi
wildcat_paris Posted March 31, 2016 Posted March 31, 2016 @Rui I have probably already put my little workaround script on the forum for DKMS modules after I update Armbian kernel (and before reboot) #!/bin/bash sudo rm /tmp/.reboot_required pushd . for f in $(ls -d /usr/src/linux-headers-*-sunxi) do cd $f sudo make scripts done popd sudo dpkg -i frandom-dkms_1.1-0centrych4_armhf.deb sudo apt-get install --reinstall -t jessie-backports sysdig sysdig-dkms 1
Igor Posted March 31, 2016 Posted March 31, 2016 BTW: I fixed packaging script so this "make scripts" is done on headers install and will not be needed any more ... adding later today. 3
Rui Ribeiro Posted March 31, 2016 Author Posted March 31, 2016 Thank you to you all. I was able to compile the sysdig kernel module finally, but somehow the module does not load as it is compiled for 4.4.1 and not 4.4.1-sunxi. More on that later on, at work now.
Rui Ribeiro Posted April 3, 2016 Author Posted April 3, 2016 Something must be amiss with the kernel sources? I had to change in /lib/modules/4.4.1-sunxi/build the following occurrences of 4.4.1 to 4.4.1-sunxi include/generated/utsrelease.h:#define UTS_RELEASE "4.4.1"include/config/auto.conf.cmd:ifneq "$(KERNELVERSION)" "4.4.1"include/config/kernel.release:4.4.1 And then I was able to compile the sysdig module without problems. Now insmod does not load due to other problem: # insmod ./sysdig-probe.ko insmod: ERROR: could not insert module ./sysdig-probe.ko: Unknown symbol in module root@ruir:/lib/modules/4.4.1-sunxi/updates/dkms# dmesg | tail [165564.069037] sysdig_probe: Unknown symbol tracepoint_probe_register (err 0) [165565.581076] sysdig_probe: Unknown symbol tracepoint_probe_unregister (err 0) [165565.581439] sysdig_probe: Unknown symbol for_each_kernel_tracepoint (err 0) [165565.581493] sysdig_probe: Unknown symbol tracepoint_probe_register (err 0) [165571.445442] sysdig_probe: Unknown symbol tracepoint_probe_unregister (err 0) [165571.445804] sysdig_probe: Unknown symbol for_each_kernel_tracepoint (err 0) [165571.445858] sysdig_probe: Unknown symbol tracepoint_probe_register (err 0) [165961.635924] sysdig_probe: Unknown symbol tracepoint_probe_unregister (err 0) [165961.636286] sysdig_probe: Unknown symbol for_each_kernel_tracepoint (err 0) [165961.636338] sysdig_probe: Unknown symbol tracepoint_probe_register (err 0) 1
zador.blood.stained Posted April 3, 2016 Posted April 3, 2016 Looking at symbol names, sysdig probably requires kernel compiled with tracing options enabled. 1
Rui Ribeiro Posted April 3, 2016 Author Posted April 3, 2016 I was arriving at that zador, thanks. CONFIG_DYNAMIC_FTRACE However "ARM presently does not support ftrace syscall?" This one from 2011...not sure wether still holds up. Will check out later, I have not compiled kernels for ages, and not fancying compiling one from scratch right one.
zador.blood.stained Posted April 3, 2016 Posted April 3, 2016 It's available now | Symbol: DYNAMIC_FTRACE [=n] | Type : boolean | Prompt: enable/disable function tracing dynamically | Location: | -> Kernel hacking | (1) -> Tracers (FTRACE [=n]) | Defined at kernel/trace/Kconfig:446 | Depends on: TRACING_SUPPORT [=y] && FTRACE [=n] && FUNCTION_TRACER [=n] && HAVE_DYNAMIC_FTRACE [=y] 1
Rui Ribeiro Posted April 3, 2016 Author Posted April 3, 2016 Thanks for the attention Zador. I understand you guys in ArmBian are cross compiling; is the /usr/src/linux-headers-4.4.1-sunxi/.config file that we have more or less up-to-date? I have an SSD disk, maybe give it a go natively.
zador.blood.stained Posted April 3, 2016 Posted April 3, 2016 You can always use config file in /boot, but I would still recommend using build script (documentation), mainly because of additional patches. I'll check description for these options later to see if it's OK to have them on by default. 1
Rui Ribeiro Posted April 3, 2016 Author Posted April 3, 2016 Thanks for all the inputs, it makes sense. Sysdig is a very valuable debugging and educational tool.
Recommended Posts