]> git.ipfire.org Git - thirdparty/suricata.git/commit
profiling: fix profiling with sample rate
authorEric Leblond <el@stamus-networks.com>
Wed, 17 Nov 2021 15:43:23 +0000 (16:43 +0100)
committerShivani Bhardwaj <shivanib134@gmail.com>
Thu, 13 Jan 2022 16:31:34 +0000 (22:01 +0530)
commit033c4b6f446554488d44af192fce0e603aaeea99
tree9f721e5116ff1fc9c7a9f496fb58ee84ca82a454
parent6e9b21d0e617df40bcc2602f20526c683b0b135c
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 6d5f59696dda77e1e7b2c45f51413b76690da4e9)
src/util-profiling.c