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

Support TraceLoggingBinary for map find, update and delete. #3781

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

Conversation

shpalani
Copy link
Collaborator

@shpalani shpalani commented Aug 22, 2024

Description

This PR contains

  1. EBPF_LOG_MESSAGE_BINARY tracing log with TraceLoggingBinary to print binary data.
    #define _EBPF_LOG_MESSAGE_BINARY(trace_level, keyword, message, type, name, data, data_size)
  2. Tracing added to the following functions:
  • ebpf_map_find_entry
  • ebpf_map_update_entry
  • ebpf_map_delete_entry
  1. Increased NET_EBPF_EXT_STACK_EXPANSION_SIZE to 16kb for release image, and 32kb for debug image.

This tracing aims to instrument the map invocations and tail calls in the drivers.

Testing

_Do any existing tests cover this change? N/A
Are new tests needed? No, as this is a trace log.

Logs:
[0]0004.15E8::2024/09/17-18:08:02.977888400 [EbpfForWindowsProvider]{"Message":"Tail call program","string":"xxxx","meta":{"provider":"EbpfForWindowsProvider","event":"EbpfGenericMessage","time":"2024-09-18T01:08:02.9778884Z","cpu":0,"pid":4,"tid":5608,"channel":11,"level":5,"keywords":"0x80"}}
[0]0004.15E8::2024/09/17-18:08:02.977892100 [EbpfForWindowsProvider]{"Message":"Tail call program","string":"xxxx","meta":{"provider":"EbpfForWindowsProvider","event":"EbpfGenericMessage","time":"2024-09-18T01:08:02.9778921Z","cpu":0,"pid":4,"tid":5608,"channel":11,"level":5,"keywords":"0x80"}}
[0]0004.15E8::2024/09/17-18:08:02.977894000 [EbpfForWindowsProvider]{"Message":"Map update","string":"xxxx","meta":{"provider":"EbpfForWindowsProvider","event":"EbpfGenericMessage","time":"2024-09-18T01:08:02.9778940Z","cpu":0,"pid":4,"tid":5608,"channel":11,"level":5,"keywords":"0x40"}}
[0]0004.15E8::2024/09/17-18:08:02.977894700 [EbpfForWindowsProvider]{"Message":"Key","(data).Length":12,"(data)":"0x0A0101030403020100010600","meta":

Note: Program name and map name are masked with xxxx in the logs.

Documentation

_Is there any documentation impact for this change? No

Installation

_Is there any installer impact for this change? No

libs/shared/tracelog.c Outdated Show resolved Hide resolved
@shpalani shpalani changed the title Support TraceLoggingBinary for map find, update and delete in DEBUG image. Support TraceLoggingBinary for map find, update and delete. Aug 24, 2024
Copy link

codecov bot commented Aug 24, 2024

Codecov Report

Attention: Patch coverage is 20.00000% with 16 lines in your changes missing coverage. Please review.

Project coverage is 86.57%. Comparing base (d7c7af6) to head (f809dac).
Report is 295 commits behind head on main.

Files with missing lines Patch % Lines
libs/shared/tracelog.c 0.00% 16 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3781      +/-   ##
==========================================
+ Coverage   83.78%   86.57%   +2.79%     
==========================================
  Files         143      150       +7     
  Lines       27297    28955    +1658     
==========================================
+ Hits        22870    25068    +2198     
+ Misses       4427     3887     -540     

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

dthaler
dthaler previously approved these changes Sep 10, 2024
Copy link
Collaborator

@dthaler dthaler left a comment

Choose a reason for hiding this comment

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

Approving but see nit

libs/execution_context/ebpf_maps.c Outdated Show resolved Hide resolved
dthaler
dthaler previously approved these changes Sep 12, 2024
shankarseal
shankarseal previously approved these changes Sep 12, 2024
@shankarseal shankarseal added this pull request to the merge queue Sep 12, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 12, 2024
@shpalani shpalani dismissed stale reviews from shankarseal and dthaler via f2ef43d September 17, 2024 03:34
dthaler
dthaler previously approved these changes Sep 17, 2024
shankarseal
shankarseal previously approved these changes Sep 17, 2024
@shpalani shpalani dismissed stale reviews from shankarseal and dthaler via b6d53cc September 18, 2024 01:27
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.

Add EBPF_LOG_MESSAGE_BINARY tracing macro with TraceLoggingBinary to print binary data.
3 participants