* [PATCH] Perfquery can be too noisy.
@ 2010-03-04 21:01 Mike Heinz
[not found] ` <4C2744E8AD2982428C5BFE523DF8CDCB477C97283B-amwN6d8PyQWXx9kJd3VG2h2eb7JE58TQ@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Mike Heinz @ 2010-03-04 21:01 UTC (permalink / raw)
To: sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
When perfquery is run against fabrics that do not support PortXmitWait, it emits this warning for every port:
ibwarn: [23225] dump_perfcounters: PortXmitWait not indicated so ignore this counter
When running ibcheckerrors on a large fabric, this leads to a flood of warnings.
The proposed patch reduces the warning to a verbose message and, on fabrics that do not support PortXmitWait, it suppresses the output of the XmitWait attribute.
Signed-off-by: Michael Heinz <michaelheinz-h88ZbnxC6KDQT0dZR+AlfA@public.gmane.org>
diff --git a/infiniband-diags/src/perfquery.c b/infiniband-diags/src/perfquery.c
index 3ae692c..812b4c2 100644
--- a/infiniband-diags/src/perfquery.c
+++ b/infiniband-diags/src/perfquery.c
@@ -282,6 +282,25 @@ static void output_aggregate_perfcounters_ext(ib_portid_t * portid)
ALL_PORTS, buf);
}
+static int dump_fields(char *buf, int bufsz, void *data, int start, int end)
+{
+ char val[64];
+ char *s = buf;
+ int n, field;
+ for (field = start; field <= end && bufsz > 0; field++) {
+ mad_decode_field(data, field, val);
+ if (!mad_dump_field(field, s, bufsz, val))
+ return -1;
+ n = strlen(s);
+ s += n;
+ *s++ = '\n';
+ *s = 0;
+ n++;
+ bufsz -= n;
+ }
+ return (int)(s - buf);
+}
+
static void dump_perfcounters(int extended, int timeout, uint16_t cap_mask,
ib_portid_t * portid, int port, int aggregate)
{
@@ -293,8 +312,7 @@ static void dump_perfcounters(int extended, int timeout, uint16_t cap_mask,
IBERROR("perfquery");
if (!(cap_mask & 0x1000)) {
/* if PortCounters:PortXmitWait not supported clear this counter */
- IBWARN
- ("PortXmitWait not indicated so ignore this counter");
+ VERBOSE("PortXmitWait not indicated so ignore this counter");
perf_count.xmtwait = 0;
mad_encode_field(pc, IB_PC_XMT_WAIT_F,
&perf_count.xmtwait);
@@ -302,7 +320,8 @@ static void dump_perfcounters(int extended, int timeout, uint16_t cap_mask,
if (aggregate)
aggregate_perfcounters();
else
- mad_dump_perfcounters(buf, sizeof buf, pc, sizeof pc);
+ dump_fields(buf, sizeof buf, pc, IB_PC_FIRST_F,
+ (cap_mask & 0x1000)?IB_PC_LAST_F:IB_PC_RCV_PKTS_F);
} else {
if (!(cap_mask & 0x200)) /* 1.2 errata: bit 9 is extended counter support */
IBWARN
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Perfquery can be too noisy.
[not found] ` <4C2744E8AD2982428C5BFE523DF8CDCB477C97283B-amwN6d8PyQWXx9kJd3VG2h2eb7JE58TQ@public.gmane.org>
@ 2010-03-23 11:10 ` Sasha Khapyorsky
0 siblings, 0 replies; 2+ messages in thread
From: Sasha Khapyorsky @ 2010-03-23 11:10 UTC (permalink / raw)
To: Mike Heinz; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Hi Mike,
On 15:01 Thu 04 Mar , Mike Heinz wrote:
> When perfquery is run against fabrics that do not support PortXmitWait, it emits this warning for every port:
>
> ibwarn: [23225] dump_perfcounters: PortXmitWait not indicated so ignore this counter
Tee patch is malformed (white space mangled).
>
> When running ibcheckerrors on a large fabric, this leads to a flood of warnings.
>
> The proposed patch reduces the warning to a verbose message
So I'm applying this verbosity reducing part by hands.
> and, on fabrics that do not support PortXmitWait, it suppresses the output of the XmitWait attribute.
This could be done, but see the comment below.
>
> Signed-off-by: Michael Heinz <michaelheinz-h88ZbnxC6KDQT0dZR+AlfA@public.gmane.org>
>
> diff --git a/infiniband-diags/src/perfquery.c b/infiniband-diags/src/perfquery.c
> index 3ae692c..812b4c2 100644
> --- a/infiniband-diags/src/perfquery.c
> +++ b/infiniband-diags/src/perfquery.c
> @@ -282,6 +282,25 @@ static void output_aggregate_perfcounters_ext(ib_portid_t * portid)
> ALL_PORTS, buf);
> }
>
> +static int dump_fields(char *buf, int bufsz, void *data, int start, int end)
> +{
> + char val[64];
> + char *s = buf;
> + int n, field;
> + for (field = start; field <= end && bufsz > 0; field++) {
> + mad_decode_field(data, field, val);
> + if (!mad_dump_field(field, s, bufsz, val))
> + return -1;
> + n = strlen(s);
> + s += n;
> + *s++ = '\n';
> + *s = 0;
> + n++;
> + bufsz -= n;
> + }
> + return (int)(s - buf);
> +}
Seems that this low level stuf is copied from libibmad. Wouldn't it be
better just to add appropriate function there (if needed).
Sasha
> +
> static void dump_perfcounters(int extended, int timeout, uint16_t cap_mask,
> ib_portid_t * portid, int port, int aggregate)
> {
> @@ -293,8 +312,7 @@ static void dump_perfcounters(int extended, int timeout, uint16_t cap_mask,
> IBERROR("perfquery");
> if (!(cap_mask & 0x1000)) {
> /* if PortCounters:PortXmitWait not supported clear this counter */
> - IBWARN
> - ("PortXmitWait not indicated so ignore this counter");
> + VERBOSE("PortXmitWait not indicated so ignore this counter");
> perf_count.xmtwait = 0;
> mad_encode_field(pc, IB_PC_XMT_WAIT_F,
> &perf_count.xmtwait);
> @@ -302,7 +320,8 @@ static void dump_perfcounters(int extended, int timeout, uint16_t cap_mask,
> if (aggregate)
> aggregate_perfcounters();
> else
> - mad_dump_perfcounters(buf, sizeof buf, pc, sizeof pc);
> + dump_fields(buf, sizeof buf, pc, IB_PC_FIRST_F,
> + (cap_mask & 0x1000)?IB_PC_LAST_F:IB_PC_RCV_PKTS_F);
> } else {
> if (!(cap_mask & 0x200)) /* 1.2 errata: bit 9 is extended counter support */
> IBWARN
>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-03-23 11:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-04 21:01 [PATCH] Perfquery can be too noisy Mike Heinz
[not found] ` <4C2744E8AD2982428C5BFE523DF8CDCB477C97283B-amwN6d8PyQWXx9kJd3VG2h2eb7JE58TQ@public.gmane.org>
2010-03-23 11:10 ` Sasha Khapyorsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox