From 2f8d59aa9e8a96d094172db339fd94aae45a90b5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?H=C3=A5kan=20Mattsson?= <hm@tail-f.com>
Date: Wed, 2 Nov 2016 12:56:39 +0100
Subject: erts: Make depth of current_stacktrace configurable

The BIF process_info(Pid, current_stacktrace) truncates the
stacktrace. The old behavior was to truncate long stacktraces to max
8 items. And this was hard coded. Now it is truncated to the value of
system_flag(backtrace_depth) instead. The backtrace_depth defaults to
8, but is configurable.
---
 erts/doc/src/erlang.xml | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

(limited to 'erts/doc')

diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml
index 9646953518..112682d713 100644
--- a/erts/doc/src/erlang.xml
+++ b/erts/doc/src/erlang.xml
@@ -4899,7 +4899,9 @@ RealSystem = system + MissedSystem</code>
             <p>Returns the current call stack back-trace (<em>stacktrace</em>)
               of the process. The stack has the same format as returned by
               <seealso marker="#get_stacktrace/0">
-              <c>erlang:get_stacktrace/0</c></seealso>.</p>
+              <c>erlang:get_stacktrace/0</c></seealso>. The depth of the
+              stacktrace is truncated according to the <c>backtrace_depth</c>
+              system flag setting.</p>
           </item>
           <tag><c>{dictionary, <anno>Dictionary</anno>}</c></tag>
           <item>
@@ -6611,7 +6613,9 @@ ok
       <fsummary>Set system flag <c>backtrace_depth</c>.</fsummary>
       <desc>
         <p>Sets the maximum depth of call stack back-traces in the
-          exit reason element of <c>'EXIT'</c> tuples.</p>
+          exit reason element of <c>'EXIT'</c> tuples. The flag
+          also limits the stacktrace depth returned by <c>process_info</c>
+          item <c>current_stacktrace.</c></p>
         <p>Returns the old value of the flag.</p>
       </desc>
     </func>
-- 
cgit v1.2.3