Lines Matching +full:line +full:- +full:name

2 # SPDX-License-Identifier: GPL-2.0-only
4 # Copyright (C) 2018-2019 Netronome Systems, Inc.
24 def __init__(self, line='<line not provided>', reader=None): argument
27 'Error at file offset %d, parsing line: %s' %
28 (reader.tell(), line))
30 BaseException.__init__(self, 'Error parsing line: %s' % line)
60 name, distincts arguments.
69 res['name'] = capture.group(3)
78 'name' : capture.group(6)
89 @filename: name of file to parse, usually include/uapi/linux/bpf.h in the
94 self.line = ''
118 capture = p.match(self.line)
122 end = end_re.match(self.line)
125 self.line = self.reader.readline()
130 # - "void"
131 # - "type name"
132 # - "type *name"
133 # - Same as above, with "const" and/or "struct" in front of type
134 # - "..." (undefined number of arguments, for bpf_trace_printk())
137 capture = p.match(self.line)
140 self.line = self.reader.readline()
145 capture = p.match(self.line)
153 self.line = self.reader.readline()
154 if self.line == ' *\n':
158 capture = p.match(self.line)
171 capture = p.match(self.line)
179 self.line = self.reader.readline()
180 if self.line == ' *\n':
184 capture = p.match(self.line)
198 if offset == -1:
204 self.line = self.reader.readline()
230 capture = assign_p.match(self.line)
232 # Skip line if an enum entry is assigned to another entry
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()
252 self.desc_unique_helpers.add(proto['name'])
260 # Note: seek_to(..) discards the first line below the target search text,
270 capture = p.match(self.line)
272 fn_defines_str += self.line
279 self.line = self.reader.readline()
290 name = proto['name']
292 enum_val = self.helper_enum_vals[name]
293 enum_pos = self.helper_enum_pos[name]
295 raise Exception("Helper %s is missing from enum bpf_func_id" % name)
297 if name in seen_helpers:
298 if last_helper != name:
299 … raise Exception("Helper %s has multiple descriptions which are not grouped together" % name)
305 …der (#%d) must be aligned with its position (#%d) in enum bpf_func_id" % (name, enum_val, i + 1, e…
307 raise Exception("Helper %s has duplicated value %d" % (name, enum_val))
309 seen_helpers.add(name)
310 last_helper = name
386 .. SPDX-License-Identifier: Linux-man-pages-copyleft
399 # a section must be followed by a blank line.
400 for line in re.sub('\n$', '', elem.desc, count=1).split('\n'):
401 print('{}{}'.format('\t\t' if line else '', line))
405 for line in elem.ret.rstrip().split('\n'):
406 print('{}{}'.format('\t\t' if line else '', line))
417 version = subprocess.run(['make', '-s', '--no-print-directory', 'kernelversion'],
426 cmd = ['git', 'log', '-1', '--pretty=format:%cs', '--no-patch',
427 '-L',
449 BPF-HELPERS
451 -------------------------------------------------------------------------------
453 -------------------------------------------------------------------------------
463 written in a pseudo-assembly language, then attached to one of the several
467 These functions are restricted to a white-list of helpers defined in the
480 without requiring any foreign-function interface. As a result, calling helpers
520 generally translates into the C source code of the program containing a line
531 But as of this writing, the BPF sub-system is under heavy development. New eBPF
534 the efforts of the community, this page might not be up-to-date. If you want to
542 * *net/core/filter.c* contains the definition of most network-related helper
544 * *kernel/trace/bpf_trace.c* is the equivalent for most tracing program-related
553 **bpftool-feature**\\ (8) for details). Add the **unprivileged** keyword to
581 **tc-bpf**\\ (8)'''
593 proto['name']),
599 if a['name']:
604 one_arg += '*{}*\\ **'.format(a['name'])
632 -------------------------------------------------------------------------------
634 -------------------------------------------------------------------------------
783 /* This is auto-generated file. See bpf_doc.py for details. */
810 if proto['name'] in self.seen_helpers:
812 self.seen_helpers.add(proto['name'])
815 print(" * %s" % proto['name'])
819 # a section must be followed by a blank line.
820 for line in re.sub('\n$', '', helper.desc, count=1).split('\n'):
821 print(' *{}{}'.format(' \t' if line else '', line))
826 for line in helper.ret.rstrip().split('\n'):
827 print(' *{}{}'.format(' \t' if line else '', line))
831 proto['ret_star'], proto['name']), end='')
835 n = a['name']
836 if proto['name'] in self.overloaded_helpers and i == 0:
855 # ../include/uapi/linux/bpf.h, use it as a default name for the file to parse,
856 # otherwise the --filename argument will be required from the command line.
868 The RST-formatted output produced can be turned into a manual page with the
871 argParser.add_argument('--header', action='store_true',
874 argParser.add_argument('--filename', help='path to include/uapi/linux/bpf.h',
877 argParser.add_argument('--filename', help='path to include/uapi/linux/bpf.h')