[Skiboot] [PATCH 1/2] core/trace: Move trace buffer exports to a subnode

Oliver O'Halloran oohall at gmail.com
Fri Nov 1 17:54:09 AEDT 2019


The top level exports node is getting a bit crowded. Move the trace
entries into their own directory since there's a lot of them and there
(currently) isn't any hard dependencies on them being in the top level
node so we can move them into a sub-node.

Cc: Jordan Niethe <jniethe5 at gmail.com>
Signed-off-by: Oliver O'Halloran <oohall at gmail.com>
---
 core/trace.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/core/trace.c b/core/trace.c
index 614be08d7de1..a3739eba5a17 100644
--- a/core/trace.c
+++ b/core/trace.c
@@ -157,14 +157,21 @@ void trace_add(union trace *trace, u8 type, u16 len)
 
 static void trace_add_dt_props(void)
 {
+	struct dt_node *exports, *traces;
 	unsigned int i;
 	u64 *prop, tmask;
-	struct dt_node *exports;
 	char tname[256];
 
+	exports = dt_find_by_path(opal_node, "firmware/exports");
+	if (!exports)
+		return;
+
+	traces = dt_new(exports, "traces");
+	if (!exports)
+		return;
+
 	prop = malloc(sizeof(u64) * 2 * debug_descriptor.num_traces);
 
-	exports = dt_find_by_path(opal_node, "firmware/exports");
 	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]);
@@ -172,7 +179,7 @@ static void trace_add_dt_props(void)
 		snprintf(tname, sizeof(tname), "trace-%x-%"PRIx64,
 			 debug_descriptor.trace_pir[i],
 			 debug_descriptor.trace_phys[i]);
-		dt_add_property_u64s(exports, tname, debug_descriptor.trace_phys[i],
+		dt_add_property_u64s(traces, tname, debug_descriptor.trace_phys[i],
 				     debug_descriptor.trace_size[i]);
 	}
 
-- 
2.21.0



More information about the Skiboot mailing list