Skip to content
Snippets Groups Projects
Commit dcd6cf29 authored by Luis Gerhorst's avatar Luis Gerhorst
Browse files

Put compiler memory barriers at memo_checkpoint entry/return

parent 333989dc
No related branches found
No related tags found
No related merge requests found
...@@ -36,6 +36,8 @@ extern struct checkpoint_record *current_cpr; ...@@ -36,6 +36,8 @@ extern struct checkpoint_record *current_cpr;
extern struct checkpoint_record *current_cpr_limit; extern struct checkpoint_record *current_cpr_limit;
static __always_inline void memo_checkpoint(const char *name) { static __always_inline void memo_checkpoint(const char *name) {
asm volatile("" ::: "memory");
/* The following catches both the case when no run hast been started /* The following catches both the case when no run hast been started
* (both are NULL) and when we are attempting to record too many * (both are NULL) and when we are attempting to record too many
* checkpoints. */ * checkpoints. */
...@@ -43,7 +45,6 @@ static __always_inline void memo_checkpoint(const char *name) { ...@@ -43,7 +45,6 @@ static __always_inline void memo_checkpoint(const char *name) {
return; return;
} }
asm volatile("" ::: "memory");
#ifdef CONFIG_MEASUREMORE_TIMESTAMP_TYPE_PMCCNTR #ifdef CONFIG_MEASUREMORE_TIMESTAMP_TYPE_PMCCNTR
pmccntr_read(current_cpr->pmccntr_ts.value); pmccntr_read(current_cpr->pmccntr_ts.value);
#endif #endif
...@@ -56,7 +57,6 @@ static __always_inline void memo_checkpoint(const char *name) { ...@@ -56,7 +57,6 @@ static __always_inline void memo_checkpoint(const char *name) {
#ifdef CONFIG_MEASUREMORE_TIMESTAMP_TYPE_NSTIMEOFDAY #ifdef CONFIG_MEASUREMORE_TIMESTAMP_TYPE_NSTIMEOFDAY
getnstimeofday(&current_cpr->nstimeofday); getnstimeofday(&current_cpr->nstimeofday);
#endif #endif
asm volatile("" ::: "memory");
current_cpr->name_blob.data = (void *) name; current_cpr->name_blob.data = (void *) name;
...@@ -66,6 +66,8 @@ static __always_inline void memo_checkpoint(const char *name) { ...@@ -66,6 +66,8 @@ static __always_inline void memo_checkpoint(const char *name) {
* so we can simply drop the rows where a checkpoint is missing in our * so we can simply drop the rows where a checkpoint is missing in our
* scripts. */ * scripts. */
current_cpr++; current_cpr++;
asm volatile("" ::: "memory");
} }
#endif /* MEASUREMORE_H */ #endif /* MEASUREMORE_H */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment