Thanks for reply.<div><div><br><div class="gmail_quote">2011/3/15 Mulyadi Santosa <span dir="ltr">&lt;<a href="mailto:mulyadi.santosa@gmail.com">mulyadi.santosa@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Minwoo...<br>
<br>
I am not the best... just trying to give idea here...<br>
<div class="im"><br>
On Tue, Mar 15, 2011 at 00:03, Minwoo Lee &lt;<a href="mailto:ermaker@gmail.com">ermaker@gmail.com</a>&gt; wrote:<br>
&gt; Hello.<br>
&gt; I am hacking the kernel source for studying.<br>
&gt; I just modified schedule() in kernel/sched.c for profiling processes.<br>
<br>
<br>
</div>basic question is: are you sure the cache misses you see during<br>
schedule is entirely attributed to the soon-to-be-switched-out<br>
process? have you consider that during that process run time, on going<br>
interrupts/exception etc could attribute into the cache misses?<br></blockquote><div><br></div><div>You&#39;re right. This code is wrong. I wrote the code just for checking that the perf library runs.</div><div>The code should be changed to check cache misses while in a slice time(or an unit time?).</div>
<div>The main problem is, sys_pref_event_open does not return the valid fd.</div><div>I have no idea why sys_perf_event_open returns invalid fd.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<br>
and about this line:<br>
<div class="im">BUG_ON(res != sizeof(u64))<br>
<br>
</div>not sure if I read it correctly, but previously I see &quot;res&quot; is<br>
declared as size_t, right?<br></blockquote><div><br></div><div>Yes, res is declared as size_t.</div><div>Also type of sizeof() is size_t. Isn&#39;t it right?</div><div>This line assumes that sys_read() read correctly.</div>
<div>This line is from the code in line 227 at tools/perf/builtin-stat.c,</div><div><br></div><div><div>225                         res = read(fd[cpu][counter][thread],</div><div>226                                         single_count, nv * sizeof(u64));</div>
<div>227                         assert(res == nv * sizeof(u64));</div></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<font color="#888888"><br>
<br>
<br>
--<br>
regards,<br>
<br>
Mulyadi Santosa<br>
Freelance Linux trainer and consultant<br>
<br>
blog: <a href="http://the-hydra.blogspot.com" target="_blank">the-hydra.blogspot.com</a><br>
training: <a href="http://mulyaditraining.blogspot.com" target="_blank">mulyaditraining.blogspot.com</a><br>
</font></blockquote></div><br></div></div>