[ewg] [PATCH] management: adding mad_dump_fields to libibmad
Mike Heinz
michael.heinz at qlogic.com
Thu May 6 11:27:13 PDT 2010
Sasha asked that I re-submit the patches for perfquery in a slightly different format. This is the first of 3 patches.
This patch adds a function to libibmad that allows the caller to dump a configurable range of MAD attributes. Basically, this provides an external interface to the internal function _dump_fields.
Signed Off: Michael Heinz
---------------- snip --------------
diff --git a/libibmad/include/infiniband/mad.h b/libibmad/include/infiniband/mad.h
index 02ef551..0478c2b 100644
--- a/libibmad/include/infiniband/mad.h
+++ b/libibmad/include/infiniband/mad.h
@@ -1031,6 +1031,9 @@ MAD_EXPORT ib_mad_dump_fn
mad_dump_perfcounters_xmt_disc, mad_dump_perfcounters_rcv_err,
mad_dump_portsamples_control;
+MAD_EXPORT void mad_dump_fields(char *buf, int bufsz, void *val, int valsz,
+ int start, int end);
+
MAD_EXPORT int ibdebug;
#if __BYTE_ORDER == __LITTLE_ENDIAN
diff --git a/libibmad/src/dump.c b/libibmad/src/dump.c
index 335e190..cc9c10f 100644
--- a/libibmad/src/dump.c
+++ b/libibmad/src/dump.c
@@ -671,6 +671,11 @@ static int _dump_fields(char *buf, int bufsz, void *data, int start, int end)
return (int)(s - buf);
}
+void mad_dump_fields(char *buf, int bufsz, void *val, int valsz, int start, int end)
+{
+ return _dump_fields(buf, bufsz, val, start, end);
+}
+
void mad_dump_nodedesc(char *buf, int bufsz, void *val, int valsz)
{
strncpy(buf, val, bufsz);
diff --git a/libibmad/src/libibmad.map b/libibmad/src/libibmad.map
index e2d0b05..5778e3e 100644
--- a/libibmad/src/libibmad.map
+++ b/libibmad/src/libibmad.map
@@ -20,6 +20,7 @@ IBMAD_1.3 {
mad_dump_nodedesc;
mad_dump_nodeinfo;
mad_dump_opervls;
+ mad_dump_fields;
mad_dump_perfcounters;
mad_dump_perfcounters_ext;
mad_dump_perfcounters_xmt_sl;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dump_fields.patch
Type: application/octet-stream
Size: 1395 bytes
Desc: dump_fields.patch
URL: <http://lists.openfabrics.org/pipermail/ewg/attachments/20100506/39e5a121/attachment.obj>
More information about the ewg
mailing list