profiling: fix profiling with sample rate

Rules profiling was returning invalid results when used with sample
rate. The problem was that the sample condition was run twice in the
packet flow. As a result, the second pass was not initializing the
variable storing the initial CPU ticks and the resulting performance
counters were reporting invalid values.

Bug: #4836.
pull/6629/head
Eric Leblond 3 years ago committed by Victor Julien
parent 16f4e5f31c
commit 6d5f59696d

@ -1243,6 +1243,8 @@ int SCProfileRuleStart(Packet *p)
return 1;
}
#endif
if (p->flags & PKT_PROFILE)
return 1;
return 0;
}

Loading…
Cancel
Save