Skip to content

add C strace-grate#24

Merged
rennergade merged 7 commits intomainfrom
strace-grate-c
Mar 18, 2026
Merged

add C strace-grate#24
rennergade merged 7 commits intomainfrom
strace-grate-c

Conversation

@drapl0n
Copy link
Copy Markdown
Contributor

@drapl0n drapl0n commented Feb 20, 2026

This PR adds C strace grate. I have currently disabled handler registration for exec and clone syscalls.

Compile using:

lind_compile --compile-grate strace_grate.c strace.c

@stupendoussuperpowers
Copy link
Copy Markdown
Contributor

  1. Can you follow the directory structure of imfs_grate and geteuid_grate as well? i.e. place all the .c/.h files in src/, and add a compile script which will place the .wasm/.cwasm files in output/?

  2. Does this convert arguments to strings as well or is that a TODO?

@drapl0n
Copy link
Copy Markdown
Contributor Author

drapl0n commented Feb 21, 2026

  1. Can you follow the directory structure of imfs_grate and geteuid_grate as well? i.e. place all the .c/.h files in src/, and add a compile script which will place the .wasm/.cwasm files in output/?

Latest version of lind_compile has a flag that facilitates compilation of the grate and copies pre-compiled binary to lindfs, which i think is pretty streamlined.

Does this convert arguments to strings as well or is that a TODO?

Yes, it does convert syscall arguments with type ARG_STR into a string.

@drapl0n drapl0n force-pushed the strace-grate-c branch 3 times, most recently from 00be611 to 13d180c Compare March 1, 2026 22:37
@stupendoussuperpowers
Copy link
Copy Markdown
Contributor

Let me know when all the changes are in so that I can more thoroughly review the code. Housekeeping comments:

  • Latest version of lind_compile has a flag that facilitates compilation of the grate and copies pre-compiled binary to lindfs, which i think is pretty streamlined.

    The compile_grate.sh script can simply be invoking lind_compile --compile-grate, but we should have that script.

    1. The only information about how to compile this in this PR description.
    2. This helps with automation, such as for the benchmark tests. Right now I would have to guess which order I should supply these .c files to lind_compile and the output binary will be named differently based on what order I pick.

    This is more or less standard practice for standalone projects to have a Makefile-esque thing.

  • Add a README

  • Add some basic unit-tests

@rennergade rennergade merged commit 5bcf8d0 into main Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants