• Home
  • Raw
  • Download

Lines Matching refs:self

24     def __init__(self, line='<line not provided>', reader=None):  argument
26 BaseException.__init__(self,
30 BaseException.__init__(self, 'Error parsing line: %s' % line)
40 def __init__(self, proto='', desc='', ret=''): argument
41 self.proto = proto
42 self.desc = desc
43 self.ret = ret
53 def __init__(self, *args, **kwargs): argument
55 self.enum_val = None
57 def proto_break_down(self): argument
66 capture = proto_re.match(self.proto)
92 def __init__(self, filename): argument
93 self.reader = open(filename, 'r')
94 self.line = ''
95 self.helpers = []
96 self.commands = []
97 self.desc_unique_helpers = set()
98 self.define_unique_helpers = []
99 self.helper_enum_vals = {}
100 self.helper_enum_pos = {}
101 self.desc_syscalls = []
102 self.enum_syscalls = []
104 def parse_element(self): argument
105 proto = self.parse_symbol()
106 desc = self.parse_desc(proto)
107 ret = self.parse_ret(proto)
110 def parse_helper(self): argument
111 proto = self.parse_proto()
112 desc = self.parse_desc(proto)
113 ret = self.parse_ret(proto)
116 def parse_symbol(self): argument
118 capture = p.match(self.line)
122 end = end_re.match(self.line)
125 self.line = self.reader.readline()
128 def parse_proto(self): argument
137 capture = p.match(self.line)
140 self.line = self.reader.readline()
143 def parse_desc(self, proto): argument
145 capture = p.match(self.line)
153 self.line = self.reader.readline()
154 if self.line == ' *\n':
158 capture = p.match(self.line)
169 def parse_ret(self, proto): argument
171 capture = p.match(self.line)
179 self.line = self.reader.readline()
180 if self.line == ' *\n':
184 capture = p.match(self.line)
195 def seek_to(self, target, help_message, discard_lines = 1): argument
196 self.reader.seek(0)
197 offset = self.reader.read().find(target)
200 self.reader.seek(offset)
201 self.reader.readline()
203 self.reader.readline()
204 self.line = self.reader.readline()
206 def parse_desc_syscall(self): argument
207 self.seek_to('* DOC: eBPF Syscall Commands',
211 command = self.parse_element()
212 self.commands.append(command)
213 self.desc_syscalls.append(command.proto)
218 def parse_enum_syscall(self): argument
219 self.seek_to('enum bpf_cmd {',
230 capture = assign_p.match(self.line)
233 self.line = self.reader.readline()
235 capture = bpf_p.match(self.line)
237 bpf_cmd_str += self.line
240 self.line = self.reader.readline()
242 self.enum_syscalls = re.findall(r'(BPF\w+)+', bpf_cmd_str)
244 def parse_desc_helpers(self): argument
245 self.seek_to(helpersDocStart,
249 helper = self.parse_helper()
250 self.helpers.append(helper)
252 self.desc_unique_helpers.add(proto['name'])
256 def parse_define_helpers(self): argument
263 self.seek_to('#define ___BPF_FUNC_MAPPER(FN, ctx...)',
270 capture = p.match(self.line)
272 fn_defines_str += self.line
274 self.helper_enum_vals[helper_name] = int(capture.group(2))
275 self.helper_enum_pos[helper_name] = i
279 self.line = self.reader.readline()
281 self.define_unique_helpers = re.findall(r'FN\(\w+, \d+, ##ctx\)', fn_defines_str)
283 def validate_helpers(self): argument
288 for helper in self.helpers:
292 enum_val = self.helper_enum_vals[name]
293 enum_pos = self.helper_enum_pos[name]
316 def run(self): argument
317 self.parse_desc_syscall()
318 self.parse_enum_syscall()
319 self.parse_desc_helpers()
320 self.parse_define_helpers()
321 self.validate_helpers()
322 self.reader.close()
332 def __init__(self, parser): argument
333 self.parser = parser
334 self.elements = []
336 def print_header(self): argument
339 def print_footer(self): argument
342 def print_one(self, helper): argument
345 def print_all(self): argument
346 self.print_header()
347 for elem in self.elements:
348 self.print_one(elem)
349 self.print_footer()
351 def elem_number_check(self, desc_unique_elem, define_unique_elem, type, instance): argument
378 def __init__(self, parser): argument
379 self.parser = parser
381 def print_license(self): argument
395 def print_elem(self, elem): argument
410 def get_kernel_version(self): argument
424 def get_last_doc_update(self, delimiter): argument
442 def __init__(self, parser): argument
443 self.elements = parser.helpers
444self.elem_number_check(parser.desc_unique_helpers, parser.define_unique_helpers, 'helper', '___BPF…
446 def print_header(self): argument
490 kernelVersion = self.get_kernel_version()
491 lastUpdate = self.get_last_doc_update(helpersDocStart)
493 PrinterRST.print_license(self)
498 def print_footer(self): argument
584 def print_proto(self, helper): argument
610 def print_one(self, helper): argument
611 self.print_proto(helper)
612 self.print_elem(helper)
623 def __init__(self, parser): argument
624 self.elements = parser.commands
625 self.elem_number_check(parser.desc_syscalls, parser.enum_syscalls, 'syscall', 'bpf_cmd')
627 def print_header(self): argument
641 PrinterRST.print_license(self)
644 def print_one(self, command): argument
646 self.print_elem(command)
655 def __init__(self, parser): argument
656 self.elements = parser.helpers
657self.elem_number_check(parser.desc_unique_helpers, parser.define_unique_helpers, 'helper', '___BPF…
781 def print_header(self): argument
788 for fwd in self.type_fwds:
792 def print_footer(self): argument
796 def map_type(self, t): argument
797 if t in self.known_types:
799 if t in self.mapped_types:
800 return self.mapped_types[t]
807 def print_one(self, helper): argument
810 if proto['name'] in self.seen_helpers:
812 self.seen_helpers.add(proto['name'])
830 print('static %s %s(*%s)(' % (self.map_type(proto['ret_type']),
836 if proto['name'] in self.overloaded_helpers and i == 0:
839 one_arg = '{}{}'.format(comma, self.map_type(t))