Lines Matching refs:rec
70 struct bootstage_record *rec; in find_id() local
73 for (rec = data->record, end = rec + data->rec_count; rec < end; in find_id()
74 rec++) { in find_id()
75 if (rec->id == id) in find_id()
76 return rec; in find_id()
85 struct bootstage_record *rec; in ensure_id() local
87 rec = find_id(data, id); in ensure_id()
88 if (!rec && data->rec_count < RECORD_COUNT) { in ensure_id()
89 rec = &data->record[data->rec_count++]; in ensure_id()
90 rec->id = id; in ensure_id()
91 return rec; in ensure_id()
94 return rec; in ensure_id()
101 struct bootstage_record *rec; in bootstage_add_record() local
107 rec = find_id(data, id); in bootstage_add_record()
108 if (!rec && data->rec_count < RECORD_COUNT) { in bootstage_add_record()
109 rec = &data->record[data->rec_count++]; in bootstage_add_record()
110 rec->time_us = mark; in bootstage_add_record()
111 rec->name = name; in bootstage_add_record()
112 rec->flags = flags; in bootstage_add_record()
113 rec->id = id; in bootstage_add_record()
174 struct bootstage_record *rec = ensure_id(data, id); in bootstage_start() local
177 if (rec) { in bootstage_start()
178 rec->start_us = start_us; in bootstage_start()
179 rec->name = name; in bootstage_start()
188 struct bootstage_record *rec = ensure_id(data, id); in bootstage_accum() local
191 if (!rec) in bootstage_accum()
193 duration = (uint32_t)timer_get_boot_us() - rec->start_us; in bootstage_accum()
194 rec->time_us += duration; in bootstage_accum()
208 const struct bootstage_record *rec) in get_record_name() argument
210 if (rec->name) in get_record_name()
211 return rec->name; in get_record_name()
212 else if (rec->id >= BOOTSTAGE_ID_USER) in get_record_name()
213 snprintf(buf, len, "user_%d", rec->id - BOOTSTAGE_ID_USER); in get_record_name()
215 snprintf(buf, len, "id=%d", rec->id); in get_record_name()
220 static uint32_t print_time_record(struct bootstage_record *rec, uint32_t prev) in print_time_record() argument
226 print_grouped_ull(rec->time_us, BOOTSTAGE_DIGITS); in print_time_record()
228 print_grouped_ull(rec->time_us, BOOTSTAGE_DIGITS); in print_time_record()
229 print_grouped_ull(rec->time_us - prev, BOOTSTAGE_DIGITS); in print_time_record()
231 printf(" %s\n", get_record_name(buf, sizeof(buf), rec)); in print_time_record()
233 return rec->time_us; in print_time_record()
274 struct bootstage_record *rec = &data->record[recnum]; in add_bootstages_devicetree() local
277 if (rec->id != BOOTSTAGE_ID_AWAKE && rec->time_us == 0) in add_bootstages_devicetree()
286 get_record_name(buf, sizeof(buf), rec))) in add_bootstages_devicetree()
291 rec->start_us ? "accum" : "mark", in add_bootstages_devicetree()
292 rec->time_us)) in add_bootstages_devicetree()
311 struct bootstage_record *rec = data->record; in bootstage_report() local
319 prev = print_time_record(rec, 0); in bootstage_report()
322 qsort(data->record, data->rec_count, sizeof(*rec), h_compare_record); in bootstage_report()
324 for (i = 1, rec++; i < data->rec_count; i++, rec++) { in bootstage_report()
325 if (rec->id && !rec->start_us) in bootstage_report()
326 prev = print_time_record(rec, prev); in bootstage_report()
334 for (i = 0, rec = data->record; i < data->rec_count; i++, rec++) { in bootstage_report()
335 if (rec->start_us) in bootstage_report()
336 prev = print_time_record(rec, -1); in bootstage_report()
366 const struct bootstage_record *rec; in bootstage_stash() local
381 for (rec = data->record, i = count = 0; i < data->rec_count; in bootstage_stash()
382 i++, rec++) { in bootstage_stash()
383 if (rec->id != 0) in bootstage_stash()
392 for (rec = data->record, i = 0; i < data->rec_count; i++, rec++) { in bootstage_stash()
393 append_data(&ptr, end, rec, sizeof(*rec)); in bootstage_stash()
397 for (rec = data->record, i = 0; i < data->rec_count; i++, rec++) { in bootstage_stash()
400 name = get_record_name(buf, sizeof(buf), rec); in bootstage_stash()
422 struct bootstage_record *rec; in bootstage_unstash() local
444 if (hdr->count * sizeof(*rec) > hdr->size) { in bootstage_unstash()
447 (ulong)hdr->count * sizeof(*rec), hdr->size); in bootstage_unstash()
472 for (rec = data->record + data->next_id, i = 0; i < hdr->count; in bootstage_unstash()
473 i++, rec++) { in bootstage_unstash()
474 rec->name = ptr; in bootstage_unstash()