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

Approximate time helpers #4013

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

Conversation

Alan-Jowett
Copy link
Member

@Alan-Jowett Alan-Jowett commented Nov 14, 2024

Resolves: #4009

Description

This pull request introduces new eBPF helper functions for retrieving time since boot in milliseconds and updates the codebase to use a new timing function, cxplat_query_time_since_boot_precise. Additionally, it includes updates to related data structures and test cases.

New eBPF Helper Functions:

  • Added bpf_ktime_get_boot_ms and bpf_ktime_get_ms helper functions to retrieve time since boot in milliseconds, including and excluding suspended time, respectively. (include/bpf_helper_defs.h, include/ebpf_structs.h, libs/execution_context/ebpf_core.c, libs/execution_context/ebpf_general_helpers.c) [1] [2] [3] [4]

Codebase Updates:

  • Replaced ebpf_query_time_since_boot_precise and ebpf_query_time_since_boot_approximate with cxplat_query_time_since_boot_precise and cxplat_query_time_since_boot_approximate across various files for better performance and consistency. (libs/execution_context/ebpf_core.c, libs/execution_context/ebpf_maps.c, libs/execution_context/ebpf_program.c, libs/runtime/ebpf_platform.c, tests/performance/platform.cpp) [1] [2] [3] [4] [5]

Data Structures and Test Cases:

  • Updated ebpf_utility_helpers_data_t structure to include new timestamp fields in milliseconds. (tests/sample/sample_test_common.h)
  • Modified test cases to validate the new timestamp fields and updated the logic to use the new timing functions. (tests/libs/common/common_tests.cpp, tests/sample/sample_common_routines.h) [1] [2]

Testing

CI/CD

Documentation

Yes, doxygen updated.

Installation

No.

Signed-off-by: Alan Jowett <[email protected]>
Signed-off-by: Alan Jowett <[email protected]>
include/bpf_helper_defs.h Outdated Show resolved Hide resolved
include/bpf_helper_defs.h Outdated Show resolved Hide resolved
@Alan-Jowett Alan-Jowett added this pull request to the merge queue Nov 15, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 15, 2024
@Alan-Jowett Alan-Jowett added this pull request to the merge queue Nov 16, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 16, 2024
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.

Expose approximate time since boot as a helper
3 participants