Instructions for profiling in K42 (SDET run)
- Boot with a large trace space: Add "K42_TRACE_LOG_NUMB_BUFS=8" to your k42console command (after a "--").
Login and make one SDET run to warm things up: "runSDET -c 0xf7f -s <n_cpus>"
- Then make a tracing run: add "-t 0x31808" to the runSDET command.
- Dump the trace file(s): type "T|E" at the test prompt. Wait for a "trace daemon finished on all processors" message. You should have a set of trace files in your kitchroot directory, one for each processor.
Generate a profile: in your kitchroot directory run "traceProfile --mp <n_cpus> --path <your_obj_os_dir>", where <your_obj_os_dir> is the path to the os subdirectory of your object tree, e.g. ~/k42/powerpc/noDeb/os. traceProfile dumps the profile to stdout, so you can redirect it to a file.
- In the profile you should find a section labeled "histogram for pid 0x0 mapped filename boot_image.dbg", and under it a two-column table with counts and methods. The methods used to be named symbolically, but now they're named by addresses.
- Pipe the output through tracePostProc (or use the runtraceProfile script which does both) to transform from addresses to symbols
These timer-based profiles are not particularly accurate because timer frequency is somewhat correlated with what's running. You can improve things somewhat by forcing the kernel, servers, and user processes to all use the same quantum and pulse intervals. In os/kernel/sys/KernelScheduler.H, set all four {MIN,MAX}_QUANTUM_MICROSECS and {MIN,MAX}_PULSE_MICROSECS values to 10000. For some reason, using a smaller number, which would give you more information, causes baseServers to crash.
