summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/tw_timer_template.h
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2017-08-29 11:43:37 -0400
committerDamjan Marion <dmarion.lists@gmail.com>2017-09-01 14:17:53 +0000
commitb7f1faa7fbd4575f28766e552a73810c6de0ace3 (patch)
tree30343f8b6f4778250bd2bcb0d123aedfd7d8c172 /src/vppinfra/tw_timer_template.h
parent774b217916ff34ea4ba89d117e93e5b3dd68276f (diff)
Add fixed-size, preallocated pool support
Simply call pool_init_fixed(...) before using the pool. Note that fixed, preallocated pools live in individually-mmap'ed address segments, except for the free element bitmap. A large fixed pool can exceed 4gb. Fix tcp buffer allocator leak, remove broken assert Change-Id: I4421082e12a77c41c6e20f7747f3150dcd01fc26 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vppinfra/tw_timer_template.h')
-rw-r--r--src/vppinfra/tw_timer_template.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/vppinfra/tw_timer_template.h b/src/vppinfra/tw_timer_template.h
index 0404e3f4715..0217644df6e 100644
--- a/src/vppinfra/tw_timer_template.h
+++ b/src/vppinfra/tw_timer_template.h
@@ -170,6 +170,13 @@ typedef enum
} tw_ring_index_t;
#endif /* __defined_tw_timer_wheel_slot__ */
+typedef CLIB_PACKED (struct
+ {
+ u8 timer_id;
+ u32 pool_index;
+ u32 handle;
+ }) TWT (trace);
+
typedef struct
{
/** Timer pool */
@@ -211,11 +218,20 @@ typedef struct
/** expired timer callback, receives a vector of handles */
void (*expired_timer_callback) (u32 * expired_timer_handles);
- /** vector of expired timers */
+ /** vectors of expired timers */
u32 *expired_timer_handles;
/** maximum expirations */
u32 max_expirations;
+
+ /** current trace index */
+#if TW_START_STOP_TRACE_SIZE > 0
+ /* Start/stop/expire tracing */
+ u32 trace_index;
+ u32 trace_wrapped;
+ TWT (trace) traces[TW_START_STOP_TRACE_SIZE];
+#endif
+
} TWT (tw_timer_wheel);
u32 TW (tw_timer_start) (TWT (tw_timer_wheel) * tw,
@@ -236,6 +252,12 @@ u32 *TW (tw_timer_expire_timers_vec) (TWT (tw_timer_wheel) * tw, f64 now,
u32 TW (tw_timer_first_expires_in_ticks) (TWT (tw_timer_wheel) * tw);
#endif
+#if TW_START_STOP_TRACE_SIZE > 0
+void TW (tw_search_trace) (TWT (tw_timer_wheel) * tw, u32 handle);
+void TW (tw_timer_trace) (TWT (tw_timer_wheel) * tw, u32 timer_id,
+ u32 pool_index, u32 handle);
+#endif
+
/*
* fd.io coding-style-patch-verification: ON
*