From: weiyu Date: Mon, 24 Jun 2019 19:43:31 +0000 (-0700) Subject: add run time library for function entries and exits X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=069d6ff621239c8d200a77c526b6755fefcfe1c8;p=c11tester.git add run time library for function entries and exits --- diff --git a/cmodelint.cc b/cmodelint.cc index 348051a0..3dbb437b 100644 --- a/cmodelint.cc +++ b/cmodelint.cc @@ -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); +} diff --git a/include/cmodelint.h b/include/cmodelint.h index 8530827c..9e82c030 100644 --- a/include/cmodelint.h +++ b/include/cmodelint.h @@ -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