Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jul 11, 2025

This PR improves the user-events benchmarks in opentelemetry-user-events-logs/benches/logs.rs by automatically managing the user-events listener state during benchmark execution.

Problem

Previously, the benchmarks required manual intervention to enable/disable the user-events listener:

# Manual commands needed before running benchmarks
echo 1 | sudo tee /sys/kernel/debug/tracing/events/user_events/myprovider_L2K1/enable  # enable
echo 0 | sudo tee /sys/kernel/debug/tracing/events/user_events/myprovider_L2K1/enable  # disable

This made it difficult to get consistent benchmark results comparing enabled vs disabled performance.

Solution

The benchmark now automatically:

  1. Detects user_events availability - checks if the system supports user_events
  2. Automatically manages listener state - programmatically enables/disables the listener
  3. Runs comparative tests - executes benchmarks in both enabled and disabled states
  4. Provides fallback behavior - works on systems without user_events support

Key Changes

  • Added helper functions:

    • set_user_events_listener() - programmatically enable/disable listener via filesystem or sudo
    • is_user_events_available() - detect user_events support
  • Enhanced benchmark logic:

    • When user_events available: runs *_Disabled and *_Enabled test variants
    • When user_events unavailable: runs fallback tests with original names
    • Automatic cleanup to disable listener after testing
  • Updated documentation:

    • Replaced manual command instructions with automatic behavior description
    • Added placeholder results tables for both enabled/disabled states
    • Clear documentation of fallback behavior

Benchmark Output

With user_events support:

  • User_Event_4_Attributes_Disabled
  • User_Event_4_Attributes_Enabled
  • User_Event_6_Attributes_Disabled
  • User_Event_6_Attributes_Enabled

Without user_events support:

  • User_Event_4_Attributes (fallback)
  • User_Event_6_Attributes (fallback)

This makes it easy to compare performance characteristics between enabled and disabled listener states without manual intervention.

Fixes #369.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copy link

linux-foundation-easycla bot commented Jul 11, 2025

CLA Missing ID CLA Not Signed

Copy link

codecov bot commented Jul 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 47.5%. Comparing base (225e1e2) to head (bd2f62e).
⚠️ Report is 33 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main    #370   +/-   ##
=====================================
  Coverage   47.5%   47.5%           
=====================================
  Files         69      69           
  Lines       9287    9287           
=====================================
  Hits        4416    4416           
  Misses      4871    4871           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…hmarks

Co-authored-by: cijothomas <5232798+cijothomas@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Benchmarks for user-events should automatically enabled and disable listener Automate enable/disable functionality for user-events benchmarks Jul 11, 2025
@Copilot Copilot AI requested a review from cijothomas July 11, 2025 18:38
Copilot finished work on behalf of cijothomas July 11, 2025 18:38
Co-authored-by: cijothomas <5232798+cijothomas@users.noreply.github.com>
@Copilot Copilot AI requested a review from cijothomas July 11, 2025 18:51
Copilot finished work on behalf of cijothomas July 11, 2025 18:51
…ation

Co-authored-by: cijothomas <5232798+cijothomas@users.noreply.github.com>
@Copilot Copilot AI requested a review from cijothomas July 11, 2025 19:06
Copilot finished work on behalf of cijothomas July 11, 2025 19:06
…code duplication

Co-authored-by: cijothomas <5232798+cijothomas@users.noreply.github.com>
Copilot finished work on behalf of cijothomas July 11, 2025 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Benchmarks for user-events should automatically enabled and disable listener
2 participants