tcp: add debug stats about reassembly fast paths

Only shown if --enable-debug is passed to configure.
pull/1315/head
Victor Julien 10 years ago
parent 2bba5eb704
commit 37b56dca55

@ -551,6 +551,10 @@ void StreamTcpReassembleFreeThreadCtx(TcpReassemblyThreadCtx *ra_ctx)
{
SCEnter();
AppLayerDestroyCtxThread(ra_ctx->app_tctx);
#ifdef DEBUG
SCLogDebug("reassembly fast path stats: fp1 %"PRIu64" fp2 %"PRIu64" sp %"PRIu64,
ra_ctx->fp1, ra_ctx->fp2, ra_ctx->sp);
#endif
SCFree(ra_ctx);
SCReturn;
}
@ -2581,7 +2585,9 @@ static inline int DoReassemble(ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx,
AppLayerProfilingStore(ra_ctx->app_tctx, p);
rd->data_sent += seg->payload_len;
rd->ra_base_seq += seg->payload_len;
#ifdef DEBUG
ra_ctx->fp1++;
#endif
/* if after the first data chunk we have no alproto yet,
* there is no point in continueing here. */
if (!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(stream)) {
@ -2598,7 +2604,9 @@ static inline int DoReassemble(ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx,
AppLayerProfilingStore(ra_ctx->app_tctx, p);
rd->data_sent += seg->payload_len;
rd->ra_base_seq += seg->payload_len;
#ifdef DEBUG
ra_ctx->fp2++;
#endif
/* if after the first data chunk we have no alproto yet,
* there is no point in continueing here. */
if (!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(stream)) {
@ -2607,7 +2615,9 @@ static inline int DoReassemble(ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx,
}
return 1;
}
#ifdef DEBUG
ra_ctx->sp++;
#endif
uint16_t payload_offset = 0;
uint16_t payload_len = 0;

@ -66,6 +66,11 @@ typedef struct TcpReassemblyThreadCtx_ {
uint16_t counter_htp_memuse;
/* number of allocation failed due to memcap when handling HTTP protocol */
uint16_t counter_htp_memcap;
#ifdef DEBUG
uint64_t fp1;
uint64_t fp2;
uint64_t sp;
#endif
} TcpReassemblyThreadCtx;
#define OS_POLICY_DEFAULT OS_POLICY_BSD

Loading…
Cancel
Save