4 Copyright 2019 Cray Inc. All Rights Reserved
5 Utility to maps numeric opcode to string identifier
8 from pykdump.API import *
11 description_short = "Maps Lustre rpc opcodes string identifiers."
32 20: 'OST_QUOTA_ADJUST_QUNIT', # not used since 2.4
36 34: 'MDS_GETATTR_NAME',
45 43: 'MDS_UNPIN', # obsolete, never used in a release
47 45: 'MDS_DONE_WRITING',
49 47: 'MDS_QUOTACHECK', # not used since 2.4
52 50: 'MDS_SETXATTR', # obsolete, now it's MDS_REINT op
54 52: 'MDS_IS_SUBDIR', # obsolete, never used in a release
56 54: 'MDS_HSM_STATE_GET',
57 55: 'MDS_HSM_STATE_SET',
59 57: 'MDS_HSM_PROGRESS',
60 58: 'MDS_HSM_REQUEST',
61 59: 'MDS_HSM_CT_REGISTER',
62 60: 'MDS_HSM_CT_UNREGISTER',
63 61: 'MDS_SWAP_LAYOUTS',
68 104: 'LDLM_BL_CALLBACK',
69 105: 'LDLM_CP_CALLBACK',
70 106: 'LDLM_GL_CALLBACK',
74 251: 'MGS_DISCONNECT',
75 252: 'MGS_EXCEPTION', # node died, etc.
76 253: 'MGS_TARGET_REG', # whenever target starts up
77 254: 'MGS_TARGET_DEL',
79 256: 'MGS_CONFIG_READ',
82 401: 'OBD_LOG_CANCEL', # obsolete since 1.5
83 402: 'OBD_QC_CALLBACK', # obsolete since 2.4
86 501: 'LLOG_ORIGIN_HANDLE_CREATE',
87 502: 'LLOG_ORIGIN_HANDLE_NEXT_BLOCK',
88 503: 'LLOG_ORIGIN_HANDLE_READ_HEADER',
89 504: 'LLOG_ORIGIN_HANDLE_WRITE_REC', # Obsolete by 2.1.
90 505: 'LLOG_ORIGIN_HANDLE_CLOSE', # Obsolete by 1.8.
91 506: 'LLOG_ORIGIN_CONNECT', # Obsolete by 2.4.
92 507: 'LLOG_CATINFO', # Obsolete by 2.3.
93 508: 'LLOG_ORIGIN_HANDLE_PREV_BLOCK',
94 509: 'LLOG_ORIGIN_HANDLE_DESTROY', # Obsolete by 2.11.
102 802: 'SEC_CTX_INIT_CONT',
110 1101: 'LFSCK_NOTIFY',
114 def translate_opcodes(opc_list):
117 print "o%d \t= %s" % (opc, opcodes[opc])
119 print "o%d \t= unknown" % opc
122 if __name__ == "__main__":
123 description = "Maps one or more Lustre rpc opcodes to its string identifier."
124 parser = argparse.ArgumentParser(description=description)
125 parser.add_argument('opcode', nargs="+", type=int,
126 help="list of one or more opcodes")
128 args = parser.parse_args()
129 translate_opcodes(args.opcode)