Tuesday, August 16, 2011

Linux: likely & unlikely

In the Linux,
You can see the below code

if ( likely(x == 0) )
{
// code ...
}
or
if ( unlikely(x == 1) )
{
// code ...
}

#define likely(x) __builtin_expect((x),1)
#define unlikely(x) __builtin_expect((x),0)


As I know, its another expression is "Branch Prediction".
It is supported gcc 2.96 or later version.

likely/unlikely macros in the Linux kernel
http://stackoverflow.com/questions/109710/likely-unlikely-macros-in-the-linux-kernel

Kernel : likely/unlikely macros
http://kerneltrap.org/node/4705

Wednesday, August 3, 2011

Tuesday, July 26, 2011

Sunday, July 10, 2011

Linux: Current Frequency

How to read cpu frequency on android device
http://stackoverflow.com/questions/3021054/how-to-read-cpu-frequency-on-android-device

How to detect android cpu speed?
http://stackoverflow.com/questions/4875415/how-to-detect-android-cpu-speed


Linux: CPU scaling governor

Governors In the Linux Kernel
1 Performance
2 Powersave
3 Userspace
4 Ondemand
5 Conservative
6 Interactive
7 InteractiveX

http://bonsai.googlecode.com/svn-history/r447/trunk/kernel-src/linux-2.6.32.9/Documentation/cpu-freq/governors.txt

http://icarus21.tistory.com/entry/CPU-Frequency-Governor


# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

For all available scaling governors:
# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors

Check Available frequencies
# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies

To control CPU1 manually,
# echo 0 > /sys/devices/system/cpu/cpu1/online
# echo 1 > /sys/devices/system/cpu/cpu1/online


Update 6/28 2013
=============================================
CPU Governors
http://forum.xda-developers.com/showthread.php?t=1736168

Linux: DVFS & hotplug

Web:
- Linux kernel CPU Frequency 변경(DVFS) 코드


PDF:

Saturday, June 11, 2011

How to debug in Release Mode in Visual C++ 6.0

Project > Setting > C/C++ tab menu
Debug Info: change from None to Program database

And, Project > Setting > Link
Check, Generate debug info