diff options
author | Oliver O'Halloran <oohall@gmail.com> | 2019-11-01 17:54:10 +1100 |
---|---|---|
committer | Oliver O'Halloran <oohall@gmail.com> | 2019-11-14 16:09:41 +1100 |
commit | 628158b2d79481ab4dfdcf6ff4f535b356148060 (patch) | |
tree | 30b561c92938c7889919f7776dc847866f0bc3ab /core/trace.c | |
parent | 24813aa20ce9f6189faf319fe35b4b8719c0b599 (diff) | |
download | skiboot-628158b2d79481ab4dfdcf6ff4f535b356148060.zip skiboot-628158b2d79481ab4dfdcf6ff4f535b356148060.tar.gz skiboot-628158b2d79481ab4dfdcf6ff4f535b356148060.tar.bz2 |
core/trace: Rename boot trace buffer
Right now we name the trace buffers:
trace-<pir>-<phys addr of buffer>
The physical address is only really required to differentiate the
boot-time trace buffer from the runtime trace buffer associated with the
same PIR. Rename the boot trace buffer to boot-<pir> to better
differentiate it.
Cc: Jordan Niethe <jniethe5@gmail.com>
[oliver: fixed trace test]
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Diffstat (limited to 'core/trace.c')
-rw-r--r-- | core/trace.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/core/trace.c b/core/trace.c index a3739eb..5388972 100644 --- a/core/trace.c +++ b/core/trace.c @@ -157,6 +157,7 @@ void trace_add(union trace *trace, u8 type, u16 len) static void trace_add_dt_props(void) { + uint64_t boot_buf_phys = (uint64_t) &boot_tracebuf.trace_info; struct dt_node *exports, *traces; unsigned int i; u64 *prop, tmask; @@ -173,14 +174,19 @@ static void trace_add_dt_props(void) prop = malloc(sizeof(u64) * 2 * debug_descriptor.num_traces); for (i = 0; i < debug_descriptor.num_traces; i++) { - prop[i * 2] = cpu_to_fdt64(debug_descriptor.trace_phys[i]); - prop[i * 2 + 1] = cpu_to_fdt64(debug_descriptor.trace_size[i]); - - snprintf(tname, sizeof(tname), "trace-%x-%"PRIx64, - debug_descriptor.trace_pir[i], - debug_descriptor.trace_phys[i]); - dt_add_property_u64s(traces, tname, debug_descriptor.trace_phys[i], - debug_descriptor.trace_size[i]); + uint64_t addr = debug_descriptor.trace_phys[i]; + uint64_t size = debug_descriptor.trace_size[i]; + uint32_t pir = debug_descriptor.trace_pir[i]; + + prop[i * 2] = cpu_to_fdt64(addr); + prop[i * 2 + 1] = cpu_to_fdt64(size); + + if (addr == boot_buf_phys) + snprintf(tname, sizeof(tname), "boot-%x", pir); + else + snprintf(tname, sizeof(tname), "trace-%x", pir); + + dt_add_property_u64s(traces, tname, addr, size); } dt_add_property(opal_node, "ibm,opal-traces", |