Profile pcap file callback.

remotes/origin/HEAD
Victor Julien 15 years ago
parent ff8755af5c
commit 41e9dba20b

@ -46,6 +46,7 @@
#include "tm-threads.h"
#include "util-optimize.h"
#include "flow-manager.h"
#include "util-profiling.h"
extern uint8_t suricata_ctl_flags;
extern int max_pending_packets;
@ -123,6 +124,7 @@ void PcapFileCallbackLoop(char *user, struct pcap_pkthdr *h, u_char *pkt) {
if (unlikely(p == NULL)) {
SCReturn;
}
PACKET_PROFILING_TMM_START(p, TMM_RECEIVEPCAPFILE);
p->ts.tv_sec = h->ts.tv_sec;
p->ts.tv_usec = h->ts.tv_usec;
@ -135,8 +137,10 @@ void PcapFileCallbackLoop(char *user, struct pcap_pkthdr *h, u_char *pkt) {
if (unlikely(PacketCopyData(p, pkt, h->caplen))) {
TmqhOutputPacketpool(ptv->tv, p);
PACKET_PROFILING_TMM_END(p, TMM_RECEIVEPCAPFILE);
SCReturn;
}
PACKET_PROFILING_TMM_END(p, TMM_RECEIVEPCAPFILE);
if (TmThreadsSlotProcessPkt(ptv->tv, ptv->slot, p) != TM_ECODE_OK) {
pcap_breakloop(pcap_g.pcap_handle);

@ -30,6 +30,8 @@
#define DBG_PERF
#endif
//#define PROFILE_LOCKING
#define TRUE 1
#define FALSE 0

@ -27,8 +27,6 @@
#ifdef PROFILING
//#define PROFILE_LOCKING
#include "util-cpu.h"
extern int profiling_rules_enabled;

Loading…
Cancel
Save