This content has been marked as final. Show 1 reply
You can think of a D expression as something that can be resolved to a value "where it stands." For example, "timestamp" is an expression that generalizes the value one needs at the point it is invoked.
Actions work with the system in some way, e.g., to read symbols from a table in a process map. The computation required to produce data you want to record, in short, makes it untenable to help form an expression. Subroutines operate on already-received data in some way; they do not require interaction with the system, and so can be handled as part of an expression.
I for one don't think it's helpful for the compiler to point out a distinction between actions and subroutines in this case, as if everyone who ends up down this road had meant to do exactly that, but whatcha gonna do?
What you want to do in your example is appealing, of course. We'd all like to be able to do what you've shown. The problem has to do with keeping DTrace behaving in a reasonably efficient manner.
Hope this helps,