detect-port: remove debug mem counters

pull/1980/head
Victor Julien 10 years ago
parent 9bd8197009
commit d5c6d08bc8

@ -59,11 +59,6 @@ static int DetectPortCut(DetectEngineCtx *, DetectPort *, DetectPort *,
DetectPort *PortParse(char *str);
int DetectPortIsValidRange(char *);
/** Memory usage counters */
static uint32_t detect_port_memory = 0;
static uint32_t detect_port_init_cnt = 0;
static uint32_t detect_port_free_cnt = 0;
/**
* \brief Alloc a DetectPort structure and update counters
*
@ -77,9 +72,6 @@ DetectPort *DetectPortInit(void)
return NULL;
memset(dp, 0, sizeof(DetectPort));
detect_port_memory += sizeof(DetectPort);
detect_port_init_cnt++;
return dp;
}
@ -99,26 +91,9 @@ void DetectPortFree(DetectPort *dp)
}
dp->sh = NULL;
detect_port_memory -= sizeof(DetectPort);
detect_port_free_cnt++;
SCFree(dp);
}
/**
* \brief Prints Memory statistics of the counters at detect-engine-port.[c,h]
*/
void DetectPortPrintMemory(void)
{
SCLogDebug(" * Port memory stats (DetectPort %" PRIuMAX "):",
(uintmax_t)sizeof(DetectPort));
SCLogDebug(" - detect_port_memory %" PRIu32 "", detect_port_memory);
SCLogDebug(" - detect_port_init_cnt %" PRIu32 "", detect_port_init_cnt);
SCLogDebug(" - detect_port_free_cnt %" PRIu32 "", detect_port_free_cnt);
SCLogDebug(" - outstanding ports %" PRIu32 "",
detect_port_init_cnt - detect_port_free_cnt);
SCLogDebug(" * Port memory stats done");
}
/**
* \brief Used to see if the exact same portrange exists in the list
*

@ -35,8 +35,6 @@ void DetectPortCleanupList (DetectPort *head);
DetectPort *DetectPortLookupGroup(DetectPort *dp, uint16_t port);
void DetectPortPrintMemory(void);
int DetectPortJoin(DetectEngineCtx *,DetectPort *target, DetectPort *source);
void DetectPortPrint(DetectPort *);

@ -8538,16 +8538,10 @@ static int SigTestMemory01 (void)
SigGroupBuild(de_ctx);
DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx);
printf("@pre cleanup\n\n");
DetectPortPrintMemory();
SigGroupCleanup(de_ctx);
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
DetectEngineCtxFree(de_ctx);
printf("@exit\n\n");
DetectPortPrintMemory();
result = 1;
end:
SCFree(p);
@ -8580,15 +8574,9 @@ static int SigTestMemory02 (void)
SigGroupBuild(de_ctx);
printf("@cleanup\n\n");
SigGroupCleanup(de_ctx);
DetectEngineCtxFree(de_ctx);
printf("@exit\n\n");
DetectPortPrintMemory();
printf("@exit\n\n");
DetectPortPrintMemory();
result = 1;
end:
return result;
@ -8625,13 +8613,9 @@ static int SigTestMemory03 (void)
SigGroupBuild(de_ctx);
printf("@cleanup\n\n");
SigGroupCleanup(de_ctx);
DetectEngineCtxFree(de_ctx);
printf("@exit\n\n");
DetectPortPrintMemory();
result = 1;
end:
return result;

Loading…
Cancel
Save