Hello community, here is the log from the commit of package collectl for openSUSE:Factory checked in at 2016-10-20 23:09:34 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/collectl (Old) and /work/SRC/openSUSE:Factory/.collectl.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "collectl" Changes: -------- --- /work/SRC/openSUSE:Factory/collectl/collectl.changes 2016-07-18 21:24:35.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.collectl.new/collectl.changes 2016-10-20 23:10:03.000000000 +0200 @@ -1,0 +2,10 @@ +Tue Oct 11 22:30:47 UTC 2016 - tabra...@suse.com + +- Update to 4.1.0 + + allow lexpr to pass formatting information for strings and numbers + [thanks Guy] + + modify the way misc.ph reports uptime to thousandths of a day [thanks, seb] + + added OPA interface support for -sx reporting and cleaned up some very + old code, like quadrics support! [thanks fred] + +------------------------------------------------------------------- Old: ---- collectl-4.0.5.src.tar.gz New: ---- collectl-4.1.0.src.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ collectl.spec ++++++ --- /var/tmp/diff_new_pack.ufJwiO/_old 2016-10-20 23:10:04.000000000 +0200 +++ /var/tmp/diff_new_pack.ufJwiO/_new 2016-10-20 23:10:04.000000000 +0200 @@ -17,7 +17,7 @@ Name: collectl -Version: 4.0.5 +Version: 4.1.0 Release: 0 Summary: Collects data that describes the current system status License: Artistic-1.0 and GPL-2.0+ ++++++ collectl-4.0.5.src.tar.gz -> collectl-4.1.0.src.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/collectl-4.0.5/RELEASE-collectl new/collectl-4.1.0/RELEASE-collectl --- old/collectl-4.0.5/RELEASE-collectl 2016-07-13 15:44:31.000000000 +0200 +++ new/collectl-4.1.0/RELEASE-collectl 2016-10-07 14:35:39.000000000 +0200 @@ -27,6 +27,13 @@ COLLECTL CHANGES +4.1.0 Oct 7, 2016 + - allow lexpr to pass formatting information for strings and numbers + [thanks Guy] + - modify the way misc.ph reports uptime to thousandths of a day [thanks, seb] + - added OPA interface support for -sx reporting and cleaned up some very + old code, like quadrics support! [thanks fred] + 4.0.5 Apr 26, 2016 - rawdskfilt has been enhanced to allow a preceding + which will cause the following string to be appended to the default filter diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/collectl-4.0.5/collectl new/collectl-4.1.0/collectl --- old/collectl-4.0.5/collectl 2016-07-13 15:44:31.000000000 +0200 +++ new/collectl-4.1.0/collectl 2016-10-07 14:35:39.000000000 +0200 @@ -89,7 +89,7 @@ $Memory=$Swap=$Hyper=$Distro=$ProductName=''; $CpuVendor=$CpuMHz=$CpuCores=$CpuSiblings=$CpuNodes=''; $PidFile='/var/run/collectl.pid'; # default, unless --pname -$PQuery=$PQopt=$PCounter=$VStat=$IBVersion=$HCALids=$OfedInfo=''; +$PQuery=$PQopt=$PCounter=$VStat=$IBVersion=$OfedInfo=''; $numBrwBuckets=$cfsVersion=$sfsVersion=''; $Resize=$IpmiCache=$IpmiTypes=$ipmiExec=''; $i1DataFlag=$i2DataFlag=$i3DataFlag=0; @@ -111,7 +111,7 @@ $rootFlag=(!$PcFlag && `whoami`=~/root/) ? 1 : 0; $SrcArch= $Config{"archname"}; -$Version= '4.0.5-1'; +$Version= '4.1.0-1'; $Copyright='Copyright 2003-2016 Hewlett-Packard Development Company, L.P.'; $License= "collectl may be copied only under the terms of either the Artistic License\n"; $License.= "or the GNU General Public License, which may be found in the source kit"; @@ -160,6 +160,7 @@ undef %disks; undef @HCAName; undef @HCAPorts; +undef @HCAId; undef %networks; undef @dskIndexAvail; undef @netIndexAvail; @@ -2962,36 +2963,43 @@ if (++$interConnectCounter==$interConnectIntervals) { newLog($filename, "", "", "", "", "") - if $mellanoxFlag && ibCheck() && $filename ne ''; + if ($mellanoxFlag || $opaFlag) && ibCheck() && $filename ne ''; $interConnectCounter=0; } - if ($mellanoxFlag && $NumHCAs) + if (($mellanoxFlag || $opaFlag) && $NumHCAs) { - for ($i=0; $i<$NumHCAs; $i++) + for (my $i=0; $i<$NumHCAs; $i++) { if ( -e $SysIB ) { - foreach my $j (1..2) + foreach my $j (1..2) { # only read if port active - if ($HCAPorts[$i][$j]) + if ($HCAPorts[$i][$j]) { - # 64 bit counters always come from /sys - if ($PQopt eq 'sys') + if ($HCAName[$i]=~/hfi/) { - my $proc="$SysIB/$HCAName[$i]$i/ports/$j/counters_ext"; - getProc(0, "$proc/port_rcv_data_64", "ib$i-$j:rcvd"); - getProc(0, "$proc/port_xmit_data_64", "ib$i-$j:xmtd"); - getProc(0, "$proc/port_rcv_packets_64", "ib$i-$j:rcvp"); - getProc(0, "$proc/port_xmit_packets_64", "ib$i-$j:xmtp"); + getExec(5, "/sbin/opapmaquery -h $HCAId[$i] -p $j -o getdatacounters", "ib$i-$j:opa"); } - - # we only use perfquery for 32bit counters or 64 when not in - # available in sys and then only if perfquery hasn't been disabled - elsif ( -e $PQuery ) + else { - getExec(1, "$PQuery $PQopt $HCALids[$i][$j] $j 0xf000", "ib$i-$j"); + # 64 bit counters always come from /sys + my $proc="$SysIB/$HCAName[$i]$i/ports/$j/counters_ext"; + if ($PQopt eq 'sys') + { + getProc(0, "$proc/port_rcv_data_64", "ib$i-$j:rcvd"); + getProc(0, "$proc/port_xmit_data_64", "ib$i-$j:xmtd"); + getProc(0, "$proc/port_rcv_packets_64", "ib$i-$j:rcvp"); + getProc(0, "$proc/port_xmit_packets_64", "ib$i-$j:xmtp"); + } + + # we only use perfquery for 32bit counters or 64 when not in + # available in sys and then only if perfquery hasn't been disabled + elsif ( -e $PQuery ) + { + getExec(1, "$PQuery $PQopt -C $HCAId[$i] -P $j", "ib$i-$j:pquery"); + } } } } @@ -4115,6 +4123,18 @@ { $count++; } record(2, "$tag: $count\n"); } + + # OPA + elsif ($type==5) + { + foreach my $line (<CMD>) + { + $line=~/ ([0x]*\d+)/; + $oneLine.="$1 "; + } + $oneLine=~s/ $//; + record(2, "$tag: $oneLine\n"); + } close CMD; } @@ -6761,6 +6781,11 @@ my $whatsnew=<<EOF6; What's new in collectl in the last year or so? +version 4.1.0 +- enhanced lexpr to allow reporting fractional metrics +- modified misc to report uptime days to 3 decimal places +- added support for Intel's OPA + version 4.0.5 - added '+' to --rawdskfilt to make easier to extend - added 'hed' to known ethernet devices @@ -6781,15 +6806,6 @@ - added mlx5 as new IB device type - colmux now part of collectl distro -Version 3.7.4 Jun 2014 -- new: --ALL collect/playback for ALL subsystems both summary and detail -- new: --full forces --verbose + RECORD separator as parsing aid for others - also include subsystems contained withing RECORD separator after UCT: -- new: 2 new cpu stats, guest and guest_nice -- new: 3rd --top parameter for vertical (non-home) display, see --showtopopt -- default native lustre support has been removed. either add 'l' to -s in - collectl.conf OR contact Peter Piela at Cray for his plugin - EOF6 printText($whatsnew); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/collectl-4.0.5/formatit.ph new/collectl-4.1.0/formatit.ph --- old/collectl-4.0.5/formatit.ph 2016-07-13 15:44:31.000000000 +0200 +++ new/collectl-4.1.0/formatit.ph 2016-10-07 14:35:39.000000000 +0200 @@ -275,8 +275,8 @@ } # if doing interconnect, the first thing to do is see what interconnect - # hardware is present via lspci - $NumHCAs=$mellanoxFlag=0; + # hardware is present via lspci. + $NumHCAs=$mellanoxFlag=$opaFlag=0; if ($subsys=~/x/i) { my $lspciVer=`$Lspci --version`; @@ -291,9 +291,10 @@ print "lspci -- Version: $lspciVer Vendor Field: $lspciVendorField\n" if $debug & 1; - $command="$Lspci -n | $Egrep '15b3|0c06|14c1|14fc|1077'"; + $command="$Lspci -n | $Egrep '15b3|0c06|14c1|14fc|1077|8086:24f0'"; print "Command: $command\n" if $debug & 1; @pci=`$command`; + $HCANames=''; foreach $temp (@pci) { ($vendorID, $type)=split(/:/,(split(/\s+/, $temp))[$lspciVendorField]); @@ -302,20 +303,34 @@ next if $type eq '5a46'; # ignore pci bridge print "Found Infiniband Interconnect\n" if $debug & 1; $mellanoxFlag=1; - $HCANames=''; ibCheck(''); } + elsif ($vendorID=~/8086/) + { + print "Found OPA Interconnect\n" if $debug & 1; + $opaFlag=1; + ibCheck(''); + } + } - disableSubsys('x', 'no interconnect hardware/drivers found') if !$mellanoxFlag; + disableSubsys('x', 'no interconnect or opa hardware/drivers found') if $mellanoxFlag+$opaFlag==0; # User had ability to turn off in case they don't want destructive monitoring + my $firstHCA=''; if ($mellanoxFlag) { - # use name for hca0 port 1 and see if extended counters supported, noting we can - # force perfquery usage during debug, which itself might use -x - my $hca0_1="$SysIB/${HCAName[0]}0/ports/1"; + # use name for first non-opa hca port 1 and see if extended counters supported, + # noting we can force perfquery usage during debug, which itself might use -x + for (my $i=0; $i<$NumHCAs; $i++) + { + if ($HCAName[$i]!~/hfi/) + { + $firstHCA="$SysIB/${HCAName[$i]}0/ports/1"; + last; + } + } $PQopt = '-r'; - $PQopt = 'sys' if -e "$hca0_1/counters_ext" && !($debug & 16384); + $PQopt = 'sys' if -e "$firstHCA/counters_ext" && !($debug & 16384); # We usually only care about perfquery for non-extended counters if ($PQopt eq '-r') @@ -368,9 +383,11 @@ # NOTE - looks like RedHat is no longer shipping ofed if (!-e $OfedInfo) { + # comment out the warning, at least for now. we WILL still see '???' + # in header $OfedInfo=getOfedPath($OfedInfo, 'ofed_info', 'OfedInfo'); - logmsg('W', "Couldn't find 'ofed_info'. Won't be able to determine OFED version") - if $OfedInfo eq ''; + #logmsg('W', "Couldn't find 'ofed_info'. Won't be able to determine OFED version") + # if $OfedInfo eq ''; } # Unfortunately the ofed_info that ships with voltaire adds 5 extra @@ -380,9 +397,10 @@ # last possibility is even though extended stats not in /sys they may still be # available with perfquery so let's see - $PQopt = '-x' if `$PQuery -h 2>&1`=~/--extended/m; + $PQopt = '-x' if !($debug & 16384) && `$PQuery -h 2>&1`=~/--extended/m; } + print "PQopt: $PQopt\n" if $debug & 1; print "reading extended IB stats from $SysIB\n" if $debug & 2 && $PQopt eq 'sys'; print "OFED V: $IBVersion PQ V:$PQVersion PQOpt: $PQopt\n" if $debug & 2 && $PQopt ne 'sys'; } @@ -1645,7 +1663,7 @@ $netTxFifoLast[$i]=$netTxCollLast[$i]=$netTxCarLast[$i]=$netTxCmpLast[$i]=0; } - # IB - we only need 16 for 32bit counters + # IB - we only need 16 for 32bit counters, but 20 for OPA! for ($i=0; $i<$NumHCAs; $i++) { # in almost all cases we only have 64 bit counters @@ -1655,7 +1673,7 @@ $ibTxKBLast[$i][1]=$ibTxKBLast[$i][2]=0; # maybe some day we can just get rid of these... - for ($j=0; $j<16; $j++) + for ($j=0; $j<20; $j++) { # There are 2 ports on an hca, numbered 1 and 2 $ibFieldsLast[$i][1][$j]=$ibFieldsLast[$i][2][$j]=0; @@ -4322,104 +4340,135 @@ # I n f i n i b a n d S t a t s + # these stats can come from multiple sources depending on values of' + # $PQopt and/or whether or not we're getting them from opa + elsif ($subsys=~/x/i && $type=~/^ib(\d+)-(\d):(\S*)/) { my $i=$1; my $port=$2; my $name=$3; + + ####################### + # ib stats from /sys + ####################### + + # as a optimization don't even look for these unless /sys if ($PQopt eq 'sys') { if ($name eq 'rcvd') { $ibRxKB[$i]=fix($data-$ibRxKBLast[$i][$port])/256; - $ibRxKBLast[$i][$port]=$data; + $ibRxKBLast[$i][$port]=$data; $ibRxKBTot+=$ibRxKB[$i]; } elsif ($name eq 'xmtd') { $ibTxKB[$i]=fix($data-$ibTxKBLast[$i][$port])/256; - $ibTxKBLast[$i][$port]=$data; + $ibTxKBLast[$i][$port]=$data; $ibTxKBTot+=$ibTxKB[$i]; } elsif ($name eq 'rcvp') { $ibRx[$i]=fix($data-$ibRxLast[$i][$port]); - $ibRxLast[$i][$port]=$data; + $ibRxLast[$i][$port]=$data; $ibRxTot+=$ibRx[$i]; } elsif ($name eq 'xmtp') { $ibTx[$i]=fix($data-$ibTxLast[$i][$port]); - $ibTxLast[$i][$port]=$data; + $ibTxLast[$i][$port]=$data; $ibTxTot+=$ibTx[$i]; } - } + } - elsif ($PQopt eq '-r') - { - my ($port, @fieldsNow)=(split(/\s+/, $data))[0,4..19]; + ############################### + # ib stats from pquery + ############################### - # Only 1 of the two ports are actually active at any one time - if ($HCAPorts[$i][$port]) + # note that these can either be extended or 32 bit counters + elsif ($name eq 'pquery:') + { + # extended status + if ($PQopt eq '-x') { - $ibErrorsTot[$i]=0; - for ($j=0; $j<16; $j++) + my ($port, @fieldsNow)=(split(/\s+/, $data))[0,4..7]; + + for ($j=0; $j<3; $j++) { $fields[$j]=fix($fieldsNow[$j]-$ibFieldsLast[$i][$port][$j]); $ibFieldsLast[$i][$port][$j]=$fieldsNow[$j]; + } - # the first 12 are accumulated as a single error count and ultimately - # reporting as anbsolute number and NOT a rate so don't use 'last' - $ibErrorsTot[$i]+=$fieldsNow[$j] if $j<12; - } + $ibTxKB[$i]=$fields[0]/256; + $ibTx[$i]= $fields[2]; + $ibRxKB[$i]=$fields[1]/256; + $ibRx[$i]= $fields[3]; - # these are already absolute since they're reset after reading - $ibTxKB[$i]=$fieldsNow[12]/256; - $ibTx[$i]= $fieldsNow[14]; - $ibRxKB[$i]=$fieldsNow[13]/256; - $ibRx[$i]= $fieldsNow[15]; + $ibTxKBTot+=$ibTxKB[$i]; + $ibTxTot+= $ibTx[$i]; + $ibRxKBTot+=$ibRxKB[$i]; + $ibRxTot+= $ibRx[$i]; + $ibErrorsTotTot+=$ibErrorsTot[$i]; + } + + # regular + elsif ($PQopt eq '-r') + { + my ($port, @fieldsNow)=(split(/\s+/, $data))[0,4..19]; + + # Only 1 of the two ports are actually active at any one time + if ($HCAPorts[$i][$port]) + { + $ibErrorsTot[$i]=0; + for ($j=0; $j<16; $j++) + { + $fields[$j]=fix($fieldsNow[$j]-$ibFieldsLast[$i][$port][$j]); + $ibFieldsLast[$i][$port][$j]=$fieldsNow[$j]; + + # the first 12 are accumulated as a single error count and ultimately + # reporting as anbsolute number and NOT a rate so don't use 'last' + $ibErrorsTot[$i]+=$fieldsNow[$j] if $j<12; + } + + # these are already absolute since they're reset after reading + $ibTxKB[$i]=$fieldsNow[12]/256; + $ibTx[$i]= $fieldsNow[14]; + $ibRxKB[$i]=$fieldsNow[13]/256; + $ibRx[$i]= $fieldsNow[15]; + } + $ibTxKBTot+=$ibTxKB[$i]; + $ibTxTot+= $ibTx[$i]; + $ibRxKBTot+=$ibRxKB[$i]; + $ibRxTot+= $ibRx[$i]; + $ibErrorsTotTot+=$ibErrorsTot[$i]; } - $ibTxKBTot+=$ibTxKB[$i]; - $ibTxTot+= $ibTx[$i]; - $ibRxKBTot+=$ibRxKB[$i]; - $ibRxTot+= $ibRx[$i]; - $ibErrorsTotTot+=$ibErrorsTot[$i]; } - else - { - $numFields=($PQopt eq 'r') ? 19 : 7; - my ($port, @fieldsNow)=(split(/\s+/, $data))[0,4..$numFields]; + ################################ + # opastats from opapmsquery + ################################ - for ($j=0; $j<$numFields-4; $j++) + elsif ($name eq 'opa:') + { + my ($port, @fieldsNow)=(split(/\s+/, $data))[4,5..24]; + for ($j=0; $j<4; $j++) { $fields[$j]=fix($fieldsNow[$j]-$ibFieldsLast[$i][$port][$j]); $ibFieldsLast[$i][$port][$j]=$fieldsNow[$j]; - - # this only applies to regular counters, but the first 12 are - # accumulated as a single error count and ultimately reporting - # as anbsolute number and NOT a rate so don't use 'last' - $ibErrorsTot[$i]+=$fieldsNow[$j] if $PQopt eq 'r' && $j<12; } - if ($PQopt eq '-r') # these are always reset and so always start at 0 - { - $ibTxKB[$i]=$fieldsNow[12]/256; - $ibTx[$i]= $fieldsNow[14]; - $ibRxKB[$i]=$fieldsNow[13]/256; - $ibRx[$i]= $fieldsNow[15]; - } - else # these are the extended counters and never start at 0 - { - $ibTxKB[$i]=$fields[0]/256; - $ibTx[$i]= $fields[2]; - $ibRxKB[$i]=$fields[1]/256; - $ibRx[$i]= $fields[2]; + $ibErrorsTot[$i]=$fieldsNow[19]-$ibFieldsLast[$i][$port][19]; + $ibFieldsLast[$i][$port][19]=$fieldsNow[19]; + + $ibTxKB[$i]=$fields[0]*976.5625; # need to express as KB + $ibTx[$i]= $fields[2]; + $ibRxKB[$i]=$fields[1]*976.5625; + $ibRx[$i]= $fields[3]; - } $ibTxKBTot+=$ibTxKB[$i]; $ibTxTot+= $ibTx[$i]; $ibRxKBTot+=$ibRxKB[$i]; @@ -4854,7 +4903,8 @@ { for ($i=0; $i<$NumHCAs; $i++) { - $ibHeaders.="[IB:$i]HCA${SEP}[IB:$i]InPkt${SEP}[IB:$i]OutPkt${SEP}[IB:$i]InKB${SEP}[IB:$i]OutKB${SEP}[IB:$i]Err${SEP}"; + $HCAName[$i]=~/(\S+?)_*$/; + $ibHeaders.="[IB:$1]HCA${SEP}[IB:$1]InPkt${SEP}[IB:$1]OutPkt${SEP}[IB:$1]InKB${SEP}[IB:$1]OutKB${SEP}[IB:$1]Err${SEP}"; } writeData(0, $ch, \$ibHeaders, IB, $ZIB, 'ib', \$headersAll); } @@ -7149,14 +7199,18 @@ { printText("\n") if !$homeFlag; printText("# INFINIBAND STATISTICS ($rate)\n"); - printText("#${miniDateTime}HCA KBIn PktIn SizeIn KBOut PktOut SizeOut Errors\n"); + printText("#${miniDateTime}HCA KBIn PktIn SizeIn KBOut PktOut SizeOut Errors\n"); exit(0) if $showColFlag; } for ($i=0; $i<$NumHCAs; $i++) { - $line=sprintf("$datetime %2d %7s %7s %7s %7s %7s %7s %7s\n", - $i, + # this is messy. some HCSa end with _ which we don't want to print BUT we + # need to preserve the full name in the array so do a non-greedy match so + # we see everything except the optional _ at the end. + $HCAName[$i]=~/(\S+?)_*$/; + $line=sprintf("$datetime %-6s %7s %7s %7s %7s %7s %7s %7s\n", + $1, cvt($ibRxKB[$i]/$intSecs,7,0,1), cvt($ibRx[$i]/$intSecs,6), $ibRx[$i] ? cvt($ibRxKB[$i]*1024/$ibRx[$i],4,0,1) : 0, cvt($ibTxKB[$i]/$intSecs,7,0,1), cvt($ibTx[$i]/$intSecs,6), @@ -9421,6 +9475,7 @@ } } +# NOTE - although called ibCheck it also picks up opa info sub ibCheck { my $saveHCANames=$HCANames; @@ -9433,16 +9488,6 @@ $NumHCAs=0; my $found=0; - foreach my $temp (split(/:/, $VStat)) - { - if (-e $temp) - { - $found=1; - $VStat=$temp; - last; - } - } - # This error can only happen when NOT open fabric if (!-e $SysIB && !$found) { @@ -9461,14 +9506,16 @@ foreach $line (@lines) { $line=~/(.*)(\d+)$/; - $devname=$1; - $devnum=$2; + my $devname=$1; + my $devnum=$2; # While this should work for any ofed compliant adaptor, doing it this # way at least makes it more explicit which ones have been found to work. - if ($devname=~/mthca|mlx4_|mlx5_|qib/) + # also note hfi is the guy who speaks to opa + if ($devname=~/mthca|mlx4_|mlx5_|qib|hfi1_/) { $HCAName[$NumHCAs]=$devname; + $HCAId[$NumHCAs]=($devname=~/hfi/) ? $devnum+1 : "$devname$devnum"; $HCANames.=" $devname"; $file=$SysIB; $file.="/$devname"; @@ -9485,11 +9532,9 @@ $state=~/.*: *(.+)/; $portState=($1 eq 'ACTIVE') ? 1 : 0; $HCAPorts[$NumHCAs][$port]=$portState; - chomp($lid=cat("$file/$port/lid")); - $HCALids[$NumHCAs][$port]=$lid; if ($portState) { - print " OFED Port: $port LID: $lid\n" if $debug & 2; + print " OFED Port: $port ID: $HCAId[$NumHCAs]\n" if $debug & 2; $HCANames.=":$port"; $activePorts++; } @@ -9915,4 +9960,4 @@ return(@dirs); } -1; \ No newline at end of file +1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/collectl-4.0.5/lexpr.ph new/collectl-4.1.0/lexpr.ph --- old/collectl-4.0.5/lexpr.ph 2016-07-13 15:44:31.000000000 +0200 +++ new/collectl-4.1.0/lexpr.ph 2016-10-07 14:35:39.000000000 +0200 @@ -427,30 +427,38 @@ $tcpString.=sendData("tcpinfo.tcpxerrs", $tcpExErrors/$intSecs) if $tcpFilt=~/T/; } - my $intString=''; + my ($intSumString,$intDetString)=('',''); if ($lexSubsys=~/x/i) { - if ($NumXRails) - { - $kbInT= $elanRxKBTot; - $pktInT= $elanRxTot; - $kbOutT= $elanTxKBTot; - $pktOutT=$elanTxTot; - } - if ($NumHCAs) { - $kbInT= $ibRxKBTot; - $pktInT= $ibRxTot; - $kbOutT= $ibTxKBTot; - $pktOutT=$ibTxTot; + if ($lexSubsys=~/x/) + { + $kbInT= $ibRxKBTot; + $pktInT= $ibRxTot; + $kbOutT= $ibTxKBTot; + $pktOutT=$ibTxTot; + + $intSumString.=sendData("iconnect.kbin", $kbInT/$intSecs); + $intSumString.=sendData("iconnect.pktin", $pktInT/$intSecs); + $intSumString.=sendData("iconnect.kbout", $kbOutT/$intSecs); + $intSumString.=sendData("iconnect.pktout", $pktOutT/$intSecs); + } + + if ($lexSubsys=~/X/) + { + for (my $i=0; $i<$NumHCAs; $i++) + { + $HCAName[$i]=~/(\S+?)_*$/; + print "HCA: $HCAName[$i] 1: $1\n"; + $intDetString.=sendData("iconnect.$1.kbin", $ibRxKB[$i]/$intSecs); + $intDetString.=sendData("iconnect.$1.pktin", $ibRx[$i]/$intSecs); + $intDetString.=sendData("iconnect.$1.kbout", $ibTxKB[$i]/$intSecs); + $intDetString.=sendData("iconnect.$1.pktout", $ibTx[$i]/$intSecs); + } + } } - - $intString.=sendData("iconnect.kbin", $kbInT/$intSecs); - $intString.=sendData("iconnect.pktin", $pktInT/$intSecs); - $intString.=sendData("iconnect.kbout", $kbOutT/$intSecs); - $intString.=sendData("iconnect.pktout", $pktOutT/$intSecs); - } + } my $envString=''; if ($lexSubsys=~/E/i) @@ -468,12 +476,16 @@ # if any imported data, it may want to include lexpr output AND we do a little more work to # separate the summary from the detail. also, in case any variables are gauges and we're doing - # totals we'll need to know that too. - my (@nameS, @valS, @nameD, @valD, @gaugeS, @gaugeD); + # totals we'll need to know that as well as non-string formatting. There is a bit of magic here, + # perhaps the easiest example in misc.ph where it reports the uptime as a fracion of a day. Here + # it passes the summary-data formatting in ref7. Also note since it does distinguish between + # summary and detail data, it you want to change the formats of both, you'd need to set ref7 and + # ref8 in their appropriate sections of the printExport code. + my (@nameS, @valS, @nameD, @valD, @gaugeS, @gaugeD, @fmtS, @fmtD); my ($impSumString, $impDetString)=('',''); - for (my $i=0; $i<$impNumMods; $i++) { &{$impPrintExport[$i]}('l', \@nameS, \@valS, \@nameD, \@valD, \@gaugeS, \@gaugeD); } - foreach (my $i=0; $i<scalar(@nameS); $i++) { $impSumString.=sendData($nameS[$i], $valS[$i], $gaugeS[$i]); } - foreach (my $i=0; $i<scalar(@nameD); $i++) { $impDetString.=sendData($nameD[$i], $valD[$i], $gaugeD[$i]); } + for (my $i=0; $i<$impNumMods; $i++) { &{$impPrintExport[$i]}('l', \@nameS, \@valS, \@nameD, \@valD, \@gaugeS, \@gaugeD, \@fmtS, \@fmtD); } + foreach (my $i=0; $i<scalar(@nameS); $i++) { $impSumString.=sendData($nameS[$i], $valS[$i], $gaugeS[$i], $fmtS[$i]); } + foreach (my $i=0; $i<scalar(@nameD); $i++) { $impDetString.=sendData($nameD[$i], $valD[$i], $gaugeD[$i], $fmtD[$i]); } $lexSumFlag=1 if $impSumString ne ''; # in case not already set $lexprExtString=''; @@ -495,11 +507,11 @@ my $lexprRec=''; $lexprRec.="sample.time $lastSecs[$rawPFlag]$debTime\n" if $lexSumFlag; $lexprRec.="$cpuSumString$diskSumString$nfsString$inodeString$memString$netSumString"; - $lexprRec.="$lusSumString$sockString$tcpString$intString$envString$impSumString"; + $lexprRec.="$lusSumString$sockString$tcpString$intSumString$envString$impSumString"; $lexprRec.=$lexprExtString; $lexprRec.="sample.time $lastSecs[$rawPFlag]$debTime\n" if !$lexSumFlag; - $lexprRec.="$cpuDetString$diskDetString$memDetString$netDetString$impDetString"; + $lexprRec.="$cpuDetString$diskDetString$memDetString$netDetString$intDetString$impDetString"; # Either send data over socket or print to terminal OR write to # a file, but not both! @@ -523,7 +535,8 @@ my $value= shift; my $gauge= shift; my $format=shift; - #print "Name: $name VAL: $value\n"; + #print "Name: $name VAL: $value GAUGE: %s FORMAT: %s\n", + # defined($gague) ? $gague : '', defined($format) ? $format : ''; # These are only undefined the very first time if (!defined($lexTTL{$name})) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/collectl-4.0.5/man1/colmux.1 new/collectl-4.1.0/man1/colmux.1 --- old/collectl-4.0.5/man1/colmux.1 2016-07-13 15:44:31.000000000 +0200 +++ new/collectl-4.1.0/man1/colmux.1 2016-10-07 14:35:40.000000000 +0200 @@ -535,9 +535,9 @@ works, tell colmux to use that address for communication via the -retaddr switch. .SH AUTHOR -This program was written by Mark Seger (mark.se...@hp.com). +This program was written by Mark Seger (mjse...@gmail.com). .br -Copyright 2015 Hewlett-Packard Development Company, L.P. +Copyright 2016 Hewlett-Packard Development Company, L.P. .SH SEE ALSO http://collectl-utils.sourceforge.net/colmux.html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/collectl-4.0.5/misc.ph new/collectl-4.1.0/misc.ph --- old/collectl-4.0.5/misc.ph 2016-07-13 15:44:31.000000000 +0200 +++ new/collectl-4.1.0/misc.ph 2016-10-07 14:35:39.000000000 +0200 @@ -121,8 +121,8 @@ } elsif ($type==3) # data { - $$lineref.=sprintf(" %4s %4d %2d %3d ", - cvt($miscUptime/86400), $miscMHz, $miscMounts, $miscLogins); + $$lineref.=sprintf(" %s %4d %2d %3d ", + cvt(1.0*$miscUptime/86400), $miscMHz, $miscMounts, $miscLogins); } elsif ($type==4) # reset 'total' counters { @@ -183,13 +183,21 @@ my $ref1= shift; my $ref2= shift; my $ref3= shift; + my $ref4= shift; + my $ref5= shift; + my $ref6= shift; + my $ref7= shift; + my $ref8= shift; + + # see lexpr for how the above parameters are interpretted and why we have + # so many that are not used # The light-weight counters are reported every sampling interval but since I think sexpr # needs to be contant, we'll always report all even if some only sampled periodically. # Same thing for gexpr, at least for now. if ($type eq 'l') { - push @$ref1, "misc.uptime"; push @$ref2, sprintf("%d", $miscUptime/86400); + push @$ref1, "misc.uptime"; push @$ref2, sprintf("%.3f", $miscUptime/86400); push @$ref7, '%.3f'; push @$ref1, "misc.cpuMHz"; push @$ref2, sprintf("%d", $miscMHz); push @$ref1, "misc.mounts"; push @$ref2, sprintf("%d", $miscMounts); }