- for (i = 0; i < ctx->num_op_metrics; i++) {
- const char *op_string;
- op_metrics_t *metric =&ctx->op_metrics[sorted[i]];
-
- /* Since we sparsely fill the array based on program
- * id, many "programs" have no time.
- */
- if (metric->time_ns == 0.0)
- continue;
-
- op_string = metrics_op_string (metric->op);
-
- printf ("%s", op_string);
- if (metric->op >= METRICS_OP_SHADER) {
- printf (" %d:", metric->op - METRICS_OP_SHADER);
- } else {
- printf (":");
- for (j = strlen (op_string); j < 20; j++)
- printf (" ");
- }
- printf ("\t%7.2f ms (% 2.1f%%)",
- metric->time_ns / 1e6,
- metric->time_ns / total * 100);
- printf ("[");
- for (j = 0; j < metric->num_counters; j++) {
- if (metric->counters[j] == 0.0)
- continue;
- printf ("%d: %.2f ms ", j, metric->counters[j] / 1e6);
- }
- printf ("]\n");
- }
+ for (i = 0; i < ctx->num_op_metrics; i++)
+ print_op_metrics (&ctx->op_metrics[sorted[i]], total);