<p dir="ltr">Personally, I interpret deep stacktraces to be a result of frameworkitis or poorly factored code, as something to avoid or fix. But that's probably an unpopular opinion to have these days. </p>
<p dir="ltr">Cheers, <br>
Robby<br>
</p>
<div class="gmail_extra"><br><div class="gmail_quote">On 1 Nov 2016 17:09, "Vans S" <<a href="mailto:vans_163@yahoo.com">vans_163@yahoo.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Increase the stack trace depth. 8 is default. No serious drawbacks I can think of. Indeed 8 is often too little.<br>
<br>
On Tuesday, November 1, 2016 11:25 AM, Håkan Mattsson <<a href="mailto:hm@tail-f.com">hm@tail-f.com</a>> wrote:<br>
<br>
<br>
<br>
Hi,<br>
<br>
Anybody who knows why the stacktrace returned by process_info(Pid, current_stacktrace) is truncated to 8 items? Is it due to some performance consideration?<br>
<br>
<br>
In order to get more usable stacktraces I were thinking of doing this little fix in our system? Do you foresee any drawbacks with it?<br>
<br>
Btw, 8 happens to be the default of the system flag backtrace_depth.<br>
<br>
<br>
diff --git a/otp/erts/emulator/beam/erl_<wbr>bif_info.c b/otp/erts/emulator/beam/erl_<wbr>bif_info.c<br>
index d7f1e2d..2dc310f 100755<br>
--- a/otp/erts/emulator/beam/erl_<wbr>bif_info.c<br>
+++ b/otp/erts/emulator/beam/erl_<wbr>bif_info.c<br>
@@ -1607,7 +1607,7 @@ current_stacktrace(Process* p, Process* rp, Eterm** hpp)<br>
Eterm mfa;<br>
Eterm res = NIL;<br>
<br>
- depth = 8;<br>
+ depth = erts_backtrace_depth;<br>
sz = offsetof(struct StackTrace, trace) + sizeof(BeamInstr *)*depth;<br>
s = (struct StackTrace *) erts_alloc(ERTS_ALC_T_TMP, sz);<br>
s->depth = 0;<br>
<br>
<br>
/Håkan<br>
<br>
<br>
______________________________<wbr>_________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/">http://erlang.org/mailman/</a><wbr>listinfo/erlang-questions<br>
______________________________<wbr>_________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/">http://erlang.org/mailman/</a><wbr>listinfo/erlang-questions<br>
</blockquote></div></div>