@item info opcount
@findex info opcount
Show dynamic compiler opcode counters
+ETEXI
+
+ {
+ .name = "sync-profile",
+ .args_type = "mean:-m,no_coalesce:-n,max:i?",
+ .params = "[-m] [-n] [max]",
+ .help = "show synchronization profiling info, up to max entries "
+ "(default: 10), sorted by total wait time. (-m: sort by "
+ "mean wait time; -n: do not coalesce objects with the "
+ "same call site)",
+ .cmd = hmp_info_sync_profile,
+ },
+
+STEXI
+@item info sync-profile [-m|-n] [@var{max}]
+@findex info sync-profile
+Show synchronization profiling info, up to @var{max} entries (default: 10),
+sorted by total wait time.
+ -m: sort by mean wait time
+ -n: do not coalesce objects with the same call site
+When different objects that share the same call site are coalesced, the "Object"
+field shows---enclosed in brackets---the number of objects being coalesced.
ETEXI
{
}
#endif
+static void hmp_info_sync_profile(Monitor *mon, const QDict *qdict)
+{
+ int64_t max = qdict_get_try_int(qdict, "max", 10);
+ bool mean = qdict_get_try_bool(qdict, "mean", false);
+ bool coalesce = !qdict_get_try_bool(qdict, "no_coalesce", false);
+ enum QSPSortBy sort_by;
+
+ sort_by = mean ? QSP_SORT_BY_AVG_WAIT_TIME : QSP_SORT_BY_TOTAL_WAIT_TIME;
+ qsp_report((FILE *)mon, monitor_fprintf, max, sort_by, coalesce);
+}
+
static void hmp_info_history(Monitor *mon, const QDict *qdict)
{
int i;