diff --git a/README.adoc b/README.adoc index 3c57870..f4bbc2f 100644 --- a/README.adoc +++ b/README.adoc @@ -2440,6 +2440,28 @@ TODO: why does this produce no output? * https://serverfault.com/questions/199654/does-anyone-know-a-simple-way-to-monitor-root-process-spawn * https://unix.stackexchange.com/questions/260162/how-to-track-newly-created-processes +==== CONFIG_PROC_EVENTS aarch64 + +Was failing with: + +.... +>>> kernel_module 1.0 Building +/usr/bin/make -j8 -C '/home/ciro/bak/git/linux-kernel-module-cheat/out/aarch64/buildroot/build/kernel_module-1.0/user' BR2_PACKAGE_OPENBLAS="" CC="/home/ciro/bak/git/linux-kernel-module-cheat/out/aarch64/buildroot/host/bin/aarch64-buildroot-linux-uclibc-gcc" LD="/home/ciro/bak/git/linux-kernel-module-cheat/out/aarch64/buildroot/host/bin/aarch64-buildroot-linux-uclibc-ld" +/home/ciro/bak/git/linux-kernel-module-cheat/out/aarch64/buildroot/host/bin/aarch64-buildroot-linux-uclibc-gcc -ggdb3 -fopenmp -O0 -std=c99 -Wall -Werror -Wextra -o 'proc_events.out' 'proc_events.c' +In file included from /home/ciro/bak/git/linux-kernel-module-cheat/out/aarch64/buildroot/host/aarch64-buildroot-linux-uclibc/sysroot/usr/include/signal.h:329:0, + from proc_events.c:12: +/home/ciro/bak/git/linux-kernel-module-cheat/out/aarch64/buildroot/host/aarch64-buildroot-linux-uclibc/sysroot/usr/include/sys/ucontext.h:50:16: error: field ‘uc_mcontext’ has incomplete type + mcontext_t uc_mcontext; + ^~~~~~~~~~~ +.... + +so we commented it out. + +Related threads: + +* https://mailman.uclibc-ng.org/pipermail/devel/2018-January/001624.html lets try to update uclibc, possibly track it as a submodule already :-) +* https://github.com/DynamoRIO/dynamorio/issues/2356 + ==== ftrace Trace a single function: diff --git a/kernel_module/user/proc_events.c b/kernel_module/user/proc_events.c index 8cc05d9..9dc3b91 100644 --- a/kernel_module/user/proc_events.c +++ b/kernel_module/user/proc_events.c @@ -4,6 +4,12 @@ This file is licensed under the GPL v2 (http://www.gnu.org/licenses/gpl2.txt) (s https://stackoverflow.com/questions/6075013/detect-launching-of-programs-on-linux-platform/8255487#8255487 */ +#if defined(__aarch64__) + +int main() {} + +#else + #define _XOPEN_SOURCE 700 #include #include @@ -178,3 +184,5 @@ out: close(nl_sock); exit(rc); } + +#endif diff --git a/run b/run index 925b541..7f0d5e2 100755 --- a/run +++ b/run @@ -293,7 +293,7 @@ if "$tmux"; then if "$debug"; then eval "./tmu ./rungdb -a "${arch}" ${tmux_args}" elif "$gem5"; then - eval "./tmu 'sleep 1;./gem5-shell'" + eval "./tmu 'sleep 2;./gem5-shell'" fi fi echo "$cmd" | tee "${out_arch_dir}/run.sh"