| 86 | } |
| 87 | |
| 88 | void cbm_scale_begin(cbm_scale_probe_t *probe, const char *phase, long total) { |
| 89 | if (!probe) { |
| 90 | return; |
| 91 | } |
| 92 | probe->phase = phase; |
| 93 | probe->total = total; |
| 94 | atomic_init(&probe->next_cp, 0); |
| 95 | for (int i = 0; i < CBM_SCALE_CHECKPOINTS; i++) { |
| 96 | probe->cp_us[i] = 0; |
| 97 | probe->cp_items[i] = 0; |
| 98 | } |
| 99 | cbm_clock_gettime(CLOCK_MONOTONIC, &probe->start); |
| 100 | } |
| 101 | |
| 102 | void cbm_scale_tick(cbm_scale_probe_t *probe, long done) { |
| 103 | if (!probe || probe->total < SCALE_MIN_ITEMS) { |
no test coverage detected