How to capture hotspots within enclaves using the Intel® VTune™ command line
- Ran Intel® VTune™ Profiler with:
$ export INTEL_LIBITTNOTIFY64=/opt/intel/oneapi/vtune/latest/lib64/runtime/libittnotify_collector.so
$ ./vtune -collect sgx-hotspots -collect-with runss -target-pid <pid> - Enclave functions do not show up in the Intel® VTune™ Profiler summary report.
Enclaves are compiled as static shared libraries with an untrusted application and run as separate threads within the application's process. The hotspots report from Intel® VTune™ shows the functions in the overall application that take the most time to execute or use the most resources. You may not see enclave functions because enclaves are typically lightweight by design. Other functions from the application show up in the hotspots report because they take more CPU cycles to execute.
- Use the sgx-hotspots analysis type in the Intel® VTune™ command line to profile enclaves.
- To capture enclave functions that run quickly, shorten the sampling interval using the sampling-interval knob.
$ vtune -collect sgx-hotspots -knob sampling-interval=.01 ./app - If using Intel® VTune™ from the command line only, generate comma-separated values (CSV) versions of various reports by running:
$ vtune -report <reportname> -format=csv - Use vtune -help report to find available report names, for example, callstacks, hotspots, top-down.
- To see data from the enclave only, run:
$ vtune -report hotspots -format=csv -filter module=enclave.signed.so