microsoft / microsoft/ebpf-for-windows

bpf2c should show BPF assembly not names of uBPF specific macros, in comments

Open
#3,176 2 comments 0 reactions 0 assignees View on GitHub
blocked enhancement help wanted triaged
Dominant language
C
Stars
3.6k
Forks
311
Avg merge
6d 10h
Merged PRs (30d)
21

Description

### Describe the feature you'd like supported

Today bpf2c generteas comments like:
```
// EBPF_OP_ADD64_IMM pc=526 dst=r1 src=r0 offset=0 imm=-1
```
whereas bpf assembly would be:
```
// add %r1, -1
```

The latter is more consistent with llvm-objdump, bpf_conformance, and other such tools.
It also avoids using a uBPF specific define (EBPF_OP_ADD64_IMM) in bpf2c which shouldn't depend on uBPF.

### Proposed solution

Use BPF assembler syntax in comments instead

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start at the bpf2c instruction-comment generation entry point and compare its current macro-based comments with the BPF assembler examples in the issue. Done means generated comments use assembler syntax such as `add %r1, -1` and no longer reference uBPF-specific macro names.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.