Commit 8f2133cc authored by Michael Ellerman's avatar Michael Ellerman

powerpc/pseries: hcall_exit tracepoint retval should be signed

The hcall_exit() tracepoint has retval defined as unsigned long. That
leads to humours results like:

  bash-3686  [009] d..2   854.134094: hcall_entry: opcode=24
  bash-3686  [009] d..2   854.134095: hcall_exit: opcode=24 retval=18446744073709551609

It's normal for some hcalls to return negative values, displaying them
as unsigned isn't very helpful. So change it to signed.

  bash-3711  [001] d..2   471.691008: hcall_entry: opcode=24
  bash-3711  [001] d..2   471.691008: hcall_exit: opcode=24 retval=-7

Which can be more easily compared to H_NOT_FOUND in hvcall.h
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Acked-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Tested-by: default avatarRavi Bangoria <ravi.bangoria@linux.ibm.com>
parent 7acf50e4
...@@ -36,8 +36,7 @@ void kexec_copy_flush(struct kimage *image); ...@@ -36,8 +36,7 @@ void kexec_copy_flush(struct kimage *image);
/* pseries hcall tracing */ /* pseries hcall tracing */
extern struct static_key hcall_tracepoint_key; extern struct static_key hcall_tracepoint_key;
void __trace_hcall_entry(unsigned long opcode, unsigned long *args); void __trace_hcall_entry(unsigned long opcode, unsigned long *args);
void __trace_hcall_exit(long opcode, unsigned long retval, void __trace_hcall_exit(long opcode, long retval, unsigned long *retbuf);
unsigned long *retbuf);
/* OPAL tracing */ /* OPAL tracing */
#ifdef HAVE_JUMP_LABEL #ifdef HAVE_JUMP_LABEL
extern struct static_key opal_tracepoint_key; extern struct static_key opal_tracepoint_key;
......
...@@ -81,8 +81,7 @@ TRACE_EVENT_FN_COND(hcall_entry, ...@@ -81,8 +81,7 @@ TRACE_EVENT_FN_COND(hcall_entry,
TRACE_EVENT_FN_COND(hcall_exit, TRACE_EVENT_FN_COND(hcall_exit,
TP_PROTO(unsigned long opcode, unsigned long retval, TP_PROTO(unsigned long opcode, long retval, unsigned long *retbuf),
unsigned long *retbuf),
TP_ARGS(opcode, retval, retbuf), TP_ARGS(opcode, retval, retbuf),
...@@ -90,7 +89,7 @@ TRACE_EVENT_FN_COND(hcall_exit, ...@@ -90,7 +89,7 @@ TRACE_EVENT_FN_COND(hcall_exit,
TP_STRUCT__entry( TP_STRUCT__entry(
__field(unsigned long, opcode) __field(unsigned long, opcode)
__field(unsigned long, retval) __field(long, retval)
), ),
TP_fast_assign( TP_fast_assign(
...@@ -98,7 +97,7 @@ TRACE_EVENT_FN_COND(hcall_exit, ...@@ -98,7 +97,7 @@ TRACE_EVENT_FN_COND(hcall_exit,
__entry->retval = retval; __entry->retval = retval;
), ),
TP_printk("opcode=%lu retval=%lu", __entry->opcode, __entry->retval), TP_printk("opcode=%lu retval=%ld", __entry->opcode, __entry->retval),
hcall_tracepoint_regfunc, hcall_tracepoint_unregfunc hcall_tracepoint_regfunc, hcall_tracepoint_unregfunc
); );
......
...@@ -125,7 +125,7 @@ static void probe_hcall_entry(void *ignored, unsigned long opcode, unsigned long ...@@ -125,7 +125,7 @@ static void probe_hcall_entry(void *ignored, unsigned long opcode, unsigned long
h->purr_start = mfspr(SPRN_PURR); h->purr_start = mfspr(SPRN_PURR);
} }
static void probe_hcall_exit(void *ignored, unsigned long opcode, unsigned long retval, static void probe_hcall_exit(void *ignored, unsigned long opcode, long retval,
unsigned long *retbuf) unsigned long *retbuf)
{ {
struct hcall_stats *h; struct hcall_stats *h;
......
...@@ -902,8 +902,7 @@ void __trace_hcall_entry(unsigned long opcode, unsigned long *args) ...@@ -902,8 +902,7 @@ void __trace_hcall_entry(unsigned long opcode, unsigned long *args)
local_irq_restore(flags); local_irq_restore(flags);
} }
void __trace_hcall_exit(long opcode, unsigned long retval, void __trace_hcall_exit(long opcode, long retval, unsigned long *retbuf)
unsigned long *retbuf)
{ {
unsigned long flags; unsigned long flags;
unsigned int *depth; unsigned int *depth;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment