diff --git a/src/app-layer.c b/src/app-layer.c index 4c7770c1ac..77c2d4f95a 100644 --- a/src/app-layer.c +++ b/src/app-layer.c @@ -656,20 +656,14 @@ void AppLayerDestroyCtxThread(AppLayerThreadCtx *app_tctx) SCReturn; } -/* profiling */ - -void AppLayerProfilingReset(AppLayerThreadCtx *app_tctx) +void AppLayerProfilingResetInternal(AppLayerThreadCtx *app_tctx) { -#ifdef PROFILING PACKET_PROFILING_APP_RESET(app_tctx); -#endif } -void AppLayerProfilingStore(AppLayerThreadCtx *app_tctx, Packet *p) +void AppLayerProfilingStoreInternal(AppLayerThreadCtx *app_tctx, Packet *p) { -#ifdef PROFILING PACKET_PROFILING_APP_STORE(app_tctx, p); -#endif } /***** Unittests *****/ diff --git a/src/app-layer.h b/src/app-layer.h index 5d4f51ca32..ca221d2dc1 100644 --- a/src/app-layer.h +++ b/src/app-layer.h @@ -31,6 +31,8 @@ #include "stream-tcp-reassemble.h" #include "stream.h" +#include "util-profiling.h" + #define APP_LAYER_DATA_ALREADY_SENT_TO_APP_LAYER \ (~STREAM_TOSERVER & ~STREAM_TOCLIENT) @@ -108,8 +110,26 @@ AppLayerThreadCtx *AppLayerGetCtxThread(ThreadVars *tv); void AppLayerDestroyCtxThread(AppLayerThreadCtx *tctx); -void AppLayerProfilingReset(AppLayerThreadCtx *tctx); -void AppLayerProfilingStore(AppLayerThreadCtx *tctx, Packet *p); +/***** Profiling *****/ + +void AppLayerProfilingResetInternal(AppLayerThreadCtx *app_tctx); + +static inline void AppLayerProfilingReset(AppLayerThreadCtx *app_tctx) +{ +#ifdef PROFILING + AppLayerProfilingResetInternal(app_tctx); +#endif +} + +void AppLayerProfilingStoreInternal(AppLayerThreadCtx *app_tctx, Packet *p); + +static inline void AppLayerProfilingStore(AppLayerThreadCtx *app_tctx, Packet *p) +{ +#ifdef PROFILING + AppLayerProfilingStoreInternal(app_tctx, p); +#endif +} + /***** Unittests *****/