diff options
author | Oliver O'Halloran <oohall@gmail.com> | 2019-11-01 17:54:09 +1100 |
---|---|---|
committer | Oliver O'Halloran <oohall@gmail.com> | 2019-11-14 16:09:37 +1100 |
commit | 24813aa20ce9f6189faf319fe35b4b8719c0b599 (patch) | |
tree | 18dc523d3ec9c745fffb261a214dbcfe8b54e1af /core/trace.c | |
parent | ca11072ab8a7786ba7476d4a5f8512928a622d97 (diff) | |
download | skiboot-24813aa20ce9f6189faf319fe35b4b8719c0b599.zip skiboot-24813aa20ce9f6189faf319fe35b4b8719c0b599.tar.gz skiboot-24813aa20ce9f6189faf319fe35b4b8719c0b599.tar.bz2 |
core/trace: Move trace buffer exports to a subnode
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@gmail.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Diffstat (limited to 'core/trace.c')
-rw-r--r-- | core/trace.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/core/trace.c b/core/trace.c index 614be08..a3739eb 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]); } |