Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pr/olsajiri/cgroup rate kprobe #2749

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

Conversation

olsajiri
Copy link
Contributor

No description provided.

Adding docs for the cgroup rate limit.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Adding docs for the persistent enforcement.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Adding cgroup-rate-map.sh script to display cgroup_rate_map values.

It takes argument either ID of the map or its pinned path.

Example output:

  # ./contrib/scripts/cgroup-rate-map.sh
  id      cpu     curr    prev    rate    time    throttled
  31250   0       2       0       2       669596000000000 0
  31250   1       1       0       1       669596000000000 0
  31250   2       1       0       1       669596000000000 0
  31250   3       8       31      20      669594000000000 0
  id      cpu     curr    prev    rate    time    throttled
  33803   0       1       1       1       669561000000000 0
  33803   1       1       4       4       669561000000000 0
  33803   2       4       0       4       669559000000000 0
  33803   3       2       1       2       669561000000000 0
  id      cpu     curr    prev    rate    time    throttled
  11218   0       0       0       0       0       0
  11218   1       4       0       4       669538000000000 0
  11218   2       1       0       1       669561000000000 0
  11218   3       1       4       3       669562000000000 0
  id      cpu     curr    prev    rate    time    throttled
  26      0       1       0       1       669562000000000 0
  26      1       5       0       5       669561000000000 0
  26      2       0       0       0       0       0
  26      3       5       0       5       669538000000000 0

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Making sure we evict inactive values from cgroup_rate_map map
once per minute.

We do have hook on cgroup_rmdir tracepoint, but we can still end
up with leftover records in cgroup_rate_map for some reason.

Before that's fixed let's make sure we cleanup the leftover records
manually.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Adding extra log output for max entries for loaded map:

  logcapture.go:25: time="2024-07-29T10:22:07Z" level=info msg="tetragon, map loaded." map=tg_stats_map max="{0 false}" ..
  logcapture.go:25: time="2024-07-29T10:22:07Z" level=info msg="tetragon, map loaded." map=cgroup_rate_map max="{32768 true}" ...

The value is the configured maximum or zero if it wasn't configured
and stays on default (hardcoded in bpf code).

The bool value is the indicator if the number was configured.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Copy link

netlify bot commented Jul 29, 2024

Deploy Preview for tetragon ready!

Name Link
🔨 Latest commit 5b2efed
🔍 Latest deploy log https://app.netlify.com/sites/tetragon/deploys/66a79662ff5f210008925772
😎 Deploy Preview https://deploy-preview-2749--tetragon.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@olsajiri olsajiri added the release-note/misc This PR makes changes that have no direct user impact. label Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant