void HTPMemuseCounter(ThreadVars *tv, TcpReassemblyThreadCtx *trt)
{
uint64_t tmpval = SC_ATOMIC_GET(htp_memuse);
- SCPerfCounterSetUI64(tv, trt->counter_htp_memuse, tmpval);
+ StatsSetUI64(tv, trt->counter_htp_memuse, tmpval);
tmpval = SC_ATOMIC_GET(htp_memcap);
- SCPerfCounterSetUI64(tv, trt->counter_htp_memcap, tmpval);
+ StatsSetUI64(tv, trt->counter_htp_memcap, tmpval);
return;
}
/**
DNSMemcapGetCounters(&memuse, &memcap_state, &memcap_global);
- SCPerfCounterSetUI64(tv, app_tctx->counter_dns_memuse, memuse);
- SCPerfCounterSetUI64(tv, app_tctx->counter_dns_memcap_state, memcap_state);
- SCPerfCounterSetUI64(tv, app_tctx->counter_dns_memcap_global, memcap_global);
+ StatsSetUI64(tv, app_tctx->counter_dns_memuse, memuse);
+ StatsSetUI64(tv, app_tctx->counter_dns_memcap_state, memcap_state);
+ StatsSetUI64(tv, app_tctx->counter_dns_memcap_global, memcap_global);
}
/***** L7 layer dispatchers *****/
* \param pca Pointer to the SCPerfPrivateContext
* \param x The value to set for the counter
*/
-void SCPerfCounterSetUI64(ThreadVars *tv, uint16_t id, uint64_t x)
+void StatsSetUI64(ThreadVars *tv, uint16_t id, uint64_t x)
{
SCPerfPrivateContext *pca = &tv->perf_private_ctx;
#ifdef UNITTESTS
/* functions used to update local counter values */
void StatsAddUI64(struct ThreadVars_ *, uint16_t, uint64_t);
-void SCPerfCounterSetUI64(struct ThreadVars_ *, uint16_t, uint64_t);
+void StatsSetUI64(struct ThreadVars_ *, uint16_t, uint64_t);
void StatsIncr(struct ThreadVars_ *, uint16_t);
#define SCPerfSyncCounters(tv) \
/*
StatsAddUI64(th_v, flow_mgr_host_prune, (uint64_t)hosts_pruned);
uint32_t hosts_active = HostGetActiveCount();
- SCPerfCounterSetUI64(th_v, flow_mgr_host_active, (uint64_t)hosts_active);
+ StatsSetUI64(th_v, flow_mgr_host_active, (uint64_t)hosts_active);
uint32_t hosts_spare = HostGetSpareCount();
- SCPerfCounterSetUI64(th_v, flow_mgr_host_spare, (uint64_t)hosts_spare);
+ StatsSetUI64(th_v, flow_mgr_host_spare, (uint64_t)hosts_spare);
*/
StatsAddUI64(th_v, ftd->flow_mgr_cnt_clo, (uint64_t)counters.clo);
StatsAddUI64(th_v, ftd->flow_mgr_cnt_new, (uint64_t)counters.new);
StatsAddUI64(th_v, ftd->flow_mgr_cnt_est, (uint64_t)counters.est);
long long unsigned int flow_memuse = SC_ATOMIC_GET(flow_memuse);
- SCPerfCounterSetUI64(th_v, ftd->flow_mgr_memuse, (uint64_t)flow_memuse);
+ StatsSetUI64(th_v, ftd->flow_mgr_memuse, (uint64_t)flow_memuse);
StatsAddUI64(th_v, ftd->flow_tcp_reuse, (uint64_t)counters.tcp_reuse);
uint32_t len = 0;
FQLOCK_LOCK(&flow_spare_q);
len = flow_spare_q.len;
FQLOCK_UNLOCK(&flow_spare_q);
- SCPerfCounterSetUI64(th_v, ftd->flow_mgr_spare, (uint64_t)len);
+ StatsSetUI64(th_v, ftd->flow_mgr_spare, (uint64_t)len);
/* Don't fear, FlowManagerThread is here...
* clear emergency bit if we have at least xx flows pruned. */
//StatsIncr(tv, dtv->counter_pkts_per_sec);
StatsAddUI64(tv, dtv->counter_bytes, GET_PKT_LEN(p));
StatsAddUI64(tv, dtv->counter_avg_pkt_size, GET_PKT_LEN(p));
- SCPerfCounterSetUI64(tv, dtv->counter_max_pkt_size, GET_PKT_LEN(p));
+ StatsSetUI64(tv, dtv->counter_max_pkt_size, GET_PKT_LEN(p));
/* If suri has set vlan during reading, we increase vlan counter */
if (p->vlan_idx) {
//StatsIncr(tv, dtv->counter_pkts_per_sec);
StatsAddUI64(tv, dtv->counter_bytes, GET_PKT_LEN(p));
StatsAddUI64(tv, dtv->counter_avg_pkt_size, GET_PKT_LEN(p));
- SCPerfCounterSetUI64(tv, dtv->counter_max_pkt_size, GET_PKT_LEN(p));
+ StatsSetUI64(tv, dtv->counter_max_pkt_size, GET_PKT_LEN(p));
/* call the decoder */
switch(p->datalink) {
//StatsIncr(tv, dtv->counter_pkts_per_sec);
StatsAddUI64(tv, dtv->counter_bytes, GET_PKT_LEN(p));
StatsAddUI64(tv, dtv->counter_avg_pkt_size, GET_PKT_LEN(p));
- SCPerfCounterSetUI64(tv, dtv->counter_max_pkt_size, GET_PKT_LEN(p));
+ StatsSetUI64(tv, dtv->counter_max_pkt_size, GET_PKT_LEN(p));
DecodeEthernet(tv, dtv, p, GET_PKT_DATA(p), GET_PKT_LEN(p), pq);
StatsIncr(tv, dtv->counter_pkts);
StatsAddUI64(tv, dtv->counter_bytes, GET_PKT_LEN(p));
StatsAddUI64(tv, dtv->counter_avg_pkt_size, GET_PKT_LEN(p));
- SCPerfCounterSetUI64(tv, dtv->counter_max_pkt_size, GET_PKT_LEN(p));
+ StatsSetUI64(tv, dtv->counter_max_pkt_size, GET_PKT_LEN(p));
/* Process IP packets */
if (IPV4_GET_RAW_VER(ip4h) == 4) {
__insn_prefetch(&idesc[i]);
}
if (unlikely(n > max_queued)) {
- SCPerfCounterSetUI64(tv, ptv->max_mpipe_depth,
+ StatsSetUI64(tv, ptv->max_mpipe_depth,
(uint64_t)n);
max_queued = n;
}
StatsAddUI64(tv, dtv->counter_bytes, GET_PKT_LEN(p));
StatsAddUI64(tv, dtv->counter_avg_pkt_size, GET_PKT_LEN(p));
- SCPerfCounterSetUI64(tv, dtv->counter_max_pkt_size, GET_PKT_LEN(p));
+ StatsSetUI64(tv, dtv->counter_max_pkt_size, GET_PKT_LEN(p));
/* call the decoder */
DecodeEthernet(tv, dtv, p, GET_PKT_DATA(p), GET_PKT_LEN(p), pq);
// StatsIncr(tv, dtv->counter_pkts_per_sec);
StatsAddUI64(tv, dtv->counter_bytes, GET_PKT_LEN(p));
StatsAddUI64(tv, dtv->counter_avg_pkt_size, GET_PKT_LEN(p));
- SCPerfCounterSetUI64(tv, dtv->counter_max_pkt_size, GET_PKT_LEN(p));
+ StatsSetUI64(tv, dtv->counter_max_pkt_size, GET_PKT_LEN(p));
switch (p->datalink) {
case LINKTYPE_ETHERNET:
StatsIncr(tv, dtv->counter_pkts);
StatsAddUI64(tv, dtv->counter_bytes, GET_PKT_LEN(p));
StatsAddUI64(tv, dtv->counter_avg_pkt_size, GET_PKT_LEN(p));
- SCPerfCounterSetUI64(tv, dtv->counter_max_pkt_size, GET_PKT_LEN(p));
+ StatsSetUI64(tv, dtv->counter_max_pkt_size, GET_PKT_LEN(p));
DecodeEthernet(tv, dtv, p, GET_PKT_DATA(p), GET_PKT_LEN(p), pq);
StatsIncr(tv, dtv->counter_pkts);
StatsAddUI64(tv, dtv->counter_bytes, GET_PKT_LEN(p));
StatsAddUI64(tv, dtv->counter_avg_pkt_size, GET_PKT_LEN(p));
- SCPerfCounterSetUI64(tv, dtv->counter_max_pkt_size, GET_PKT_LEN(p));
+ StatsSetUI64(tv, dtv->counter_max_pkt_size, GET_PKT_LEN(p));
if (IPV4_GET_RAW_VER(ip4h) == 4) {
SCLogDebug("IPv4 packet");
StatsIncr(tv, dtv->counter_pkts);
StatsAddUI64(tv, dtv->counter_bytes, GET_PKT_LEN(p));
StatsAddUI64(tv, dtv->counter_avg_pkt_size, GET_PKT_LEN(p));
- SCPerfCounterSetUI64(tv, dtv->counter_max_pkt_size, GET_PKT_LEN(p));
+ StatsSetUI64(tv, dtv->counter_max_pkt_size, GET_PKT_LEN(p));
if (IPV4_GET_RAW_VER(ip4h) == 4) {
SCLogDebug("IPv4 packet");
//StatsIncr(tv, dtv->counter_pkts_per_sec);
StatsAddUI64(tv, dtv->counter_bytes, GET_PKT_LEN(p));
StatsAddUI64(tv, dtv->counter_avg_pkt_size, GET_PKT_LEN(p));
- SCPerfCounterSetUI64(tv, dtv->counter_max_pkt_size, GET_PKT_LEN(p));
+ StatsSetUI64(tv, dtv->counter_max_pkt_size, GET_PKT_LEN(p));
double curr_ts = p->ts.tv_sec + p->ts.tv_usec / 1000.0;
if (curr_ts < prev_signaled_ts || (curr_ts - prev_signaled_ts) > 60.0) {
{
struct pcap_stat pcap_s;
if (likely((pcap_stats(ptv->pcap_handle, &pcap_s) >= 0))) {
- SCPerfCounterSetUI64(ptv->tv, ptv->capture_kernel_packets, pcap_s.ps_recv);
- SCPerfCounterSetUI64(ptv->tv, ptv->capture_kernel_drops, pcap_s.ps_drop);
+ StatsSetUI64(ptv->tv, ptv->capture_kernel_packets, pcap_s.ps_recv);
+ StatsSetUI64(ptv->tv, ptv->capture_kernel_drops, pcap_s.ps_drop);
(void) SC_ATOMIC_SET(ptv->livedev->drop, pcap_s.ps_drop);
- SCPerfCounterSetUI64(ptv->tv, ptv->capture_kernel_ifdrops, pcap_s.ps_ifdrop);
+ StatsSetUI64(ptv->tv, ptv->capture_kernel_ifdrops, pcap_s.ps_ifdrop);
}
}
//StatsIncr(tv, dtv->counter_pkts_per_sec);
StatsAddUI64(tv, dtv->counter_bytes, GET_PKT_LEN(p));
StatsAddUI64(tv, dtv->counter_avg_pkt_size, GET_PKT_LEN(p));
- SCPerfCounterSetUI64(tv, dtv->counter_max_pkt_size, GET_PKT_LEN(p));
+ StatsSetUI64(tv, dtv->counter_max_pkt_size, GET_PKT_LEN(p));
/* call the decoder */
switch(p->datalink) {
uint64_t th_drops = SCPerfGetLocalCounterValue(ptv->tv, ptv->capture_kernel_drops);
SC_ATOMIC_ADD(ptv->livedev->pkts, pfring_s.recv - th_pkts);
SC_ATOMIC_ADD(ptv->livedev->drop, pfring_s.drop - th_drops);
- SCPerfCounterSetUI64(ptv->tv, ptv->capture_kernel_packets, pfring_s.recv);
- SCPerfCounterSetUI64(ptv->tv, ptv->capture_kernel_drops, pfring_s.drop);
+ StatsSetUI64(ptv->tv, ptv->capture_kernel_packets, pfring_s.recv);
+ StatsSetUI64(ptv->tv, ptv->capture_kernel_drops, pfring_s.drop);
}
}
//StatsIncr(tv, dtv->counter_pkts_per_sec);
StatsAddUI64(tv, dtv->counter_bytes, GET_PKT_LEN(p));
StatsAddUI64(tv, dtv->counter_avg_pkt_size, GET_PKT_LEN(p));
- SCPerfCounterSetUI64(tv, dtv->counter_max_pkt_size, GET_PKT_LEN(p));
+ StatsSetUI64(tv, dtv->counter_max_pkt_size, GET_PKT_LEN(p));
/* If suri has set vlan during reading, we increase vlan counter */
if (p->vlan_idx) {
void StreamTcpMemuseCounter(ThreadVars *tv, StreamTcpThread *stt)
{
uint64_t memusecopy = SC_ATOMIC_GET(st_memuse);
- SCPerfCounterSetUI64(tv, stt->counter_tcp_memuse, memusecopy);
+ StatsSetUI64(tv, stt->counter_tcp_memuse, memusecopy);
return;
}