15 #ifndef SRC_VNET_SESSION_SESSION_DEBUG_H_ 16 #define SRC_VNET_SESSION_SESSION_DEBUG_H_ 21 #define foreach_session_dbg_evt \ 24 _(DEQ_NODE, "dequeue") \ 25 _(POLL_GAP_TRACK, "poll gap track") \ 27 typedef enum _session_evt_dbg
29 #define _(sym, str) SESSION_EVT_##sym, 34 #define SESSION_DBG (0) 35 #define SESSION_DEQ_NODE_EVTS (0) 36 #define SESSION_EVT_POLL_DBG (1) 38 #if TRANSPORT_DEBUG && SESSION_DBG 40 #define DEC_SESSION_ETD(_s, _e, _size) \ 45 transport_proto_vft_t *vft = \ 46 session_get_transport_vft (_s->session_type); \ 47 transport_connection_t *_tc = \ 48 vft->get_connection (_s->connection_index, _s->thread_index); \ 49 ed = ELOG_TRACK_DATA (&vlib_global_main.elog_main, \ 52 #define DEC_SESSION_ED(_e, _size) \ 57 ed = ELOG_DATA (&vlib_global_main.elog_main, _e) 59 #define SESSION_EVT_DEQ_HANDLER(_s, _body) \ 61 ELOG_TYPE_DECLARE (_e) = \ 63 .format = "deq: id %d len %d rd %d wnd %d", \ 64 .format_args = "i4i4i4i4", \ 66 DEC_SESSION_ETD(_s, _e, 4); \ 67 do { _body; } while (0); \ 70 #define SESSION_EVT_ENQ_HANDLER(_s, _body) \ 72 ELOG_TYPE_DECLARE (_e) = \ 74 .format = "enq: id %d length %d", \ 75 .format_args = "i4i4", \ 77 DEC_SESSION_ETD(_s, _e, 2); \ 78 do { _body; } while (0); \ 81 #if SESSION_DEQ_NODE_EVTS 82 #define SESSION_EVT_DEQ_NODE_HANDLER(_node_evt) \ 84 ELOG_TYPE_DECLARE (_e) = \ 86 .format = "deq-node: %s", \ 87 .format_args = "t4", \ 88 .n_enum_strings = 2, \ 94 DEC_SESSION_ED(_e, 1); \ 95 ed->data[0] = _node_evt; \ 98 #define SESSION_EVT_DEQ_NODE_HANDLER(_node_evt) 101 #if SESSION_DBG && SESSION_EVT_POLL_DBG 102 #define SESSION_EVT_POLL_GAP(_smm, _my_thread_index) \ 104 ELOG_TYPE_DECLARE (_e) = \ 106 .format = "nixon-gap: %d MS", \ 107 .format_args = "i4", \ 109 DEC_SESSION_ED(_e, 1); \ 110 ed->data[0] = (u32) ((now - \ 111 _smm->last_event_poll_by_thread[my_thread_index])*1000.0); \ 113 #define SESSION_EVT_POLL_GAP_TRACK_HANDLER(_smm, _my_thread_index) \ 116 smm->last_event_poll_by_thread[my_thread_index] != 0.0)) \ 117 if (now > smm->last_event_poll_by_thread[_my_thread_index] + 500e-6)\ 118 SESSION_EVT_POLL_GAP(smm, my_thread_index); \ 119 _smm->last_event_poll_by_thread[my_thread_index] = now; \ 123 #define SESSION_EVT_POLL_GAP(_smm, _my_thread_index) 124 #define SESSION_EVT_POLL_GAP_TRACK_HANDLER(_smm, _my_thread_index) 127 #define CONCAT_HELPER(_a, _b) _a##_b 128 #define CC(_a, _b) CONCAT_HELPER(_a, _b) 129 #define SESSION_EVT_DBG(_evt, _args...) CC(_evt, _HANDLER)(_args) 132 #define SESSION_EVT_DBG(_evt, _args...)
#define foreach_session_dbg_evt
enum _session_evt_dbg session_evt_dbg_e