diff options
Diffstat (limited to 'fs-tracer-ebpf/src')
| -rw-r--r-- | fs-tracer-ebpf/src/main.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/fs-tracer-ebpf/src/main.rs b/fs-tracer-ebpf/src/main.rs new file mode 100644 index 0000000..f6d7dfb --- /dev/null +++ b/fs-tracer-ebpf/src/main.rs @@ -0,0 +1,26 @@ +#![no_std] +#![no_main] + +use aya_bpf::{ + macros::tracepoint, + programs::TracePointContext, +}; +use aya_log_ebpf::info; + +#[tracepoint] +pub fn fs_tracer(ctx: TracePointContext) -> u32 { + match try_fs_tracer(ctx) { + Ok(ret) => ret, + Err(ret) => ret, + } +} + +fn try_fs_tracer(ctx: TracePointContext) -> Result<u32, u32> { + info!(&ctx, "tracepoint syscalls called"); + Ok(0) +} + +#[panic_handler] +fn panic(_info: &core::panic::PanicInfo) -> ! { + unsafe { core::hint::unreachable_unchecked() } +} |