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

2 # SPDX-License-Identifier: GPL-2.0-only
4 # Copyright (C) 2018-2019 Netronome Systems, Inc.
25 def __init__(self, line='<line not provided>', reader=None): argument
28 'Error at file offset %d, parsing line: %s' %
29 (reader.tell(), line))
31 BaseException.__init__(self, 'Error parsing line: %s' % line)
69 name, distincts arguments.
78 res['name'] = capture.group(3)
87 'name' : capture.group(6)
109 @filename: name of file to parse, usually include/uapi/linux/bpf.h in the
114 self.line = ''
139 capture = p.match(self.line)
143 end = end_re.match(self.line)
146 self.line = self.reader.readline()
151 # - "void"
152 # - "type name"
153 # - "type *name"
154 # - Same as above, with "const" and/or "struct" in front of type
155 # - "..." (undefined number of arguments, for bpf_trace_printk())
158 capture = p.match(self.line)
161 self.line = self.reader.readline()
166 capture = p.match(self.line)
174 self.line = self.reader.readline()
175 if self.line == ' *\n':
179 capture = p.match(self.line)
192 capture = p.match(self.line)
200 self.line = self.reader.readline()
201 if self.line == ' *\n':
205 capture = p.match(self.line)
218 capture = p.match(self.line)
221 # Expect a single line with mnemonics for attributes separated by spaces
222 self.line = self.reader.readline()
224 capture = p.match(self.line)
231 self.line = self.reader.readline()
232 if self.line != ' *\n':
233 raise Exception("Expecting empty line after 'Attributes' section for " + proto)
234 # Prepare a line for next self.parse_* to consume
235 self.line = self.reader.readline()
241 if offset == -1:
247 self.line = self.reader.readline()
273 capture = assign_p.match(self.line)
275 # Skip line if an enum entry is assigned to another entry
276 self.line = self.reader.readline()
278 capture = bpf_p.match(self.line)
280 bpf_cmd_str += self.line
283 self.line = self.reader.readline()
295 self.desc_unique_helpers.add(proto['name'])
303 # Note: seek_to(..) discards the first line below the target search text,
313 capture = p.match(self.line)
315 fn_defines_str += self.line
322 self.line = self.reader.readline()
333 name = proto['name']
335 enum_val = self.helper_enum_vals[name]
336 enum_pos = self.helper_enum_pos[name]
338 raise Exception("Helper %s is missing from enum bpf_func_id" % name)
340 if name in seen_helpers:
341 if last_helper != name:
342 … raise Exception("Helper %s has multiple descriptions which are not grouped together" % name)
348 …der (#%d) must be aligned with its position (#%d) in enum bpf_func_id" % (name, enum_val, i + 1, e…
350 raise Exception("Helper %s has duplicated value %d" % (name, enum_val))
352 seen_helpers.add(name)
353 last_helper = name
429 .. SPDX-License-Identifier: Linux-man-pages-copyleft
442 # a section must be followed by a blank line.
443 for line in re.sub('\n$', '', elem.desc, count=1).split('\n'):
444 print('{}{}'.format('\t\t' if line else '', line))
448 for line in elem.ret.rstrip().split('\n'):
449 print('{}{}'.format('\t\t' if line else '', line))
460 version = subprocess.run(['make', '-s', '--no-print-directory', 'kernelversion'],
469 cmd = ['git', 'log', '-1', '--pretty=format:%cs', '--no-patch',
470 '-L',
492 BPF-HELPERS
494 -------------------------------------------------------------------------------
496 -------------------------------------------------------------------------------
506 written in a pseudo-assembly language, then attached to one of the several
510 These functions are restricted to a white-list of helpers defined in the
523 without requiring any foreign-function interface. As a result, calling helpers
563 generally translates into the C source code of the program containing a line
574 But as of this writing, the BPF sub-system is under heavy development. New eBPF
577 the efforts of the community, this page might not be up-to-date. If you want to
585 * *net/core/filter.c* contains the definition of most network-related helper
587 * *kernel/trace/bpf_trace.c* is the equivalent for most tracing program-related
596 **bpftool-feature**\\ (8) for details). Add the **unprivileged** keyword to
624 **tc-bpf**\\ (8)'''
636 proto['name']),
642 if a['name']:
647 one_arg += '*{}*\\ **'.format(a['name'])
675 -------------------------------------------------------------------------------
677 -------------------------------------------------------------------------------
827 /* This is auto-generated file. See bpf_doc.py for details. */
869 if proto['name'] in self.seen_helpers:
871 self.seen_helpers.add(proto['name'])
874 print(" * %s" % proto['name'])
878 # a section must be followed by a blank line.
879 for line in re.sub('\n$', '', helper.desc, count=1).split('\n'):
880 print(' *{}{}'.format(' \t' if line else '', line))
885 for line in helper.ret.rstrip().split('\n'):
886 print(' *{}{}'.format(' \t' if line else '', line))
893 proto['ret_star'], proto['name']), end='')
897 n = a['name']
898 if proto['name'] in self.overloaded_helpers and i == 0:
954 # ../include/uapi/linux/bpf.h, use it as a default name for the file to parse,
955 # otherwise the --filename argument will be required from the command line.
960 # target -> output format -> printer
975 The RST-formatted output produced can be turned into a manual page with the
978 argParser.add_argument('--header', action='store_true',
980 argParser.add_argument('--json', action='store_true',
983 argParser.add_argument('--filename', help='path to include/uapi/linux/bpf.h',
986 argParser.add_argument('--filename', help='path to include/uapi/linux/bpf.h')
1003 error_die('Use either --header or --json, not both')