We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
On a 5.19 kernel with bpftrace HEAD commit == 742f0cf we get a naming clash when attempting to access an fentry argument named 'fn'.
$ sudo ./bpftrace -lv fentry:vmlinux:module_kallsyms_on_each_symbol kfunc:vmlinux:module_kallsyms_on_each_symbol const char * modname int (*)(void *, const char *, struct module *, unsigned long) fn void * data int retval $ sudo ./bpftrace -e 'fentry:vmlinux:module_kallsyms_on_each_symbol{ $t = args.fn; }' stdin:1:53-60: ERROR: syntax error, unexpected subprog fentry:vmlinux:module_kallsyms_on_each_symbol{ $t = args.fn; } ~~~~~~~
@ajor suggested adding the SUBPROG token as a known keyword in the grammar as so:
diff --git a/src/parser.yy b/src/parser.yy index 85c8a20e..89efca28 100644 --- a/src/parser.yy +++ b/src/parser.yy @@ -628,6 +628,7 @@ keyword: | SIZEOF { $$ = $1; } | UNROLL { $$ = $1; } | WHILE { $$ = $1; } + | SUBPROG { $$ = $1; } ;
The above modification makes bpftrace happier but whether it is a complete fix is another thing.
$ sudo ./bpftrace -e 'fentry:vmlinux:module_kallsyms_on_each_symbol{ $t = args.fn; }' Attaching 1 probe... ERROR: Error loading program: kfunc:vmlinux:module_kallsyms_on_each_symbol (try -v)
(The error here is a verifier problem and should be ignored for the purpose of this bug).
bpftrace --info
The text was updated successfully, but these errors were encountered:
cc @lenticularis39
Sorry, something went wrong.
Oops, I planned to "do that later" for fn also (the addition to the grammar) and forgot, thanks for reporting that!
fn will never appear in the place of an identifier, since subprog definitions are top-level so there is no problem with parsing it as a keyword.
fn
No branches or pull requests
What reproduces the bug? Provide code if possible.
On a 5.19 kernel with bpftrace HEAD commit == 742f0cf we get a naming clash when attempting to access an fentry argument named 'fn'.
@ajor suggested adding the SUBPROG token as a known keyword in the grammar as so:
The above modification makes bpftrace happier but whether it is a complete fix is another thing.
(The error here is a verifier problem and should be ignored for the purpose of this bug).
bpftrace --info
outputThe text was updated successfully, but these errors were encountered: