<div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello Abu,<br>
<br>
I had to include &lt;linux/module.h&gt; or an error was issued about &quot;THIS_MODULE&quot;.<br></blockquote><div><br></div>I am running this tool on Scientific Linux 6.0, which is 2.6.32 kernel. I know this is old but this is what I have for my product.<br>

<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
What Kernel version are you using? I&#39;m trying to compile it and I&#39;m<br>
getting the error:<br>
<br>
[peter@ace m]$ make<br>
make -C /lib/modules/3.3.7-1.fc17.x86_64/build SUBDIRS=`pwd` modules<br>
make[1]: Entering directory `/usr/src/kernels/3.3.7-1.fc17.x86_64&#39;<br>
  CC [M]  /tmp/m/m.o<br>
/tmp/m/m.c:36:2: error: unknown field ‘ioctl’ specified in initializer<br>
/tmp/m/m.c:36:2: warning: initialization from incompatible pointer<br>
type [enabled by default]<br>
/tmp/m/m.c:36:2: warning: (near initialization for ‘m_fops.llseek’)<br>
[enabled by default]<br>
make[2]: *** [/tmp/m/m.o] Error 1<br>
make[1]: *** [_module_/tmp/m] Error 2<br>
make[1]: Leaving directory `/usr/src/kernels/3.3.7-1.fc17.x86_64&#39;<br>
make: *** [module] Error 2<br>
<br>
According to:<br>
<a href="http://lxr.linux.no/linux+v3.4.1/include/linux/fs.h#L1609" target="_blank">http://lxr.linux.no/linux+v3.4.1/include/linux/fs.h#L1609</a><br>
<br>
There is no .ioctl at struct file_operations...<br>
<br>
Can you share how you&#39;ve used perf/oprofile on your module/Kernel code?<br>
<br>
[]&#39;s<br>
<br>
Peter</blockquote><div><br></div>for perf:</div><div class="gmail_quote"><br></div><div class="gmail_quote"><div class="gmail_quote">perf stat -e cpu-cycles,stalled-cycles-frontend,stalled-cycles-backend,instructions,cache-references,cache-misses,branch-instructions,branch-misses,bus-cycles,cpu-clock,task-clock,page-faults,minor-faults,major-faults,context-switches,cpu-migrations,alignment-faults,emulation-faults,L1-dcache-loads,L1-dcache-load-misses,L1-dcache-stores,L1-dcache-store-misses,L1-dcache-prefetches,L1-dcache-prefetch-misses,L1-icache-loads,L1-icache-load-misses,L1-icache-prefetches,L1-icache-prefetch-misses,LLC-loads,LLC-load-misses,LLC-stores,LLC-store-misses,LLC-prefetches,LLC-prefetch-misses,dTLB-loads,dTLB-load-misses,dTLB-stores,dTLB-store-misses,dTLB-prefetches,dTLB-prefetch-misses,iTLB-loads,iTLB-load-misses,branch-loads,branch-load-misses,syscalls:sys_enter_sendmsg,syscalls:sys_exit_sendmsg,sched:sched_wakeup,sched:sched_stat_sleep ./prog</div>

<div class="gmail_quote"><br></div><div class="gmail_quote">for oprofile:</div><div class="gmail_quote"><br></div><div class="gmail_quote"><div class="gmail_quote"># opcontrol --reset</div><div class="gmail_quote"># opcontrol --vmlinux=/boot/vmlinux.64</div>

<div class="gmail_quote"># opcontrol --start</div><div class="gmail_quote"># ./a.out</div><div class="gmail_quote"># opcontrol --shutdown</div><div class="gmail_quote"># opreport -l -p</div></div></div></div>