Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

victormlg
Copy link
Contributor

The policy evaluation creates multiple copies of the same bundle, promise, and function stack frames. The final evaluation tree is built on the assumption that the correct evaluation tree is the one with the longest execution time.

Example policy:

bundle agent main
{
  commands:
    "/bin/sleep 1";
}

To generate the profiling tree, run:
sudo /var/cfengine/bin/cf-agent -Kpf ~/profiler5.cf

{
  "children": [
    {
      "children": [
        {
          "children": [],
          "elapsed": 1007,
          "filename": "",
          "name": "commands",
          "offset": {
            "end": 0,
            "lineno": 4,
            "start": 67
          },
          "type": "promise"
        }
      ],
      "elapsed": 1012,
      "filename": "/home/vagrant/profiler5.cf",
      "name": "main",
      "offset": {
        "end": 85,
        "lineno": 1,
        "start": 13
      },
      "type": "bundle"
    }
  ],
  "elapsed": 1012,
  "filename": "",
  "name": "",
  "offset": {
    "end": 0,
    "lineno": 0,
    "start": 0
  },
  "type": "policy"
}

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>
@victormlg
Copy link
Contributor Author

I still need to add functions execution in the profiler

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.