diff mbox series

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

Message ID 20190325001425.29483-2-jniethe5@gmail.com
State Superseded
Headers show
Series Improve usability of skiboot traces | expand

Checks

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

Commit Message

Jordan Niethe March 25, 2019, 12:14 a.m. UTC
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(-)

Comments

Oliver O'Halloran March 25, 2019, 12:36 a.m. UTC | #1
On Mon, Mar 25, 2019 at 11:16 AM Jordan Niethe <jniethe5@gmail.com> wrote:
>
> 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.

It would help if you described what's incorrect about the current
behaviour. Is the reader assuming there is always 9 arguments?

> ---
>  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));
>  }
>  #endif
>
> --
> 2.20.1

Reviewed-by: Oliver O'Halloran <oohall@gmail.com>

>
> _______________________________________________
> Skiboot mailing list
> Skiboot@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/skiboot
diff mbox series

Patch

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));
 }
 #endif