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

[USMON-1083] usm: http2: Refactor handle_first_frame #32514

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

guyarb
Copy link
Contributor

@guyarb guyarb commented Dec 25, 2024

What does this PR do?

Refactors the way we maintain and process incomplete frames to better handle edge cases we've found.

The PR introduces two types of an incomplete frame -

  1. Incomplete Frame Header - we didn't fully read a frame header.
  2. Incomplete Frame Payload - we didn't fully read the frame payload.

The PR also changes the responsibility of handle_first_frame to handle_incomplete_frame.
We had a redundant duplication between handle_first_frame and filter_frame, which contributed to the complex conditions we had, and to the edge cases we missed. Now the probe is just consuming the remainder (if exists).

Motivation

An edge case (USMON-1083) found while working on better dealing with TCP out of order.

Describe how you validated your changes

  1. New UTs were added
  2. Existing UTs passed
  3. Dogfooding - in progress
  4. Load test - in progress

Possible Drawbacks / Trade-offs

Additional Notes

Suggested to review it in a commit-by-commit approach and read the commit messages.

@github-actions github-actions bot added component/system-probe medium review PR review might take time labels Dec 25, 2024
@agent-platform-auto-pr
Copy link
Contributor

agent-platform-auto-pr bot commented Dec 25, 2024

Uncompressed package size comparison

Comparison with ancestor 57183f81af4390123ce2a86f343ec42d8ef8eed0

Diff per package
package diff status size ancestor threshold
datadog-heroku-agent-amd64-deb 0.00MB 505.29MB 505.28MB 70.00MB
datadog-iot-agent-x86_64-rpm 0.00MB 113.43MB 113.43MB 10.00MB
datadog-iot-agent-x86_64-suse 0.00MB 113.43MB 113.43MB 10.00MB
datadog-iot-agent-aarch64-rpm 0.00MB 108.89MB 108.89MB 10.00MB
datadog-dogstatsd-x86_64-rpm 0.00MB 78.64MB 78.64MB 10.00MB
datadog-dogstatsd-x86_64-suse 0.00MB 78.64MB 78.64MB 10.00MB
datadog-dogstatsd-amd64-deb 0.00MB 78.57MB 78.57MB 10.00MB
datadog-dogstatsd-arm64-deb 0.00MB 55.77MB 55.77MB 10.00MB
datadog-iot-agent-amd64-deb 0.00MB 113.36MB 113.36MB 10.00MB
datadog-iot-agent-arm64-deb 0.00MB 108.82MB 108.82MB 10.00MB
datadog-agent-aarch64-rpm -0.06MB 944.66MB 944.71MB 140.00MB
datadog-agent-arm64-deb -0.06MB 935.36MB 935.42MB 140.00MB
datadog-agent-x86_64-rpm -0.07MB 1200.36MB 1200.43MB 140.00MB
datadog-agent-x86_64-suse -0.07MB 1200.36MB 1200.43MB 140.00MB
datadog-agent-amd64-deb -0.07MB 1191.05MB 1191.11MB 140.00MB

Decision

✅ Passed

@agent-platform-auto-pr
Copy link
Contributor

agent-platform-auto-pr bot commented Dec 25, 2024

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=51895814 --os-family=ubuntu

Note: This applies to commit 50a6b66

Copy link

cit-pr-commenter bot commented Dec 25, 2024

Regression Detector

Regression Detector Results

Metrics dashboard
Target profiles
Run ID: 10a83f6f-a904-4e2c-8d59-b8f304f58839

Baseline: 57183f8
Comparison: 50a6b66
Diff

Optimization Goals: ✅ No significant changes detected

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
quality_gate_idle memory utilization +0.64 [+0.61, +0.68] 1 Logs bounds checks dashboard
tcp_syslog_to_blackhole ingress throughput +0.62 [+0.56, +0.69] 1 Logs
quality_gate_logs % cpu utilization +0.61 [-2.65, +3.87] 1 Logs
uds_dogstatsd_to_api_cpu % cpu utilization +0.45 [-0.22, +1.12] 1 Logs
file_to_blackhole_500ms_latency egress throughput +0.15 [-0.63, +0.93] 1 Logs
file_to_blackhole_0ms_latency_http2 egress throughput +0.04 [-0.83, +0.91] 1 Logs
tcp_dd_logs_filter_exclude ingress throughput +0.00 [-0.01, +0.01] 1 Logs
uds_dogstatsd_to_api ingress throughput -0.00 [-0.12, +0.12] 1 Logs
file_to_blackhole_0ms_latency egress throughput -0.00 [-0.85, +0.84] 1 Logs
file_to_blackhole_1000ms_latency_linear_load egress throughput -0.03 [-0.49, +0.43] 1 Logs
file_to_blackhole_100ms_latency egress throughput -0.03 [-0.72, +0.65] 1 Logs
file_to_blackhole_0ms_latency_http1 egress throughput -0.04 [-0.95, +0.87] 1 Logs
file_to_blackhole_300ms_latency egress throughput -0.07 [-0.71, +0.57] 1 Logs
quality_gate_idle_all_features memory utilization -0.08 [-0.16, +0.00] 1 Logs bounds checks dashboard
file_tree memory utilization -0.12 [-0.24, +0.01] 1 Logs
file_to_blackhole_1000ms_latency egress throughput -0.52 [-1.29, +0.25] 1 Logs

Bounds Checks: ❌ Failed

perf experiment bounds_check_name replicates_passed links
file_to_blackhole_0ms_latency_http2 lost_bytes 9/10
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 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 memory_usage 10/10 bounds checks dashboard
quality_gate_idle_all_features memory_usage 10/10 bounds checks dashboard
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_idle_all_features, 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 memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, bounds check memory_usage: 10/10 replicas passed. Gate passed.

@agent-platform-auto-pr
Copy link
Contributor

agent-platform-auto-pr bot commented Dec 26, 2024

eBPF complexity changes

Summary result: ❗ - significant complexity increases

  • Highest complexity change (%): +18.12%
  • Highest complexity change (abs.): +12312 instructions
  • Programs that were above the 85.0% limit of instructions and are now below: 0
  • Programs that were below the 85.0% limit of instructions and are now above: 0
usm details

usm [programs with changes]

Program Avg. complexity Distro with highest complexity Distro with lowest complexity
uprobe__http2_tls_filter 🔴 76056.7 (+7944.7, +11.66%) fedora_38/arm64: 🔴 80250.0 (+12312.0, +18.12%) amazon_5.4/arm64: 🔴 73779.0 (+5319.0, +7.77%)

usm [programs without changes]

Program Avg. complexity Distro with highest complexity Distro with lowest complexity
socket__http_filter ⚪ 6175.3 (+0.0, +0.00%) fedora_38/arm64: ⚪ 7990.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 5268.0 (+0.0, +0.00%)
socket__kafka_fetch_response_partition_parser_v0 ⚪ 5050.8 (+0.0, +0.00%) centos_8/arm64: ⚪ 5076.0 (+0.0, +0.00%) ubuntu_18.04/arm64: ⚪ 5016.0 (+0.0, +0.00%)
socket__kafka_fetch_response_partition_parser_v12 ⚪ 5380.4 (+0.0, +0.00%) ubuntu_18.04/arm64: ⚪ 6149.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 4914.0 (+0.0, +0.00%)
socket__kafka_fetch_response_record_batch_parser_v0 ⚪ 6146.3 (+0.0, +0.00%) centos_8/arm64: ⚪ 6166.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 6107.0 (+0.0, +0.00%)
socket__kafka_fetch_response_record_batch_parser_v12 ⚪ 6146.3 (+0.0, +0.00%) centos_8/arm64: ⚪ 6166.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 6107.0 (+0.0, +0.00%)
socket__kafka_filter ⚪ 38388.7 (+0.0, +0.00%) centos_8/arm64: ⚪ 44790.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 25586.0 (+0.0, +0.00%)
socket__kafka_produce_response_partition_parser_v0 ⚪ 1372.2 (+0.0, +0.00%) centos_8/arm64: ⚪ 1442.0 (+0.0, +0.00%) debian_10/arm64: ⚪ 1250.0 (+0.0, +0.00%)
socket__kafka_produce_response_partition_parser_v9 ⚪ 1544.6 (+0.0, +0.00%) debian_10/arm64: ⚪ 2062.0 (+0.0, +0.00%) fedora_38/arm64: ⚪ 1190.0 (+0.0, +0.00%)
socket__postgres_handle ⚪ 943.3 (+0.0, +0.00%) fedora_38/arm64: ⚪ 1312.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 758.0 (+0.0, +0.00%)
socket__postgres_handle_response ⚪ 4385.0 (+0.0, +0.00%) debian_10/arm64: ⚪ 4774.0 (+0.0, +0.00%) ubuntu_18.04/arm64: ⚪ 3391.0 (+0.0, +0.00%)
socket__postgres_process_parse_message ⚪ 35878.0 (+0.0, +0.00%) fedora_38/arm64: ⚪ 59525.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 18994.0 (+0.0, +0.00%)
socket__protocol_dispatcher ⚪ 1650.7 (+0.0, +0.00%) fedora_38/arm64: ⚪ 1746.0 (+0.0, +0.00%) centos_8/arm64: ⚪ 1543.0 (+0.0, +0.00%)
socket__protocol_dispatcher_kafka ⚪ 48157.7 (+0.0, +0.00%) centos_8/arm64: ⚪ 58717.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 27039.0 (+0.0, +0.00%)
socket__redis_process ⚪ 2.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 2.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 2.0 (+0.0, +0.00%)
tracepoint__net__netif_receive_skb ⚪ 16.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 16.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 16.0 (+0.0, +0.00%)
uprobe__BIO_new_socket ⚪ 23.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 23.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 23.0 (+0.0, +0.00%)
uprobe__SSL_connect ⚪ 23.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 23.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 23.0 (+0.0, +0.00%)
uprobe__SSL_do_handshake ⚪ 23.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 23.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 23.0 (+0.0, +0.00%)
uprobe__SSL_read ⚪ 98.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 98.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 98.0 (+0.0, +0.00%)
uprobe__SSL_read_ex ⚪ 85.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 85.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 85.0 (+0.0, +0.00%)
uprobe__SSL_set_bio ⚪ 46.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 46.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 46.0 (+0.0, +0.00%)
uprobe__SSL_set_fd ⚪ 31.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 31.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 31.0 (+0.0, +0.00%)
uprobe__SSL_shutdown ⚪ 352.0 (+0.0, +0.00%) centos_8/arm64: ⚪ 363.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 333.0 (+0.0, +0.00%)
uprobe__SSL_write ⚪ 28.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 28.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 28.0 (+0.0, +0.00%)
uprobe__SSL_write_ex ⚪ 22.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 22.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 22.0 (+0.0, +0.00%)
uprobe__crypto_tls_Conn_Close ⚪ 1137.2 (+0.0, +0.00%) centos_8/arm64: ⚪ 1265.0 (+0.0, +0.00%) amazon_5.4/x86_64: ⚪ 1009.0 (+0.0, +0.00%)
uprobe__crypto_tls_Conn_Read ⚪ 773.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 860.0 (+0.0, +0.00%) amazon_5.4/x86_64: ⚪ 686.0 (+0.0, +0.00%)
uprobe__crypto_tls_Conn_Read__return ⚪ 5377.2 (+0.0, +0.00%) fedora_38/arm64: ⚪ 8266.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 3245.0 (+0.0, +0.00%)
uprobe__crypto_tls_Conn_Write ⚪ 1315.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 1807.0 (+0.0, +0.00%) amazon_5.4/x86_64: ⚪ 823.0 (+0.0, +0.00%)
uprobe__crypto_tls_Conn_Write__return ⚪ 6434.3 (+0.0, +0.00%) fedora_38/x86_64: ⚪ 10094.0 (+0.0, +0.00%) amazon_5.4/x86_64: ⚪ 3335.0 (+0.0, +0.00%)
uprobe__gnutls_bye ⚪ 352.0 (+0.0, +0.00%) centos_8/arm64: ⚪ 363.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 333.0 (+0.0, +0.00%)
uprobe__gnutls_deinit ⚪ 352.0 (+0.0, +0.00%) centos_8/arm64: ⚪ 363.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 333.0 (+0.0, +0.00%)
uprobe__gnutls_handshake ⚪ 23.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 23.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 23.0 (+0.0, +0.00%)
uprobe__gnutls_record_recv ⚪ 25.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 25.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 25.0 (+0.0, +0.00%)
uprobe__gnutls_record_send ⚪ 28.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 28.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 28.0 (+0.0, +0.00%)
uprobe__gnutls_transport_set_int2 ⚪ 31.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 31.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 31.0 (+0.0, +0.00%)
uprobe__gnutls_transport_set_ptr ⚪ 31.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 31.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 31.0 (+0.0, +0.00%)
uprobe__gnutls_transport_set_ptr2 ⚪ 31.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 31.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 31.0 (+0.0, +0.00%)
uprobe__http2_dynamic_table_cleaner ⚪ 3964.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 3964.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 3964.0 (+0.0, +0.00%)
uprobe__http2_tls_eos_parser ⚪ 182422.7 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 182451.0 (+0.0, +0.00%) centos_8/arm64: ⚪ 182366.0 (+0.0, +0.00%)
uprobe__http2_tls_headers_parser ⚪ 637767.0 (+0.0, +0.00%) fedora_38/arm64: ⚪ 637767.0 (+0.0, +0.00%) fedora_38/arm64: ⚪ 637767.0 (+0.0, +0.00%)
uprobe__http2_tls_termination ⚪ 100.2 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 105.0 (+0.0, +0.00%) debian_10/arm64: ⚪ 93.0 (+0.0, +0.00%)
uprobe__http_process ⚪ 2777.8 (+0.0, +0.00%) debian_10/arm64: ⚪ 5143.0 (+0.0, +0.00%) ubuntu_18.04/arm64: ⚪ 2050.0 (+0.0, +0.00%)
uprobe__http_termination ⚪ 288.6 (+0.0, +0.00%) debian_10/arm64: ⚪ 291.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 287.0 (+0.0, +0.00%)
uprobe__kafka_tls_fetch_response_partition_parser_v0 ⚪ 5338.6 (+0.0, +0.00%) centos_8/arm64: ⚪ 5569.0 (+0.0, +0.00%) debian_10/arm64: ⚪ 4934.0 (+0.0, +0.00%)
uprobe__kafka_tls_fetch_response_partition_parser_v12 ⚪ 6582.4 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 6713.0 (+0.0, +0.00%) debian_10/arm64: ⚪ 6305.0 (+0.0, +0.00%)
uprobe__kafka_tls_fetch_response_record_batch_parser_v0 ⚪ 6853.0 (+0.0, +0.00%) centos_8/arm64: ⚪ 6890.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 6723.0 (+0.0, +0.00%)
uprobe__kafka_tls_fetch_response_record_batch_parser_v12 ⚪ 6853.0 (+0.0, +0.00%) centos_8/arm64: ⚪ 6890.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 6723.0 (+0.0, +0.00%)
uprobe__kafka_tls_filter ⚪ 20025.0 (+0.0, +0.00%) centos_8/arm64: ⚪ 29839.0 (+0.0, +0.00%) ubuntu_18.04/arm64: ⚪ 9737.0 (+0.0, +0.00%)
uprobe__kafka_tls_produce_response_partition_parser_v0 ⚪ 1436.6 (+0.0, +0.00%) centos_8/arm64: ⚪ 1563.0 (+0.0, +0.00%) debian_10/arm64: ⚪ 1218.0 (+0.0, +0.00%)
uprobe__kafka_tls_produce_response_partition_parser_v9 ⚪ 1825.8 (+0.0, +0.00%) debian_10/arm64: ⚪ 2241.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 1476.0 (+0.0, +0.00%)
uprobe__kafka_tls_termination ⚪ 43.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 43.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 43.0 (+0.0, +0.00%)
uprobe__postgres_tls_handle ⚪ 195.2 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 199.0 (+0.0, +0.00%) debian_10/arm64: ⚪ 189.0 (+0.0, +0.00%)
uprobe__postgres_tls_handle_response ⚪ 4799.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 5049.0 (+0.0, +0.00%) ubuntu_18.04/arm64: ⚪ 3815.0 (+0.0, +0.00%)
uprobe__postgres_tls_process_parse_message ⚪ 3067.4 (+0.0, +0.00%) ubuntu_18.04/arm64: ⚪ 3327.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 2895.0 (+0.0, +0.00%)
uprobe__postgres_tls_termination ⚪ 43.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 43.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 43.0 (+0.0, +0.00%)
uprobe__redis_tls_process ⚪ 2.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 2.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 2.0 (+0.0, +0.00%)
uprobe__redis_tls_termination ⚪ 2.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 2.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 2.0 (+0.0, +0.00%)
uprobe__tls_protocol_dispatcher_kafka ⚪ 6136.8 (+0.0, +0.00%) fedora_38/arm64: ⚪ 9305.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 4747.0 (+0.0, +0.00%)
uretprobe__BIO_new_socket ⚪ 44.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 44.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 44.0 (+0.0, +0.00%)
uretprobe__SSL_connect ⚪ 9.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 9.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 9.0 (+0.0, +0.00%)
uretprobe__SSL_do_handshake ⚪ 9.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 9.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 9.0 (+0.0, +0.00%)
uretprobe__SSL_read ⚪ 5626.3 (+0.0, +0.00%) fedora_38/arm64: ⚪ 9080.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 2633.0 (+0.0, +0.00%)
uretprobe__SSL_read_ex ⚪ 7004.7 (+0.0, +0.00%) fedora_38/arm64: ⚪ 9184.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 2722.0 (+0.0, +0.00%)
uretprobe__SSL_write ⚪ 2941.3 (+0.0, +0.00%) fedora_38/arm64: ⚪ 3180.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 2750.0 (+0.0, +0.00%)
uretprobe__SSL_write_ex ⚪ 6612.3 (+0.0, +0.00%) fedora_38/arm64: ⚪ 9569.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 2820.0 (+0.0, +0.00%)
uretprobe__gnutls_handshake ⚪ 9.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 9.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 9.0 (+0.0, +0.00%)
uretprobe__gnutls_record_recv ⚪ 5201.3 (+0.0, +0.00%) fedora_38/arm64: ⚪ 7470.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 2733.0 (+0.0, +0.00%)
uretprobe__gnutls_record_send ⚪ 4185.3 (+0.0, +0.00%) centos_8/arm64: ⚪ 4921.0 (+0.0, +0.00%) amazon_5.4/arm64: ⚪ 2728.0 (+0.0, +0.00%)

This report was generated based on the complexity data for the current branch guy.arbitman/USMON-1083-incomplete-frame-type (pipeline 51895814, commit 50a6b66) and the base branch main (commit 57183f8). Objects without changes are not reported. Contact #ebpf-platform if you have any questions/feedback.

Table complexity legend: 🔵 - new; ⚪ - unchanged; 🟢 - reduced; 🔴 - increased

@guyarb guyarb force-pushed the guy.arbitman/USMON-1083-incomplete-frame-type branch 4 times, most recently from 65f180a to 3b9934d Compare December 26, 2024 12:00
The new enum represents the different options for an incomlete frame.
Either we have an incomplete frame header or an incomplete frame payload.

Having also a default state 'unknown' to avoid adding bugs of relying on the default
value of the type as either incomlete frame header or an incomplete frame payload
Introducing types incomplete frame header and incomplete frame payload types.
Those types will be later used to store the correct status of the incompletion
In a followup commit, we will need to have the last frame header for the case of incomplete frame payload.
For that matter, we save the last frame header from the function 'pktbuf_find_relevant_frames'.

In case we do have an incomplete frame payload, we need to know whether the frame is interesting (for further
processing) and how many bytes we need to read from future packets.
The code was duplicated, and in the future commits we will use it further
We distinguish between incomplete frame header and incomplete frame payload
Now the logic treat each of them differentaly and makes the code much clearer
Now we do support handling incomplete frame payload
Added 2 tests, the first to check we are able to consume correctly frame that is split
to many packets.

The second to check an unsupported scenario (headers frame that its payload split on multiple packets)
does not prevent us from continue capturing valid requests on the connection
@guyarb guyarb force-pushed the guy.arbitman/USMON-1083-incomplete-frame-type branch from 3b9934d to b185c46 Compare December 30, 2024 07:47
…first_frame

The program 'filter_frame' assumes it reads a frame from the current offset, and knows how to
generate incomplete frame state. So if we don't have an existing incomplete_frame, we can rely
on 'filter_frame' to do the same as we used to do in 'handle_first_frame'
A preliminary change for the followup commit.
Allow to decide dynamically what will be the next tail call we use after handle_first_frame.
In the followup PR, we will have a flow in which handle_first_frame will call itself with
modified state
Added a 'processed' flag to the frame_payload struct. We want to avoid from processing some frames multiple times, and
the flag is meant to ensure it.

For data frames we only process the header and we don't care about their payloads, so we need to ensure
we processed the frame header only once. But for header frames we do process the payload, and we still need
to do so as a best effort. A common practice is to send only the frame header for Headers frame, and in a
separate packet to send the payload. In such a case, we will have a payload remainder, and we want to process it
Now we simplify the processing and just and only handling incomplete frames, and not generic
handling first frame.
@guyarb guyarb changed the title Guy.arbitman/usmon 1083 incomplete frame type [USMON-1083] usm: http2: Refactor handle_first_frame Dec 30, 2024
@guyarb guyarb added changelog/no-changelog team/usm The USM team qa/done QA done before merge and regressions are covered by tests labels Dec 30, 2024
@guyarb guyarb marked this pull request as ready for review December 30, 2024 12:09
@guyarb guyarb requested a review from a team as a code owner December 30, 2024 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/no-changelog component/system-probe medium review PR review might take time qa/done QA done before merge and regressions are covered by tests team/usm The USM team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant