diff options
author | Joachim Fenkes <fenkes@de.ibm.com> | 2007-09-11 09:31:49 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2007-10-09 22:59:10 -0400 |
commit | 2863ad4bddf366790a733cfd71f2f480afdf36fc (patch) | |
tree | 48b0d1b705d43a22069554d1a520599c9db7a1fb /drivers/infiniband/hw/ehca/hcp_if.c | |
parent | e390d3b52f791fcea26312ba4982cda82052727b (diff) |
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: Joachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/ehca/hcp_if.c')
-rw-r--r-- | drivers/infiniband/hw/ehca/hcp_if.c | 57 |
1 files changed, 24 insertions, 33 deletions
diff --git a/drivers/infiniband/hw/ehca/hcp_if.c b/drivers/infiniband/hw/ehca/hcp_if.c index 24f454162f24..a762cc7e0165 100644 --- a/drivers/infiniband/hw/ehca/hcp_if.c +++ b/drivers/infiniband/hw/ehca/hcp_if.c | |||
@@ -84,6 +84,10 @@ | |||
84 | #define H_MP_SHUTDOWN EHCA_BMASK_IBM(48, 48) | 84 | #define H_MP_SHUTDOWN EHCA_BMASK_IBM(48, 48) |
85 | #define H_MP_RESET_QKEY_CTR EHCA_BMASK_IBM(49, 49) | 85 | #define H_MP_RESET_QKEY_CTR EHCA_BMASK_IBM(49, 49) |
86 | 86 | ||
87 | #define HCALL4_REGS_FORMAT "r4=%lx r5=%lx r6=%lx r7=%lx" | ||
88 | #define HCALL7_REGS_FORMAT HCALL4_REGS_FORMAT " r8=%lx r9=%lx r10=%lx" | ||
89 | #define HCALL9_REGS_FORMAT HCALL7_REGS_FORMAT " r11=%lx r12=%lx" | ||
90 | |||
87 | static DEFINE_SPINLOCK(hcall_lock); | 91 | static DEFINE_SPINLOCK(hcall_lock); |
88 | 92 | ||
89 | static u32 get_longbusy_msecs(int longbusy_rc) | 93 | static u32 get_longbusy_msecs(int longbusy_rc) |
@@ -118,8 +122,7 @@ static long ehca_plpar_hcall_norets(unsigned long opcode, | |||
118 | long ret; | 122 | long ret; |
119 | int i, sleep_msecs; | 123 | int i, sleep_msecs; |
120 | 124 | ||
121 | ehca_gen_dbg("opcode=%lx arg1=%lx arg2=%lx arg3=%lx arg4=%lx " | 125 | ehca_gen_dbg("opcode=%lx " HCALL7_REGS_FORMAT, |
122 | "arg5=%lx arg6=%lx arg7=%lx", | ||
123 | opcode, arg1, arg2, arg3, arg4, arg5, arg6, arg7); | 126 | opcode, arg1, arg2, arg3, arg4, arg5, arg6, arg7); |
124 | 127 | ||
125 | for (i = 0; i < 5; i++) { | 128 | for (i = 0; i < 5; i++) { |
@@ -133,16 +136,13 @@ static long ehca_plpar_hcall_norets(unsigned long opcode, | |||
133 | } | 136 | } |
134 | 137 | ||
135 | if (ret < H_SUCCESS) | 138 | if (ret < H_SUCCESS) |
136 | ehca_gen_err("opcode=%lx ret=%lx" | 139 | ehca_gen_err("opcode=%lx ret=%li " HCALL7_REGS_FORMAT, |
137 | " arg1=%lx arg2=%lx arg3=%lx arg4=%lx" | 140 | opcode, ret, arg1, arg2, arg3, |
138 | " arg5=%lx arg6=%lx arg7=%lx ", | 141 | arg4, arg5, arg6, arg7); |
139 | opcode, ret, | 142 | else |
140 | arg1, arg2, arg3, arg4, arg5, | 143 | ehca_gen_dbg("opcode=%lx ret=%li", opcode, ret); |
141 | arg6, arg7); | ||
142 | |||
143 | ehca_gen_dbg("opcode=%lx ret=%lx", opcode, ret); | ||
144 | return ret; | ||
145 | 144 | ||
145 | return ret; | ||
146 | } | 146 | } |
147 | 147 | ||
148 | return H_BUSY; | 148 | return H_BUSY; |
@@ -164,10 +164,8 @@ static long ehca_plpar_hcall9(unsigned long opcode, | |||
164 | int i, sleep_msecs, lock_is_set = 0; | 164 | int i, sleep_msecs, lock_is_set = 0; |
165 | unsigned long flags = 0; | 165 | unsigned long flags = 0; |
166 | 166 | ||
167 | ehca_gen_dbg("opcode=%lx arg1=%lx arg2=%lx arg3=%lx arg4=%lx " | 167 | ehca_gen_dbg("INPUT -- opcode=%lx " HCALL9_REGS_FORMAT, opcode, |
168 | "arg5=%lx arg6=%lx arg7=%lx arg8=%lx arg9=%lx", | 168 | arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); |
169 | opcode, arg1, arg2, arg3, arg4, arg5, arg6, arg7, | ||
170 | arg8, arg9); | ||
171 | 169 | ||
172 | for (i = 0; i < 5; i++) { | 170 | for (i = 0; i < 5; i++) { |
173 | if ((opcode == H_ALLOC_RESOURCE) && (arg2 == 5)) { | 171 | if ((opcode == H_ALLOC_RESOURCE) && (arg2 == 5)) { |
@@ -188,26 +186,19 @@ static long ehca_plpar_hcall9(unsigned long opcode, | |||
188 | continue; | 186 | continue; |
189 | } | 187 | } |
190 | 188 | ||
191 | if (ret < H_SUCCESS) | 189 | if (ret < H_SUCCESS) { |
192 | ehca_gen_err("opcode=%lx ret=%lx" | 190 | ehca_gen_err("INPUT -- opcode=%lx " HCALL9_REGS_FORMAT, |
193 | " arg1=%lx arg2=%lx arg3=%lx arg4=%lx" | 191 | opcode, arg1, arg2, arg3, arg4, arg5, |
194 | " arg5=%lx arg6=%lx arg7=%lx arg8=%lx" | 192 | arg6, arg7, arg8, arg9); |
195 | " arg9=%lx" | 193 | ehca_gen_err("OUTPUT -- ret=%li " HCALL9_REGS_FORMAT, |
196 | " out1=%lx out2=%lx out3=%lx out4=%lx" | 194 | ret, outs[0], outs[1], outs[2], outs[3], |
197 | " out5=%lx out6=%lx out7=%lx out8=%lx" | 195 | outs[4], outs[5], outs[6], outs[7], |
198 | " out9=%lx", | 196 | outs[8]); |
199 | opcode, ret, | 197 | } else |
200 | arg1, arg2, arg3, arg4, arg5, | 198 | ehca_gen_dbg("OUTPUT -- ret=%li " HCALL9_REGS_FORMAT, |
201 | arg6, arg7, arg8, arg9, | 199 | ret, outs[0], outs[1], outs[2], outs[3], |
202 | outs[0], outs[1], outs[2], outs[3], | ||
203 | outs[4], outs[5], outs[6], outs[7], | 200 | outs[4], outs[5], outs[6], outs[7], |
204 | outs[8]); | 201 | outs[8]); |
205 | |||
206 | ehca_gen_dbg("opcode=%lx ret=%lx out1=%lx out2=%lx out3=%lx " | ||
207 | "out4=%lx out5=%lx out6=%lx out7=%lx out8=%lx " | ||
208 | "out9=%lx", | ||
209 | opcode, ret, outs[0], outs[1], outs[2], outs[3], | ||
210 | outs[4], outs[5], outs[6], outs[7], outs[8]); | ||
211 | return ret; | 202 | return ret; |
212 | } | 203 | } |
213 | 204 | ||