Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scripts/get_abi.pl: Add filtering capabilities to rest output

This way, Sphinx ABI extension can parse symbols only once, while
keep displaying results in separate files.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/41e108e816e46434aa596e5c0d25d227cb9f0fe5.1739182025.git.mchehab+huawei@kernel.org

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
2a21d80d cc93e482

+15 -6
+15 -6
scripts/lib/abi/abi_parser.py
··· 160 160 self.data[fdata.key] = { 161 161 "what": [content], 162 162 "file": [fdata.file_ref], 163 + "path": fdata.ftype, 163 164 "line_no": fdata.ln, 164 165 } 165 166 ··· 182 181 183 182 if new_what: 184 183 fdata.label = "" 185 - 186 - self.data[fdata.key]["type"] = fdata.ftype 187 184 188 185 if "description" in self.data[fdata.key]: 189 186 self.data[fdata.key]["description"] += "\n\n" ··· 298 299 fdata.nametag = {} 299 300 fdata.nametag["what"] = [f"File {path}/{basename}"] 300 301 fdata.nametag["type"] = "File" 302 + fdata.nametag["path"] = fdata.ftype 301 303 fdata.nametag["file"] = [fdata.file_ref] 302 304 fdata.nametag["line_no"] = 1 303 305 fdata.nametag["description"] = "" ··· 427 427 428 428 return new_desc + "\n\n" 429 429 430 - def doc(self, output_in_txt=False, show_file=True): 430 + def doc(self, output_in_txt=False, show_symbols=True, show_file=True, 431 + filter_path=None): 431 432 """Print ABI at stdout""" 432 433 433 434 part = None ··· 436 435 key=lambda x: (x[1].get("type", ""), 437 436 x[1].get("what"))): 438 437 439 - wtype = v.get("type", "Var") 438 + wtype = v.get("type", "Symbol") 440 439 file_ref = v.get("file") 441 440 names = v.get("what", [""]) 442 441 443 - if not show_file and wtype == "File": 444 - continue 442 + if wtype == "File": 443 + if not show_file: 444 + continue 445 + else: 446 + if not show_symbols: 447 + continue 448 + 449 + if filter_path: 450 + if v.get("path") != filter_path: 451 + continue 445 452 446 453 msg = "" 447 454