[Skiboot] [PATCH 01/15] opal: Fix parameter for opal entry in skiboot trace

Jordan Niethe jniethe5 at gmail.com
Mon Mar 25 11:14:11 AEDT 2019

trace_add expects to be given the complete size of the trace entry it
will add to the trace buffer. Currently the size of the trace_opal trace
type is not calculated correctly which leads to it being added
incorrectly to the trace buffer. Calculate using the sizeof operator.
This is consistent with how it is done for the uart entry.
 core/opal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/opal.c b/core/opal.c
index 624e2a255f4d..f42fd8d258fb 100644
--- a/core/opal.c
+++ b/core/opal.c
@@ -110,7 +110,7 @@ static void opal_trace_entry(struct stack_frame *eframe __unused)
 	for(i=0; i<nargs; i++)
 		t.opal.r3_to_11[i] = cpu_to_be64(eframe->gpr[3+i]);
-	trace_add(&t, TRACE_OPAL, offsetof(struct trace_opal, r3_to_11[nargs]));
+	trace_add(&t, TRACE_OPAL, sizeof(struct trace_opal));

More information about the Skiboot mailing list