summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session_debug.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-06-14 14:55:50 -0700
committerDave Barach <openvpp@barachs.net>2018-06-19 22:08:34 +0000
commit8b20bf5ef72a85ed70d7457f33c096f1eef51d0a (patch)
tree7e485897c8ef6d5d21c45c58e74600250dca92b7 /src/vnet/session/session_debug.h
parent0c8a3bc95dd79cc856c4210a2234d15153149be0 (diff)
tcp: optimize tcp output
Change-Id: Idf17a0633a1618b12c22b1119e40c2e9d3192df9 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/session_debug.h')
-rw-r--r--src/vnet/session/session_debug.h31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/vnet/session/session_debug.h b/src/vnet/session/session_debug.h
index f63509d1ffb..559f0bd6ed1 100644
--- a/src/vnet/session/session_debug.h
+++ b/src/vnet/session/session_debug.h
@@ -23,6 +23,8 @@
_(DEQ, "dequeue") \
_(DEQ_NODE, "dequeue") \
_(POLL_GAP_TRACK, "poll gap track") \
+ _(POLL_DISPATCH_TIME, "dispatch time")\
+ _(DISPATCH_END, "dispatch end") \
typedef enum _session_evt_dbg
{
@@ -31,7 +33,7 @@ typedef enum _session_evt_dbg
#undef _
} session_evt_dbg_e;
-#define SESSION_DEBUG (0 && TRANSPORT_DEBUG)
+#define SESSION_DEBUG 0 * (TRANSPORT_DEBUG > 0)
#define SESSION_DEQ_NODE_EVTS (0)
#define SESSION_EVT_POLL_DBG (0)
@@ -55,6 +57,7 @@ typedef enum _session_evt_dbg
} * ed; \
ed = ELOG_DATA (&vlib_global_main.elog_main, _e)
+#if SESSION_DEQ_NODE_EVTS && SESSION_DEBUG > 1
#define SESSION_EVT_DEQ_HANDLER(_s, _body) \
{ \
ELOG_TYPE_DECLARE (_e) = \
@@ -77,7 +80,6 @@ typedef enum _session_evt_dbg
do { _body; } while (0); \
}
-#if SESSION_DEQ_NODE_EVTS && SESSION_DEBUG > 1
#define SESSION_EVT_DEQ_NODE_HANDLER(_node_evt) \
{ \
ELOG_TYPE_DECLARE (_e) = \
@@ -94,6 +96,8 @@ typedef enum _session_evt_dbg
ed->data[0] = _node_evt; \
}
#else
+#define SESSION_EVT_DEQ_HANDLER(_s, _body)
+#define SESSION_EVT_ENQ_HANDLER(_s, _body)
#define SESSION_EVT_DEQ_NODE_HANDLER(_node_evt)
#endif /* SESSION_DEQ_NODE_EVTS */
@@ -117,11 +121,34 @@ typedef enum _session_evt_dbg
_smm->last_event_poll_by_thread[_ti] = now; \
}
+#define SESSION_EVT_POLL_DISPATCH_TIME_HANDLER(_smm, _ti) \
+{ \
+ f64 diff = vlib_time_now (vlib_get_main ()) - \
+ _smm->last_event_poll_by_thread[_ti]; \
+ if (diff > 5e-2) \
+ { \
+ ELOG_TYPE_DECLARE (_e) = \
+ { \
+ .format = "dispatch time: %d us", \
+ .format_args = "i4", \
+ }; \
+ DEC_SESSION_ED(_e, 1); \
+ ed->data[0] = diff *1000000.0; \
+ } \
+}
+
#else
#define SESSION_EVT_POLL_GAP(_smm, _my_thread_index)
#define SESSION_EVT_POLL_GAP_TRACK_HANDLER(_smm, _my_thread_index)
+#define SESSION_EVT_POLL_DISPATCH_TIME_HANDLER(_smm, _ti)
#endif /* SESSION_EVT_POLL_DBG */
+#define SESSION_EVT_DISPATCH_END_HANDLER(_smm, _ti) \
+{ \
+ SESSION_EVT_DEQ_NODE_HANDLER(1); \
+ SESSION_EVT_POLL_DISPATCH_TIME_HANDLER(_smm, _ti); \
+}
+
#define CONCAT_HELPER(_a, _b) _a##_b
#define CC(_a, _b) CONCAT_HELPER(_a, _b)
#define SESSION_EVT_DBG(_evt, _args...) CC(_evt, _HANDLER)(_args)