oprofile Log

Commit Date  
[543be6] (2.9 kB) by Carl Love Carl Love , pushed by Maynard Johnson Maynard Johnson

OProfile, fix the units for the reported CPU frequency

The freqency of the processor is found by function op_cpu_frequency() in
libutil/op_cpufreq.c by either checking for the frequency in the file
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq or from /proc/cpuinfo.

Most of the Intel processors get the frequency from cpuinfo_max_freq. The
frequency stored in this file is stored in units of KHz for the Intel
processors I can check. I do not know what other architectures store the
CPU frequency in this file. When this value is printed, the value is printed
by the routine describe_cpu() in libpp/op_header.cpp the assumption is the
freqency is assumed to be MHz. For example, the following is what is printed
by my laptop after running opreport

Using /home/carll/oprofile_data/samples/ for samples directory.
CPU: Core 2, speed 2.534e+06 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit ma\
sk of 0x00 (Unhalted core cycles) count 100000

Note the speed is stated as 2.534e+06 MHz that is Mega Mega Hz or Tera Hz which
is a factor of 1000 high.

The fix is to have the function op_cpu_freq_sys_devices() in
libutil/op_cpufreq.c to adjust the frequency read from the file
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq by dividing by 1000
to return the frequency in units of MHz. The following patch implements this
fix for reporting the estimated processor frequency.

Signed-off-by: Carl Love <cel@us.ibm.com>

2013-08-12 16:13:36 View
[0613ab] (2.7 kB) by Suravee Suthikulpanit Suravee Suthikulpanit

Fix BUG3069227: Time discrepancy using oprofile

Report CPU frequency using value from
by default instead of /proc/cpuinfo

2011-06-15 22:11:45 View
[a56ab0] (1.2 kB) by Maynard johnson Maynard johnson

Add support for ICT loongson2

2009-11-25 20:35:20 View
[64c737] (1.1 kB) by Philippe Elie Philippe Elie

minor tidy

2003-11-04 04:26:45 View
[0bd8a8] (1.1 kB) by Philippe Elie Philippe Elie

memory leak + FILE * leak

2003-10-07 03:23:19 View
[031f43] (1.0 kB) by Philippe Elie Philippe Elie

libop/tests/load_events_files_tests.c: new file, validate events description file by loading them. Revert last commit in libop/op_events.c

2003-10-02 04:04:52 View
[ac21b7] (980 Bytes) by Philippe Elie Philippe Elie

typo in comment


2003-03-22 14:46:49 View
[046c00] (980 Bytes) by Philippe Elie Philippe Elie

get cpu frequency for all supported arch, the bad point is that we
need to duplicate a portion of the code in opcontrol since we
need always cpu frequency in opcontrol to get the default count.

Shell code tested on x86/alpha/sparc64 and through school test case on
other arch, C code tested on x86 and through school test case on other


2003-03-22 04:51:21 View

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks