[profiler] Simplify the encoding of monitor events.