You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@teaclave.apache.org by ms...@apache.org on 2021/12/03 00:06:38 UTC

[incubator-teaclave] branch master updated: Log g_peak_heap_used and g_peak_rsrv_mem_committed when finalizing an enclave (#584)

This is an automated email from the ASF dual-hosted git repository.

mssun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave.git


The following commit(s) were added to refs/heads/master by this push:
     new 64b2579  Log g_peak_heap_used and g_peak_rsrv_mem_committed when finalizing an enclave (#584)
64b2579 is described below

commit 64b25798f6dded932923c40fb7bb3e8225a8d542
Author: Mingshen Sun <bo...@mssun.me>
AuthorDate: Thu Dec 2 16:06:33 2021 -0800

    Log g_peak_heap_used and g_peak_rsrv_mem_committed when finalizing an enclave (#584)
---
 services/utils/service_enclave_utils/src/lib.rs | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/services/utils/service_enclave_utils/src/lib.rs b/services/utils/service_enclave_utils/src/lib.rs
index 2f938ab..84fff11 100644
--- a/services/utils/service_enclave_utils/src/lib.rs
+++ b/services/utils/service_enclave_utils/src/lib.rs
@@ -42,6 +42,11 @@ global_dtors_object! {
     }
 }
 
+extern "C" {
+    pub static g_peak_heap_used: isize;
+    pub static g_peak_rsrv_mem_committed: isize;
+}
+
 pub struct ServiceEnclave;
 
 impl ServiceEnclave {
@@ -66,6 +71,10 @@ impl ServiceEnclave {
 
     pub fn finalize() -> teaclave_types::TeeServiceResult<()> {
         debug!("Enclave finalizing");
+        unsafe {
+            debug!("g_peak_heap_used: {}", g_peak_heap_used);
+            debug!("g_peak_rsrv_mem_committed: {}", g_peak_rsrv_mem_committed);
+        }
 
         #[cfg(feature = "cov")]
         sgx_cov::cov_writeout();

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@teaclave.apache.org
For additional commands, e-mail: commits-help@teaclave.apache.org