1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 This is APC - graphical CPU load meter.
4 It is more suitable/accurate in situations where applications generate
5 "short" periodic bursts of activity.
7 Kernel can use variety of values for HZ (most frequent: 100 250 1000)
9 PAL/SECAM video frame grabbers do so with 25/50 FPS frequency, if the
10 pulse leads to some application deciding to burn CPU (putting the
11 frame on the screen, encoding it, etc) chances are good that the load
12 you will see in top(1) (or anything `/proc/stat' based) would not
13 represent reality accurately. Ditto for plain video clips playing at
16 When frequency of aforementioned bursts devides HZ value evenly
17 reading `/proc/stat' or `/proc/uptime' can make an impression that
18 sometimes machine gets loaded for a brief period of time but then goes
19 idle again (for a while) then the cycle repeats. This is not the case,
20 the machine is constantly loaded (well according to ad-hoc measuring
21 via background niced process and/or APC)
23 If this line of thinking is correct one can not notice any load at all
24 while watching NTSC content (30fps - does not divide 100/250/1000
27 Furthermore `/proc/stat' exports monotonically increasing load times
28 but _NOT_ real time[1], so there's omni-present sub-jiffy error. Not
29 to mention that jiffy resolution is somewhat low.
31 If you depend on sorta-kinda semi-correct load meter in those
32 conditions APC might present a better choice.
34 The kernel module part of APC measures how much time is spent
35 executing idle kernel function - this information is represented by
36 yellow color, values obtained via `/proc/stat' are represented by red.
38 You can use `-help' command line option to get a brief overview of
43 Linux 2.4.30 - AMD Athlon(tm) Processor (1.4 Ghz)
44 Linux 2.6.17.6 - AMD Athlon(tm)64 X2 Dual Core Processor 3800+
45 Linux 2.6.18 - AMD Athlon(tm)64 3800+
47 It's possible that RMClock[3] does something similar(load measuring
48 wise) on Microsoft Windows.
50 [1] Unlike `/proc/uptime'. But this one is useless for SMP
51 [2] SMP not tested on 2.4 kernels (nor QUIRK mode)
52 [3] http://cpu.rightmark.org/products/rmclock.shtml
54 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55 To build you will need:
57 OCaml - http://caml.inria.fr/ocaml/
58 LablGL - http://wwwfun.kurims.kyoto-u.ac.jp/soft/lsl/lablgl.html
59 (and by extension some OpenGL implementation)
60 GLUT - http://www.opengl.org/resources/libraries/glut/
61 http://freeglut.sourceforge.net/
62 GCC - http://gcc.gnu.org/
64 Plus all what is required to build a kernel module.
68 <untar and go to directory with sources>
71 $ su -c 'insmod ./its.ko' - 2.6 Kernels
72 $ su -c 'insmod ./its.o' - 2.4 Kernels
74 If the module fails to load consult dmesg(8). Most likely cause is the
75 lack of exported `default_idle' function and no specific power
76 management idle function is specified. Few workarounds follow:
79 Add `idle=halt' to the kernel command line (method depends on the
80 boot-loader) and reboot.
83 ------------------------------------------------------------------
85 $ func=$(awk '/default_idle$/ {print "0x" $1}' /proc/kallsyms)
86 $ su -c "insmod ./itc.ko idle_func=$func"
88 ------------------------------------------------------------------
90 $ func=$(awk '/default_idle$/ {print "0x" $1}' /proc/ksyms)
91 $ su -c "insmod ./itc.o idle_func=$func"
93 ======================================================================
95 $ major=$(awk '/ itc$/ {print $1}' /proc/devices)
96 $ su -c "mknod -m 0444 itc c $major 0"
98 [make sure you are in X]