/// <summary>
        /// Get the 'logcal' call stack from PROCESS ROOT (the root of all stacks) to (but not including) the frame for the
        /// thread.   By default (if you can't attribute it to anything else) it will just be attributed to the process, however
        /// it is likley that you want to insert pseudo-frames for the request and other logical groupings here.
        ///
        /// The actual method frames within a thread, as well as any resource specific pseduo-frames (e.g. BLOCKING, ...)
        /// are added by the ComputingResourceMachine itself.
        ///</summary>
        public virtual StackSourceCallStackIndex GetCallStackIndex(MutableTraceEventStackSource stackSource, TraceThread thread, TraceEvent data)
        {
            var callStackIndex = stackSource.GetCallStackForProcess(thread.Process);
            // There is no request, so add this stack as an unattributed sample.
            string frameName = "Unattributed";
            StackSourceFrameIndex requestsFrameIndex = stackSource.Interner.FrameIntern(frameName);

            callStackIndex = stackSource.Interner.CallStackIntern(requestsFrameIndex, callStackIndex);
            return(callStackIndex);
        }
        /// <summary>
        /// Get the call stack index for the current thread in its current state.
        /// </summary>
        /// <remarks>
        /// The return value will be used to append the actual call stack.  This is how real call stacks get stitched together with grouping mechanisms.
        /// </remarks>
        public virtual StackSourceCallStackIndex GetCallStackIndex(
            MutableTraceEventStackSource stackSource,
            TraceThread thread)
        {
            if (null == stackSource)
            {
                throw new ArgumentNullException("stackSource");
            }
            if (null == thread)
            {
                throw new ArgumentNullException("thread");
            }

            // By default, return the call stack for the process.
            return(stackSource.GetCallStackForProcess(thread.Process));
        }