Skip to content

Commit

Permalink
profiling/rules: Clear profiling flag at end
Browse files Browse the repository at this point in the history
Issue: 6861

When profiling ends, clear the per-packet profiling flag to prevent
future profiling processing on the packet *unless it was enabled* again
for that packet.

With lightweight rule profiling, it's possible to perform profiling
end-time processing if profiling was active in the past but since has
been disabled.
  • Loading branch information
jlucovsky committed Mar 16, 2024
1 parent ece2029 commit 269e102
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/util-profiling.h
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ void SCProfilingRuleThreatAggregate(DetectEngineThreadCtx *det_ctx);
ctx, r->profiling_id, profile_rule_end_ - profile_rule_start_, m); \
profiling_rules_entered--; \
BUG_ON(profiling_rules_entered < 0); \
(p)->flags &= ~PKT_PROFILE; \
}

#else /* PROFILE_RULES */
Expand Down

0 comments on commit 269e102

Please sign in to comment.