Intel® Software Guard Extensions (Intel® SGX)
Discussion board focused on hardware-based isolation and memory encryption to provide extended code protection in solutions.

No results from the sgx_emmt tool.

JC1
Beginner
916 Views

Hi,

I am trying to use the sgx_emmt tool to measure the memory used by program within the enclave. I have read the documentation and set the configuration file and debug flags accordingly. The .pdb and .obj files are in the same place as the executable I am running (I'm using Visual Studio)

I run it as follows: sgx_emmt MyExe.exe but all I see is "The command line is: MyExe.exe".

I also tried running it with the --enclave option but even if I use the full filepath to the .signed.dll file it says "The enclave does not exist".

Please can anyone shed some light on this?

Many Thanks.

0 Kudos
1 Solution
Surenthar_S_Intel
916 Views

Hi JC,

Two versions of sgx_emmt are provided in the Intel® Software Guard Extensions Evaluation SDK: 32bit version and 64bit version. Cross utilizing the tool will cause a measurement failure. By default, the 64bit version is utilized. To measure 32bit enclaves, use the 32bit version sgx_emmt manually.

I build the enclave and application in x64 bit mode and used the following command for measure the memory used by program within the enclave (Sample Application Shipped with Intel SGX SDK).

sgx_emmt --enclave=Enclave.signed.dll App.exe

sgx_emmt App.exe

Output: 
The commandline is : "App.exe".
Enclave : "Enclave.signed.dll"
       [Peak stack use] : 0xbc8
       [Peak heap use] : 0x1000

PFA for more reference.

Thanks and Regards,
Surenthar Selvaraj

View solution in original post

0 Kudos
6 Replies
Surenthar_S_Intel
917 Views

Hi JC,

Two versions of sgx_emmt are provided in the Intel® Software Guard Extensions Evaluation SDK: 32bit version and 64bit version. Cross utilizing the tool will cause a measurement failure. By default, the 64bit version is utilized. To measure 32bit enclaves, use the 32bit version sgx_emmt manually.

I build the enclave and application in x64 bit mode and used the following command for measure the memory used by program within the enclave (Sample Application Shipped with Intel SGX SDK).

sgx_emmt --enclave=Enclave.signed.dll App.exe

sgx_emmt App.exe

Output: 
The commandline is : "App.exe".
Enclave : "Enclave.signed.dll"
       [Peak stack use] : 0xbc8
       [Peak heap use] : 0x1000

PFA for more reference.

Thanks and Regards,
Surenthar Selvaraj

0 Kudos
JC1
Beginner
916 Views

Thanks very much. I knew it would be something simple! I've got it working now.

I did have to copy the 32 bit version elsewhere and rename it otherwise it was still using the 64 bit version. Not a problem, but just in case anyone else has this problem.

Thanks again!

0 Kudos
André_E_
Beginner
916 Views

Hi all,

I'm getting incredible high numbers for the peak heap use.

What's the problem? I am using the 32 bit version of the sgx_emmt tool since my enclave is a 32 bit one.

The result is:

The command line is : "App.exe ".
Enclave : "Enclave.signed.dll"
       [Peak stack use] : 5KB
       [Peak heap use] : 35 064 044 285 067 264KB
(I added the spaces for a better readability)

See it's something like 35064 Peta Bytes...

Any suggestions?

0 Kudos
Juan_d_Intel
Employee
916 Views

Can you reproduce this problem with one of the sample enclaves?

What version of the SDK are you using?

0 Kudos
André_E_
Beginner
921 Views

Sure even with the sample enclaves I get huge values.

I have both the SDK and PSW for Windows v1.9.100.41172 installed. My OS is Windows 7 64 bit and the CPU is Intel Core i5-6500T @ 2.50 GHz 2.5GHz. Here are the commands I used and the console output of the sgx_emmt tool e.g. for the examples called "SampleEnclave" and "SealdData":

C:\Program Files (x86)\Intel\IntelSGXSDK\src\SampleEnclave\Debug>"C:\Program Files (x86)\Intel\IntelSGXSDK\bin\win32\Release\sgx_emmt.exe" --enclave=Enclave.signed.dll App.exe
The command line is: "App.exe ".
Enclave: "Enclave.signed.dll"
        [Peak stack use]: 17179869186KB
        [Peak heap use]: 26967996572368896KB

C:\Program Files (x86)\Intel\IntelSGXSDK\src\SealedData\Debug>"C:\Program Files (x86)\Intel\IntelSGXSDK\bin\win32\Release\sgx_emmt.exe" --enclave=DRM_enclave.signed.dll DRM_app.exe
The command line is: "DRM_app.exe ".
Enclave: "DRM_enclave.signed.dll"
        [Peak stack use]: 0KB
        [Peak heap use]: 31075703294263296KB
Enclave: "DRM_enclave.signed.dll"
        [Peak stack use]: 0KB
        [Peak heap use]: 31074706861850624KB
Enclave: "DRM_enclave.signed.dll"
        [Peak stack use]: 0KB
        [Peak heap use]: 31074706861850624KB
Enclave: "DRM_enclave.signed.dll"
        [Peak stack use]: 0KB
        [Peak heap use]: 31074706861850624KB
Enclave: "DRM_enclave.signed.dll"
        [Peak stack use]: 0KB
        [Peak heap use]: 31074706861850624KB

 

 

Thanks for any help.

0 Kudos
André_E_
Beginner
920 Views

Hi guys,

any news on my huge number results issue with sgx_emmt tool? Do you want me to open a new thread for this?

Could you reproduce it with the samples for the windows version v1.9.100.41172?

 

Kind regards,

André

0 Kudos
Reply