@@ -37,38 +37,38 @@ def is_vmlinux_enum(self, name):
3737 """Check if name is a vmlinux enum constant"""
3838 return (
3939 name in self .vmlinux_symtab
40- and self .vmlinux_symtab [name ][ " value_type" ] == AssignmentType .CONSTANT
40+ and self .vmlinux_symtab [name ]. value_type == AssignmentType .CONSTANT
4141 )
4242
4343 def get_vmlinux_struct_type (self , name ):
4444 """Check if name is a vmlinux struct type"""
4545 if (
4646 name in self .vmlinux_symtab
47- and self .vmlinux_symtab [name ][ " value_type" ] == AssignmentType .STRUCT
47+ and self .vmlinux_symtab [name ]. value_type == AssignmentType .STRUCT
4848 ):
49- return self .vmlinux_symtab [name ][ " python_type" ]
49+ return self .vmlinux_symtab [name ]. python_type
5050 else :
5151 raise ValueError (f"{ name } is not a vmlinux struct type" )
5252
5353 def is_vmlinux_struct (self , name ):
5454 """Check if name is a vmlinux struct"""
5555 return (
5656 name in self .vmlinux_symtab
57- and self .vmlinux_symtab [name ][ " value_type" ] == AssignmentType .STRUCT
57+ and self .vmlinux_symtab [name ]. value_type == AssignmentType .STRUCT
5858 )
5959
6060 def handle_vmlinux_enum (self , name ):
6161 """Handle vmlinux enum constants by returning LLVM IR constants"""
6262 if self .is_vmlinux_enum (name ):
63- value = self .vmlinux_symtab [name ][ " value" ]
63+ value = self .vmlinux_symtab [name ]. value
6464 logger .info (f"Resolving vmlinux enum { name } = { value } " )
6565 return ir .Constant (ir .IntType (64 ), value ), ir .IntType (64 )
6666 return None
6767
6868 def get_vmlinux_enum_value (self , name ):
6969 """Handle vmlinux enum constants by returning LLVM IR constants"""
7070 if self .is_vmlinux_enum (name ):
71- value = self .vmlinux_symtab [name ][ " value" ]
71+ value = self .vmlinux_symtab [name ]. value
7272 logger .info (f"The value of vmlinux enum { name } = { value } " )
7373 return value
7474 return None
@@ -115,16 +115,16 @@ def handle_vmlinux_struct_field(
115115 def has_field (self , struct_name , field_name ):
116116 """Check if a vmlinux struct has a specific field"""
117117 if self .is_vmlinux_struct (struct_name ):
118- python_type = self .vmlinux_symtab [struct_name ][ " python_type" ]
118+ python_type = self .vmlinux_symtab [struct_name ]. python_type
119119 return hasattr (python_type , field_name )
120120 return False
121121
122122 def get_field_type (self , vmlinux_struct_name , field_name ):
123123 """Get the type of a field in a vmlinux struct"""
124124 if self .is_vmlinux_struct (vmlinux_struct_name ):
125- python_type = self .vmlinux_symtab [vmlinux_struct_name ][ " python_type" ]
125+ python_type = self .vmlinux_symtab [vmlinux_struct_name ]. python_type
126126 if hasattr (python_type , field_name ):
127- return self .vmlinux_symtab [vmlinux_struct_name ][ " members" ] [field_name ]
127+ return self .vmlinux_symtab [vmlinux_struct_name ]. members [field_name ]
128128 else :
129129 raise ValueError (
130130 f"Field { field_name } not found in vmlinux struct { vmlinux_struct_name } "
@@ -135,10 +135,10 @@ def get_field_type(self, vmlinux_struct_name, field_name):
135135 def get_field_index (self , vmlinux_struct_name , field_name ):
136136 """Get the type of a field in a vmlinux struct"""
137137 if self .is_vmlinux_struct (vmlinux_struct_name ):
138- python_type = self .vmlinux_symtab [vmlinux_struct_name ][ " python_type" ]
138+ python_type = self .vmlinux_symtab [vmlinux_struct_name ]. python_type
139139 if hasattr (python_type , field_name ):
140140 return list (
141- self .vmlinux_symtab [vmlinux_struct_name ][ " members" ] .keys ()
141+ self .vmlinux_symtab [vmlinux_struct_name ]. members .keys ()
142142 ).index (field_name )
143143 else :
144144 raise ValueError (
0 commit comments