summaryrefslogtreecommitdiffstats
path: root/vppinfra
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2016-03-26 18:45:42 -0400
committerDave Barach <dave@barachs.net>2016-03-26 18:45:52 -0400
commitfb6e59d839001b37bbb70e253627d5b1331ae918 (patch)
treeaa62c9da5996e254fe98cce20f3075ba1e2c7480 /vppinfra
parent20a64f5f8a3dc6132c79da074adc7de1f037a154 (diff)
Improve main-loop event-logs
Change-Id: I984debeffe0dce36c9e7ab963f25d862cc7550cc Signed-off-by: Dave Barach <dave@barachs.net>
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)
{