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

Disable fentry by default in event stream #33692

Merged
merged 1 commit into from
Feb 4, 2025

Conversation

safchain
Copy link
Contributor

@safchain safchain commented Feb 4, 2025

What does this PR do?

Disable fentry by default as it trigger a kernel bug.

[92791.043467] task:system-probe    state:D stack:0     pid:82617 tgid:3768  ppid:3292   flags:0x00004006
[92791.043473] Call Trace:
[92791.043475]  <TASK>
[92791.043496]  __schedule+0x27c/0x6a0
[92791.043542]  schedule+0x33/0x110
[92791.043555]  schedule_timeout+0x157/0x170
[92791.043588]  wait_for_completion+0x88/0x150
[92791.043626]  __wait_rcu_gp+0x150/0x160
[92791.043645]  ? 0xffffffffc0256600
[92791.043716]  synchronize_rcu_tasks_generic+0x64/0xe0
[92791.043722]  ? __pfx_call_rcu_tasks+0x10/0x10
[92791.043731]  ? __pfx_wakeme_after_rcu+0x10/0x10
[92791.043759]  synchronize_rcu_tasks+0x15/0x20
[92791.043768]  ftrace_shutdown.part.0+0xd5/0x1f0
[92791.043784]  ? 0xffffffffc0256600
[92791.043797]  ? __pfx_module_param_sysfs_setup+0x10/0x10
[92791.043805]  unregister_ftrace_function+0x47/0x170
[92791.043825]  ? 0xffffffffc0256600
[92791.043837]  ? __pfx_module_param_sysfs_setup+0x10/0x10
[92791.043847]  unregister_ftrace_direct+0x64/0x1f0
[92791.043855]  ? kmalloc_trace+0x139/0x360
[92791.043864]  ? bpf_trampoline_update+0x68/0x650
[92791.043892]  ? 0xffffffffc0256600
[92791.043904]  ? __pfx_module_param_sysfs_setup+0x10/0x10
[92791.043914]  bpf_trampoline_update+0x4e1/0x650
[92791.043950]  bpf_trampoline_unlink_prog+0x9d/0x130
[92791.043968]  bpf_tracing_link_release+0x16/0x50
[92791.043979]  bpf_link_free+0x6d/0x100
[92791.043993]  bpf_link_release+0x26/0x40
[92791.044000]  __fput+0x9e/0x2e0
[92791.044024]  ____fput+0xe/0x20
[92791.044032]  task_work_run+0x5e/0xa0
[92791.044050]  do_exit+0x2bb/0x530
[92791.044064]  ? bpf_trampoline_6442526190+0x59/0xa4
[92791.044087]  do_group_exit+0x35/0x90
[92791.044104]  get_signal+0x972/0x9b0
[92791.044151]  arch_do_signal_or_restart+0x39/0x120
[92791.044199]  syscall_exit_to_user_mode+0x203/0x260
[92791.044217]  do_syscall_64+0x8d/0x170
[92791.044239]  ? __audit_syscall_exit+0xd1/0x140
[92791.044256]  ? syscall_exit_work+0x12b/0x150
[92791.044271]  ? syscall_exit_to_user_mode_prepare+0x39/0x80
[92791.044279]  ? syscall_exit_to_user_mode+0x83/0x260
[92791.044296]  ? do_syscall_64+0x8d/0x170
[92791.044303]  ? syscall_exit_work+0x12b/0x150
[92791.044316]  ? syscall_exit_to_user_mode_prepare+0x39/0x80
[92791.044324]  ? syscall_exit_to_user_mode+0x83/0x260
[92791.044340]  ? do_syscall_64+0x8d/0x170
[92791.044351]  ? do_syscall_64+0x8d/0x170
[92791.044366]  ? syscall_exit_to_user_mode+0x83/0x260
[92791.044382]  ? do_syscall_64+0x8d/0x170
[92791.044389]  ? irqentry_exit+0x43/0x50
[92791.044409]  entry_SYSCALL_64_after_hwframe+0x78/0x80

Motivation

Describe how you validated your changes

Possible Drawbacks / Trade-offs

Additional Notes

@safchain safchain added changelog/no-changelog team/agent-security qa/done QA done before merge and regressions are covered by tests labels Feb 4, 2025
@safchain safchain added this to the Triage milestone Feb 4, 2025
@safchain safchain requested review from a team as code owners February 4, 2025 12:10
@safchain safchain requested a review from hush-hush February 4, 2025 12:10
@github-actions github-actions bot added the short review PR is simple enough to be reviewed quickly label Feb 4, 2025
@agent-platform-auto-pr
Copy link
Contributor

Static quality checks ✅

Please find below the results from static quality gates

Info

Result Quality gate On disk size On disk size limit On wire size On wire size limit
static_quality_gate_agent_deb_amd64 844.71MiB 858.45MiB 203.52MiB 214.3MiB
static_quality_gate_docker_agent_amd64 928.99MiB 942.69MiB 310.64MiB 321.56MiB

@agent-platform-auto-pr
Copy link
Contributor

Uncompressed package size comparison

Comparison with ancestor 5025a79f8c4d17a1d33fb1758cdd2802678819c7

Diff per package
package diff status size ancestor threshold
datadog-agent-amd64-deb 0.00MB 873.29MB 873.29MB 0.50MB
datadog-agent-x86_64-rpm 0.00MB 883.03MB 883.03MB 0.50MB
datadog-agent-x86_64-suse 0.00MB 883.03MB 883.03MB 0.50MB
datadog-agent-arm64-deb 0.00MB 861.19MB 861.19MB 0.50MB
datadog-agent-aarch64-rpm 0.00MB 870.90MB 870.90MB 0.50MB
datadog-dogstatsd-amd64-deb 0.00MB 59.04MB 59.04MB 0.50MB
datadog-dogstatsd-x86_64-rpm 0.00MB 59.12MB 59.12MB 0.50MB
datadog-dogstatsd-x86_64-suse 0.00MB 59.12MB 59.12MB 0.50MB
datadog-dogstatsd-arm64-deb 0.00MB 56.52MB 56.52MB 0.50MB
datadog-heroku-agent-amd64-deb 0.00MB 445.51MB 445.51MB 0.50MB
datadog-iot-agent-amd64-deb 0.00MB 86.11MB 86.11MB 0.50MB
datadog-iot-agent-x86_64-rpm 0.00MB 86.18MB 86.18MB 0.50MB
datadog-iot-agent-x86_64-suse 0.00MB 86.18MB 86.18MB 0.50MB
datadog-iot-agent-arm64-deb 0.00MB 82.39MB 82.39MB 0.50MB
datadog-iot-agent-aarch64-rpm 0.00MB 82.46MB 82.46MB 0.50MB

Decision

✅ Passed

@agent-platform-auto-pr
Copy link
Contributor

Test changes on VM

Use this command from test-infra-definitions to manually test this PR changes on a VM:

inv aws.create-vm --pipeline-id=54826137 --os-family=ubuntu

Note: This applies to commit 31e5ecf

Copy link

Regression Detector

Regression Detector Results

Metrics dashboard
Target profiles
Run ID: 2803fc50-64c2-4eac-83b7-a19b166bf5c3

Baseline: 5025a79
Comparison: 31e5ecf
Diff

Optimization Goals: ✅ No significant changes detected

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
uds_dogstatsd_to_api_cpu % cpu utilization +2.64 [+1.75, +3.54] 1 Logs
tcp_syslog_to_blackhole ingress throughput +0.83 [+0.77, +0.90] 1 Logs
quality_gate_idle memory utilization +0.58 [+0.54, +0.61] 1 Logs bounds checks dashboard
quality_gate_logs % cpu utilization +0.20 [-2.88, +3.28] 1 Logs
file_to_blackhole_1000ms_latency egress throughput +0.18 [-0.59, +0.95] 1 Logs
file_to_blackhole_0ms_latency_http1 egress throughput +0.10 [-0.82, +1.01] 1 Logs
file_to_blackhole_100ms_latency egress throughput +0.09 [-0.65, +0.82] 1 Logs
file_to_blackhole_1000ms_latency_linear_load egress throughput +0.07 [-0.39, +0.54] 1 Logs
file_to_blackhole_0ms_latency egress throughput +0.02 [-0.86, +0.91] 1 Logs
file_to_blackhole_0ms_latency_http2 egress throughput +0.02 [-0.92, +0.97] 1 Logs
file_to_blackhole_300ms_latency egress throughput +0.01 [-0.62, +0.65] 1 Logs
tcp_dd_logs_filter_exclude ingress throughput +0.01 [-0.01, +0.03] 1 Logs
quality_gate_idle_all_features memory utilization +0.00 [-0.07, +0.08] 1 Logs bounds checks dashboard
file_to_blackhole_500ms_latency egress throughput -0.00 [-0.80, +0.79] 1 Logs
uds_dogstatsd_to_api ingress throughput -0.01 [-0.28, +0.26] 1 Logs
file_tree memory utilization -0.12 [-0.19, -0.05] 1 Logs

Bounds Checks: ✅ Passed

perf experiment bounds_check_name replicates_passed links
file_to_blackhole_0ms_latency lost_bytes 10/10
file_to_blackhole_0ms_latency memory_usage 10/10
file_to_blackhole_0ms_latency_http1 lost_bytes 10/10
file_to_blackhole_0ms_latency_http1 memory_usage 10/10
file_to_blackhole_0ms_latency_http2 lost_bytes 10/10
file_to_blackhole_0ms_latency_http2 memory_usage 10/10
file_to_blackhole_1000ms_latency memory_usage 10/10
file_to_blackhole_1000ms_latency_linear_load memory_usage 10/10
file_to_blackhole_100ms_latency lost_bytes 10/10
file_to_blackhole_100ms_latency memory_usage 10/10
file_to_blackhole_300ms_latency lost_bytes 10/10
file_to_blackhole_300ms_latency memory_usage 10/10
file_to_blackhole_500ms_latency lost_bytes 10/10
file_to_blackhole_500ms_latency memory_usage 10/10
quality_gate_idle intake_connections 10/10 bounds checks dashboard
quality_gate_idle memory_usage 10/10 bounds checks dashboard
quality_gate_idle_all_features intake_connections 10/10 bounds checks dashboard
quality_gate_idle_all_features memory_usage 10/10 bounds checks dashboard
quality_gate_logs intake_connections 10/10
quality_gate_logs lost_bytes 10/10
quality_gate_logs memory_usage 10/10

Explanation

Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%

Performance changes are noted in the perf column of each table:

  • ✅ = significantly better comparison variant performance
  • ❌ = significantly worse comparison variant performance
  • ➖ = no significant change in performance

A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".

For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:

  1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

  2. Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.

  3. Its configuration does not mark it "erratic".

CI Pass/Fail Decision

Passed. All Quality Gates passed.

  • quality_gate_logs, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check lost_bytes: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_idle_all_features, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_idle_all_features, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, bounds check memory_usage: 10/10 replicas passed. Gate passed.

@@ -381,7 +381,7 @@ func InitSystemProbeConfig(cfg pkgconfigmodel.Config) {
eventMonitorBindEnvAndSetDefault(cfg, join(evNS, "network.flow_monitor.period"), "10s")
eventMonitorBindEnvAndSetDefault(cfg, join(evNS, "network.raw_classifier_handle"), 0)
eventMonitorBindEnvAndSetDefault(cfg, join(evNS, "event_stream.use_ring_buffer"), true)
eventMonitorBindEnvAndSetDefault(cfg, join(evNS, "event_stream.use_fentry"), true)
eventMonitorBindEnvAndSetDefault(cfg, join(evNS, "event_stream.use_fentry"), false)
Copy link
Member

Choose a reason for hiding this comment

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

Would this break backward compatibility ?

Copy link
Contributor Author

@safchain safchain Feb 4, 2025

Choose a reason for hiding this comment

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

no, It won't. The old way to hook (kprobes) will be used as it is used on old kernel.

@github-actions github-actions bot added medium review PR review might take time and removed short review PR is simple enough to be reviewed quickly labels Feb 4, 2025
@usamasaqib
Copy link
Contributor

Do we have any more information on this bug, such as the kernel versions on which it happens, whether it is fixed upstream?

@safchain
Copy link
Contributor Author

safchain commented Feb 4, 2025

Do we have any more information on this bug, such as the kernel versions on which it happens, whether it is fixed upstream?

Not yet, got some kernel version for which it is clearly broken and some it is not sure

@safchain
Copy link
Contributor Author

safchain commented Feb 4, 2025

/merge

@dd-devflow
Copy link

dd-devflow bot commented Feb 4, 2025

Devflow running: /merge

View all feedbacks in Devflow UI.


2025-02-04 14:53:52 UTC ℹ️ MergeQueue: pull request added to the queue

The median merge time in main is 27m.


2025-02-04 15:25:18 UTC ℹ️ MergeQueue: This merge request was merged

@safchain safchain added the backport/7.63.x Automatically create a backport PR to 7.63.x label Feb 4, 2025
@YoannGh YoannGh added the backport/7.62.x Automatically create a backport PR to 7.62.x label Feb 4, 2025
@dd-mergequeue dd-mergequeue bot merged commit f9ce1e4 into main Feb 4, 2025
285 checks passed
@dd-mergequeue dd-mergequeue bot deleted the safchain/disable-fentry branch February 4, 2025 15:25
@github-actions github-actions bot modified the milestones: Triage, 7.64.0 Feb 4, 2025
@agent-platform-auto-pr
Copy link
Contributor

The backport to 7.62.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-7.62.x 7.62.x
# Navigate to the new working tree
cd .worktrees/backport-7.62.x
# Create a new branch
git switch --create backport-33692-to-7.62.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 f9ce1e41dafc9f23cc4de3c3cfce2c50b4465990
# Push it to GitHub
git push --set-upstream origin backport-33692-to-7.62.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-7.62.x

Then, create a pull request where the base branch is 7.62.x and the compare/head branch is backport-33692-to-7.62.x.

agent-platform-auto-pr bot pushed a commit that referenced this pull request Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/7.62.x Automatically create a backport PR to 7.62.x backport/7.63.x Automatically create a backport PR to 7.63.x changelog/no-changelog medium review PR review might take time qa/done QA done before merge and regressions are covered by tests team/agent-security
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants