3 # This file is provided under a dual BSD/GPLv2 license. When using or
4 # redistributing this file, you may do so under either license.
8 # Copyright(c) 2016 Intel Corporation.
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of version 2 of the GNU General Public License as
12 # published by the Free Software Foundation.
14 # This program is distributed in the hope that it will be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # General Public License for more details.
19 # Contact Information:
20 # Cong Xu, cong.xu@intel.com
24 # Copyright(c) 2016 Intel Corporation.
26 # Redistribution and use in source and binary forms, with or without
27 # modification, are permitted provided that the following conditions
30 # * Redistributions of source code must retain the above copyright
31 # notice, this list of conditions and the following disclaimer.
32 # * Redistributions in binary form must reproduce the above copyright
33 # notice, this list of conditions and the following disclaimer in
34 # the documentation and/or other materials provided with the
36 # * Neither the name of Intel Corporation nor the names of its
37 # contributors may be used to endorse or promote products derived
38 # from this software without specific prior written permission.
40 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
41 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
42 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
43 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
44 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
46 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
47 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
48 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
49 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
50 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
57 Usage: $0 [-i] [-x] [-y] [-t]
58 -i path to LIOProf rpc tracing logs
59 -x lowest Lustre Client [IB IP Address]
60 -y highest Lustre Client [IB IP Address]
61 -t Type of Operation Code (OPC) (OST_READ 3, OST_WRITE 4)
67 while getopts ":i:x:y:t:" o; do
83 if [ -z "${i}" ] || [ -z "${x}" ] || [ -z "${y}" ] || [ -z "${t}" ]; then
89 cluster_name=$(cut -d- -f1 <<<"${x}")
92 CLIENT_PRE=$(cut -d. -f 1-3 <<<"${x}")
93 CLIENT_MIN=$(cut -d. -f4 <<<"${x}")
94 CLIENT_MAX=$(cut -d. -f4 <<<"${y}")
96 # Type of Operation Code (OPC) (Defined in lustre/include/lustre/lustre_idl.h)
109 echo "Processing ${f}"
110 for ((c = $CLIENT_MIN; c <= $CLIENT_MAX; c = c + 1))
113 CUR_OST=$(echo "${f}" | rev | cut -d'/' -f1 | rev)
115 cat ${f} | grep "Handling RPC pname" | grep "ll_ost_io" | \
116 grep o2ib:${OPC_TYPE} | grep ${ip} | \
117 awk 'BEGIN{FS=":"}{print $4}' | sort -n | \
118 awk 'BEGIN {count = 0; line = 0; FS="."} {
119 if (NR == 1) {curval = $1};
123 print line "\t" count;
134 print line "\t" count;
136 > ${OUT_PUT}/$CUR_OST-Client-$c &
140 # Wait for completion
144 # If the lines of the files are different, fill the end of files with zeros to
145 # guarantee all the files have the same number of lines.
149 for f in ${OUT_PUT}/*
152 if [ "$MAX_LINE" -lt "$LINE" ]
159 for f in ${OUT_PUT}/*
162 for ((i = $LINE; i < $MAX_LINE; i = i + 1))
164 printf "0\t0\n" >> ${f} &