summaryrefslogtreecommitdiffstats
path: root/src/vnet/session
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-04-20 10:51:49 -0700
committerFlorin Coras <fcoras@cisco.com>2018-04-30 23:50:41 -0700
commitc1a448b3ad16f4ae78527220420fe5c1e41a4ab9 (patch)
treebcccc20a32a8dfdd27c8eb32e20681ec30785c86 /src/vnet/session
parentf4addbd03a21c6aa2a25d693cfd66988605fff36 (diff)
tcp/session: debug improvements/fixes
Change-Id: I906e58b4f9827a79a6ab673f8fa2e03036c69820 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session')
-rw-r--r--src/vnet/session/session.c2
-rw-r--r--src/vnet/session/session.h2
-rw-r--r--src/vnet/session/session_debug.h22
3 files changed, 11 insertions, 15 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index dfc967b12dc..568065ebc0d 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -1293,7 +1293,7 @@ session_manager_main_enable (vlib_main_t * vm)
clib_rwlock_init (&smm->peekers_rw_locks[i]);
}
-#if SESSION_DBG
+#if SESSION_DEBUG
vec_validate (smm->last_event_poll_by_thread, num_threads - 1);
#endif
diff --git a/src/vnet/session/session.h b/src/vnet/session/session.h
index 9d534aec19b..b54f46189f3 100644
--- a/src/vnet/session/session.h
+++ b/src/vnet/session/session.h
@@ -194,7 +194,7 @@ struct _session_manager_main
/** Preallocate session config parameter */
u32 preallocated_sessions;
-#if SESSION_DBG
+#if SESSION_DEBUG
/**
* last event poll time by thread
* Debug only. Will cause false cache-line sharing as-is
diff --git a/src/vnet/session/session_debug.h b/src/vnet/session/session_debug.h
index 12c667c08d8..f63509d1ffb 100644
--- a/src/vnet/session/session_debug.h
+++ b/src/vnet/session/session_debug.h
@@ -44,10 +44,7 @@ typedef enum _session_evt_dbg
{ \
u32 data[_size]; \
} * ed; \
- transport_proto_vft_t *vft = \
- transport_protocol_get_vft (_s->session_type); \
- transport_connection_t *_tc = \
- vft->get_connection (_s->connection_index, _s->thread_index); \
+ transport_connection_t *_tc = session_get_transport (_s); \
ed = ELOG_TRACK_DATA (&vlib_global_main.elog_main, \
_e, _tc->elog_track)
@@ -101,24 +98,23 @@ typedef enum _session_evt_dbg
#endif /* SESSION_DEQ_NODE_EVTS */
#if SESSION_EVT_POLL_DBG && SESSION_DEBUG > 1
-#define SESSION_EVT_POLL_GAP(_smm, _my_thread_index) \
+#define SESSION_EVT_POLL_GAP(_smm, _ti) \
{ \
ELOG_TYPE_DECLARE (_e) = \
{ \
- .format = "nixon-gap: %d MS", \
+ .format = "nixon-gap: %d us", \
.format_args = "i4", \
}; \
DEC_SESSION_ED(_e, 1); \
ed->data[0] = (u32) ((now - \
- _smm->last_event_poll_by_thread[my_thread_index])*1000.0); \
+ _smm->last_event_poll_by_thread[_ti])*1000000.0); \
}
-#define SESSION_EVT_POLL_GAP_TRACK_HANDLER(_smm, _my_thread_index) \
+#define SESSION_EVT_POLL_GAP_TRACK_HANDLER(_smm, _ti) \
{ \
- if (PREDICT_TRUE( \
- smm->last_event_poll_by_thread[my_thread_index] != 0.0)) \
- if (now > smm->last_event_poll_by_thread[_my_thread_index] + 500e-6)\
- SESSION_EVT_POLL_GAP(smm, my_thread_index); \
- _smm->last_event_poll_by_thread[my_thread_index] = now; \
+ if (PREDICT_TRUE (smm->last_event_poll_by_thread[_ti] != 0.0)) \
+ if (now > smm->last_event_poll_by_thread[_ti] + 500e-6) \
+ SESSION_EVT_POLL_GAP(smm, _ti); \
+ _smm->last_event_poll_by_thread[_ti] = now; \
}
#else