diff mbox series

[2/2] core/trace: Rename boot trace buffer

Message ID 20191101065410.4804-2-oohall@gmail.com
State Accepted
Headers show
Series [1/2] core/trace: Move trace buffer exports to a subnode | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (d75e82dbfbb9443efeb3f9a5921ac23605aab469)
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot fail Test snowpatch/job/snowpatch-skiboot on branch master
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot-dco success Signed-off-by present

Commit Message

Oliver O'Halloran Nov. 1, 2019, 6:54 a.m. UTC
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>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
 core/trace.c | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/core/trace.c b/core/trace.c
index a3739eba5a17..5388972f30c6 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",