Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
8d07a4c
add xdp struct to args
varun-r-mallya Oct 8, 2025
d84ce0c
update helpers and change examples.
varun-r-mallya Oct 8, 2025
b95fbd0
rollback example
varun-r-mallya Oct 8, 2025
9d73eb6
Add TODO for fixing struct_kioctx issue
varun-r-mallya Oct 8, 2025
f46e7cd
Reduce a condition from handle_cond
r41k0u Oct 6, 2025
82ff71b
Add _handle_cond to expr_pass
r41k0u Oct 6, 2025
ff78140
Eval LHS and RHS in _handle_compare
r41k0u Oct 6, 2025
49c59b3
Add Boolean return support
r41k0u Oct 6, 2025
745f592
Move conditional logic to eval_expr, add _conver_to_bool, add passing…
r41k0u Oct 6, 2025
2979cee
Add const_int test for conditionals
r41k0u Oct 6, 2025
9c7560e
Add const_binop test for conditionals
r41k0u Oct 6, 2025
97e74d0
Add var test for conditionals
r41k0u Oct 6, 2025
6f65903
Add var_binop test for conditionals
r41k0u Oct 6, 2025
eb0a7a9
Add map test to conditionals
r41k0u Oct 6, 2025
7720437
Add failing tests struct and not for conditionals
r41k0u Oct 6, 2025
5451ba6
Add support for unary op 'not' in eval_expr, move not test to passing
r41k0u Oct 6, 2025
6cc29c4
Add var_comp test for conditionals
r41k0u Oct 6, 2025
b8b937b
Add failing test map_comp for conditionals
r41k0u Oct 6, 2025
4ea7b22
Add 'and' and 'or' BoolOps as future deliverables
r41k0u Oct 6, 2025
2e677c2
Fix struct_access in eval_expr, move struct_access conditional test t…
r41k0u Oct 7, 2025
c81aad7
Add failing struct_ptr test for conditionals
r41k0u Oct 7, 2025
34a267e
Add type_mismatch failing test for conditionals
r41k0u Oct 7, 2025
e180a89
Add _normalize_types to handle mismatched ints, move type_mismatch te…
r41k0u Oct 7, 2025
1e29460
Add _get_base_type to expr_pass
r41k0u Oct 7, 2025
7081e93
Move _get_base_type to _get_base_type_and_depth
r41k0u Oct 7, 2025
46f5eca
Add _deref_to_depth in expr_pass
r41k0u Oct 7, 2025
0794317
Add null checks for pointer derefs to avoid map_value_or_null verifie…
r41k0u Oct 8, 2025
0d3a574
Move map_comp test to passing
r41k0u Oct 8, 2025
f3c80f9
Add helper_cond failing test for conditionals
r41k0u Oct 8, 2025
cfc246c
Add explanation notes to failing conditionals tests
r41k0u Oct 8, 2025
00d1c58
Add support for is and is not keywords
r41k0u Oct 8, 2025
86378d6
Add BoolOp handling stub in eval_expr
r41k0u Oct 8, 2025
3b08c2b
Add handle_and and handle_or handling stub in eval_expr
r41k0u Oct 8, 2025
3cb73ff
Add _handle_and_op in expr_pass
r41k0u Oct 8, 2025
a351b0f
Add _handle_or_or in expr_pass
r41k0u Oct 8, 2025
140d9e6
Add passing or.py test for conditionals
r41k0u Oct 8, 2025
019a83c
Add passing and.py test for conditionals
r41k0u Oct 8, 2025
48923d0
cleanup handle_cond in functions_pass
r41k0u Oct 8, 2025
6f9a730
Rework dir structure for expr
r41k0u Oct 8, 2025
aae7aa9
Fix expr imports
r41k0u Oct 8, 2025
b43c252
Fix type_deducer import in expr
r41k0u Oct 8, 2025
eff0f66
Seperate type_normalization from expr_pass
r41k0u Oct 8, 2025
fa720f8
Move convert_to_bool to type_normalization
r41k0u Oct 8, 2025
bc7b5c9
Move handle_comparator to type_normalization
r41k0u Oct 8, 2025
e4ddec3
Fix expr imports
r41k0u Oct 8, 2025
1ba27ac
Remove completed short term goal from TODO.md
r41k0u Oct 8, 2025
435bf27
Add compile to tests/failing_tests/conditionals/helper_cond.py
r41k0u Oct 8, 2025
7210366
add global failing test
varun-r-mallya Oct 3, 2025
e7c4bdb
add global support with broken generation function
varun-r-mallya Oct 3, 2025
4846241
fix broken IR generation logic for globals
varun-r-mallya Oct 3, 2025
40ae3d8
fix broken IR generation logic for globals
varun-r-mallya Oct 4, 2025
130d8a9
format chore
varun-r-mallya Oct 4, 2025
5f2df57
update globals test and todos.
varun-r-mallya Oct 4, 2025
384fc9d
changer order of passes
varun-r-mallya Oct 4, 2025
a049796
add failing test
varun-r-mallya Oct 4, 2025
ed196ca
add global symbol table populate function
varun-r-mallya Oct 5, 2025
200d293
add global symbol table populate function
varun-r-mallya Oct 5, 2025
9683e37
format chore
varun-r-mallya Oct 8, 2025
8aa9cf7
Add failing oneline IfExpr conditional test
r41k0u Oct 8, 2025
e6c05ab
Update TODO.md
r41k0u Oct 8, 2025
9f8e240
add patch for Kernel 6.14 BTF
varun-r-mallya Oct 8, 2025
28b7b16
remove todos and move to projects on github.
varun-r-mallya Oct 8, 2025
ec59dad
Refactor hist() calls to use dot notation
r41k0u Oct 10, 2025
7fb3ecf
initialise tbaa generation and vmlinux recursive importer modules
varun-r-mallya Oct 10, 2025
3ec3ab3
add vmlinux processor to codegen pipeline
varun-r-mallya Oct 10, 2025
e4575a6
Merge branch 'master' into vmlinux-working
varun-r-mallya Oct 10, 2025
68e9693
add import parser
varun-r-mallya Oct 10, 2025
2483ef2
separate vmlinux class handler
varun-r-mallya Oct 10, 2025
7940d02
add symbol resolution to import detection
varun-r-mallya Oct 11, 2025
f227fe9
add dependency_node format and also cache results of symbol loader.
varun-r-mallya Oct 11, 2025
2ae3aad
static type checks
varun-r-mallya Oct 11, 2025
eb636ef
add dependency handler class
varun-r-mallya Oct 11, 2025
f190a33
init IR generation file and clarify purpose
varun-r-mallya Oct 11, 2025
d24d59c
fix structure for IR generation separation.
varun-r-mallya Oct 11, 2025
2cf7b28
extract fields from the class
varun-r-mallya Oct 11, 2025
168e262
add recursive addition algorithm with mixing of ast node type and typ…
varun-r-mallya Oct 11, 2025
1e3d775
handle non-complex types along with recursion
varun-r-mallya Oct 11, 2025
06773c8
add error message
varun-r-mallya Oct 11, 2025
7c55984
add ctype subclass identifier
varun-r-mallya Oct 11, 2025
abbf177
format chore
varun-r-mallya Oct 11, 2025
75d3ad4
format chore
varun-r-mallya Oct 11, 2025
3343bed
add extra fields to Field datatype
varun-r-mallya Oct 11, 2025
f884410
add support for single depth pointer resolution
varun-r-mallya Oct 11, 2025
8743ea1
one recursion issue solved
varun-r-mallya Oct 11, 2025
8774277
try to separate out ast node from vmlinux type
varun-r-mallya Oct 11, 2025
80396c7
recursive parsing fix without ctypes in recursed type
varun-r-mallya Oct 12, 2025
7851827
make semantics work other than field diffs
varun-r-mallya Oct 12, 2025
9b8462f
add bitfield size resolution
varun-r-mallya Oct 12, 2025
93634a4
format chore
varun-r-mallya Oct 12, 2025
e574156
add full confidence import parsing
varun-r-mallya Oct 12, 2025
0b4c626
complete dependency tree readiness resolution
varun-r-mallya Oct 13, 2025
20ec307
format chore
varun-r-mallya Oct 13, 2025
d4f5a9c
fix static typing errors
varun-r-mallya Oct 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ __pycache__/
*.ll
*.o
.ipynb_checkpoints/
vmlinux.py
~*
vmlinux.h
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#
# See https://github.com/pre-commit/pre-commit

exclude: 'vmlinux.*\.py$'
exclude: 'vmlinux.py'

ci:
autoupdate_commit_msg: "chore: update pre-commit hooks"
Expand Down Expand Up @@ -41,7 +41,7 @@ repos:
- id: ruff
args: ["--fix", "--show-fixes"]
- id: ruff-format
exclude: ^(docs)|^(tests)|^(examples)
# exclude: ^(docs)|^(tests)|^(examples)

# Checking static types
- repo: https://github.com/pre-commit/mirrors-mypy
Expand Down
3 changes: 2 additions & 1 deletion examples/clone-matplotlib.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@
"def hist() -> HashMap:\n",
" return HashMap(key=c_int32, value=c_uint64, max_entries=4096)\n",
"\n",
"\n",
"@bpf\n",
"@section(\"tracepoint/syscalls/sys_enter_clone\")\n",
"def hello(ctx: c_void_p) -> c_int64:\n",
Expand All @@ -329,6 +330,7 @@
"def LICENSE() -> str:\n",
" return \"GPL\"\n",
"\n",
"\n",
"b = BPF()"
]
},
Expand Down Expand Up @@ -357,7 +359,6 @@
}
],
"source": [
"\n",
"b.load_and_attach()\n",
"hist = BpfMap(b, hist)\n",
"print(\"Recording\")\n",
Expand Down
2 changes: 2 additions & 0 deletions examples/kprobes.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ def hello_world(ctx: c_void_p) -> c_int64:
print("Hello, World!")
return c_int64(0)


@bpf
@section("kprobe/do_unlinkat")
def hello_world2(ctx: c_void_p) -> c_int64:
print("Hello, World!")
return c_int64(0)


@bpf
@bpfglobal
def LICENSE() -> str:
Expand Down
2 changes: 1 addition & 1 deletion examples/struct_and_perf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def hello(ctx: c_void_p) -> c_int32:
dataobj.pid = pid()
dataobj.ts = ktime()
# dataobj.comm = strobj
print(f"clone called at {dataobj.ts} by pid" f"{dataobj.pid}, comm {strobj}")
print(f"clone called at {dataobj.ts} by pid{dataobj.pid}, comm {strobj}")
events.output(dataobj)
return c_int32(0)

Expand Down
Loading