126{
128 char *desc = 0;
129 if (! input_str)
130 return (0);
131
133 if (desc == 0) {
134 PAPIERROR(
"cannot allocate memory for event description");
135 return (0);
136 }
137 len = strlen(input_str);
138
139
140 int bits = 32;
141 if (extended)
142 bits = 64;
143
144 int ret;
145
146 if (strstr(input_str, "rx_atomic_requests")) {
148 "Number of received ATOMIC requests for the associated Queue Pairs",
149 bits);
150 }
151 else if (strstr(input_str, "out_of_buffer")) {
153 "Number of drops which occurred due to lack of Work Queue Entry for the associated Queue Pairs",
154 bits);
155 }
156 else if (strstr(input_str, "out_of_sequence")) {
158 "Number of out of sequence packets received",
159 bits);
160 }
161 else if (strstr(input_str, "lifespan")) {
163 "Maximum sampling period of the counters in milliseconds",
164 bits);
165 }
166 else if (strstr(input_str, "rx_read_requests")) {
168 "Number of received READ requests for the associated Queue Pairs",
169 bits);
170 }
171 else if (strstr(input_str, "rx_write_requests")) {
173 "Number of received WRITE requests for the associated Queue Pairs",
174 bits);
175 }
176 else if (strstr(input_str, "port_rcv_data")) {
178 "Total number of data octets, divided by 4 (lanes), received on all Virtual Lanes. "
179 "Multiply this by 4 to get bytes",
180 bits);
181 }
182 else if (strstr(input_str, "port_rcv_packets")) {
184 "Total number of packets received on all Virtual Lanes from this port, including packets containing errors",
185 bits);
186 }
187 else if (strstr(input_str, "port_multicast_rcv_packets") || strstr(input_str, "multicast_rcv_packets")) {
189 "Total number of multicast packets, including multicast packets containing errors",
190 bits);
191 }
192 else if (strstr(input_str, "port_unicast_rcv_packets") || strstr(input_str, "unicast_rcv_packets")) {
194 "Total number of unicast packets, including unicast packets containing errors",
195 bits);
196 }
197 else if (strstr(input_str, "port_xmit_data")) {
199 "Total number of data octets, divided by 4 (lanes), transmitted on all Virtual Lanes. "
200 "Multiply this by 4 to get bytes",
201 bits);
202 }
203 else if (strstr(input_str, "port_xmit_packets")) {
205 "Total number of packets transmitted on all Virtual Lanes from this port, including packets containing errors",
206 bits);
207 }
208 else if (strstr(input_str, "port_rcv_switch_relay_errors")) {
210 "Total number of packets received on port that were discarded"
211 " because they could not be forwarded by switch relay",
212 bits);
213 }
214 else if (strstr(input_str, "port_rcv_errors")) {
216 "Total number of packets containing an error that were received on the port",
217 bits);
218 }
219 else if (strstr(input_str, "port_rcv_constraint_errors")) {
221 "Total number of packets received on the switch physical port that are discarded",
222 bits);
223 }
224 else if (strstr(input_str, "local_link_integrity_errors")) {
226 "Number of times the count of local physical errors exceeded threshold",
227 bits);
228 }
229 else if (strstr(input_str, "port_xmit_wait")) {
231 "Number of ticks during which port had data to transmit but no data was sent during the entire tick",
232 bits);
233 }
234 else if (strstr(input_str, "port_multicast_xmit_packets") || strstr(input_str, "multicast_xmit_packets")) {
236 "Total number of multicast packets transmitted on all VLs from port,"
237 " including multicast packets containing errors",
238 bits);
239 }
240 else if (strstr(input_str, "port_unicast_xmit_packets") || strstr(input_str, "unicast_xmit_packets")) {
242 "Total number of unicast packets transmitted on all VLs from port,"
243 " including unicast packets containing errors",
244 bits);
245 }
246 else if (strstr(input_str, "port_xmit_discards")) {
248 "Total number of outbound packets discarded by the port because it is down or congested",
249 bits);
250 }
251 else if (strstr(input_str, "port_xmit_constraint_errors")) {
253 "Total number of packets not transmitted from the switch physical port",
254 bits);
255 }
256 else if (strstr(input_str, "port_rcv_remote_physical_errors")) {
258 "Total number of packets marked with EBP (End of Bad Packet) delimiter received on the port",
259 bits);
260 }
261 else if (strstr(input_str, "symbol_error")) {
263 "Total number of minor link errors detected on one or more physical lanes",
264 bits);
265 }
266 else if (strstr(input_str, "VL15_dropped")) {
268 "Number of incoming VL15 packets (can include management packets) dropped due to resource limitations of the port",
269 bits);
270 }
271 else if (strstr(input_str, "link_error_recovery")) {
273 "Total number of times the Port Training state machine has successfully completed the link error recovery process",
274 bits);
275 }
276 else if (strstr(input_str, "link_downed")) {
278 "Total number of times the Port Training state machine has failed link error recovery process and downed the link",
279 bits);
280 }
281 else {
282
284 input_str, (extended ? "free-running 64bit counter" :
285 "overflowing, auto-resetting counter"));
286 desc[0] = toupper(desc[0]);
287 for (
i=0 ;
i<len ; ++
i)
290 }
292
293 }
294 return desc;
295}