+static char __run_str[REAL_MAX_JOBS + 1];
+
+/*
+ * Worst level condensing would be 1:5, so allow enough room for that
+ */
+static char run_str[__THREAD_RUNSTR_SZ(REAL_MAX_JOBS)];
+
+static void update_condensed_str(char *run_str, char *run_str_condensed)
+{
+ int i, ci, last, nr;
+ size_t len;
+
+ len = strlen(run_str);
+ if (!len)
+ return;
+
+ last = 0;
+ nr = 0;
+ ci = 0;
+ for (i = 0; i < len; i++) {
+ if (!last) {
+new:
+ run_str_condensed[ci] = run_str[i];
+ last = run_str[i];
+ nr = 1;
+ ci++;
+ } else if (last == run_str[i]) {
+ nr++;
+ } else {
+ ci += sprintf(&run_str_condensed[ci], "(%u),", nr);
+ goto new;
+ }
+ }
+
+ if (nr)
+ ci += sprintf(&run_str_condensed[ci], "(%u)", nr);
+
+ run_str_condensed[ci + 1] = '\0';
+}