Open OTP-Maintainer opened 7 years ago
lukas
said:
The lttng tracing is implemented using the erl_tracer NIF framework and thus has access to the same information as exposed through the nif API. At the moment, it is not possible to get the current stack size from a NIF so the lttng probes do not provide it. The reason it is in the trace at all it because the dtrace/systemtap probes have it and we want the different tracing technologies to be consistent.
With regards to your assertion that you need it in order to analyze traces. Having the depth will not give you any guarantees that you will catch all lost trace messages. For instance the process may pop the stack multiple times and then call down again to the same function using a different path. So no matter what you do, you will have to deal with the possibility of lost trace messages and not being able to reconstruct the call path of a process.
That being said, if you or someone else wants to contribute a way for nifs to get this information, I don't think we'd have any problems with that. However with the way that dirty-schedulers work it will be a non-trivial thing to implement.
lukas
said:
It may also be possible to implement via extending the matchspec functions related to tracing, in the same way as process_dump works.
boris.okner
said:
Thank you for the clarification and suggestions. You are right in that having depth value alone is not sufficient to reliably analyze the call path. However, it will greatly reduce the number of cases where the analyzing code has to make complex decisions to deal with the broken call stack.
It would also be great if the documentation mentioned that the 'depth' field does not currently represent the stack depth and is there for consistency only.
Original reporter:
boris.okner
Affected version:OTP-19.1.1
Component:runtime_tools
Migrated from: https://bugs.erlang.org/browse/ERL-355