Lines Matching full:record
118 struct pstore_record *record) in ramoops_get_next_prz() argument
137 record->type = prz->type; in ramoops_get_next_prz()
138 record->id = id; in ramoops_get_next_prz()
176 static ssize_t ramoops_pstore_read(struct pstore_record *record) in ramoops_pstore_read() argument
179 struct ramoops_context *cxt = record->psi->data; in ramoops_pstore_read()
189 record->time.tv_sec = 0; in ramoops_pstore_read()
190 record->time.tv_nsec = 0; in ramoops_pstore_read()
191 record->compressed = false; in ramoops_pstore_read()
196 record); in ramoops_pstore_read()
200 &record->time, in ramoops_pstore_read()
201 &record->compressed); in ramoops_pstore_read()
202 /* Clear and skip this DMESG record if it has no valid header */ in ramoops_pstore_read()
211 prz = ramoops_get_next_prz(&cxt->cprz, 0 /* single */, record); in ramoops_pstore_read()
214 prz = ramoops_get_next_prz(&cxt->mprz, 0 /* single */, record); in ramoops_pstore_read()
221 record); in ramoops_pstore_read()
224 * Build a new dummy record which combines all the in ramoops_pstore_read()
238 cxt->ftrace_read_cnt++, record); in ramoops_pstore_read()
256 record->id = 0; in ramoops_pstore_read()
268 record->ecc_notice_size = persistent_ram_ecc_string(prz, NULL, 0); in ramoops_pstore_read()
270 record->buf = kmalloc(size + record->ecc_notice_size + 1, GFP_KERNEL); in ramoops_pstore_read()
271 if (record->buf == NULL) { in ramoops_pstore_read()
276 memcpy(record->buf, (char *)persistent_ram_old(prz) + header_length, in ramoops_pstore_read()
279 persistent_ram_ecc_string(prz, record->buf + size, in ramoops_pstore_read()
280 record->ecc_notice_size + 1); in ramoops_pstore_read()
292 struct pstore_record *record) in ramoops_write_kmsg_hdr() argument
299 (time64_t)record->time.tv_sec, in ramoops_write_kmsg_hdr()
300 record->time.tv_nsec / 1000, in ramoops_write_kmsg_hdr()
301 record->compressed ? 'C' : 'D'); in ramoops_write_kmsg_hdr()
307 static int notrace ramoops_pstore_write(struct pstore_record *record) in ramoops_pstore_write() argument
309 struct ramoops_context *cxt = record->psi->data; in ramoops_pstore_write()
313 if (record->type == PSTORE_TYPE_CONSOLE) { in ramoops_pstore_write()
316 persistent_ram_write(cxt->cprz, record->buf, record->size); in ramoops_pstore_write()
318 } else if (record->type == PSTORE_TYPE_FTRACE) { in ramoops_pstore_write()
331 persistent_ram_write(cxt->fprzs[zonenum], record->buf, in ramoops_pstore_write()
332 record->size); in ramoops_pstore_write()
334 } else if (record->type == PSTORE_TYPE_PMSG) { in ramoops_pstore_write()
339 if (record->type != PSTORE_TYPE_DMESG) in ramoops_pstore_write()
343 * We could filter on record->reason here if we wanted to (which in ramoops_pstore_write()
358 if (record->part != 1) in ramoops_pstore_write()
377 /* Build header and append record contents. */ in ramoops_pstore_write()
378 hlen = ramoops_write_kmsg_hdr(prz, record); in ramoops_pstore_write()
382 size = record->size; in ramoops_pstore_write()
385 persistent_ram_write(prz, record->buf, size); in ramoops_pstore_write()
392 static int notrace ramoops_pstore_write_user(struct pstore_record *record, in ramoops_pstore_write_user() argument
395 if (record->type == PSTORE_TYPE_PMSG) { in ramoops_pstore_write_user()
396 struct ramoops_context *cxt = record->psi->data; in ramoops_pstore_write_user()
400 return persistent_ram_write_user(cxt->mprz, buf, record->size); in ramoops_pstore_write_user()
406 static int ramoops_pstore_erase(struct pstore_record *record) in ramoops_pstore_erase() argument
408 struct ramoops_context *cxt = record->psi->data; in ramoops_pstore_erase()
411 switch (record->type) { in ramoops_pstore_erase()
413 if (record->id >= cxt->max_dump_cnt) in ramoops_pstore_erase()
415 prz = cxt->dprzs[record->id]; in ramoops_pstore_erase()
421 if (record->id >= cxt->max_ftrace_cnt) in ramoops_pstore_erase()
423 prz = cxt->fprzs[record->id]; in ramoops_pstore_erase()
491 * If we have a negative record size, calculate it based on in ramoops_init_przs()
492 * mem_sz / *cnt. If we have a positive record size, calculate in ramoops_init_przs()
500 dev_err(dev, "%s record size == 0 (%zu / %u)\n", in ramoops_init_przs()
507 dev_err(dev, "%s record count == 0 (%zu / %zu)\n", in ramoops_init_przs()
674 parse_u32("record-size", pdata->record_size, 0); in ramoops_parse_dt()
686 * console_size and pmsg_size to the record size since that's in ramoops_parse_dt()
743 pr_err("The memory size and the record/console size must be " in ramoops_probe()
819 * must match the size of the dprz record (after PRZ header in ramoops_probe()