aboutsummaryrefslogtreecommitdiff
path: root/core/trace.c
diff options
context:
space:
mode:
authorJordan Niethe <jniethe5@gmail.com>2019-04-02 10:43:21 +1100
committerStewart Smith <stewart@linux.ibm.com>2019-05-20 14:21:50 +1000
commit8c4763094cb87d34c595b2b911a5b26fc32360e7 (patch)
treecfd7cb5415b634f108857da56966c15192720209 /core/trace.c
parent8a566ff62037b574beb529e3b801916062e9234d (diff)
downloadskiboot-8c4763094cb87d34c595b2b911a5b26fc32360e7.zip
skiboot-8c4763094cb87d34c595b2b911a5b26fc32360e7.tar.gz
skiboot-8c4763094cb87d34c595b2b911a5b26fc32360e7.tar.bz2
core/trace: Export trace buffers to sysfs
Every property in the device-tree under /ibm,opal/firmware/exports has a sysfs node created in /firmware/opal/exports. Add properties with the physical address and size for each trace buffer so they are exported. Signed-off-by: Jordan Niethe <jniethe5@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'core/trace.c')
-rw-r--r--core/trace.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/trace.c b/core/trace.c
index 169282e..de6b661 100644
--- a/core/trace.c
+++ b/core/trace.c
@@ -19,6 +19,7 @@
#include <lock.h>
#include <string.h>
#include <stdlib.h>
+#include <inttypes.h>
#include <cpu.h>
#include <device.h>
#include <libfdt.h>
@@ -167,12 +168,21 @@ static void trace_add_dt_props(void)
{
unsigned int i;
u64 *prop, tmask;
+ struct dt_node *exports;
+ char tname[256];
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]);
+
+ 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],
+ debug_descriptor.trace_size[i]);
}
dt_add_property(opal_node, "ibm,opal-traces",