Lines Matching full:record
124 struct pstore_record *record) in ramoops_get_next_prz() argument
143 record->type = prz->type; in ramoops_get_next_prz()
144 record->id = id; in ramoops_get_next_prz()
182 static ssize_t ramoops_pstore_read(struct pstore_record *record) in ramoops_pstore_read() argument
185 struct ramoops_context *cxt = record->psi->data; in ramoops_pstore_read()
195 record->time.tv_sec = 0; in ramoops_pstore_read()
196 record->time.tv_nsec = 0; in ramoops_pstore_read()
197 record->compressed = false; in ramoops_pstore_read()
202 record); in ramoops_pstore_read()
206 &record->time, in ramoops_pstore_read()
207 &record->compressed); in ramoops_pstore_read()
208 /* Clear and skip this DMESG record if it has no valid header */ in ramoops_pstore_read()
217 prz = ramoops_get_next_prz(&cxt->cprz, 0 /* single */, record); in ramoops_pstore_read()
220 prz = ramoops_get_next_prz(&cxt->mprz, 0 /* single */, record); in ramoops_pstore_read()
227 record); in ramoops_pstore_read()
230 * Build a new dummy record which combines all the in ramoops_pstore_read()
244 cxt->ftrace_read_cnt++, record); in ramoops_pstore_read()
262 record->id = 0; in ramoops_pstore_read()
274 record->ecc_notice_size = persistent_ram_ecc_string(prz, NULL, 0); in ramoops_pstore_read()
276 record->buf = kvzalloc(size + record->ecc_notice_size + 1, GFP_KERNEL); in ramoops_pstore_read()
277 if (record->buf == NULL) { in ramoops_pstore_read()
282 memcpy(record->buf, (char *)persistent_ram_old(prz) + header_length, in ramoops_pstore_read()
285 persistent_ram_ecc_string(prz, record->buf + size, in ramoops_pstore_read()
286 record->ecc_notice_size + 1); in ramoops_pstore_read()
298 struct pstore_record *record) in ramoops_write_kmsg_hdr() argument
305 (time64_t)record->time.tv_sec, in ramoops_write_kmsg_hdr()
306 record->time.tv_nsec / 1000, in ramoops_write_kmsg_hdr()
307 record->compressed ? 'C' : 'D'); in ramoops_write_kmsg_hdr()
313 static int notrace ramoops_pstore_write(struct pstore_record *record) in ramoops_pstore_write() argument
315 struct ramoops_context *cxt = record->psi->data; in ramoops_pstore_write()
319 if (record->type == PSTORE_TYPE_CONSOLE) { in ramoops_pstore_write()
322 persistent_ram_write(cxt->cprz, record->buf, record->size); in ramoops_pstore_write()
324 } else if (record->type == PSTORE_TYPE_FTRACE) { in ramoops_pstore_write()
337 persistent_ram_write(cxt->fprzs[zonenum], record->buf, in ramoops_pstore_write()
338 record->size); in ramoops_pstore_write()
340 } else if (record->type == PSTORE_TYPE_PMSG) { in ramoops_pstore_write()
345 if (record->type != PSTORE_TYPE_DMESG) in ramoops_pstore_write()
349 * We could filter on record->reason here if we wanted to (which in ramoops_pstore_write()
364 if (record->part != 1) in ramoops_pstore_write()
383 /* Build header and append record contents. */ in ramoops_pstore_write()
384 hlen = ramoops_write_kmsg_hdr(prz, record); in ramoops_pstore_write()
388 size = record->size; in ramoops_pstore_write()
391 persistent_ram_write(prz, record->buf, size); in ramoops_pstore_write()
398 static int notrace ramoops_pstore_write_user(struct pstore_record *record, in ramoops_pstore_write_user() argument
401 if (record->type == PSTORE_TYPE_PMSG) { in ramoops_pstore_write_user()
402 struct ramoops_context *cxt = record->psi->data; in ramoops_pstore_write_user()
406 return persistent_ram_write_user(cxt->mprz, buf, record->size); in ramoops_pstore_write_user()
412 static int ramoops_pstore_erase(struct pstore_record *record) in ramoops_pstore_erase() argument
414 struct ramoops_context *cxt = record->psi->data; in ramoops_pstore_erase()
417 switch (record->type) { in ramoops_pstore_erase()
419 if (record->id >= cxt->max_dump_cnt) in ramoops_pstore_erase()
421 prz = cxt->dprzs[record->id]; in ramoops_pstore_erase()
427 if (record->id >= cxt->max_ftrace_cnt) in ramoops_pstore_erase()
429 prz = cxt->fprzs[record->id]; in ramoops_pstore_erase()
505 * If we have a negative record size, calculate it based on in ramoops_init_przs()
506 * mem_sz / *cnt. If we have a positive record size, calculate in ramoops_init_przs()
514 dev_err(dev, "%s record size == 0 (%zu / %u)\n", in ramoops_init_przs()
521 dev_err(dev, "%s record count == 0 (%zu / %zu)\n", in ramoops_init_przs()
690 parse_u32("record-size", pdata->record_size, 0); in ramoops_parse_dt()
702 * console_size and pmsg_size to the record size since that's in ramoops_parse_dt()
760 pr_err("The memory size and the record/console size must be " in ramoops_probe()
837 * must match the size of the dprz record (after PRZ header in ramoops_probe()