erts: Support prefix argument matching in trace match specs#10754
erts: Support prefix argument matching in trace match specs#10754sverker merged 2 commits intoerlang:masterfrom
Conversation
CT Test Results 3 files 136 suites 50m 8s ⏱️ Results for commit 3910919. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts// Erlang/OTP Github Action Bot |
sverker
left a comment
There was a problem hiding this comment.
Add something in the match spec docs also:
Extend the grammar
https://www.erlang.org/doc/apps/erts/match_spec#grammar
Add an example or modify one of the existing
https://www.erlang.org/doc/apps/erts/match_spec#tracing-examples
|
I pushed a commit that addresses the feedback:
|
|
@michalmuskala Thanks. Sorry for the nitpickery. |
Allow trace match spec heads to use [Arg1, Arg2 | '_'] syntax to match functions with at least N arguments, regardless of actual arity. This is useful when combined with the '_' arity wildcard in trace:function/4, e.g. to trace lists:seq/2 and lists:seq/3 with a single match spec that only constrains the first argument. The prefix flag is encoded as a tag bit on the arity operand of the existing matchArray instruction (bit 8, since max arity is 255), avoiding the need for a separate VM instruction.
fb5425f to
3910919
Compare
Allow trace match spec heads to use
[Arg1, Arg2 | '_']syntax to match functions with at least N arguments, regardless of actual arity. This is useful when combined with the'_'arity wildcard intrace:function/4, e.g. to tracelists:seq/2andlists:seq/3with a single match spec that only constrains the first argument.The prefix flag is encoded as a tag bit on the arity operand of the existing
matchArrayinstruction (bit 8, since max arity is 255), avoiding the need for a separate VM instruction.Fixes #9999