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)
61 name, distincts arguments.
70 res['name'] = capture.group(3)
79 'name' : capture.group(6)
95 @filename: name of file to parse, usually include/uapi/linux/bpf.h in the
100 self.line = ''
125 capture = p.match(self.line)
129 end = end_re.match(self.line)
132 self.line = self.reader.readline()
137 # - "void"
138 # - "type name"
139 # - "type *name"
140 # - Same as above, with "const" and/or "struct" in front of type
141 # - "..." (undefined number of arguments, for bpf_trace_printk())
144 capture = p.match(self.line)
147 self.line = self.reader.readline()
152 capture = p.match(self.line)
160 self.line = self.reader.readline()
161 if self.line == ' *\n':
165 capture = p.match(self.line)
178 capture = p.match(self.line)
186 self.line = self.reader.readline()
187 if self.line == ' *\n':
191 capture = p.match(self.line)
204 capture = p.match(self.line)
207 # Expect a single line with mnemonics for attributes separated by spaces
208 self.line = self.reader.readline()
210 capture = p.match(self.line)
217 self.line = self.reader.readline()
218 if self.line != ' *\n':
219 raise Exception("Expecting empty line after 'Attributes' section for " + proto)
220 # Prepare a line for next self.parse_* to consume
221 self.line = self.reader.readline()
227 if offset == -1:
233 self.line = self.reader.readline()
259 capture = assign_p.match(self.line)
261 # Skip line if an enum entry is assigned to another entry
262 self.line = self.reader.readline()
264 capture = bpf_p.match(self.line)
266 bpf_cmd_str += self.line
269 self.line = self.reader.readline()
281 self.desc_unique_helpers.add(proto['name'])
289 # Note: seek_to(..) discards the first line below the target search text,
299 capture = p.match(self.line)
301 fn_defines_str += self.line
308 self.line = self.reader.readline()
319 name = proto['name']
321 enum_val = self.helper_enum_vals[name]
322 enum_pos = self.helper_enum_pos[name]
324 raise Exception("Helper %s is missing from enum bpf_func_id" % name)
326 if name in seen_helpers:
327 if last_helper != name:
328 … raise Exception("Helper %s has multiple descriptions which are not grouped together" % name)
334 …der (#%d) must be aligned with its position (#%d) in enum bpf_func_id" % (name, enum_val, i + 1, e…
336 raise Exception("Helper %s has duplicated value %d" % (name, enum_val))
338 seen_helpers.add(name)
339 last_helper = name
415 .. SPDX-License-Identifier: Linux-man-pages-copyleft
428 # a section must be followed by a blank line.
429 for line in re.sub('\n$', '', elem.desc, count=1).split('\n'):
430 print('{}{}'.format('\t\t' if line else '', line))
434 for line in elem.ret.rstrip().split('\n'):
435 print('{}{}'.format('\t\t' if line else '', line))
446 version = subprocess.run(['make', '-s', '--no-print-directory', 'kernelversion'],
455 cmd = ['git', 'log', '-1', '--pretty=format:%cs', '--no-patch',
456 '-L',
478 BPF-HELPERS
480 -------------------------------------------------------------------------------
482 -------------------------------------------------------------------------------
492 written in a pseudo-assembly language, then attached to one of the several
496 These functions are restricted to a white-list of helpers defined in the
509 without requiring any foreign-function interface. As a result, calling helpers
549 generally translates into the C source code of the program containing a line
560 But as of this writing, the BPF sub-system is under heavy development. New eBPF
563 the efforts of the community, this page might not be up-to-date. If you want to
571 * *net/core/filter.c* contains the definition of most network-related helper
573 * *kernel/trace/bpf_trace.c* is the equivalent for most tracing program-related
582 **bpftool-feature**\\ (8) for details). Add the **unprivileged** keyword to
610 **tc-bpf**\\ (8)'''
622 proto['name']),
628 if a['name']:
633 one_arg += '*{}*\\ **'.format(a['name'])
661 -------------------------------------------------------------------------------
663 -------------------------------------------------------------------------------
812 /* This is auto-generated file. See bpf_doc.py for details. */
854 if proto['name'] in self.seen_helpers:
856 self.seen_helpers.add(proto['name'])
859 print(" * %s" % proto['name'])
863 # a section must be followed by a blank line.
864 for line in re.sub('\n$', '', helper.desc, count=1).split('\n'):
865 print(' *{}{}'.format(' \t' if line else '', line))
870 for line in helper.ret.rstrip().split('\n'):
871 print(' *{}{}'.format(' \t' if line else '', line))
878 proto['ret_star'], proto['name']), end='')
882 n = a['name']
883 if proto['name'] in self.overloaded_helpers and i == 0:
902 # ../include/uapi/linux/bpf.h, use it as a default name for the file to parse,
903 # otherwise the --filename argument will be required from the command line.
915 The RST-formatted output produced can be turned into a manual page with the
918 argParser.add_argument('--header', action='store_true',
921 argParser.add_argument('--filename', help='path to include/uapi/linux/bpf.h',
924 argParser.add_argument('--filename', help='path to include/uapi/linux/bpf.h')