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.
(cherry picked from commit 6d5f59696d)
pull/6786/head
Eric Leblond 4 years ago committed by Shivani Bhardwaj
parent 6e9b21d0e6
commit 033c4b6f44

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

Loading…
Cancel
Save