Several customers have complained about clean up task takes longer time than they should be. The current source print the break down time when TraceSafepoint is on. But TraceSafepoint is a develop flag and also will enable printing a lot of information regarding safepoint. So this CR needs to address the exposure of these times and also make sure as less overheads as possible.
The solution is to have a new flag "-XX:+TraceCleanupTimeInSafepoint" and print out the time spent in each clean up tasks when that is on. The time stamp will also be printed out when PrintGCTimeStamp is on.
Use a new flag -XX:+TraceCleanupTimeInSafepoint to enable tracing the clean up task time.
I think TraceSafepointCleanupTime might be a better name for that flag.