<br><br><div class="gmail_quote">On Thu, Oct 6, 2011 at 10:39 PM, Zheng Da <span dir="ltr"><<a href="mailto:zhengda1936@gmail.com">zhengda1936@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Thank you, Peter. I didn't realize Intel has explained all performance<br>
counters in its manual, and I was desperately looking for more<br>
detailed explanation on the Internet.<br>
<div><div></div><div class="h5"><br>
On Mon, Oct 3, 2011 at 11:19 PM, Peter Teoh <<a href="mailto:htmldeveloper@gmail.com">htmldeveloper@gmail.com</a>> wrote:<br>
><br>
><br>
> On Tue, Oct 4, 2011 at 9:53 AM, Peter Teoh <<a href="mailto:htmldeveloper@gmail.com">htmldeveloper@gmail.com</a>> wrote:<br>
>><br>
>> On Sun, Oct 2, 2011 at 5:07 AM, Zheng Da <<a href="mailto:zhengda1936@gmail.com">zhengda1936@gmail.com</a>> wrote:<br>
>> > Hello,<br>
>> ><br>
>> > I start to use perf to profile my program, but I'm not quite sure if I<br>
>> > understand some events.<br>
>><br>
>> Firstly perf is using hardware to read these performance information. So<br>
>> for intel CPU, depending on the different model, u can find the relevant<br>
>> information in the reference manual from Intel here:<br>
>><br>
>> <a href="http://www.intel.com/Assets/en_US/PDF/manual/248966.pdf" target="_blank">http://www.intel.com/Assets/en_US/PDF/manual/248966.pdf</a><br>
>><br>
>> In particular, the various model of Intel CPU is listed in page xvii, and<br>
>> along with it are the various performance information u can extract out -<br>
>> the last item is the BUS information (B.6.10).<br>
>><br>
>> > First, perf can profile bus cycles. Is it the bus cycles of FSB?<br>
>> > Second, what is task clock? It seems to me that task clock is the<br>
><br>
> task clock, from reading the implementation in kernel/events/core.c, i<br>
> suspect is a software event, not hardware. Ie, it counts upon each task<br>
> switch. To quote from core.c:<br>
> /*<br>
> * Software event: task time clock<br>
> */<br>
> static void task_clock_event_update(struct perf_event *event, u64 now)<br>
> {<br>
><br>
> More details here:<br>
> <a href="http://lwn.net/Articles/312720/" target="_blank">http://lwn.net/Articles/312720/</a><br>
><br>
>><br>
>> > ticks used by a process. It should include the ticks used in the<br>
>> > kernel mode and the user space mode, as long as it is used in the<br>
>> > context of the process. I suppose it doesn't count the cycles used by<br>
>> > the interrupts such as page faults and softirq, even though the irqs<br>
>> > are caused by the process. Is it correct?<br>
><br>
> on the contrary, i think it should include, as to exclude these cycles does<br>
> entail stopping the hrtimer.....read into core.c further.<br>
</div></div>I'm disappointed that the information isn't documented somewhere. The<br>
developers shouldn't expect users to read the code to understand how<br>
to use the tool :(<br>
<br></blockquote><div><br>i suspect it is documented in many places, at here is one good one:</div><div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><a href="http://developer.apple.com/library/IOS/#documentation/DeveloperTools/Conceptual/SharkUserGuide/MiscellaneousTopics/MiscellaneousTopics.html#//apple_ref/doc/uid/TP40005233-CH14-SW3">http://developer.apple.com/library/IOS/#documentation/DeveloperTools/Conceptual/SharkUserGuide/MiscellaneousTopics/MiscellaneousTopics.html#//apple_ref/doc/uid/TP40005233-CH14-SW3</a></div>
<div><br></div><div>and from the side, looking at Appendix A, u can see a table of all the PerfCounters for ARM11, and then another section will list out for Intel, and then PPC etc.....</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
BTW, is there any wiki where people can share what they found in the kernel?<br>
<br>
Thanks,<br>
<font color="#888888">Da<br>
</font></blockquote></div><br><br clear="all"><div><br></div>-- <br>Regards,<br>Peter Teoh<br>