Commit 2863ad4b authored by Joachim Fenkes's avatar Joachim Fenkes Committed by Roland Dreier

IB/ehca: Refactor hvcall tracing

Change hvcall trace output towards better readability: reg numbers
instead of argument numbers, return code as signed decimal instead of
unsigned hex.
Signed-off-by: default avatarJoachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent e390d3b5
...@@ -84,6 +84,10 @@ ...@@ -84,6 +84,10 @@
#define H_MP_SHUTDOWN EHCA_BMASK_IBM(48, 48) #define H_MP_SHUTDOWN EHCA_BMASK_IBM(48, 48)
#define H_MP_RESET_QKEY_CTR EHCA_BMASK_IBM(49, 49) #define H_MP_RESET_QKEY_CTR EHCA_BMASK_IBM(49, 49)
#define HCALL4_REGS_FORMAT "r4=%lx r5=%lx r6=%lx r7=%lx"
#define HCALL7_REGS_FORMAT HCALL4_REGS_FORMAT " r8=%lx r9=%lx r10=%lx"
#define HCALL9_REGS_FORMAT HCALL7_REGS_FORMAT " r11=%lx r12=%lx"
static DEFINE_SPINLOCK(hcall_lock); static DEFINE_SPINLOCK(hcall_lock);
static u32 get_longbusy_msecs(int longbusy_rc) static u32 get_longbusy_msecs(int longbusy_rc)
...@@ -118,8 +122,7 @@ static long ehca_plpar_hcall_norets(unsigned long opcode, ...@@ -118,8 +122,7 @@ static long ehca_plpar_hcall_norets(unsigned long opcode,
long ret; long ret;
int i, sleep_msecs; int i, sleep_msecs;
ehca_gen_dbg("opcode=%lx arg1=%lx arg2=%lx arg3=%lx arg4=%lx " ehca_gen_dbg("opcode=%lx " HCALL7_REGS_FORMAT,
"arg5=%lx arg6=%lx arg7=%lx",
opcode, arg1, arg2, arg3, arg4, arg5, arg6, arg7); opcode, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
...@@ -133,16 +136,13 @@ static long ehca_plpar_hcall_norets(unsigned long opcode, ...@@ -133,16 +136,13 @@ static long ehca_plpar_hcall_norets(unsigned long opcode,
} }
if (ret < H_SUCCESS) if (ret < H_SUCCESS)
ehca_gen_err("opcode=%lx ret=%lx" ehca_gen_err("opcode=%lx ret=%li " HCALL7_REGS_FORMAT,
" arg1=%lx arg2=%lx arg3=%lx arg4=%lx" opcode, ret, arg1, arg2, arg3,
" arg5=%lx arg6=%lx arg7=%lx ", arg4, arg5, arg6, arg7);
opcode, ret, else
arg1, arg2, arg3, arg4, arg5, ehca_gen_dbg("opcode=%lx ret=%li", opcode, ret);
arg6, arg7);
ehca_gen_dbg("opcode=%lx ret=%lx", opcode, ret);
return ret; return ret;
} }
return H_BUSY; return H_BUSY;
...@@ -164,10 +164,8 @@ static long ehca_plpar_hcall9(unsigned long opcode, ...@@ -164,10 +164,8 @@ static long ehca_plpar_hcall9(unsigned long opcode,
int i, sleep_msecs, lock_is_set = 0; int i, sleep_msecs, lock_is_set = 0;
unsigned long flags = 0; unsigned long flags = 0;
ehca_gen_dbg("opcode=%lx arg1=%lx arg2=%lx arg3=%lx arg4=%lx " ehca_gen_dbg("INPUT -- opcode=%lx " HCALL9_REGS_FORMAT, opcode,
"arg5=%lx arg6=%lx arg7=%lx arg8=%lx arg9=%lx", arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
opcode, arg1, arg2, arg3, arg4, arg5, arg6, arg7,
arg8, arg9);
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
if ((opcode == H_ALLOC_RESOURCE) && (arg2 == 5)) { if ((opcode == H_ALLOC_RESOURCE) && (arg2 == 5)) {
...@@ -188,26 +186,19 @@ static long ehca_plpar_hcall9(unsigned long opcode, ...@@ -188,26 +186,19 @@ static long ehca_plpar_hcall9(unsigned long opcode,
continue; continue;
} }
if (ret < H_SUCCESS) if (ret < H_SUCCESS) {
ehca_gen_err("opcode=%lx ret=%lx" ehca_gen_err("INPUT -- opcode=%lx " HCALL9_REGS_FORMAT,
" arg1=%lx arg2=%lx arg3=%lx arg4=%lx" opcode, arg1, arg2, arg3, arg4, arg5,
" arg5=%lx arg6=%lx arg7=%lx arg8=%lx" arg6, arg7, arg8, arg9);
" arg9=%lx" ehca_gen_err("OUTPUT -- ret=%li " HCALL9_REGS_FORMAT,
" out1=%lx out2=%lx out3=%lx out4=%lx" ret, outs[0], outs[1], outs[2], outs[3],
" out5=%lx out6=%lx out7=%lx out8=%lx" outs[4], outs[5], outs[6], outs[7],
" out9=%lx", outs[8]);
opcode, ret, } else
arg1, arg2, arg3, arg4, arg5, ehca_gen_dbg("OUTPUT -- ret=%li " HCALL9_REGS_FORMAT,
arg6, arg7, arg8, arg9, ret, outs[0], outs[1], outs[2], outs[3],
outs[0], outs[1], outs[2], outs[3],
outs[4], outs[5], outs[6], outs[7], outs[4], outs[5], outs[6], outs[7],
outs[8]); outs[8]);
ehca_gen_dbg("opcode=%lx ret=%lx out1=%lx out2=%lx out3=%lx "
"out4=%lx out5=%lx out6=%lx out7=%lx out8=%lx "
"out9=%lx",
opcode, ret, outs[0], outs[1], outs[2], outs[3],
outs[4], outs[5], outs[6], outs[7], outs[8]);
return ret; return ret;
} }
......
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