[PATCHv2 infiniband-diags] smpdump.c: Print number of bytes returned by umad_recv

Hal Rosenstock
2018-02-07T17:05:40Z

when debug is set

Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
Change from v1:
Only print when debug is set

src/smpdump.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/src/smpdump.c b/src/smpdump.c
index bc8559a..efc522f 100644
--- a/src/smpdump.c
+++ b/src/smpdump.c
@@ -281,6 +281,9 @@ int main(int argc, char *argv[])
if (umad_recv(portid, umad, &length, -1) != mad_agent)
IBPANIC("recv error: %s", strerror(errno));

+ if (ibdebug)
+ fprintf(stdout, "%d bytes received\n", length);
+
if (!dump_char) {
xdump(stdout, 0, smp->data, 64);
if (smp->status)
--
2.8.4