This doesn't work:
bpftrace -e 'kprobe:sys_execve { printf("%s\n", join(arg1)); }'
(See #25 for notes about kprobe:sys_execve going away.)
Is it possible to have join() be used as a printf() argument? This may be more trouble that it's worth.
This needs fixing. The join() builtin really should return a string so that it can be used with maps / printf's / whatever. In its current form it's not very usable.
I agree with @tyroguru, join() would be way more useful if it returned a string. I think the bigger question is: should we keep the current behavior as well (print if the return value is not used), or should we change it to always return a string?
Considering all the problems raised in #769, do we still want this to be implemented?
I think we should change the join behaviour despite the problems raised.
We can block its use in situations which are currently not possible, e.g. assigning to variables and maps, but allow it as a printf argument. This gets us better formatting of joins by allowing them in printfs and means that the syntax will not have to change when any new kernel/compiler features come in which allow the broken cases to work.
Most helpful comment
This needs fixing. The join() builtin really should return a string so that it can be used with maps / printf's / whatever. In its current form it's not very usable.