Intel® Software Guard Extensions (Intel® SGX)
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.

Measure per-thread cpu time inside an enclave

Kopf__Benedikt
Beginner
165 Views

Hello.

I would like to measure the per-thread cpu time of a part of my program inside the enclave. If I create two ocalls, ocall_start_time and ocall_stop_time, which take the current per-thread CPU time using getrusage(RUSAGE_THREAD, &start) and getrusage(RUSAGE_THREAD, &stop). At the beginning of the interesting part I call ocall_start_time and at the end of the part I call ocall_stop_time. After obtaining the two values, I compute the difference between start and stop. Is the CPU time spend inside the enclave included in the result? If not, is there any other possibility to measure the per-thread CPU time spend inside an enclave?

Regards, Benedikt

0 Kudos
1 Solution
JesusG_Intel
Moderator
132 Views

Hello Kopf_Benedikt,


Yes, using getrusage in the manner you described will give you the amount of user time spent in the enclave between the two calls.


Sincerely,

Jesus G.

Intel Customer Support


View solution in original post

1 Reply
JesusG_Intel
Moderator
133 Views

Hello Kopf_Benedikt,


Yes, using getrusage in the manner you described will give you the amount of user time spent in the enclave between the two calls.


Sincerely,

Jesus G.

Intel Customer Support


View solution in original post

Reply