- bzero(mca->mca_stack, sizeof (mca->mca_stack));
- mca->mca_depth = OSBacktrace(mca->mca_stack, MCACHE_STACK_DEPTH);
+ bzero(stack, sizeof (stack));
+ mca->mca_depth = OSBacktrace(stack, MCACHE_STACK_DEPTH + 1) - 1;
+ bcopy(&stack[1], mca->mca_stack, sizeof (mca->mca_pstack));
+
+ mca->mca_ptstamp = mca->mca_tstamp;
+ microuptime(&now);
+ if (base_ts != NULL)
+ base = *base_ts;
+ /* tstamp is in ms relative to base_ts */
+ mca->mca_tstamp = ((now.tv_usec - base.tv_usec) / 1000);
+ if ((now.tv_sec - base.tv_sec) > 0)
+ mca->mca_tstamp += ((now.tv_sec - base.tv_sec) * 1000);