So I have a python script running in sgx enclave using graphene. I need to check values like memory utilization and cpu utilization. How can I check these values of the script running inside enclave?
How to check memory usage of application in sgx enclave
668 views Asked by Jake Hemmington At
2
For measuring memory utilization of SGX enclaves you can use the Enclave Memory Measurement Tool (sgx_emmt). This will report to you the peak usages of: stack, heap, and reserved memory. It has a big limitation that it only reports the statistics after you destroy the enclave.
On Linux, sgx_emmt is provided by sgx-gdb. Search for a chapter "Enclave Memory Measurement Tool" in the Developer Reference for more details.
You can also check this blog post to see how to conveniently use the tool.
For CPU utilization you can take a look at Intel VTune. It has an option sgx-hotspots, which allows to collect statistics from the enclave programs.