Skip to content

feature: add sgx_tracer with memcmp example - #101

Merged
jovanbulck merged 10 commits into
jovanbulck:masterfrom
Charitonos:feature/sgx-tracer
May 28, 2026
Merged

jovanbulck merged 10 commits into
jovanbulck:masterfrom
Charitonos:feature/sgx-tracer

Conversation

@Charitonos

Copy link
Copy Markdown
Contributor

New feature

tracer support for sgx-step

@jovanbulck jovanbulck left a comment •

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @Charitonos , this is very nice! See (detailed, sometimes nitpicky) comments above

For the first review iteration, I suggest we try to:

  • focus on finalizing the tracer API (see comments on the init and opt_add functions):
    • first always have to do sgx_tracer_add_mod
    • then optionally call sgxs_tracer_init_mod to pass options?
  • avoid the code duplication from copying the entire memcmp example: can we just create a minimal standalone main.c that traces everything for a small enclave? (Once this gets merged, I think we can focus on creating a unified cmdline-driven main.c sgx-step cmdline utility that could work for any enclave :) )

Comment thread libsgxstep/sgx_tracer.h Outdated
Comment thread libsgxstep/sgx_tracer.h
Comment thread libsgxstep/sgx_tracer.h Outdated
Comment thread libsgxstep/sgx_tracer.h Outdated
Comment thread libsgxstep/sgx_tracer.h Outdated
Comment thread libsgxstep/trace_pages.c
Comment thread libsgxstep/trace_pages.c Outdated
Comment thread libsgxstep/trace_pages.c
Comment thread libsgxstep/trace_pages.c Outdated
Comment thread libsgxstep/sgx_tracer.c Outdated
Comment thread app/tracer/example/Enclave/encl.c Outdated
Comment thread app/tracer/example/gtkwave_example.png Outdated
Comment thread app/tracer/example/main.c Outdated
Comment thread app/tracer/main.c
Comment thread app/tracer/example/main.c Outdated
Comment thread libsgxstep/enclave.h Outdated
Comment thread libsgxstep/enclave.h Outdated
Comment thread libsgxstep/enclave.c
Comment thread libsgxstep/sgx_tracer.c Outdated
Comment thread libsgxstep/sgx_tracer.c Outdated

@jovanbulck jovanbulck left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks @Charitonos ! I tested it on the aeolus machine (using sim-stepping) and it works nicely there :) There's only a couple of very minor nitpicks/clarifications left before this can be merged! 👍

Comment thread app/tracer/example/main.c Outdated
Comment thread app/tracer/Enclave/encl.c
Comment thread app/tracer/example/page_access_pattern.png Outdated
Comment thread app/tracer/example_trace.gtkw
@jovanbulck

Copy link
Copy Markdown
Owner

Thanks @Charitonos , looks excellent!

Before I can merge this, I want to avoid any licensing issues in the upstream source tree: can you please copy the LICENCE file from https://github.com/zyantific/zydis into tools/disasm/zydis-amalgamated-v4.0.0/LICENSE and add a README.md in tools/disasm/README.md to explain the zydis-amalgamated-v4.0.0 is taken verbatim from https://github.com/zyantific/zydis and is licensed under MIT license? 🙏

Once this is done, it can be merged! 🚀

@jovanbulck
jovanbulck merged commit 5ae41a2 into jovanbulck:master May 28, 2026
0 of 3 checks passed
@jovanbulck

Copy link
Copy Markdown
Owner

Merged, thanks @Charitonos ! 🚀

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.

2 participants