osphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget$/translations/zh_CN/tools/kabi_regexmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget$/translations/zh_TW/tools/kabi_regexmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget$/translations/it_IT/tools/kabi_regexmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget$/translations/ja_JP/tools/kabi_regexmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget$/translations/ko_KR/tools/kabi_regexmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget$/translations/sp_SP/tools/kabi_regexmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h SPDX-License-Identifier: GPL-2.0h]h SPDX-License-Identifier: GPL-2.0}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhh>/var/lib/git/docbuild/linux/Documentation/tools/kabi_regex.rsthKubhsection)}(hhh](htitle)}(hABI regex search symbol classh]hABI regex search symbol class}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubhindex)}(hhh]h}(h]h ]h"]h$]h&]entries](pair module; lib.python.abi.abi_regexmodule-lib.python.abi.abi_regexhNtauh1hhhhhht/var/lib/git/docbuild/linux/Documentation/../tools/lib/python/abi/abi_regex.py:docstring of lib.python.abi.abi_regexhNubh paragraph)}(h)Convert ABI what into regular expressionsh]h)Convert ABI what into regular expressions}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hhh]h}(h]h ]h"]h$]h&]entries](single,AbiRegex (class in lib.python.abi.abi_regex)!lib.python.abi.abi_regex.AbiRegexhNtauh1hhhhhhNhNubhdesc)}(hhh](hdesc_signature)}(hAbiRegex(*args, **kwargs)h](hdesc_annotation)}(h2[<#text: 'class'>, >]h](hclass}(hjhhhNhNubhdesc_sig_space)}(h h]h }(hjhhhNhNubah}(h]h ]wah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]hhuh1jhjhhh}/var/lib/git/docbuild/linux/Documentation/../tools/lib/python/abi/abi_regex.py:docstring of lib.python.abi.abi_regex.AbiRegexhKubh desc_addname)}(hlib.python.abi.abi_regex.h]hlib.python.abi.abi_regex.}(hj)hhhNhNubah}(h]h ]( sig-prename descclassnameeh"]h$]h&]hhuh1j'hjhhhj&hKubh desc_name)}(hAbiRegexh]hAbiRegex}(hj;hhhNhNubah}(h]h ](sig-namedescnameeh"]h$]h&]hhuh1j9hjhhhj&hKubhdesc_parameterlist)}(h*args, **kwargsh](hdesc_parameter)}(h*argsh](hdesc_sig_operator)}(h*h]h*}(hjYhhhNhNubah}(h]h ]oah"]h$]h&]uh1jWhjSubh desc_sig_name)}(hargsh]hargs}(hjjhhhNhNubah}(h]h ]nah"]h$]h&]uh1jhhjSubeh}(h]h ]h"]h$]h&]hhuh1jQhjMubjR)}(h**kwargsh](jX)}(h**h]h**}(hjhhhNhNubah}(h]h ]jdah"]h$]h&]uh1jWhjubji)}(hkwargsh]hkwargs}(hjhhhNhNubah}(h]h ]juah"]h$]h&]uh1jhhjubeh}(h]h ]h"]h$]h&]hhuh1jQhjMubeh}(h]h ]h"]h$]h&]hhuh1jKhjhhhj&hKubeh}(h]hah ](sig sig-objecteh"]h$]h&]modulelib.python.abi.abi_regexclasshfullnamej= _toc_partsjj= _toc_namej=uh1hhj&hKhhhhubh desc_content)}(hhh](h)}(h,Bases: :py:class:`~abi.abi_parser.AbiParser`h](hBases: }(hjhhhNhNubh)}(h%:py:class:`~abi.abi_parser.AbiParser`h]hliteral)}(hjh]h AbiParser}(hjhhhNhNubah}(h]h ](xrefpypy-classeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdoctools/kabi_regex refdomainjreftypeclass refexplicitrefwarn py:modulejpy:classj= reftargetabi.abi_parser.AbiParseruh1hht/var/lib/git/docbuild/linux/Documentation/../tools/lib/python/abi/abi_regex.py:docstring of lib.python.abi.abi_regexhKhjubeh}(h]h ]h"]h$]h&]uh1hh}/var/lib/git/docbuild/linux/Documentation/../tools/lib/python/abi/abi_regex.py:docstring of lib.python.abi.abi_regex.AbiRegexhKhjhhubh)}(h?Extends AbiParser to search ABI nodes with regular expressions.h]h?Extends AbiParser to search ABI nodes with regular expressions.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh}/var/lib/git/docbuild/linux/Documentation/../tools/lib/python/abi/abi_regex.py:docstring of lib.python.abi.abi_regex.AbiRegexhKhjhhubh)}(hThere some optimizations here to allow a quick symbol search: instead of trying to place all symbols altogether an doing linear search which is very time consuming, create a tree with one depth, grouping similar symbols altogether.h]hThere some optimizations here to allow a quick symbol search: instead of trying to place all symbols altogether an doing linear search which is very time consuming, create a tree with one depth, grouping similar symbols altogether.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjhhubh)}(h{Yet, sometimes a full search will be needed, so we have a special branch on such group tree where other symbols are placed.h]h{Yet, sometimes a full search will be needed, so we have a special branch on such group tree where other symbols are placed.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjhhubh)}(hhh]h}(h]h ]h"]h$]h&]entries](h\\]]'), '(\\1|\\2)'), (re.compile('([^\\/])\\*'), '\\1\\\\w÷'), (re.compile('/\\*/'), '/.*/'), (re.compile('/\\xf6\\xf6\\xf6'), '/.*'), (re.compile('\\<[^\\>]+\\>'), '\\\\w÷'), (re.compile('\\{[^\\}]+\\}'), '\\\\w÷'), (re.compile('\\[[^\\]]+\\]'), '\\\\w÷'), (re.compile('XX+'), '\\\\w÷'), (re.compile('([^A-Z])[XYZ]([^A-Z])'), '\\1\\\\w÷\\2'), (re.compile('([^A-Z])[XYZ]$'), '\\1\\\\w÷'), (re.compile('_[AB]_'), '_\\\\w÷_'), (re.compile('\\xf4'), '['), (re.compile('\\xf5'), ']'), (re.compile('\\s+'), ' '), (re.compile('\\s*\\=.*$'), ''), (re.compile('([\\x21-\\x29\\x2b-\\x2d\\x3a-\\x40\\x5c\\x60\\x7b-\\x7e])'), '\\\\\\1'), (re.compile('\\\\\\\\'), '\\\\'), (re.compile('\\\\([\\[\\]\\(\\)\\|])'), '\\1'), (re.compile('(\\d+)\\\\(-\\d+)'), '\\1\\2'), (re.compile('\\xff'), '\\\\d+'), (re.compile('sqrt(.*)'), 'sqrt(.*)'), (re.compile('(?:\\.\\*){2,}'), ''), (re.compile('\\xf6'), '\\.'), (re.compile('\\xf7'), '+')]h](j)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubjY)}(h=h]h=}(hjhhhNhNubah}(h]h ]jeah"]h$]h&]uh1jXhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubhX[(re.compile('\\\\'), ''), (re.compile('\\.'), 'ö'), (re.compile('\\[0\\-9\\]\\+'), 'ÿ'), (re.compile('\\[0\\-\\d+\\]'), 'ÿ'), (re.compile('\\[0:\\d+\\]'), 'ÿ'), (re.compile('\\[(\\d+)\\]'), 'ô\\\\d+õ'), (re.compile('\\[(\\d)\\-(\\d)\\]'), 'ô\x01-\x02õ'), (re.compile('[\\{\\<\\[]([\\w_]+)(?:[,|]+([\\w_]+)){1,}[\\}\\>\\]]'), '(\\1|\\2)'), (re.compile('([^\\/])\\*'), '\\1\\\\w÷'), (re.compile('/\\*/'), '/.*/'), (re.compile('/\\xf6\\xf6\\xf6'), '/.*'), (re.compile('\\<[^\\>]+\\>'), '\\\\w÷'), (re.compile('\\{[^\\}]+\\}'), '\\\\w÷'), (re.compile('\\[[^\\]]+\\]'), '\\\\w÷'), (re.compile('XX+'), '\\\\w÷'), (re.compile('([^A-Z])[XYZ]([^A-Z])'), '\\1\\\\w÷\\2'), (re.compile('([^A-Z])[XYZ]$'), '\\1\\\\w÷'), (re.compile('_[AB]_'), '_\\\\w÷_'), (re.compile('\\xf4'), '['), (re.compile('\\xf5'), ']'), (re.compile('\\s+'), ' '), (re.compile('\\s*\\=.*$'), ''), (re.compile('([\\x21-\\x29\\x2b-\\x2d\\x3a-\\x40\\x5c\\x60\\x7b-\\x7e])'), '\\\\\\1'), (re.compile('\\\\\\\\'), '\\\\'), (re.compile('\\\\([\\[\\]\\(\\)\\|])'), '\\1'), (re.compile('(\\d+)\\\\(-\\d+)'), '\\1\\2'), (re.compile('\\xff'), '\\\\d+'), (re.compile('sqrt(.*)'), 'sqrt(.*)'), (re.compile('(?:\\.\\*){2,}'), ''), (re.compile('\\xf6'), '\\.'), (re.compile('\\xf7'), '+')]}(hjhhhNhNubeh}(h]h ]h"]h$]h&]hhuh1jhjohhhjhKubeh}(h]jjah ](jjeh"]h$]h&]jlib.python.abi.abi_regexjj=jAbiRegex.re_whatsjjAbiRegexre_whatsjjuh1hhjhKhjlhhubj)}(hhh]h}(h]h ]h"]h$]h&]uh1jhjlhhhjhKubeh}(h]h ](py attributeeh"]h$]h&]jjjjjjjjjuh1hhhhjhNhNubh)}(hhh]h}(h]h ]h"]h$]h&]entries](h9regex_append() (lib.python.abi.abi_regex.AbiRegex method).lib.python.abi.abi_regex.AbiRegex.regex_appendhNtauh1hhjhhh/var/lib/git/docbuild/linux/Documentation/../tools/lib/python/abi/abi_regex.py:docstring of lib.python.abi.abi_regex.AbiRegex.regex_appendhNubh)}(hhh](j)}(h AbiRegex.regex_append(what, new)h](j:)}(h regex_appendh]h regex_append}(hjhhhNhNubah}(h]h ](jFjGeh"]h$]h&]hhuh1j9hjhhh/var/lib/git/docbuild/linux/Documentation/../tools/lib/python/abi/abi_regex.py:docstring of lib.python.abi.abi_regex.AbiRegex.regex_appendhKubjL)}(h what, newh](jR)}(hwhath]ji)}(hwhath]hwhat}(hjhhhNhNubah}(h]h ]juah"]h$]h&]uh1jhhjubah}(h]h ]h"]h$]h&]hhuh1jQhjubjR)}(hnewh]ji)}(hnewh]hnew}(hjhhhNhNubah}(h]h ]juah"]h$]h&]uh1jhhjubah}(h]h ]h"]h$]h&]hhuh1jQhjubeh}(h]h ]h"]h$]h&]hhuh1jKhjhhhjhKubeh}(h]jah ](jjeh"]h$]h&]jlib.python.abi.abi_regexjj=jAbiRegex.regex_appendjj;AbiRegex regex_appendjAbiRegex.regex_append()uh1hhjhKhjhhubj)}(hhh](h)}(h7Get a search group for a subset of regular expressions.h]h7Get a search group for a subset of regular expressions.}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjAhhubh)}(hAs ABI may have thousands of symbols, using a for to search all regular expressions is at least O(n^2). When there are wildcards, the complexity increases substantially, eventually becoming exponential.h]hAs ABI may have thousands of symbols, using a for to search all regular expressions is at least O(n^2). When there are wildcards, the complexity increases substantially, eventually becoming exponential.}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjAhhubh)}(hTo avoid spending too much time on them, use a logic to split them into groups. The smaller the group, the better, as it would mean that searches will be confined to a small number of regular expressions.h]hTo avoid spending too much time on them, use a logic to split them into groups. The smaller the group, the better, as it would mean that searches will be confined to a small number of regular expressions.}(hj`hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjAhhubh)}(hThe conversion to a regex subset is tricky, as we need something that can be easily obtained from the sysfs symbol and from the regular expression. So, we need to discard nodes that have wildcards.h]hThe conversion to a regex subset is tricky, as we need something that can be easily obtained from the sysfs symbol and from the regular expression. So, we need to discard nodes that have wildcards.}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhK hjAhhubh)}(hgIf it can't obtain a subgroup, place the regular expression inside a special group (self.leave_others).h]hiIf it can’t obtain a subgroup, place the regular expression inside a special group (self.leave_others).}(hj|hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjAhhubeh}(h]h ]h"]h$]h&]uh1jhjhhhjhKubeh}(h]h ](pymethodeh"]h$]h&]jjjjjjjjjuh1hhhhjhjhNubh)}(hhh]h}(h]h ]h"]h$]h&]entries](h8skip_names (lib.python.abi.abi_regex.AbiRegex attribute),lib.python.abi.abi_regex.AbiRegex.skip_nameshNtauh1hhjhhh9docstring of lib.python.abi.abi_regex.AbiRegex.skip_nameshNubh)}(hhh](j)}(hAbiRegex.skip_namesh](j:)}(h skip_namesh]h skip_names}(hjhhhNhNubah}(h]h ](jFjGeh"]h$]h&]hhuh1j9hjhhh/var/lib/git/docbuild/linux/Documentation/../tools/lib/python/abi/abi_regex.py:docstring of lib.python.abi.abi_regex.AbiRegex.skip_nameshKubj)}(h{'devices', 'hwmon'}h](j)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubjY)}(h=h]h=}(hjhhhNhNubah}(h]h ]jeah"]h$]h&]uh1jXhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubh{'devices', 'hwmon'}}(hjhhhNhNubeh}(h]h ]h"]h$]h&]hhuh1jhjhhhjhKubeh}(h]jah ](jjeh"]h$]h&]jlib.python.abi.abi_regexjj=jAbiRegex.skip_namesjjAbiRegex skip_namesjjuh1hhjhKhjhhubj)}(hhh]h)}(hrList of popular group names to be skipped to minimize regex group size Use AbiDebug.SUBGROUP_SIZE to detect those.h]hrList of popular group names to be skipped to minimize regex group size Use AbiDebug.SUBGROUP_SIZE to detect those.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjhhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhKubeh}(h]h ](py attributeeh"]h$]h&]jjjjjjjjjuh1hhhhjhjhNubeh}(h]h ]h"]h$]h&]uh1jhhhhhj&hKubeh}(h]h ](pyclasseh"]h$]h&]jj(jj)jj)jjjuh1hhhhhhNhNubeh}(h](h،abi-regex-search-symbol-classeh ]h"]abi regex search symbol classah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjXerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}j2j/s nametypes}j2sh}(j/hhhtarget)}(hhh]h}(h]hah ]h"]h$]h&]ismoduh1jht/var/lib/git/docbuild/linux/Documentation/../tools/lib/python/abi/abi_regex.py:docstring of lib.python.abi.abi_regexhKhhhhubhjj-j3jjj/j5jjj\jbjjjjjojjjju footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.