TimeDoctor Logger Linux Component
- compile the kernel module (TD_logger) : make
- patch your kernel to instrument with logging calls : see example modified fork.c and sched.c (look for #ifdef CONFIG_PHILIPS_LOG)
- insmod the logging module : (sudo) insmod TD_logger.ko
- the module uses procfs for interfacing (see TD_logger source for details) : echo reset | status | on | off > /proc/TimeDoctor
- a dump of the log buffer can be obtained by reading from /proc/TimeDoctor : cat /proc/TimeDoctor > trace.raw
- the raw buffer can be converted to a TDI file by using the script log2tdi : log2tdi trace.raw > trace.tdi
(N.B. potential endianess issues issues when target & host are different, see bytes2int32)
- trace.tdi can be viewed with the Eclipse TimeDoctor viewer
- did not test the kernel patching, instead added some test logging to the 'on' command. (avoids recompiling kernel).
- Not sure how logging without the module installed works (instrumented kernel calls functions that are not yet there?)
- module now uses X86 TSC cycle counter ( rdtscll() ). This will not work on ARM, and has issues on X86 (sleep states, frequency changes).
A portable solution using high resolution timers might be better, could have performance impact, though.
- CONFIG_LOG_SIZE is now statically define in TD_logger.c Make this a (kernel) config option.
- The logging module starts logging only when the module is loaded initialized. For starting logging asap. see if the init can be done
earlier (e.g. using early_initcall(TD_BufferInit) )