add run time library for function entries and exits
authorweiyu <weiyuluo1232@gmail.com>
Mon, 24 Jun 2019 19:43:31 +0000 (12:43 -0700)
committerweiyu <weiyuluo1232@gmail.com>
Mon, 24 Jun 2019 19:43:31 +0000 (12:43 -0700)
cmodelint.cc
include/cmodelint.h

index 348051a0f7f13fb736baf14f8a24c81bcfdbb4f9..3dbb437b9914e42b0f045dda81b31af223aa2620 100644 (file)
@@ -358,3 +358,13 @@ void cds_atomic_thread_fence(int atomic_index, const char * position) {
         __old__ = __old__;  Silence clang (-Wunused-value)                    \
          })
  */
+
+void cds_func_entry(const char * funcName) {
+        Thread * th = thread_current();
+        printf("thread %d Enter function %s\n", th->get_id(), funcName);
+}
+
+void cds_func_exit(const char * funcName) {
+        Thread * th = thread_current();
+        printf("thread %d Exit from function %s\n", th->get_id(), funcName);
+}
index 8530827cfe39b5cf673efa3e047a8f987f7642a1..9e82c030900c4ab2e89a8a8c4b2575e908d03ce1 100644 (file)
@@ -98,6 +98,9 @@ bool cds_atomic_compare_exchange64_v2(void* addr, uint64_t* expected, uint64_t d
 // cds atomic thread fence
 void cds_atomic_thread_fence(int atomic_index, const char * position);
 
+void cds_func_entry(const char * funcName);
+void cds_func_exit(const char * funcName);
+
 #if __cplusplus
 }
 #endif