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

Measure per-thread cpu time inside an enclave

Kopf__Benedikt
Beginner
670 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
637 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

0 Kudos
1 Reply
JesusG_Intel
Moderator
638 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


0 Kudos
Reply