Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to invoke callout prior to each instruction #563

Merged
merged 2 commits into from
Oct 12, 2024

Conversation

Alan-Jowett
Copy link
Collaborator

This pull request introduces a new debugging feature for the ubpf virtual machine, allowing a debug function to be registered and invoked before each instruction execution. The most important changes include adding the debug function registration and invocation, updating the VM state structure, and creating a new test to verify this functionality.

Debugging Feature Enhancements:

  • Added a new typedef ubpf_debug_fn and the function ubpf_register_debug_fn to ubpf.h to allow the registration of a debug function that gets invoked before each instruction. (vm/inc/ubpf.h)
  • Updated the ubpf_vm structure to include the debug function and its context. (vm/ubpf_int.h)
  • Modified ubpf_exec_ex to call the registered debug function before executing each instruction. (vm/ubpf_vm.c)
  • Implemented the ubpf_register_debug_fn function to handle the registration and validation of the debug function. (vm/ubpf_vm.c)

Testing and Documentation:

  • Created a new test source file ubpf_test_debug_function.cc to verify that the debug function is correctly registered and invoked, capturing the VM state before each instruction. (custom_tests/srcs/ubpf_test_debug_function.cc)
  • Added a test description file ubpf_test_debug_function.md to document the purpose and functionality of the new test. (custom_tests/descrs/ubpf_test_debug_function.md)
  • Included a test input file ubpf_test_debug_function.input to provide the necessary data for the new test. (custom_tests/data/ubpf_test_debug_function.input)

@coveralls
Copy link

coveralls commented Oct 10, 2024

Coverage Status

coverage: 79.637%. first build
when pulling 1640801 on Alan-Jowett:single_step
into f81cba0 on iovisor:main.

@Alan-Jowett Alan-Jowett merged commit 35471f3 into iovisor:main Oct 12, 2024
47 checks passed
@Alan-Jowett Alan-Jowett deleted the single_step branch October 20, 2024 16:53
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