Re: Stupid Instruments questions
Re: Stupid Instruments questions
- Subject: Re: Stupid Instruments questions
- From: Ken Thomases <email@hidden>
- Date: Tue, 18 Oct 2011 21:33:04 -0500
On Oct 18, 2011, at 9:01 PM, Quincey Morris wrote:
> On Oct 18, 2011, at 17:44 , Jens Alfke wrote:
>
>> (2) What’s the difference between Time Profiler and Sampler? The descriptions use different wording but seem to say the same thing; the only difference seems to be that the former can sample multiple processes. Provided I only care about one process, is there any benefit to one vs the other? I actually just tried adding both of them, but the results are bizarre: the CPU loads shown in their graphs are completely different, almost inverses of each other, so I’m assuming that they interfere with each other and shouldn’t be used at the same time.
>
> I believe Time Profiler is answering the question, "What is each CPU spending its time doing?", while the Sampler is answering the question, "What is each thread spending its time doing?" However, since the answer to either question always seems to be, "Waiting, except for a negligibly small percentage of the time," I guess you could use either. (AFAICT, there's no instrument that answers the question, "What is each thread doing during those times when it's doing something other than waiting?" That's the instrument I want.)
I think they are somewhat redundant and came from different lineages. In general, I think that the Time Profiler is the newer, more capable tool.
Sampler is similar to the "sample" command-line tool and the Sample Process feature of Activity Monitor. The Time Profiler is the reimplementation of old Shark features in Instruments.
The Time Profiler has two modes. When All Thread States is enabled, it behaves a lot like the Sampler. It pauses your program every so often and records what each of the threads is doing (i.e. their current stack traces). Much of the time, the threads will be idle, but at least you get to see where they are waiting. When All Thread States is not enabled, it stops each CPU core every so often and, if it's running a thread from a process that's within the target scope, it records the stack trace of that thread. Therefore, it only shows you threads that were doing something. Idle threads just don't show up. I'm not sure why this doesn't fit the definition of what Quincey wants; it sounds like it to me.
Regards,
Ken
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden