The implementation for ustackdepth was causing it to always return 1,
regardless of the depth of the ustack(). The commit ensures that the
underlying code can walk the stack (without actually collecting PCs)
and determine the depth.
Orabug:
25949692
Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
Acked-by: Nick Alcock <nick.alcock@oracle.com>
dtrace_stacktrace(&st);
depth = st.depth;
- while (st.depth < st.limit) {
- if (pcstack)
+ if (pcstack) {
+ while (st.depth < st.limit) {
pcstack[st.depth++] = 0;
- if (fpstack)
- fpstack[st.depth++] = 0;
+ if (fpstack)
+ fpstack[st.depth++] = 0;
+ }
}
return depth;
int dtrace_getustackdepth(void)
{
- return dtrace_getufpstack(NULL, NULL, 0);
+ return dtrace_getufpstack(NULL, NULL, INT_MAX);
}