€•»lŒsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ7/translations/zh_CN/bpf/libbpf/libbpf_naming_convention”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ7/translations/zh_TW/bpf/libbpf/libbpf_naming_convention”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ7/translations/it_IT/bpf/libbpf/libbpf_naming_convention”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ7/translations/ja_JP/bpf/libbpf/libbpf_naming_convention”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ7/translations/ko_KR/bpf/libbpf/libbpf_naming_convention”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ7/translations/pt_BR/bpf/libbpf/libbpf_naming_convention”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ7/translations/sp_SP/bpf/libbpf/libbpf_naming_convention”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)”}”(hŒ3SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)”h]”hŒ3SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)”…””}”hh·sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hµhhh²hh³ŒQ/var/lib/git/docbuild/linux/Documentation/bpf/libbpf/libbpf_naming_convention.rst”h´KubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒAPI naming convention”h]”hŒAPI naming convention”…””}”(hhÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÊh²hh³hÇh´KubhŒ paragraph”“”)”}”(hXlibbpf API provides access to a few logically separated groups of functions and types. Every group has its own naming convention described here. It's recommended to follow these conventions whenever a new function or type is added to keep libbpf API clean and consistent.”h]”hXlibbpf API provides access to a few logically separated groups of functions and types. Every group has its own naming convention described here. It’s recommended to follow these conventions whenever a new function or type is added to keep libbpf API clean and consistent.”…””}”(hhßh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KhhÊh²hubhÞ)”}”(hŒ­All types and functions provided by libbpf API should have one of the following prefixes: ``bpf_``, ``btf_``, ``libbpf_``, ``btf_dump_``, ``ring_buffer_``, ``perf_buffer_``.”h]”(hŒZAll types and functions provided by libbpf API should have one of the following prefixes: ”…””}”(hhíh²hh³Nh´NubhŒliteral”“”)”}”(hŒ``bpf_``”h]”hŒbpf_”…””}”(hh÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhhíubhŒ, ”…””}”(hhíh²hh³Nh´Nubhö)”}”(hŒ``btf_``”h]”hŒbtf_”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhhíubhŒ, ”…””}”hhísbhö)”}”(hŒ ``libbpf_``”h]”hŒlibbpf_”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhhíubhŒ, ”…””}”hhísbhö)”}”(hŒ ``btf_dump_``”h]”hŒ btf_dump_”…””}”(hj-h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhhíubhŒ, ”…””}”(hhíh²hh³Nh´Nubhö)”}”(hŒ``ring_buffer_``”h]”hŒ ring_buffer_”…””}”(hj?h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhhíubhŒ, ”…””}”hhísbhö)”}”(hŒ``perf_buffer_``”h]”hŒ perf_buffer_”…””}”(hjQh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhhíubhŒ.”…””}”(hhíh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K hhÊh²hubhÉ)”}”(hhh]”(hÎ)”}”(hŒSystem call wrappers”h]”hŒSystem call wrappers”…””}”(hjlh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjih²hh³hÇh´KubhÞ)”}”(hŒ·System call wrappers are simple wrappers for commands supported by sys_bpf system call. These wrappers should go to ``bpf.h`` header file and map one to one to corresponding commands.”h]”(hŒtSystem call wrappers are simple wrappers for commands supported by sys_bpf system call. These wrappers should go to ”…””}”(hjzh²hh³Nh´Nubhö)”}”(hŒ ``bpf.h``”h]”hŒbpf.h”…””}”(hj‚h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjzubhŒ: header file and map one to one to corresponding commands.”…””}”(hjzh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Khjih²hubhÞ)”}”(hŒ‰For example ``bpf_map_lookup_elem`` wraps ``BPF_MAP_LOOKUP_ELEM`` command of sys_bpf, ``bpf_prog_attach`` wraps ``BPF_PROG_ATTACH``, etc.”h]”(hŒ For example ”…””}”(hjšh²hh³Nh´Nubhö)”}”(hŒ``bpf_map_lookup_elem``”h]”hŒbpf_map_lookup_elem”…””}”(hj¢h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjšubhŒ wraps ”…””}”(hjšh²hh³Nh´Nubhö)”}”(hŒ``BPF_MAP_LOOKUP_ELEM``”h]”hŒBPF_MAP_LOOKUP_ELEM”…””}”(hj´h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjšubhŒ command of sys_bpf, ”…””}”(hjšh²hh³Nh´Nubhö)”}”(hŒ``bpf_prog_attach``”h]”hŒbpf_prog_attach”…””}”(hjÆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjšubhŒ wraps ”…””}”hjšsbhö)”}”(hŒ``BPF_PROG_ATTACH``”h]”hŒBPF_PROG_ATTACH”…””}”(hjØh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjšubhŒ, etc.”…””}”(hjšh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Khjih²hubeh}”(h]”Œsystem-call-wrappers”ah ]”h"]”Œsystem call wrappers”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KubhÉ)”}”(hhh]”(hÎ)”}”(hŒObjects”h]”hŒObjects”…””}”(hjûh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjøh²hh³hÇh´KubhÞ)”}”(hX-Another class of types and functions provided by libbpf API is "objects" and functions to work with them. Objects are high-level abstractions such as BPF program or BPF map. They're represented by corresponding structures such as ``struct bpf_object``, ``struct bpf_program``, ``struct bpf_map``, etc.”h]”(hŒìAnother class of types and functions provided by libbpf API is “objects†and functions to work with them. Objects are high-level abstractions such as BPF program or BPF map. They’re represented by corresponding structures such as ”…””}”(hj h²hh³Nh´Nubhö)”}”(hŒ``struct bpf_object``”h]”hŒstruct bpf_object”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj ubhŒ, ”…””}”(hj h²hh³Nh´Nubhö)”}”(hŒ``struct bpf_program``”h]”hŒstruct bpf_program”…””}”(hj#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj ubhŒ, ”…””}”(hj h²hh³Nh´Nubhö)”}”(hŒ``struct bpf_map``”h]”hŒstruct bpf_map”…””}”(hj5h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj ubhŒ, etc.”…””}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Khjøh²hubhÞ)”}”(hŒ‰Structures are forward declared and access to their fields should be provided via corresponding getters and setters rather than directly.”h]”hŒ‰Structures are forward declared and access to their fields should be provided via corresponding getters and setters rather than directly.”…””}”(hjMh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K"hjøh²hubhÞ)”}”(hŒhThese objects are associated with corresponding parts of ELF object that contains compiled BPF programs.”h]”hŒhThese objects are associated with corresponding parts of ELF object that contains compiled BPF programs.”…””}”(hj[h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K%hjøh²hubhÞ)”}”(hŒÄFor example ``struct bpf_object`` represents ELF object itself created from an ELF file or from a buffer, ``struct bpf_program`` represents a program in ELF object and ``struct bpf_map`` is a map.”h]”(hŒ For example ”…””}”(hjih²hh³Nh´Nubhö)”}”(hŒ``struct bpf_object``”h]”hŒstruct bpf_object”…””}”(hjqh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjiubhŒI represents ELF object itself created from an ELF file or from a buffer, ”…””}”(hjih²hh³Nh´Nubhö)”}”(hŒ``struct bpf_program``”h]”hŒstruct bpf_program”…””}”(hjƒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjiubhŒ( represents a program in ELF object and ”…””}”(hjih²hh³Nh´Nubhö)”}”(hŒ``struct bpf_map``”h]”hŒstruct bpf_map”…””}”(hj•h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjiubhŒ is a map.”…””}”(hjih²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K(hjøh²hubhÞ)”}”(hŒFunctions that work with an object have names built from object name, double underscore and part that describes function purpose.”h]”hŒFunctions that work with an object have names built from object name, double underscore and part that describes function purpose.”…””}”(hj­h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K,hjøh²hubhÞ)”}”(hŒÚFor example ``bpf_object__open`` consists of the name of corresponding object, ``bpf_object``, double underscore and ``open`` that defines the purpose of the function to open ELF file and create ``bpf_object`` from it.”h]”(hŒ For example ”…””}”(hj»h²hh³Nh´Nubhö)”}”(hŒ``bpf_object__open``”h]”hŒbpf_object__open”…””}”(hjÃh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj»ubhŒ/ consists of the name of corresponding object, ”…””}”(hj»h²hh³Nh´Nubhö)”}”(hŒ``bpf_object``”h]”hŒ bpf_object”…””}”(hjÕh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj»ubhŒ, double underscore and ”…””}”(hj»h²hh³Nh´Nubhö)”}”(hŒ``open``”h]”hŒopen”…””}”(hjçh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj»ubhŒF that defines the purpose of the function to open ELF file and create ”…””}”(hj»h²hh³Nh´Nubhö)”}”(hŒ``bpf_object``”h]”hŒ bpf_object”…””}”(hjùh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj»ubhŒ from it.”…””}”(hj»h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K/hjøh²hubhÞ)”}”(hŒ‰All objects and corresponding functions other than BTF related should go to ``libbpf.h``. BTF types and functions should go to ``btf.h``.”h]”(hŒLAll objects and corresponding functions other than BTF related should go to ”…””}”(hjh²hh³Nh´Nubhö)”}”(hŒ ``libbpf.h``”h]”hŒlibbpf.h”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjubhŒ'. BTF types and functions should go to ”…””}”(hjh²hh³Nh´Nubhö)”}”(hŒ ``btf.h``”h]”hŒbtf.h”…””}”(hj+h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjubhŒ.”…””}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K4hjøh²hubeh}”(h]”Œobjects”ah ]”h"]”Œobjects”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KubhÉ)”}”(hhh]”(hÎ)”}”(hŒAuxiliary functions”h]”hŒAuxiliary functions”…””}”(hjNh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjKh²hh³hÇh´K8ubhÞ)”}”(hŒ±Auxiliary functions and types that don't fit well in any of categories described above should have ``libbpf_`` prefix, e.g. ``libbpf_get_error`` or ``libbpf_prog_type_by_name``.”h]”(hŒeAuxiliary functions and types that don’t fit well in any of categories described above should have ”…””}”(hj\h²hh³Nh´Nubhö)”}”(hŒ ``libbpf_``”h]”hŒlibbpf_”…””}”(hjdh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj\ubhŒ prefix, e.g. ”…””}”(hj\h²hh³Nh´Nubhö)”}”(hŒ``libbpf_get_error``”h]”hŒlibbpf_get_error”…””}”(hjvh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj\ubhŒ or ”…””}”(hj\h²hh³Nh´Nubhö)”}”(hŒ``libbpf_prog_type_by_name``”h]”hŒlibbpf_prog_type_by_name”…””}”(hjˆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj\ubhŒ.”…””}”(hj\h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K:hjKh²hubeh}”(h]”Œauxiliary-functions”ah ]”h"]”Œauxiliary functions”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K8ubhÉ)”}”(hhh]”(hÎ)”}”(hŒABI”h]”hŒABI”…””}”(hj«h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj¨h²hh³hÇh´K?ubhÞ)”}”(hX-libbpf can be both linked statically or used as DSO. To avoid possible conflicts with other libraries an application is linked with, all non-static libbpf symbols should have one of the prefixes mentioned in API documentation above. See API naming convention to choose the right name for a new symbol.”h]”hX-libbpf can be both linked statically or used as DSO. To avoid possible conflicts with other libraries an application is linked with, all non-static libbpf symbols should have one of the prefixes mentioned in API documentation above. See API naming convention to choose the right name for a new symbol.”…””}”(hj¹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KAhj¨h²hubeh}”(h]”Œabi”ah ]”h"]”Œabi”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K?ubhÉ)”}”(hhh]”(hÎ)”}”(hŒSymbol visibility”h]”hŒSymbol visibility”…””}”(hjÒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjÏh²hh³hÇh´KHubhÞ)”}”(hŒ»libbpf follow the model when all global symbols have visibility "hidden" by default and to make a symbol visible it has to be explicitly attributed with ``LIBBPF_API`` macro. For example:”h]”(hŒlibbpf follow the model when all global symbols have visibility “hidden†by default and to make a symbol visible it has to be explicitly attributed with ”…””}”(hjàh²hh³Nh´Nubhö)”}”(hŒ``LIBBPF_API``”h]”hŒ LIBBPF_API”…””}”(hjèh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjàubhŒ macro. For example:”…””}”(hjàh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KJhjÏh²hubhŒ literal_block”“”)”}”(hŒ/LIBBPF_API int bpf_prog_get_fd_by_id(__u32 id);”h]”hŒ/LIBBPF_API int bpf_prog_get_fd_by_id(__u32 id);”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆŒforce”‰Œlanguage”Œc”Œhighlight_args”}”uh1jh³hÇh´KNhjÏh²hubhÞ)”}”(hŒ¡This prevents from accidentally exporting a symbol, that is not supposed to be a part of ABI what, in turn, improves both libbpf developer- and user-experiences.”h]”hŒ¡This prevents from accidentally exporting a symbol, that is not supposed to be a part of ABI what, in turn, improves both libbpf developer- and user-experiences.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KRhjÏh²hubeh}”(h]”Œsymbol-visibility”ah ]”h"]”Œsymbol visibility”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KHubhÉ)”}”(hhh]”(hÎ)”}”(hŒABI versioning”h]”hŒABI versioning”…””}”(hj.h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj+h²hh³hÇh´KWubhÞ)”}”(hŒ”To make future ABI extensions possible libbpf ABI is versioned. Versioning is implemented by ``libbpf.map`` version script that is passed to linker.”h]”(hŒ]To make future ABI extensions possible libbpf ABI is versioned. Versioning is implemented by ”…””}”(hj<h²hh³Nh´Nubhö)”}”(hŒ``libbpf.map``”h]”hŒ libbpf.map”…””}”(hjDh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj<ubhŒ) version script that is passed to linker.”…””}”(hj<h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KYhj+h²hubhÞ)”}”(hŒ^Version name is ``LIBBPF_`` prefix + three-component numeric version, starting from ``0.0.1``.”h]”(hŒVersion name is ”…””}”(hj\h²hh³Nh´Nubhö)”}”(hŒ ``LIBBPF_``”h]”hŒLIBBPF_”…””}”(hjdh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj\ubhŒ9 prefix + three-component numeric version, starting from ”…””}”(hj\h²hh³Nh´Nubhö)”}”(hŒ ``0.0.1``”h]”hŒ0.0.1”…””}”(hjvh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj\ubhŒ.”…””}”(hj\h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K]hj+h²hubhÞ)”}”(hŒÓEvery time ABI is being changed, e.g. because a new symbol is added or semantic of existing symbol is changed, ABI version should be bumped. This bump in ABI version is at most once per kernel development cycle.”h]”hŒÓEvery time ABI is being changed, e.g. because a new symbol is added or semantic of existing symbol is changed, ABI version should be bumped. This bump in ABI version is at most once per kernel development cycle.”…””}”(hjŽh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K`hj+h²hubhÞ)”}”(hŒ3For example, if current state of ``libbpf.map`` is:”h]”(hŒ!For example, if current state of ”…””}”(hjœh²hh³Nh´Nubhö)”}”(hŒ``libbpf.map``”h]”hŒ libbpf.map”…””}”(hj¤h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjœubhŒ is:”…””}”(hjœh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Kdhj+h²hubj)”}”(hŒ|LIBBPF_0.0.1 { global: bpf_func_a; bpf_func_b; local: \*; };”h]”hŒ|LIBBPF_0.0.1 { global: bpf_func_a; bpf_func_b; local: \*; };”…””}”hj¼sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆj‰jŒnone”j}”uh1jh³hÇh´Kfhj+h²hubhÞ)”}”(hŒg, and a new symbol ``bpf_func_c`` is being introduced, then ``libbpf.map`` should be changed like this:”h]”(hŒ, and a new symbol ”…””}”(hjÌh²hh³Nh´Nubhö)”}”(hŒ``bpf_func_c``”h]”hŒ bpf_func_c”…””}”(hjÔh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjÌubhŒ is being introduced, then ”…””}”(hjÌh²hh³Nh´Nubhö)”}”(hŒ``libbpf.map``”h]”hŒ libbpf.map”…””}”(hjæh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjÌubhŒ should be changed like this:”…””}”(hjÌh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Kphj+h²hubj)”}”(hŒÇLIBBPF_0.0.1 { global: bpf_func_a; bpf_func_b; local: \*; }; LIBBPF_0.0.2 { global: bpf_func_c; } LIBBPF_0.0.1;”h]”hŒÇLIBBPF_0.0.1 { global: bpf_func_a; bpf_func_b; local: \*; }; LIBBPF_0.0.2 { global: bpf_func_c; } LIBBPF_0.0.1;”…””}”hjþsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆj‰jŒnone”j}”uh1jh³hÇh´Kshj+h²hubhÞ)”}”(hŒN, where new version ``LIBBPF_0.0.2`` depends on the previous ``LIBBPF_0.0.1``.”h]”(hŒ, where new version ”…””}”(hjh²hh³Nh´Nubhö)”}”(hŒ``LIBBPF_0.0.2``”h]”hŒ LIBBPF_0.0.2”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjubhŒ depends on the previous ”…””}”(hjh²hh³Nh´Nubhö)”}”(hŒ``LIBBPF_0.0.1``”h]”hŒ LIBBPF_0.0.1”…””}”(hj(h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjubhŒ.”…””}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Khj+h²hubhÞ)”}”(hŒrFormat of version script and ways to handle ABI changes, including incompatible ones, described in details in [1].”h]”hŒrFormat of version script and ways to handle ABI changes, including incompatible ones, described in details in [1].”…””}”(hj@h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K„hj+h²hubeh}”(h]”Œabi-versioning”ah ]”h"]”Œabi versioning”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KWubhÉ)”}”(hhh]”(hÎ)”}”(hŒStand-alone build”h]”hŒStand-alone build”…””}”(hjYh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjVh²hh³hÇh´KˆubhÞ)”}”(hŒ†Under https://github.com/libbpf/libbpf there is a (semi-)automated mirror of the mainline's version of libbpf for a stand-alone build.”h]”(hŒUnder ”…””}”(hjgh²hh³Nh´NubhŒ reference”“”)”}”(hŒ https://github.com/libbpf/libbpf”h]”hŒ https://github.com/libbpf/libbpf”…””}”(hjqh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”jsuh1johjgubhŒb there is a (semi-)automated mirror of the mainline’s version of libbpf for a stand-alone build.”…””}”(hjgh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KŠhjVh²hubhÞ)”}”(hŒ_However, all changes to libbpf's code base must be upstreamed through the mainline kernel tree.”h]”hŒaHowever, all changes to libbpf’s code base must be upstreamed through the mainline kernel tree.”…””}”(hjŠh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KhjVh²hubeh}”(h]”Œstand-alone-build”ah ]”h"]”Œstand-alone build”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´Kˆubeh}”(h]”Œapi-naming-convention”ah ]”h"]”Œapi naming convention”ah$]”h&]”uh1hÈhhh²hh³hÇh´KubhÉ)”}”(hhh]”(hÎ)”}”(hŒAPI documentation convention”h]”hŒAPI documentation convention”…””}”(hj«h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj¨h²hh³hÇh´K’ubhÞ)”}”(hŒôThe libbpf API is documented via comments above definitions in header files. These comments can be rendered by doxygen and sphinx for well organized html output. This section describes the convention in which these comments should be formatted.”h]”hŒôThe libbpf API is documented via comments above definitions in header files. These comments can be rendered by doxygen and sphinx for well organized html output. This section describes the convention in which these comments should be formatted.”…””}”(hj¹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K”hj¨h²hubhÞ)”}”(hŒHere is an example from btf.h:”h]”hŒHere is an example from btf.h:”…””}”(hjÇh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K™hj¨h²hubj)”}”(hXr/** * @brief **btf__new()** creates a new instance of a BTF object from the raw * bytes of an ELF's BTF section * @param data raw bytes * @param size number of bytes passed in `data` * @return new BTF object instance which has to be eventually freed with * **btf__free()** * * On error, error-code-encoded-as-pointer is returned, not a NULL. To extract * error code from such a pointer `libbpf_get_error()` should be used. If * `libbpf_set_strict_mode(LIBBPF_STRICT_CLEAN_PTRS)` is enabled, NULL is * returned on error instead. In both cases thread-local `errno` variable is * always set to error code as well. */”h]”hXr/** * @brief **btf__new()** creates a new instance of a BTF object from the raw * bytes of an ELF's BTF section * @param data raw bytes * @param size number of bytes passed in `data` * @return new BTF object instance which has to be eventually freed with * **btf__free()** * * On error, error-code-encoded-as-pointer is returned, not a NULL. To extract * error code from such a pointer `libbpf_get_error()` should be used. If * `libbpf_set_strict_mode(LIBBPF_STRICT_CLEAN_PTRS)` is enabled, NULL is * returned on error instead. In both cases thread-local `errno` variable is * always set to error code as well. */”…””}”hjÕsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆj‰jjj}”uh1jh³hÇh´K›hj¨h²hubhÞ)”}”(hŒ@The comment must start with a block comment of the form '/\*\*'.”h]”hŒDThe comment must start with a block comment of the form ‘/**’.”…””}”(hjäh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K¬hj¨h²hubhÞ)”}”(hX…The documentation always starts with a @brief directive. This line is a short description about this API. It starts with the name of the API, denoted in bold like so: **api_name**. Please include an open and close parenthesis if this is a function. Follow with the short description of the API. A longer form description can be added below the last directive, at the bottom of the comment.”h]”(hŒ§The documentation always starts with a @brief directive. This line is a short description about this API. It starts with the name of the API, denoted in bold like so: ”…””}”(hjòh²hh³Nh´NubhŒstrong”“”)”}”(hŒ **api_name**”h]”hŒapi_name”…””}”(hjüh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1júhjòubhŒÒ. Please include an open and close parenthesis if this is a function. Follow with the short description of the API. A longer form description can be added below the last directive, at the bottom of the comment.”…””}”(hjòh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K®hj¨h²hubhÞ)”}”(hŒ±Parameters are denoted with the @param directive, there should be one for each parameter. If this is a function with a non-void return, use the @return directive to document it.”h]”hŒ±Parameters are denoted with the @param directive, there should be one for each parameter. If this is a function with a non-void return, use the @return directive to document it.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K´hj¨h²hubhÉ)”}”(hhh]”(hÎ)”}”(hŒLicense”h]”hŒLicense”…””}”(hj%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj"h²hh³hÇh´K¹ubhÞ)”}”(hŒ8libbpf is dual-licensed under LGPL 2.1 and BSD 2-Clause.”h]”hŒ8libbpf is dual-licensed under LGPL 2.1 and BSD 2-Clause.”…””}”(hj3h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K»hj"h²hubeh}”(h]”Œlicense”ah ]”h"]”Œlicense”ah$]”h&]”uh1hÈhj¨h²hh³hÇh´K¹ubhÉ)”}”(hhh]”(hÎ)”}”(hŒLinks”h]”hŒLinks”…””}”(hjLh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjIh²hh³hÇh´K¾ubhŒdefinition_list”“”)”}”(hhh]”hŒdefinition_list_item”“”)”}”(hŒX[1] https://www.akkadia.org/drepper/dsohowto.pdf (Chapter 3. Maintaining APIs and ABIs).”h]”(hŒterm”“”)”}”(hŒ0[1] https://www.akkadia.org/drepper/dsohowto.pdf”h]”(hŒ[1] ”…””}”(hjgh²hh³Nh´Nubjp)”}”(hŒ,https://www.akkadia.org/drepper/dsohowto.pdf”h]”hŒ,https://www.akkadia.org/drepper/dsohowto.pdf”…””}”(hjoh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”jquh1johjgubeh}”(h]”h ]”h"]”h$]”h&]”uh1jeh³hÇh´KÀhjaubhŒ definition”“”)”}”(hhh]”hÞ)”}”(hŒ'(Chapter 3. Maintaining APIs and ABIs).”h]”hŒ'(Chapter 3. Maintaining APIs and ABIs).”…””}”(hj‰h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KÁhj†ubah}”(h]”h ]”h"]”h$]”h&]”uh1j„hjaubeh}”(h]”h ]”h"]”h$]”h&]”uh1j_h³hÇh´KÀhj\ubah}”(h]”h ]”h"]”h$]”h&]”uh1jZhjIh²hh³hÇh´Nubeh}”(h]”Œlinks”ah ]”h"]”Œlinks”ah$]”h&]”uh1hÈhj¨h²hh³hÇh´K¾ubeh}”(h]”Œapi-documentation-convention”ah ]”h"]”Œapi documentation convention”ah$]”h&]”uh1hÈhhh²hh³hÇh´K’ubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÇuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(hÍNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jÜŒerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÇŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(j¥j¢jõjòjHjEj¥j¢jÌjÉj(j%jSjPjjšj¶j³jFjCj®j«uŒ nametypes”}”(j¥‰jõ‰jH‰j¥‰j̉j(‰jS‰j‰j¶‰jF‰j®‰uh}”(j¢hÊjòjijEjøj¢jKjÉj¨j%jÏjPj+jšjVj³j¨jCj"j«jIuŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.