Log context switch event for tracing