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

aya: add guardrails for valid combinations of perf_event type and config fields #1038

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Oct 19, 2024

  1. aya: enforce valid perf_event type & config combos

    Add guardrails for when setting event type and config for perf_event
    programs. The `PerfEventConfig` enum now defines the event `type` and
    `config` of interest.
    
    Remove public re-exports, and add idiomatic Rust types for:
    - perf_hw_id => HardwareEvent
    - perf_sw_ids => SoftwareEvent
    - perf_hw_cache_id => HwCacheEvent
    - perf_hw_cache_op_id => HwCacheOp
    - perf_hw_cache_op_result_id => HwCacheResult
    
    The motivation behind this is mainly for the `type` and `config` fields
    of `bpf_link_info.perf_event.event`. The newly added enums are planned
    to also be used in the `bpf_link_info` metadata.
    
    Although `Breakpoint`/`PERF_TYPE_BREAKPOINT` variant exists, it is not
    fully implemented. It's only usage at the moment is in link info.
    tyrone-wu committed Oct 19, 2024
    Configuration menu
    Copy the full SHA
    c5be267 View commit details
    Browse the repository at this point in the history