-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Better error message for args in mixed probes #3047
Conversation
55a5602
to
97b4603
Compare
Could we get a test for this error message? A la: bpftrace/tests/semantic_analyser.cpp Lines 286 to 290 in e8d088b
Errors messages are one of the main outputs of SemanticAnalyser, so I'd like to eventually have all of them tested. |
97b4603
to
6bc1bc7
Compare
Done. I had to add it into |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The most rigorously reviewed change to an error message ever! Thanks @viktormalik!
It is not possible to use the `args` builtin in probes with mixed probe types (e.g. tracepoints and kfuncs). When trying that, bpftrace correctly fails but the error message is not very clear: # bpftrace -e 'tracepoint:syscalls:sys_enter_read,kfunc:vfs_read { print(args.count); }' stdin:1:53-63: ERROR: The args builtin can only be used with tracepoint/kfunc/uprobeprobes (invalid used here) tracepoint:syscalls:sys_enter_read,kfunc:vfs_read { print(args.count); } ~~~~~~~~~~ Improve the error message: # bpftrace -e 'tracepoint:syscalls:sys_enter_read,kfunc:vfs_read { print(args.count); }' stdin:1:53-63: ERROR: The args builtin can only be used within the context of a single probe type, e.g. "probe1 {args}" is valid while "probe1,probe2 {args}" is not. tracepoint:syscalls:sys_enter_read,kfunc:vfs_read { print(args.count); } ~~~~~~~~~~
6bc1bc7
to
996f598
Compare
It is not possible to use the
args
builtin in probes with mixed probe types (e.g. tracepoints and kfuncs). When trying that, bpftrace correctly fails but the error message is not very clear:Improve the error message:
Checklist
man/adoc/bpftrace.adoc
CHANGELOG.md