ENT-8096: Implemented policy profiler in cf-agent#5903
Merged
olehermanse merged 1 commit intocfengine:masterfrom Oct 27, 2025
Merged
ENT-8096: Implemented policy profiler in cf-agent#5903olehermanse merged 1 commit intocfengine:masterfrom
olehermanse merged 1 commit intocfengine:masterfrom
Conversation
Contributor
Author
|
I still need to add functions execution in the profiler edit: this is done |
There was a problem hiding this comment.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
20debf1 to
7f623aa
Compare
6347574 to
1c3e1ca
Compare
c988d98 to
dd5817d
Compare
olehermanse
reviewed
Oct 24, 2025
libpromises/eval_context.c
Outdated
| { | ||
| assert(ctx != NULL); | ||
| assert(last_event != NULL); | ||
| SeqAppend(ctx->events, last_event); // keep track of EventFrames for cleanup |
Member
There was a problem hiding this comment.
@victormlg I think this part (pushing an event into the Seq) is the only thing we want to do while evaluating policy. The rest (building a nice tree, hashmaps, summarizing, sorting, etc. Should all appen by iterating over the events after policy evaluation is done.
olehermanse
reviewed
Oct 24, 2025
libpromises/eval_context.c
Outdated
| return; | ||
| } | ||
|
|
||
| JsonElement *tree = EventFrameTreeToJson(ctx->root); |
Member
There was a problem hiding this comment.
Here we should loop over the "unprocessed" events in the Seq, and convert them to the proper tree.
olehermanse
reviewed
Oct 27, 2025
olehermanse
reviewed
Oct 27, 2025
olehermanse
reviewed
Oct 27, 2025
Changelog: The policy profiling logic is now implemented natively within the cf-agent, replacing the previous reliance on cf-agent logs and the cf-profile.pl script for faster execution. Ticket: ENT-8096 Signed-off-by: Victor Moene <victor.moene@northern.tech>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Example policy:
To generate the profiling tree, run:
sudo /var/cfengine/bin/cf-agent -Kpf ~/profiler5.cf