-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsumm
executable file
·7757 lines (7200 loc) · 214 KB
/
summ
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/perl -w
#
# AIX I/O error summarizer v0.6.52 (08/30/2013)
# Send suggestions, complaints, requests for updates to:
# Brian Hart ([email protected])
#
# - 04/28/2006 - bwh - initial cut from err_decode
# - 02/17/2007 - bwh - LVM_ errors
# - 04/09/2007 - bwh - first FCS_ERRs
# - 04/12/2007 - bwh - enhanced some dyntrk related FSCSI_ERRs
# - 07/18/2007 - bwh - FCS_ERR 00000021
# - 07/23/2007 - bwh - FCS_ERR 0000005D & 0000005E
# - 07/31/2007 - bwh - Show abending program for CORE_DUMP errors, FSCSI_ERR 4E
# - 08/01/2007 - bwh - FCS_ERR 00000026
# - 08/15/2007 - bwh - [SC_]TAPE_ERRx, J2/JFS errors, SDDPCM_PATH_RECOVER, etc.
# - 08/16/2007 - bwh - Fixed FS errors, added FCS_ERR 0x30, 0x51, 0x53, etc
# - 08/17/2007 - bwh - LOST_EVENTS, DISK_ERR, refactor some routines
# - 08/20/2007 - bwh - Fix: FSCSI 0x15, 0x2E, 0xAA, 0xAC, 0xD9; CORE_DUMP;
# FCS 0x21; JFS_general errno; NS&LS reject codes;
# [SC_]DISK_ERR.
# Add: FSCSI 0x4F; FCS 0x5, 0x6, 0x7; PCI_xxx_ERR
# - 08/21/2007 - bwh - Fix: FSCSI 0x01, 0x03, 0x29; tidy up layout, improve
# comments
# - 09/14/2007 - bwh - Typos
# - 11/09/2007 - bwh - Typos, disk driver status 0x84
# - 01/03/2008 - bwh - FCS_ERR 0x127
# - 02/29/2008 - bwh - DMA_ERR; Happy Leap Year!
# - 05/23/2008 - bwh - FCS_ERR 0x0c, 0x48
# - 05/29/2008 - bwh - Decode RSP_CODEs from FCP_RSP's RSP_INFO
# - 08/12/2008 - bwh - Add "-s" flag to force printing of Sequence Number
# - 08/18/2008 - bwh - Retrieve LBAs from LVM_* errors
# - 09/09/2008 - bwh - Add new SCSI-3 driver adapter stats
# - 09/25/2008 - bwh - Add specific EEH error codes for PCI_RECOVERABLE_ERR
# - 09/29/2008 - bwh - FCP_ERR for some Emulex errors; DMA_ERR changes for 6.1;
# EEH_ERR
# - 10/21/2008 - bwh - FSCSI/FCP_ERR 0x41, 0x42, 0xb7; Add OPMSG & VFC_ERR
# - 10/23/2008 - bwh - FCA_ERR 0x06, 0x21
# - 10/27/2008 - bwh - FSCSI_ERR 0x25
# - 11/13/2008 - bwh - Emulex FCA_ERR 0x24, 0x27, and 0xD303
# Emulex FCP_ERR 0xA5, 0xAC
# - 11/14/2008 - bwh - Emulex FCA_ERR 0xD300, 0xD301, 0xD302
# Emulex FCP_ERR 0x29, 0xA30
# - 11/15/2008 - bwh - Emulex FCA_ERR 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xA5,
# 0x11, correct 0x24, 0xD300, 0xD301, 0xD302, 0xD303
# Emulex FCP_ERR 0xB5; add ELS 'ACCEPT'
# - 11/25/2008 - bwh - Emulex FCP_ERR 0x23, 0x2A, 0x6B, 0x6C, 0x6E, 0x6F, 0xAD,
# 0xAF, 0xB8
# - 11/30/2008 - bwh - FSCSI_ERR 0xB4, 0xBD, 0xC7
# - 12/17/2008 - bwh - First QLogic FCP_ERRs, 0x0B, 0x4A, 0x4E
# - 03/04/2009 - bwh - Emulex FCP_ERR 0x73, 0x327; Emulex FCA_ERR 0x41
# - 03/26/2009 - bwh - Treat SC_DISK_PCM_ERR label same as SC_DISK_ERR
# - 04/21/2009 - bwh - First QLogic v4/NPIV FCP_ERRs; QLogic FCP 0x1EA;
# Emulex FCP 0x07, 0x70
# - 04/22/2009 - bwh - First QLogic FCA_ERRs; QLogic FCA_ERR 0x2E;
# QLogic FCP_ERR 0x16, 0x2C, 0xA1
# - 04/23/2009 - bwh - QLogic FCP_ERR 0x23, 0x26, 0x29;
# QLogic FCA_ERR 0x26, 0x41; Emulex FCP_ERR 0x302
# VFC_HOST errors
# - 04/24/2009 - bwh - QLogic FCP_ERR 0xb1
# - 04/30/2009 - bwh - Tweak VFC_HOST errors
# - 05/04/2009 - bwh - Emulex FCP_ERR 0xD3
# - 05/07/2009 - bwh - Many new QLogic FCP_ERRs; QLogic FCA_ERR 0x30
# - 05/20/2009 - bwh - Emulex FCP_ERR 0x26; QLogic FCA_ERR 0x4A;
# Quiet complaint about substitution in regex
# - 06/09/2009 - bwh - QLogic FCA_ERRs 0x1E, 0x34
# - 06/12/2009 - bwh - FSCSI_ERR 0x73
# - 06/16/2009 - bwh - Emulex FCP_ERR 0x4A, 0xC0; FCS_ERR 0x1B, 0x24 & be
# explicit about Unknown error numbers;
# Emulex FCA_ERR 0x52, 0x38
# - 06/30/2009 - bwh - QLogic FCA_ERR 0x16, 0x39, 0x3A
# - 07/01/2009 - bwh - QLogic FCA_ERR 0x23, 0x105; QLogic FCP_ERR 0x40
# - 08/10/2009 - bwh - Fix Emulex FCA_ERR 0xD301
# - 08/11/2009 - bwh - QLogic FCP_ERR 0x17, 0x48
# - 08/14/2009 - bwh - QLogic FCA_ERR 0x29;
# QLogic FCP_ERR 0x6C, 0xA5, 0xAC, 0xAD, 0xAF, 0xB8
# - 08/20/2009 - bwh - Emulex FCP_ERR 0x4F, 0xAA, 0xB01; QLogic FCP_ERR 0xAA
# - 08/25/2009 - bwh - QLogic FCA_ERR 0x10, 0x82
# - 09/16/2009 - bwh - Emulex FCA_ERR 0x4C
# - 09/17/2009 - bwh - Emulex FCP_ERR 0x09; QLogic FCA_ERR 0x03
# - 11/11/2009 - bwh - Emulex FCA_ERR 0x17, 0x30, 0x51, 0x53;
# QLogic FCA_ERR 0x6A; QLogic FCP_ERR 0xA2, 0xC3
# - 01/06/2010 - bwh - Emulex FCP_ERR 0xD9
# - 02/05/2010 - bwh - Emulex FSCSI_ERR 0x7; Add Location to VFC_ERR;
# Generalize SDDPCM_* to just SDDPCM and collect path_id;
# Generalize VFC_HOST and VSCSI_HOST to Vxx_HOST;
# Add old & new serial for disk serial mismatch;
# Initial SAS_ERR processing
# - 02/19/2010 - bwh - Handle all 0xAF errors same; include WWPN
# - 02/22/2010 - bwh - Complete ELS listing; QLogic FCP_ERR 0x03, 0xC8
# - 04/26/2010 - bwh - Added Emulex error version 0x11
# - 06/01/2010 - bwh - Emulex FCP_ERR 0x5B2
# - 06/11/2010 - bwh - Emulex FCP_ERR 0xB9
# - 06/15/2010 - bwh - Fix problem w/ strip leading zeros in VFC_HOST
# - 11/15/2010 - rew - QLogic FCP_ERR 0x1, 0x4, 0x1ED; QLogic FCA_ERR 0x27, 0x75
# - 12/10/2010 - rew - Show error numbers for protocol & adapter errors
# - 12/16/2010 - bwh - Include CDB op and failure reason for SC_DISK_ERR7
# path fail. FSCSI_ERR 0xB1 include retry count.
# Emulex FCP_ERR 0x3E, 0xBFF
# - 12/17/2010 - bwh - Emulex FCA_ERR 0x14, 0x29, 0x4B;
# Emulex FCS_ERR 0x3A;
# Emulex FCP_ERR 0x4E, 0xA2, 0x509, 0x525;
# QLogic FCA_ERR 0x4B, 0x75;
# Initial support for SC_DISK_SDDAPPCM_ER;
# Fixed Emulex FCA_ERR 0x21 for V11 errlog;
# Improved argument handling; print errnums w/ '-e';
# Improved VFC_ERR parsing;
# Fixed Emulex FSCSI_ERR 0xD9
# - 12/20/2010 - bwh - Emulex FCS_ERR 0xC4; QLogic FCA_ERR 0x0E;
# QLogic FCP_ERR 0xE5; Minor cleanups;
# Fix QLogic FCP_ERR 0xA2, Emulex FCS_ERR 0x41;
# Initial support for DMPCHK_NOSPACE, DUMP_STATS,
# FIRMWARE_EVENT, INIT_RAPID, LVM_GS_RLEAVE, SRC_RSTRT,
# SRC_TRYX
# - 12/21/2010 - bwh - Improve FIRMWARE_EVENT, Emulex FCP_ERR 0xBFF,
# Emulex FCA_ERR 0x27, QLogic FCA_ERR 0x1E;
# Initial support for DMPCHK_LDMPFSFULL, DMPCHK_TOOSMALL,
# DSI_*, SISSAS_*, SH_LOST_IO;
# Sort per-error decoders; Gather only last SENSE DATA;
# SIS SAS IOASC 01080000, 04050000, 066B9100, 066B9200;
# Generalize handling of SRC_* errors;
# QLogic FCP_ERR 0x07, 0x6A
# - 01/25/2011 - bwh - QLogic FCA_ERR 0x49
# - 03/19/2012 - bwh - Initial Emulex SLI-4 driver errors
# - 03/21/2012 - bwh - Emulex SLI-4 FCA errors 0x158, 0x178, 0x300, 0xA20,
# 0xEAB. Initial Emulex SLI-4 FCP error handling.
# - 03/22/2012 - bwh - Emulex SLI-4 FCA error 0x140, 0x62A, 0xDB8, 0xC9C
# - 04/16/2012 - bwh - Emulex SLI-4 FCA error 0x12C, 0x809
# - 04/27/2012 - bwh - Emulex SLI-4 FCA error 0x168, 0x23C, 0x403, 0x405,
# 0x470, 0x60C, 0x80F, 0x827, 0xA30, 0xA50, 0xA80, 0xC1C,
# 0xE22, 0xE23, 0xE27, 0xE2A, 0xE36, 0xE42, 0xE48, 0xE54,
# 0xEAF; Initial support for LDMP_COMPLETE
# - 05/04/2012 - bwh - Initial support for LDMP_PASSTIME;
# Emulex SLI-4 FCA error 0xC28, 0xE62, 0xE66
# - 05/07/2012 - bwh - Emulex SLI-4 FCP error 0x48, 0x61, 0xA5, 0xAC, 0xAF,
# 0x326, 0x327, 0x328, 0x403;
# Emulex SLI-4 FCA error 0x104, 0x624, 0x67B, 0x80E,
# 0x833, 0x958;
# Update Emulex SLI-4 FCA error 0x80F, 0xA20;
# Emulex SLI-3 FCP error 0x403
# - 06/15/2012 - bwh - Pulled in Marcus' changes for Emulex SLI-4 FCA error
# 0xE45 and 0xE4F;
# Emulex SLI-4 FCA error 0x621, 0x928, 0xA60, 0xC26,
# 0xDB0, 0xE2D;
# Emulex SLI-4 FCP error 0x7, 0x30, 0xB8, 0xA3, 0x402
# - 06/21/2012 - bwh - Emulex SLI-4 FCA error 0xA48, 0xE63
# Emulex SLI-4 FCP error 0x2A, 0xA1
# Emulex SLI-3 FCP error 0xBD
# - 06/27/2012 - bwh - Emulex SLI-4 FCA error 0x170, 0xC48
# Emulex SLI-4 FCP error 0x6A
# - 07/05/2012 - bwh - Emulex SLI-4 FCA error 0xC4C
# Emulex SLI-4 FCP error 0x36
# - 07/09/2012 - bwh - Emulex SLI-4 FCA error 0x812
# Emulex SLI-4 FCP error 0x71
# - 07/10/2012 - bwh - Emulex SLI-4 FCA error 0x530, 0x68A, 0x81B, 0x88D,
# 0xBA8, 0xE57
# - 07/10/2012 - bwh - Emulex SLI-4 FCA error 0x530, 0x68A, 0x81B, 0x88D,
# - 07/25/2012 - bwh - Emulex SLI-4 FCA error 0xDC8, 0xE6C
# Emulex SLI-4 FCP error 0x2E, 0x302
# - 08/14/2012 - bwh - Emulex SLI-4 FCA error 0x410, 0x460, 0x550
# Emulex SLI-4 FCP error 0xAC (improved)
# Emulex SLI-3 FCA error 0x26
# Emulex SLI-3 FCP error 0xC8
# Initial support for LDMP_DUMPERR
# - 08/15/2012 - bwh - QLogic FCA error 0x2B
# Emulex SLI-4 FCP error 0xC8, 0x330
# Initial support for KERNEL_ABEND
# - 08/21/2012 - bwh - Emulex SLI-4 FCA error 0x402, 0x812 (improved),
# 0x81B (improved), 0x84B, 0xC1B, 0xCD0
# - 08/22/2012 - mg - Emulex SLI-4 FCA error 0x6C8 (link recovery),
# 0xE4F (improved)
# - 08/23/2012 - mg - Emulex SLI-4 FCA error 0xC04, 0x68A (improved)
# - 08/24/2012 - bwh - Emulex SLI-4 FCA error 0x160, 0x6C8 (mark INFO)
# - 08/27/2012 - bwh - Emulex SLI-4 FCA error 0x4B0, 0xAB4, 0xABC, 0xCDA, 0xEB0
# Emulex SLI-4 FCP error 0xB
# - 08/29/2012 - bwh - Emulex SLI-4 FCP error 0x4A
# Emulex SLI-3 FCP error 0x3
# - 09/04/2012 - bwh - Emulex SLI-4 FCA error 0x250, 0xB08, 0xDC4, 0xE64, 0xEB4
# Emulex SLI-4 FCP error 0x1, 0x28, 0x2c, 0x49,
# 0x70, 0x277
# - 09/07/2012 - bwh - Emulex SLI-4 FCA error 0xDA0, 0xE66 (improve), 0xE79,
# 0xEB4 (improve)
# - 09/13/2012 - bwh - Emulex SLI-4 FCA error 0x612
# - 09/14/2012 - bwh - Emulex SLI-4 FCP error 0x323
# - 09/19/2012 - bwh - Emulex SLI-4 FCA error 0x4A1, 0xE25, 0xEAB (improve),
# 0xEC4, 0xECC, 0xED0
# - 09/20/2012 - bwh - Emulex SLI-4 FCA error 0xEC6, 0xECE
# - 09/24/2012 - bwh - Emulex SLI-4 FCP error 0x1B8
# Emulex SLI-4 FCA error 0x402 (defunct), 0x405 (defunct)
# - 10/02/2012 - bwh - Initial support for Emulex SLI-4 FCP Version 1 layout
# - 10/04/2012 - bwh - Emulex SLI-4 FCA error 0xAB8, 0xEC2
# Emulex SLI-4 FCP V1 errors 0x402 (improve),
# 0x403 (improve)
# - 10/09/2012 - bwh - Emulex SLI-4 FCP errors - fix version retrieval
# - 10/10/2012 - mg - Emulex SLI-4 FCP error 0xAA (improve)
# - 10/10/2012 - bwh - Emulex SLI-4 FCP V0 error 0x402 (improve),
# 0x403 (improve both)
# Emulex SLI-3 FCP error 0x402, 0x403 (improve)
# - 10/10/2012 - lm - Emulex SLI-3 FCA error 0x7, 0x19, 0x1F, 0x2E, 0x121,
# 0xD04; QLogic FCA error 0x114; Emulex SLI-3 FCP error
# 0x4, 0x1F, 0x71, 0xD3 (improve), 0xE2, 0x326;
# QLogic FCP error 0x2E, 0xD3; FSCSI_ERR 0xD3
# - 10/15/2012 - bwh - Emulex SLI-4 FCA error 0xE14, 0xE15
# Emulex SLI-4 FCP v0 error 0xA30
# Emulex SLI-4 FCP v1 error 0x26, 0x4F, 0x277 (fix),
# 0x279, 0xA30
# - 10/16/2012 - bwh - Emulex SLI-4 FCP v1 error 0x7A
# - 10/25/2012 - bwh - Emulex SLI-4 FCP v1 error 0xA2
# - 10/30/2012 - bwh - Emulex SLI-4 FCA error 0xCD6, 0xEC8, and fix ordering
# - 11/14/2012 - bwh - Initial VFC_CLIENT_FAILURE decoding
# - 11/19/2012 - bwh - Emulex SLI-3 FCP error 0x25, 0x226;
# QLogic FCP error 0x6D, 0x6F, 0x402, 0x403;
# QLogic FCA error 0x3E, 0x72;
# Improved handling of some SC_DISK_PCM_ERRx
# - 11/20/2012 - bwh - Emulex SLI-4 FCA error 0xA00, 0xEAE, 0xECA
# - 12/12/2012 - bwh - Emulex SLI-4 FCP v1 error 0x3, 0x4, 0x228, remove FIXME
# from 0x1
# - 12/17/2012 - bwh - Emulex SLI-4 FCA error 0x690
# - 01/16/2013 - bwh - Emulex SLI-4 FCA error 0x6C6
# - 02/18/2013 - bwh - QLogic FCP error 0x47; QLogic FCA_ERR 0x107
# - 02/27/2013 - bwh - Emulex SLI-4 FCP error 0x150 - 0x159
# - 02/28/2013 - bwh - Emulex SLI-4 FCP renumber 0x150 - 0x15B
# - 03/13/2013 - bwh - Emulex SLI-3 FCP error 0x150 - 0x15B
# - 03/25/2013 - bwh - QLogic FCP error 0x150 - 0x15B
# - 04/03/2013 - bwh - Emulex SLI-4 FCP error 0x25
# - 08/08/2013 - bwh - QLogic FCP error 0x30, 0x71, 0xA3
# - 08/14/2013 - mg - QLogic FCA error 0x50, 0x94, 0x306
# update to QLogic FCP error 0xA3
# - 08/19/2013 - gsd - Add support for SC_DISK_PPRC_ERRx
# - 08/30/2013 - bwh - Emulex SLI-3 FCA error 0xBB
# Emulex SLI-3 FCP error 0x31, 0x32, 0x33, 0x38, 0x48, 0x61
# Emulex SLI-4 FCP error 0x22
# Emulex SLI-4 FCA error 0xAD0
use strict;
#
# We use several lookup tables for common translations (errno names,
# SCSI opcodes, etc). To keep the code clean we'll declare them all
# global and initialize them up front.
#
my %aix_d_map_list_rc_lt;
my %aix_errno_lt;
my %aix_rdac_stat_lt;
my %aix_s2_adap_stat_lt;
my %aix_s3_adap_stat_lt;
my %aix_scdisk_stat_lt;
my %scsi_sbcop_lt;
my %scsi_sscop_lt;
my %scsi_status_lt;
my %scsi_skey_lt;
my %scsi_ascq_lt;
my %fc_payload_op_lt;
my %fc_nsrjt_lt;
my %fc_lsrjt_rc_lt;
my %fc_lsrjt_re_lt;
my %fcp_rsp_code_lt;
my %plat_eeh_err_lt;
&initialize_lookup_tables();
#
# Check for commandline options:
#
# -s Include sequence numbers in each line's header. Useful for
# re-sorting errors from an error log recovered with 'errlog_recover'.
#
# -e Include FC driver error numbers for each error.
#
#
# Setting STANDARD_HELP_VERSION causes processing to stop immediately
# if --help is specified. (Without that "summ --help" would print the
# help message then wait for data on stdin.)
#
use Getopt::Std;
$Getopt::Std::STANDARD_HELP_VERSION = 1;
my %opts;
my $SEQNO = 0;
my $ERRNUMS = 0;
getopts('se', \%opts);
$SEQNO = 1 if defined $opts{'s'};
$ERRNUMS = 1 if defined $opts{'e'};
#
# Read each error into an array then decode it.
#
# We assume that each error entry starts with the "LABEL:" line and ends
# with a line of dashes ("---"). The last entry may (will) not be followed
# by a line of dashes so we may need one extra decode call at EOF.
#
#
my @error;
my $need_decode = 0;
while (<>)
{
if (/^LABEL:/)
{
undef @error;
$need_decode = 1;
}
elsif (/^----------------/)
{
# First is often dashes--not ready to decode then.
if ($need_decode)
{
&decode(@error);
}
$need_decode = 0;
}
$error[$#error + 1] = $_;
}
if ($need_decode)
{
&decode(@error);
}
exit 0;
#######################################################################
##
# Main dispatcher and header routines
#
# The dispatcher routine prints a header that's common for all
# errors then calls out a specific decoder to further summarize
# the error.
#
# Then individual decoders are given a copy of the complete error
# and are expected to _print_ (to stdout) a one-line string that
# summarizes the error. The printed strings need not start with
# any spaces and should not include a newline.
##
#######################################################################
#
# decode - The main dispatcher routine. Print the header for the
# error then call out an appropriate decoder based on the error's
# LABEL:
#
sub decode
{
my @error = @_;
#
# Print a line "header" that's common to any error. print_header
# will not emit a newline--that will be the responsibility of the
# individual decoders below.
#
&print_header(@error);
my $label = "";
for (my $i = 0; $i <= $#error; $i++)
{
my @f;
if ($error[$i] =~ /^LABEL:/)
{
@f = split /\s+/, $error[$i];
$label = $f[1];
last;
}
}
if ($label =~ /^CORE_DUMP/)
{
&CORE_DUMP(@error)
}
elsif ($label =~ /^DISK_ERR/)
{
&DISK_ERR(@error)
}
elsif ($label =~ /^DMA_ERR/)
{
&DMA_ERR(@error)
}
elsif ($label =~ /^DMPCHK_LDMPFSFULL/)
{
&DMPCHK_LDMPFSFULL(@error)
}
elsif ($label =~ /^DMPCHK_NOSPACE/)
{
&DMPCHK_NOSPACE(@error)
}
elsif ($label =~ /^DMPCHK_TOOSMALL/)
{
&DMPCHK_TOOSMALL(@error)
}
elsif ($label =~ /^DUMP_STATS/)
{
&DUMP_STATS(@error)
}
elsif ($label =~ /^DSI_/)
{
&DSI_general(@error)
}
elsif ($label =~ /^EEH_ERR/)
{
&EEH_ERR(@error)
}
elsif ($label =~ /^FCA_ERR/)
{
&FCA_ERR(@error);
}
elsif ($label =~ /^FCP_ARRAY_ERR/)
{
&SC_DISK_ERR(@error);
}
elsif ($label =~ /^FCP_ERR/)
{
&FCP_ERR(@error);
}
elsif ($label =~ /^FCS_ERR/)
{
&FCS_ERR(@error);
}
elsif ($label =~ /^FIRMWARE_EVENT/)
{
&FIRMWARE_EVENT(@error);
}
elsif ($label =~ /^FSCSI_ERR/)
{
&FSCSI_ERR(@error);
}
elsif ($label =~ /^INIT_RAPID/)
{
&INIT_RAPID(@error)
}
elsif ($label =~ /^ISCSISW_ERR/)
{
&ISCSISW_ERR(@error)
}
elsif ($label =~ /^JFS_/)
{
&JFS_general(@error)
}
elsif ($label =~ /^J2_/)
{
&JFS_general(@error)
}
elsif ($label =~ /^KERNEL_ABEND/)
{
&KERNEL_ABEND(@error)
}
elsif ($label =~ /^LDMP_COMPLETE/)
{
&LDMP_COMPLETE(@error)
}
elsif ($label =~ /^LDMP_DUMPERR/)
{
&LDMP_DUMPERR(@error)
}
elsif ($label =~ /^LDMP_PASSTIME/)
{
&LDMP_PASSTIME(@error)
}
elsif ($label =~ /^LOST_EVENTS/)
{
&LOST_EVENTS(@error)
}
elsif ($label =~ /^LVM_GS_RLEAVE/)
{
&LVM_GS_RLEAVE(@error)
}
elsif ($label =~ /^LVM_/)
{
&LVM_ERR(@error)
}
elsif ($label =~ /^OPMSG/)
{
&OPMSG(@error)
}
elsif ($label =~ /^PCI_/)
{
&PCI_err(@error)
}
elsif ($label =~ /^SAS_ERR/)
{
&SAS_ERR(@error);
}
elsif ($label =~ /^SC_DISK_ERR/)
{
&SC_DISK_ERR(@error);
}
elsif ($label =~ /^SC_DISK_PCM_ERR/)
{
&SC_DISK_ERR(@error);
}
elsif ($label =~ /^SC_DISK_PPRC_ERR/)
{
&SC_DISK_PPRC_ERR(@error);
}
elsif ($label =~ /^SC_DISK_SDDAPPCM_ER/)
{
&SC_DISK_ERR(@error);
}
elsif ($label =~ /^SC_TAPE_ERR/)
{
&SC_TAPE_ERR(@error);
}
elsif ($label =~ /^SDDPCM/)
{
&SDDPCM(@error);
}
elsif ($label =~ /^SH_LOST_IO/)
{
&SH_LOST_IO(@error);
}
elsif ($label =~ /^SISSAS_/)
{
&SAS_ERR_SIS_proto(@error);
}
elsif ($label =~ /^SRC_/)
{
&SRC_general(@error);
}
elsif ($label =~ /^TAPE_ERR/)
{
&TAPE_ERR(@error);
}
elsif ($label =~ /^VFC_CLIENT_FAILURE/)
{
&VFC_CLIENT_FAILURE(@error);
}
elsif ($label =~ /^VFC_ERR/)
{
&VFC_ERR(@error);
}
elsif ($label =~ /^VFC_HOST/)
{
&Vxx_HOST(@error);
}
elsif ($label =~ /^VSCSI_HOST/)
{
&Vxx_HOST(@error);
}
else
{
# Unknown error label--no decoder.
}
printf("\n");
return;
}
#
# print_header - Prints a common header for any error, including things
# like the date/time, label, resource, and type. E.g.:
#
# An error with the following header would produce the header shown below.
#
# ---------------------------------------------------------------------------
# LABEL: FSCSI_ERR6
# IDENTIFIER: B8FBD189
#
# Date/Time: Mon Aug 4 08:24:20 2008
# Sequence Number: 76736
# Machine Id: 00C252B04C00
# Node Id: tsm00p20
# Class: S
# Type: TEMP
# Resource Name: fscsi3
# ---------------------------------------------------------------------------
#
# Aug 4 08:24:20 fscsi3 T FSCSI_ERR6
#
# -or, if the '-s' flag was used
#
# 76736 Aug 4 08:24:20 fscsi3 T FSCSI_ERR6
#
sub print_header
{
my @error = @_;
my $label = "";
my $tstamp = "";
my $seqno = 0;
my $etype = "";
my $res = "";
for (my $i = 0; $i <= $#error; $i++)
{
my @f = split /\s+/, $error[$i];
if ($error[$i] =~ /^LABEL:/)
{
$label = defined($f[1]) ? $f[1] : "";
}
elsif ($error[$i] =~ /^Date\/Time:/)
{
# TODO: Not all dates are in US format
$tstamp = sprintf("%s %2d %s", $f[2], $f[3], $f[4]);
}
elsif ($error[$i] =~ /^Sequence Number:/)
{
$seqno = defined($f[2]) ? $f[2] : 0;
}
elsif ($error[$i] =~ /^Type:/)
{
$etype = defined($f[1]) ? substr($f[1], 0, 1) : "?";
}
elsif ($error[$i] =~ /^Resource Name:/)
{
$res = defined($f[2]) ? $f[2] : "(none)";
}
}
if ($SEQNO eq 1)
{
printf("%d %s %-10s %1s %-19s ", $seqno, $tstamp, $res, $etype,
$label);
}
else
{
printf("%s %-10s %1s %-19s ", $tstamp, $res, $etype, $label);
}
return;
}
#######################################################################
##
# Subroutines for common operations
#
# Includes service routines that are be used by several of the
# individual decoders. Things like routines to break apart sense
# data or do simple lookups, etc.
#
# These routines do not produce any output.
#
# Note that some of the retrieval routines may traverse the entire
# error to find the requested information. Callers may wish to cache
# the retrieved information locally, rather than using multiple calls
# to the retrieval function.
#
##
#######################################################################
#############################################
##
# Routines for manipulating hex SENSE DATA
##
#############################################
#
# get_sense_data - Retrieve and return the SENSE DATA section from an
# error entry. Assumes the sense data follows the LAST line starting with
# "SENSE DATA" or "ADDITIONAL HEX DATA" and spans to the end of the error
# entry.
#
# The return is a hexstring (ASCII-encoded hex digits, e.g. "DEADBEEF")
# with no whitespace.
#
# TODO: Note that the returned string may contain non-hex characters if,
# say, other text follows the actual SENSE DATA. Perhaps we should stop
# gathering at the first non-hex digit, or at the first line that contains
# a non-hex digit.
#
sub get_sense_data
{
my @error = @_;
my $sense = "";
#
# Search backwards from the bottom of the error so that we
# find only the last batch of sense data.
#
for (my $i = $#error; $i >= 0; $i--)
{
if (($error[$i] =~ /^SENSE DATA/) ||
($error[$i] =~ /^ADDITIONAL HEX DATA/))
{
# Found the start of the SENSE DATA; grab it all
# then get out.
for (my $j = $i + 1; $j <= $#error; $j++)
{
$sense = $sense . $error[$j];
}
last;
}
}
$sense =~ s/\s+//g;
return $sense;
}
#
# nibbles - Return a hexstring representing one or more nibbles
# retrieved from the input hexstring.
#
# &nibbles("DEADBEEF", 3, 2) returns "DB"
#
sub nibbles
{
my ($hexstr, $offset, $len) = @_;
return substr($hexstr, $offset, $len);
}
#
# bytes - See nibbles. Return one or more bytes (8-bit) from a hexstring.
#
# &bytes("DEADBEEF", 1, 2) returns "ADBE"
#
sub bytes
{
my ($hexstr, $offset, $len) = @_;
return substr($hexstr, $offset * 2, $len * 2);
}
#
# shorts - See nibbles. Return one or more shorts (16-bit) from a hexstring.
#
# &shorts("DEADBEEF", 1, 1) returns "BEEF"
#
sub shorts
{
my ($hexstr, $offset, $len) = @_;
return substr($hexstr, $offset * 4, $len * 4);
}
#
# words - See nibbles. Return one or more words (32-bit) from a hexstring.
#
sub words
{
my ($hexstr, $offset, $len) = @_;
return substr($hexstr, $offset * 8, $len * 8);
}
#
# longs - See nibbles. Return one or more longs (64-bit) from a hexstring.
#
sub longs
{
my ($hexstr, $offset, $len) = @_;
return substr($hexstr, $offset * 16, $len * 16);
}
#
# mask - Given a hexstring and a mask (also expressed as a hexstring),
# apply the mask to the hexstring. If the mask is shorter than the
# source hexstring, the mask is effectively zero-padded to length.
#
# Returns a hexstring the same length as the input string.
#
# &mask("AAAAAAAA", "0707") returns "00000202"
#
sub mask
{
my ($val, $mask) = @_;
my $len = length($val);
return int2hex(hex($val) & hex($mask), $len);
}
#
# int2hex - Given an int value and a length, converts the int value
# to a hexstring of _at least_ the requested length, padding with zeros
# as necessary.
#
# Returns the hexstring representing the value.
#
# &int2hex(255, 4) returns "00FF"
#
sub int2hex
{
my ($num, $digits) = @_;
my $hex = "";
my $len = 0;
while (($num > 0) || ($len < $digits))
{
$hex = substr("0123456789ABCDEF", ($num % 16), 1) . $hex;
$len++;
$num = int($num / 16);
}
return $hex
}
#
# hex2int - Convert a hexstring to an int.
#
# Returns the value represented by the hexstring
#
# &hex2int("FF") returns 255
#
sub hex2int
{
# TODO: Assumes upper case!
my ($hex) = @_;
my $i;
my $value = 0;
for ($i = 0; $i < length($hex); $i++)
{
my $digval = index("0123456789ABCDEF", substr($hex, $i, 1));
$value = $value * 16 + $digval;
}
return $value;
}
#
# hex2ipaddr - Convert a hexstring to a IP-style address, expressed as
# ASCII-encoded decimal values (one-per-byte) seperated by dots (".").
#
# Returns a string containing the IP-style address.
#
# &hex2ipaddr("C0A80001") returns "192.168.0.1"
#
sub hex2ipaddr
{
my ($hex) = @_;
my $i;
my $num_octets = length($hex)/2;
my $addr = "";
for ($i = 0; $i < $num_octets; $i++)
{
if ($i != 0)
{
$addr .= ".";
}
$addr .= hex(&bytes($hex, $i, 2));
}
return $addr;
}
#
# byte_reverse - Reverse the byte order of a hexstring.
#
# Returns a hexstring with bytes reversed.
#
# &byte_reverse("DEADBEEF") returns "EFBEADDE"
#
sub byte_reverse
{
my ($hexstr) = @_;
my $reversed = "";
my $bytenum = (length($hexstr) / 2) - 1;
while ($bytenum >= 0)
{
$reversed .= &bytes($hexstr, $bytenum--, 1);
}
return $reversed;
}
#############################################
##
# Routines for simple lookups
##
#############################################
#
# lookup - Perform a hash table lookup.
#
# Given a prefix-string, a key, and a reference to a hash, retrieves
# the key's value in the hash.
#
# Returns:
#
# - Hash value if the key is present in the hash
# &lookup("Opcode ", "2A", \%sbc_opcodes) returns "WRITE(10)"
#
# - String consisting of the prefix-string and the key value if the
# key is not present in the hash (note no whitespace is inserted
# between the prefix and the key):
# &lookup("Opcode ", "FF", \%sbc_opcodes) returns "Opcode FF"
#
sub lookup
{
my ($decoration, $key, $hashref) = @_;
return exists $hashref->{$key} ? $hashref->{$key} : "$decoration$key";
}
#############################################
##
# Routines to retrieve specific fields from
# the error
##
#############################################
#
# get_description - Retrieve and return the text in the Description field.
#
sub get_description
{
my @error = @_;
my $description = "";
#
# Search error for the description
#
for (my $i = 0; $i < $#error; $i++)
{
if ($error[$i] =~ /^Description/)
{
# Found the start of the Description. grab it
# and get out.
$description = $error[$i+1];
last;
}
}
$description =~ s/\s+$//;
return $description;
}
#
# get_group_name - Retrieve and return the group name from PPRC errors
#
sub get_group_name
{
my @error = @_;
my $group_name = "";
#
# Search backwards from the bottom of the error so that we
# find only the last batch of sense data.
#
for (my $i = $#error; $i >= 0; $i--)
{
if ($error[$i] =~ /^GROUP NAME/)
{
# Found the start of the Group Name; grab it
# then get out.
$group_name = $error[$i+1];
last;
}
}
$group_name =~ s/\s+//g;
return $group_name;
}
#
# get_label - Get the label field from the error.
#
# Returns a string containing the label or "(unknown)" if the label
# could not be found.
#
# If the error contains:
#
# LABEL: SC_DISK_ERR4
#
# &get_label() returns "SC_DISK_ERR4"
#
sub get_label
{
my @error = @_;
my $label = "(unknown)";
for (my $i = 0; $i < $#error; $i++)
{
if ($error[$i] =~ /^LABEL:/)
{
my @f = split /\s+/, $error[$i];
$label = $f[1];
last;
}
}
return $label;