• Home
  • Raw
  • Download

Lines Matching +full:self +full:- +full:working

2 # SPDX-License-Identifier: GPL-2.0-only
4 # Copyright (C) 2018-2019 Netronome Systems, Inc.
17 def __init__(self, line='<line not provided>', reader=None): argument
19 BaseException.__init__(self,
23 BaseException.__init__(self, 'Error parsing line: %s' % line)
32 def __init__(self, proto='', desc='', ret=''): argument
33 self.proto = proto
34 self.desc = desc
35 self.ret = ret
37 def proto_break_down(self): argument
46 capture = proto_re.match(self.proto)
67 stored as Helper object, in the self.helpers() array.
71 def __init__(self, filename): argument
72 self.reader = open(filename, 'r')
73 self.line = ''
74 self.helpers = []
76 def parse_helper(self): argument
77 proto = self.parse_proto()
78 desc = self.parse_desc()
79 ret = self.parse_ret()
82 def parse_proto(self): argument
84 # - "void"
85 # - "type name"
86 # - "type *name"
87 # - Same as above, with "const" and/or "struct" in front of type
88 # - "..." (undefined number of arguments, for bpf_trace_printk())
91 capture = p.match(self.line)
94 self.line = self.reader.readline()
97 def parse_desc(self): argument
99 capture = p.match(self.line)
108 self.line = self.reader.readline()
109 if self.line == ' *\n':
113 capture = p.match(self.line)
120 def parse_ret(self): argument
122 capture = p.match(self.line)
131 self.line = self.reader.readline()
132 if self.line == ' *\n':
136 capture = p.match(self.line)
143 def run(self): argument
145 offset = self.reader.read().find('* Start of BPF helper function descriptions:')
146 if offset == -1:
148 self.reader.seek(offset)
149 self.reader.readline()
150 self.reader.readline()
151 self.line = self.reader.readline()
155 helper = self.parse_helper()
156 self.helpers.append(helper)
160 self.reader.close()
170 def __init__(self, helpers): argument
171 self.helpers = helpers
173 def print_header(self): argument
176 def print_footer(self): argument
179 def print_one(self, helper): argument
182 def print_all(self): argument
183 self.print_header()
184 for helper in self.helpers:
185 self.print_one(helper)
186 self.print_footer()
195 def print_header(self): argument
211 .. manual page may be incorrect or out-of-date. The author(s) assume no
215 .. which is licensed free of charge, as they might when working
228 BPF-HELPERS
230 -------------------------------------------------------------------------------
232 -------------------------------------------------------------------------------
240 written in a pseudo-assembly language, then attached to one of the several
244 These functions are restricted to a white-list of helpers defined in the
257 without requiring any foreign-function interface. As a result, calling helpers
269 def print_footer(self): argument
302 But as of this writing, the BPF sub-system is under heavy development. New eBPF
305 the efforts of the community, this page might not be up-to-date. If you want to
313 * *net/core/filter.c* contains the definition of most network-related helper
315 * *kernel/trace/bpf_trace.c* is the equivalent for most tracing program-related
324 **bpftool-feature**\ (8) for details). Add the **unprivileged** keyword to
352 **tc-bpf**\ (8)'''
355 def print_proto(self, helper): argument
381 def print_one(self, helper): argument
382 self.print_proto(helper)
504 def print_header(self): argument
506 /* This is auto-generated file. See bpf_helpers_doc.py for details. */
511 for fwd in self.type_fwds:
515 def print_footer(self): argument
519 def map_type(self, t): argument
520 if t in self.known_types:
522 if t in self.mapped_types:
523 return self.mapped_types[t]
530 def print_one(self, helper): argument
533 if proto['name'] in self.seen_helpers:
535 self.seen_helpers.add(proto['name'])
553 print('static %s %s(*%s)(' % (self.map_type(proto['ret_type']),
559 if proto['name'] in self.overloaded_helpers and i == 0:
562 one_arg = '{}{}'.format(comma, self.map_type(t))
572 print(') = (void *) %d;' % len(self.seen_helpers))
579 # otherwise the --filename argument will be required from the command line.
586 The RST-formatted output produced can be turned into a manual page with the
589 argParser.add_argument('--header', action='store_true',
592 argParser.add_argument('--filename', help='path to include/uapi/linux/bpf.h',
595 argParser.add_argument('--filename', help='path to include/uapi/linux/bpf.h')