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

Pinning trace error is misleading in ebpf_pinning_table_find function #2897

Closed
shpalani opened this issue Sep 23, 2023 · 0 comments · Fixed by #2954
Closed

Pinning trace error is misleading in ebpf_pinning_table_find function #2897

shpalani opened this issue Sep 23, 2023 · 0 comments · Fixed by #2954
Assignees
Labels
cleanup Affects API usability or code maintainability but not correctness or applicability triaged Discussed in a triage meeting
Milestone

Comments

@shpalani
Copy link
Collaborator

Describe the bug

Debuggability: Pinning error trace is misleading in debugging.

It is expected to have a key not found when the map is newly created and pinning is not done.

Trace:
[39]1624.193C::‎2023‎-‎09‎-‎21 15:06:26.933 [EbpfForWindowsProvider]ebpf_core_create_map returned success
[39]1624.193C::‎2023‎-‎09‎-‎21 15:06:26.933 [EbpfForWindowsProvider]ebpf_core_get_pinned_object
[39]1624.193C::‎2023‎-‎09‎-‎21 15:06:26.933 [EbpfForWindowsProvider]ebpf_pinning_table_find
[39]1624.193C::‎2023‎-‎09‎-‎21 15:06:26.933 [EbpfForWindowsProvider]ebpf_pinning_table_find returned error,19
[39]1624.193C::‎2023‎-‎09‎-‎21 15:06:26.933 [EbpfForWindowsProvider]ebpf_core_get_pinned_object returned error,19

[39]1624.193C::‎2023‎-‎09‎-‎21 15:06:26.933 [EbpfForWindowsProvider]ebpf_core_create_map
[39]1624.193C::‎2023‎-‎09‎-‎21 15:06:26.933 [EbpfForWindowsProvider]ebpf_map_create
[39]1624.193C::‎2023‎-‎09‎-‎21 15:06:26.933 [EbpfForWindowsProvider]_create_object_hash_map
[39]1624.193C::‎2023‎-‎09‎-‎21 15:06:26.935 [EbpfForWindowsProvider]_create_object_hash_map returned success
[39]1624.193C::‎2023‎-‎09‎-‎21 15:06:26.935 [EbpfForWindowsProvider]eBPF object initialized,0xFFFFB589858AAF30,1

where 19 is KEY_NOT_FOUND.

OS information

Windows 10 and above.

Steps taken to reproduce bug

  1. Enable tracing, and load ebpf program with maps.
    logman create trace "xdp_trace" -o C:\Temp\xdp_trace.etl -f bincirc -max 1024 -ets
    logman update trace "xdp_trace" -p "{394f321c-5cf4-404c-aa34-4df1428a7f9c}" 0xffffffffffffffff 0xff -ets
    logman update trace "xdp_trace" -p "{f2f2ca01-ad02-4a07-9e90-95a2334f3692}" 0xffffffffffffffff 0xff -ets
    logman update trace "xdp_trace" -p "{00e7ee66-5b24-5c41-22cb-af98f63e2f90}" 0xffffffffffffffff 0xff -ets
    logman stop "xdp_trace" -ets

netsh trace convert C:\Temp\xdp_trace.etl

xdp_trace_2.txt

Expected behavior

The proposal agreed upon internal discussion:

  1. Remove the return statement from ebpf_pinning_table_find()
  • EBPF_RETURN_RESULT(return_value);
  • return the return_value.
  1. Add the trace in the callers of this ebpf_pinning_table_find(), if it is a valid error.

Actual outcome

Prints error of 19 (KEY_NOT_FOUND)

[39]1624.193C::‎2023‎-‎09‎-‎21 15:06:26.933 [EbpfForWindowsProvider]ebpf_core_create_map returned success
[39]1624.193C::‎2023‎-‎09‎-‎21 15:06:26.933 [EbpfForWindowsProvider]ebpf_core_get_pinned_object
[39]1624.193C::‎2023‎-‎09‎-‎21 15:06:26.933 [EbpfForWindowsProvider]ebpf_pinning_table_find
[39]1624.193C::‎2023‎-‎09‎-‎21 15:06:26.933 [EbpfForWindowsProvider]ebpf_pinning_table_find returned error,19
[39]1624.193C::‎2023‎-‎09‎-‎21 15:06:26.933 [EbpfForWindowsProvider]ebpf_core_get_pinned_object returned error,19

[39]1624.193C::‎2023‎-‎09‎-‎21 15:06:26.933 [EbpfForWindowsProvider]ebpf_core_create_map
[39]1624.193C::‎2023‎-‎09‎-‎21 15:06:26.933 [EbpfForWindowsProvider]ebpf_map_create
[39]1624.193C::‎2023‎-‎09‎-‎21 15:06:26.933 [EbpfForWindowsProvider]_create_object_hash_map
[39]1624.193C::‎2023‎-‎09‎-‎21 15:06:26.935 [EbpfForWindowsProvider]_create_object_hash_map returned success
[39]1624.193C::‎2023‎-‎09‎-‎21 15:06:26.935 [EbpfForWindowsProvider]eBPF object initialized,0xFFFFB589858AAF30,1

Additional details

No response

@shpalani shpalani added the bug Something isn't working label Sep 23, 2023
@dahavey dahavey added the triaged Discussed in a triage meeting label Sep 25, 2023
@dahavey dahavey added cleanup Affects API usability or code maintainability but not correctness or applicability and removed bug Something isn't working labels Sep 25, 2023
@dahavey dahavey added this to the 2310 milestone Sep 25, 2023
@shpalani shpalani linked a pull request Oct 6, 2023 that will close this issue
@shankarseal shankarseal modified the milestones: 2310, 2311 Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Affects API usability or code maintainability but not correctness or applicability triaged Discussed in a triage meeting
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants