From patchwork Thu Mar 4 21:01:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Heinz X-Patchwork-Id: 83675 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o24L1pow009826 for ; Thu, 4 Mar 2010 21:01:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932323Ab0CDVBu (ORCPT ); Thu, 4 Mar 2010 16:01:50 -0500 Received: from avexch1.qlogic.com ([198.70.193.115]:52910 "EHLO avexch1.qlogic.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932113Ab0CDVBu convert rfc822-to-8bit (ORCPT ); Thu, 4 Mar 2010 16:01:50 -0500 Received: from avexcashub1.qlogic.org ([10.1.4.112]) by avexch1.qlogic.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 4 Mar 2010 13:01:50 -0800 Received: from avexcashub2.qlogic.org (10.1.4.116) by avexcashub1.qlogic.org (10.1.4.161) with Microsoft SMTP Server (TLS) id 8.1.375.2; Thu, 4 Mar 2010 13:01:49 -0800 Received: from MNEXCASHUB2.qlogic.org (10.33.2.104) by avexcashub2.qlogic.org (10.1.4.162) with Microsoft SMTP Server (TLS) id 8.1.375.2; Thu, 4 Mar 2010 13:01:49 -0800 Received: from MNEXMB1.qlogic.org ([fe80::8516:7839:9549:6996]) by MNEXCASHUB2.qlogic.org ([::1]) with mapi; Thu, 4 Mar 2010 15:01:46 -0600 From: Mike Heinz To: "sashak@voltaire.com" CC: "linux-rdma@vger.kernel.org" Date: Thu, 4 Mar 2010 15:01:44 -0600 Subject: [PATCH] Perfquery can be too noisy. Thread-Topic: [PATCH] Perfquery can be too noisy. Thread-Index: Acq73eVNy1c17+ZXTKiiCIMkqtHXxQ== Message-ID: <4C2744E8AD2982428C5BFE523DF8CDCB477C97283B@MNEXMB1.qlogic.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 X-OriginalArrivalTime: 04 Mar 2010 21:01:50.0090 (UTC) FILETIME=[E8C56EA0:01CABBDD] Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 04 Mar 2010 21:01:51 +0000 (UTC) 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