summaryrefslogtreecommitdiffstats
path: root/vppinfra
diff options
context:
space:
mode:
Diffstat (limited to 'vppinfra')
-rw-r--r--vppinfra/vppinfra/elog.c6
-rw-r--r--vppinfra/vppinfra/elog.h26
2 files changed, 29 insertions, 3 deletions
diff --git a/vppinfra/vppinfra/elog.c b/vppinfra/vppinfra/elog.c
index 3c327481141..222c55fd63e 100644
--- a/vppinfra/vppinfra/elog.c
+++ b/vppinfra/vppinfra/elog.c
@@ -52,7 +52,10 @@ static inline void elog_lock (elog_main_t * em)
static inline void elog_unlock (elog_main_t * em)
{
if (PREDICT_FALSE(em->lock != 0))
- *em->lock = 0;
+ {
+ CLIB_MEMORY_BARRIER();
+ *em->lock = 0;
+ }
}
/* Non-inline version. */
@@ -168,7 +171,6 @@ word elog_event_type_register (elog_main_t * em, elog_event_type_t * t)
}
new_event_type (em, l);
-
elog_unlock(em);
return l;
diff --git a/vppinfra/vppinfra/elog.h b/vppinfra/vppinfra/elog.h
index 8c5482ae284..db84c95f7ca 100644
--- a/vppinfra/vppinfra/elog.h
+++ b/vppinfra/vppinfra/elog.h
@@ -273,7 +273,7 @@ elog_event_data_not_inline (elog_main_t * em,
return elog_event_data (em, type, track, cpu_time);
}
-/* Most common form: log a single 32 bit datum. */
+/* Most common forms: log a single 32 bit datum, w / w-out track */
always_inline void
elog (elog_main_t * em, elog_event_type_t * type, u32 data)
{
@@ -297,6 +297,30 @@ elog_inline (elog_main_t * em, elog_event_type_t * type, u32 data)
d[0] = data;
}
+always_inline void
+elog_track (elog_main_t * em, elog_event_type_t * type, elog_track_t *track,
+ u32 data)
+{
+ u32 * d = elog_event_data_not_inline
+ (em,
+ type,
+ track,
+ clib_cpu_time_now ());
+ d[0] = data;
+}
+
+always_inline void
+elog_track_inline (elog_main_t * em, elog_event_type_t * type,
+ elog_track_t *track, u32 data)
+{
+ u32 * d = elog_event_data_inline
+ (em,
+ type,
+ track,
+ clib_cpu_time_now ());
+ d[0] = data;
+}
+
always_inline void *
elog_data (elog_main_t * em, elog_event_type_t * type, elog_track_t * track)
{