thread.c: added profiling outputs for thread changes
os.c: added profiling stuff
os.h: added profiling macros