From: William C. <wc...@re...> - 2009-10-27 18:24:52
|
Henry DeYoung wrote: > Hi, > > I'm trying to use OProfile as part of a class project with another > graduate student on cache behavior of Haskell programs. I've never used > OProfile before and so I'm in the process of becoming familiar with it. > > > If I do > > opcontrol --list-events > > I see that one event for my Core 2 processor is CPU_CLK_UNHALTED with a > minimum count of 6000. However, if I try > > sudo opcontrol --setup --event=CPU_CLK_UNHALTED:6000 > > it complains that: > > Count 6000 for event CPU_CLK_UNHALTED is below the minimum 90000 > > Of course, it lets me do > > sudo opcontrol --setup --event=CPU_CLK_UNHALTED:90000 > > but then the samples are very small for a single program run. One thing that might be happening is that haskell is using shared libraries and most of the time is spent in those other shared libraries. You might want to add the following to the --setup: --separate=library Do you have a back of the envelope estimate of how many clock cycles you expect for the program? For example if the processor is a 2GHz processor and the /usr/bin/time says that it takes total of 1 second of user and system time then would expect something around: 22,000samples = 2e9 clocks/s * 1s / (90,000 clk/sample) This is > more of a problem when it will not let me do > > sudo opcontrol --setup --event=L2_RQSTS:6000:0xc1:1:1 > > to measure the L2 cache misses since there are fewer cache miss events > than unhalted clock cycles. > > > Why is OProfile requiring a minimum count of 90,000 when the minimum > stated in --list-events is 6000? What version of oprofile are you using? On oprofile 0.9.5 on fedora. $ ophelp -c i386/core_2|more oprofile: available events for CPU type "Core 2" See Intel Architecture Developer's Manual Volume 3B, Appendix A and Intel Architecture Optimization Reference Manual (730795-001) CPU_CLK_UNHALTED: (counter: all)) Clock cycles when not halted (min count: 6000) Unit masks (default 0x0) ---------- 0x00: Unhalted core cycles 0x01: Unhalted bus cycles 0x02: Unhalted bus cycles of this core while the other core is halted ... That message "below the minimum..." is coming from ophelp. Is it possible that you have two versions of oprofile in use/installed? so that opcontrol and ophelp commands are from different places? opcontrol is looking for ophelp in the same directory, and ophelp looks in specific directories for the event information. -Will |