]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Profile pcap file callback.
authorVictor Julien <victor@inliniac.net>
Thu, 15 Mar 2012 15:22:47 +0000 (16:22 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 15 Mar 2012 15:22:47 +0000 (16:22 +0100)
src/source-pcap-file.c
src/suricata-common.h
src/util-profiling.h

index e0144be67c4cd23f963646974a2e2aa5c30e41da..3919fcdaf36987eb25babc0edbaf28a307fecf8d 100644 (file)
@@ -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);
index f8e58853249cd3423936427d9ce5b8f10e98d860..b7345fd9bc1cf1e2c00bf7888cae23666797b187 100644 (file)
@@ -30,6 +30,8 @@
 #define DBG_PERF
 #endif
 
+//#define PROFILE_LOCKING
+
 #define TRUE   1
 #define FALSE  0
 
index 1dce64c90a08a34d6baa087a49affb9b2dd7d259..4f99085e7b734b53cb48a62ce44919319cf0183f 100644 (file)
@@ -27,8 +27,6 @@
 
 #ifdef PROFILING
 
-//#define PROFILE_LOCKING
-
 #include "util-cpu.h"
 
 extern int profiling_rules_enabled;