]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tree-wide: several cleanups for generating symbol lists and gperf files
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 8 Jul 2025 04:07:32 +0000 (13:07 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 11 Jul 2025 04:05:42 +0000 (13:05 +0900)
- pass our system include directories to make generators use our libc
  wrappers and latest kernel headers,
- include relevant headers in generated gperf file,
- use files() rather than find_program(), as the result of
  find_program() cannot be passed to 'input' of custom_target(),
- move generate-bpf-delegate-configs.py to src/core/, as it is only used
  by libcore.

20 files changed:
.github/workflows/linter.yml
man/meson.build
meson.build
src/basic/generate-af-list.sh
src/basic/generate-arphrd-list.sh
src/basic/generate-cap-list.sh
src/basic/generate-errno-list.sh
src/basic/meson.build
src/core/generate-bpf-delegate-configs.py [moved from src/basic/generate-bpf-delegate-configs.py with 100% similarity]
src/core/meson.build
src/include/meson.build [new file with mode: 0644]
src/libsystemd/sd-journal/generate-audit_type-list.sh
src/libsystemd/sd-journal/meson.build
src/shared/ethtool-link-mode.py
src/shared/generate-ip-protocol-list.sh
src/shared/meson.build
src/udev/generate-keyboard-keys-gperf.sh
src/udev/generate-keyboard-keys-list.sh
src/udev/meson.build
tools/xml_helper.py

index a489b556615a4b52cdc34ba965031b86bbead2a4..8c0ec63d4038eff0508ccc48039837ea4e00ad89 100644 (file)
@@ -41,7 +41,7 @@ jobs:
       - uses: systemd/mkosi@184472f0f1f831ca29953546ec01fd941ff763a6
 
       - name: Check that tabs are not used in Python code
-        run: sh -c '! git grep -P "\\t" -- src/basic/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py'
+        run: sh -c '! git grep -P "\\t" -- src/core/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py'
 
       - name: Build tools tree
         run: |
@@ -56,20 +56,20 @@ jobs:
       - name: Run mypy
         run: |
           mkosi box -- mypy --version
-          mkosi box -- mypy src/basic/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py
+          mkosi box -- mypy src/core/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py
 
       - name: Run ruff check
         run: |
           mkosi box -- ruff --version
-          mkosi box -- ruff check src/basic/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py
+          mkosi box -- ruff check src/core/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py
 
       - name: Run ruff format
         run: |
           mkosi box -- ruff --version
-          if ! mkosi box -- ruff format --check src/basic/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py
+          if ! mkosi box -- ruff format --check src/core/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py
           then
               echo "Please run 'ruff format' on the above files or apply the diffs below manually"
-              mkosi box -- ruff format --check --quiet --diff src/basic/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py
+              mkosi box -- ruff format --check --quiet --diff src/core/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py
           fi
 
       - name: Configure meson
index 4aa9ed237c3a6d38f2ff1c81ab690094ff8fa361..89e813ee3218cb473e7d2345c7514edc6789092e 100644 (file)
@@ -20,9 +20,10 @@ xsltproc_flags = [
         '--stringparam', 'man.copyright.section.enabled', '0',
         '--stringparam', 'systemd.version', '@0@'.format(meson.project_version()),
         '--path',
-        '@0@:@1@:@2@'.format(meson.current_build_dir(),
+        '@0@:@1@:@2@:@3@'.format(meson.current_build_dir(),
                              meson.current_source_dir(),
-                             libshared_build_dir)]
+                             libshared_build_dir,
+                             libcore_build_dir)]
 
 custom_man_xsl = files('custom-man.xsl')
 custom_html_xsl = files('custom-html.xsl')
@@ -35,17 +36,6 @@ custom_entities_ent = custom_target(
 
 man_page_depends += custom_entities_ent
 
-generate_bpf_delegate_configs = find_program('../src/basic/generate-bpf-delegate-configs.py')
-
-bpf_delegate_xml = custom_target(
-        input : files('../src/include/uapi/linux/bpf.h'),
-        output : 'bpf-delegate.xml',
-        command : [generate_bpf_delegate_configs,
-                   'doc',
-                   '@INPUT@'],
-        capture : true)
-man_page_depends += bpf_delegate_xml
-
 man_pages = []
 html_pages = []
 source_xml_files = []
index 8b7809043dbe6936782c86037e531274f6dd0b80..b97fe3aa414234dc840601b73f01892b580d36e6 100644 (file)
@@ -2008,6 +2008,14 @@ dbus_programs = []
 # A list of boot stubs. Required for testing of ukify.
 boot_stubs = []
 
+# This is similar to system_includes below, but for passing custom_target().
+system_include_args = [
+        '-isystem', meson.project_build_root()  / 'src/include/override',
+        '-isystem', meson.project_source_root() / 'src/include/override',
+        '-isystem', meson.project_build_root()  / 'src/include/uapi',
+        '-isystem', meson.project_source_root() / 'src/include/uapi',
+]
+
 system_includes = [
         include_directories(
                 # gcc(1) says
@@ -2048,6 +2056,7 @@ includes = [libsystemd_includes, include_directories('src/shared')]
 
 subdir('po')
 subdir('catalog')
+subdir('src/include')
 subdir('src/fundamental')
 subdir('src/basic')
 subdir('src/libsystemd')
index 4fec46a2ef7781669e28978834ddf43e7fc8f98c..d7c777507b5da24b423b9aee980e8b86eb05d5a3 100755 (executable)
@@ -3,6 +3,9 @@
 set -eu
 set -o pipefail
 
-${1:?} -E -dM -include sys/socket.h -include "${2:?}" - </dev/null | \
+CC=${1:?}
+shift
+
+$CC -E -dM -include sys/socket.h "$@" - </dev/null | \
        grep -Ev 'AF_UNSPEC|AF_MAX' | \
        awk '/^#define[ \t]+AF_[^ \t]+[ \t]+[AP]F_[^ \t]/ { print $2; }'
index 5727a23dabf1241ee3ed0ab230ad785fd00e1e8e..be4c75d7e0b9a85c2ba4e12356888cbbd45466a2 100755 (executable)
@@ -3,6 +3,9 @@
 set -eu
 set -o pipefail
 
-${1:?} -dM -include "${2:?}" - </dev/null | \
+CC=${1:?}
+shift
+
+$CC -dM -include linux/if_arp.h "$@" - </dev/null | \
        awk '/^#define[ \t]+ARPHRD_[^ \t]+[ \t]+[^ \t]/ { print $2; }' | \
        sed -e 's/ARPHRD_//'
index 320539003756eca81d99d9185e8e536368061782..ab87f94f500dccf931ad42ce7b05a892f82fe9f7 100755 (executable)
@@ -3,6 +3,9 @@
 set -eu
 set -o pipefail
 
-${1:?} -dM -include "${2:?}" - </dev/null | \
+CC=${1:?}
+shift
+
+$CC -dM -include linux/capability.h "$@" - </dev/null | \
        awk '/^#define[ \t]+CAP_[A-Z_]+[ \t]+/ { print $2; }' | \
        grep -v CAP_LAST_CAP
index f756b2e020834d5ec10f7c05177213f8d1595c97..86f89f8cee0cd85de8eb1a5621442b66270658aa 100755 (executable)
@@ -6,6 +6,9 @@ set -o pipefail
 # In kernel's arch/parisc/include/uapi/asm/errno.h, ECANCELLED and EREFUSED are defined as aliases of
 # ECANCELED and ECONNREFUSED, respectively. Let's drop them.
 
-${1:?} -dM -include errno.h - </dev/null | \
+CC=${1:?}
+shift
+
+$CC -dM -include errno.h "$@" - </dev/null | \
        grep -Ev '^#define[[:space:]]+(ECANCELLED|EREFUSED)' | \
        awk '/^#define[ \t]+E[^ _]+[ \t]+/ { print $2; }'
index 19ed187646ff2b65065426c6b3ffcd092c799974..b7b2253586a4e909efbc496a6175c2f8c968e6d8 100644 (file)
@@ -124,39 +124,26 @@ missing_audit_h = files('missing_audit.h')
 missing_syscall_def_h = files('missing_syscall_def.h')
 basic_sources += missing_syscall_def_h
 
-generate_af_list = find_program('generate-af-list.sh')
-af_list_txt = custom_target(
-        output : 'af-list.txt',
-        command : [generate_af_list, cpp, files('../include/override/sys/socket.h')],
-        capture : true)
-
-generate_arphrd_list = find_program('generate-arphrd-list.sh')
-arphrd_list_txt = custom_target(
-        output : 'arphrd-list.txt',
-        command : [generate_arphrd_list, cpp, files('../include/uapi/linux/if_arp.h')],
-        capture : true)
-
-generate_cap_list = find_program('generate-cap-list.sh')
-cap_list_txt = custom_target(
-        output : 'cap-list.txt',
-        command : [generate_cap_list, cpp, files('../include/uapi/linux/capability.h')],
-        capture : true)
-
-generate_errno_list = find_program('generate-errno-list.sh')
-errno_list_txt = custom_target(
-        output : 'errno-list.txt',
-        command : [generate_errno_list, cpp],
-        capture : true)
-
 generated_gperf_headers = []
-foreach item : [['af',     af_list_txt,     'af',         '',        ['<sys/socket.h>']],
-                ['arphrd', arphrd_list_txt, 'arphrd',     'ARPHRD_', []],
-                ['cap',    cap_list_txt,    'capability', '',        []],
-                ['errno',  errno_list_txt,  'errno',      '',        []]]
+foreach item : [
+        # name,    source,         struct name,  prefix,    headers
+        ['af',     af_sources,     'af',         '',        ['<sys/socket.h>'],       ],
+        ['arphrd', arphrd_sources, 'arphrd',     'ARPHRD_', ['<linux/if_arp.h>'],     ],
+        ['cap',    cap_sources,    'capability', '',        ['<linux/capability.h>'], ],
+        ['errno',  [],             'errno',      '',        ['<errno.h>'],            ],
+]
+
+        fname = '@0@-list.txt'.format(item[0])
+        generate_list = files('generate-@0@-list.sh'.format(item[0]))
+        list_txt = custom_target(
+                input : [generate_list, item[1]],
+                output : fname,
+                command : [env, 'bash', generate_list, cpp, system_include_args],
+                capture : true)
 
         fname = '@0@-from-name.gperf'.format(item[0])
         gperf_file = custom_target(
-                input : item[1],
+                input : list_txt,
                 output : fname,
                 command : [generate_gperfs, item[2], item[3], '@INPUT@'] + item[4],
                 capture : true)
@@ -176,7 +163,7 @@ foreach item : [['af',     af_list_txt,     'af',         '',        ['<sys/sock
         fname = '@0@-to-name.inc'.format(item[0])
         awkscript = '@0@-to-name.awk'.format(item[0])
         target2 = custom_target(
-                input : [awkscript, item[1]],
+                input : [awkscript, list_txt],
                 output : fname,
                 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
                 capture : true)
@@ -273,17 +260,8 @@ filesystem_switch_case_inc = custom_target(
                    '@INPUT@'],
         capture : true)
 
-generate_bpf_delegate_configs = find_program('generate-bpf-delegate-configs.py')
-bpf_delegate_configs_inc = custom_target(
-        input : files('../include/uapi/linux/bpf.h'),
-        output : 'bpf-delegate-configs.inc',
-        command : [generate_bpf_delegate_configs,
-                   'code',
-                   '@INPUT@'],
-        capture : true)
-
-generated_sources += [filesystem_list_inc, filesystem_switch_case_inc, filesystems_gperf_h, bpf_delegate_configs_inc]
-basic_sources += [filesystem_list_inc, filesystem_switch_case_inc, filesystems_gperf_h, bpf_delegate_configs_inc]
+generated_sources += [filesystem_list_inc, filesystem_switch_case_inc, filesystems_gperf_h]
+basic_sources += [filesystem_list_inc, filesystem_switch_case_inc, filesystems_gperf_h]
 
 libbasic_static = static_library(
         'basic',
index a515704a1f8ff1bcac376093d673da9d76cf8390..067ecee30321ecd22b8e53b8fc295d761f8126f4 100644 (file)
@@ -100,15 +100,34 @@ load_fragment_gperf_nulstr_c = custom_target(
         command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
         capture : true)
 
-generated_sources += [load_fragment_gperf_c, load_fragment_gperf_nulstr_c]
+generate_bpf_delegate_configs = files('generate-bpf-delegate-configs.py')
+bpf_delegate_configs_inc = custom_target(
+        input : [generate_bpf_delegate_configs, bpf_delegate_sources],
+        output : 'bpf-delegate-configs.inc',
+        command : [python,
+                   generate_bpf_delegate_configs,
+                   'code',
+                   bpf_delegate_sources],
+        capture : true)
+
+bpf_delegate_xml = custom_target(
+        input : [generate_bpf_delegate_configs, bpf_delegate_sources],
+        output : 'bpf-delegate.xml',
+        command : [python,
+                   generate_bpf_delegate_configs,
+                   'doc',
+                   bpf_delegate_sources],
+        capture : true)
+man_page_depends += bpf_delegate_xml
 
+generated_sources += [load_fragment_gperf_c, load_fragment_gperf_nulstr_c, bpf_delegate_configs_inc]
+libcore_sources += [load_fragment_gperf_c, load_fragment_gperf_nulstr_c, bpf_delegate_configs_inc]
+libcore_build_dir = meson.current_build_dir()
 libcore_name = 'systemd-core-@0@'.format(shared_lib_tag)
 
 libcore_static = static_library(
         libcore_name,
         libcore_sources,
-        load_fragment_gperf_c,
-        load_fragment_gperf_nulstr_c,
         include_directories : [includes, include_directories('.')],
         implicit_include_directories : false,
         c_args : ['-fvisibility=default'],
diff --git a/src/include/meson.build b/src/include/meson.build
new file mode 100644 (file)
index 0000000..74f4437
--- /dev/null
@@ -0,0 +1,38 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+# Source files that provides AF_XYZ
+af_sources = files(
+        'override/sys/socket.h',
+)
+
+# Source files that provides ARPHRD_XYZ
+arphrd_sources = files(
+        'uapi/linux/if_arp.h',
+)
+
+# Source files that provides CAP_XYZ
+cap_sources = files(
+        'uapi/linux/capability.h',
+)
+
+# Source files that provides BPF delegate options
+bpf_delegate_sources = files(
+        'uapi/linux/bpf.h',
+)
+
+# Source files that provides ETHTOOL_LINK_MODE_XYZ
+ethtool_link_mode_sources = files(
+        'uapi/linux/ethtool.h',
+)
+
+# Source files that provides IPPROTO_XYZ
+ipproto_sources = files(
+        'override/netinet/in.h',
+        'uapi/linux/in.h',
+)
+
+# Source files that provides KEY_XYZ
+keyboard_sources = files(
+        'uapi/linux/input.h',
+        'uapi/linux/input-event-codes.h',
+)
index 3851ea176f038d2528f1fd758031e84d8589a9ce..12103b2a0ff38b1422aa997c8b203939d411b749 100755 (executable)
@@ -3,15 +3,13 @@
 set -eu
 set -o pipefail
 
-cpp="${1:?}"
+CC="${1:?}"
 shift
 
-includes=()
-for i in "$@"; do
-    includes+=(-include "$i")
-done
+HEADER="${1:?}"
+shift
 
-$cpp -dM "${includes[@]}" - </dev/null | \
+$CC -dM -include "$HEADER" "$@" - </dev/null | \
      grep -vE 'AUDIT_.*(FIRST|LAST)_' | \
      sed -r -n 's/^#define\s+AUDIT_(\w+)\s+([0-9]{4})\s*$$/\1\t\2/p' | \
      sort -k2
index 0f8a101d89f418c06213039ecd68f3427b443745..87f39981c5b848524727dc951f7062603343176e 100644 (file)
 # the custom_target() has to be defined here in src/libsystemd/sd-journal
 # in the source directory.
 
-generate_audit_type_list = find_program('generate-audit_type-list.sh')
+generate_audit_type_list = files('generate-audit_type-list.sh')
 audit_type_list_txt = custom_target(
+        input : [generate_audit_type_list, missing_audit_h],
         output : 'audit_type-list.txt',
-        command : [generate_audit_type_list, cpp, missing_audit_h],
+        command : [env, 'bash', generate_audit_type_list, cpp, missing_audit_h, system_include_args],
         capture : true)
 
 audit_type_to_name = custom_target(
index aac1576145e93f5ae964e08e7f64c14ecc021299..6d23f3c43aee92980b0dd9a55718d58c809be2fb 100644 (file)
@@ -10,10 +10,12 @@ OVERRIDES = {
     'autoneg' : 'autonegotiation',
 }
 
-mode, cpp, header = sys.argv[1:]
+mode = sys.argv[1]
+cpp = sys.argv[2]
+include_dirs = sys.argv[3:]
 xml = mode == '--xml'
 
-command = [*shlex.split(cpp), '-include', header, '-']
+command = [*shlex.split(cpp), '-include', 'linux/ethtool.h'] + include_dirs + ['-']
 out = subprocess.check_output(command, stdin=subprocess.DEVNULL, universal_newlines=True)
 
 lines = iter(out.splitlines())
index ff898a9d466f486ece402b43132bdb4a8983496d..768a4df8ed8e93e57b8643748308e048f8952e29 100755 (executable)
@@ -4,6 +4,9 @@
 set -eu
 set -o pipefail
 
-${1:?} -dM -include netinet/in.h - </dev/null | \
+CC=${1:?}
+shift
+
+$CC -dM -include netinet/in.h "$@" - </dev/null | \
        awk '/^#define[ \t]+IPPROTO_[^ \t]+[ \t]+[^ \t]/ { print $2; }' | \
        sed -e 's/IPPROTO_//'
index 94a7eaa469d5d5b4f22103595e3bc6f26c3cdf17..dc509eeb281600d2aaac31fa879da2f5fc8e29fa 100644 (file)
@@ -258,10 +258,11 @@ if conf.get('HAVE_PAM') == 1
         shared_sources += files('pam-util.c')
 endif
 
-generate_ip_protocol_list = find_program('generate-ip-protocol-list.sh')
+generate_ip_protocol_list = files('generate-ip-protocol-list.sh')
 ip_protocol_list_txt = custom_target(
+        input : [generate_ip_protocol_list, ipproto_sources],
         output : 'ip-protocol-list.txt',
-        command : [generate_ip_protocol_list, cpp],
+        command : [env, 'bash', generate_ip_protocol_list, cpp, system_include_args],
         capture : true)
 
 fname = 'ip-protocol-from-name.gperf'
@@ -294,11 +295,12 @@ target2 = custom_target(
 generated_sources += [target1, target2]
 shared_sources += [target1, target2]
 
+ethtool_link_mode_py = files('ethtool-link-mode.py')
 fname = 'ethtool-link-mode.inc'
 ethtool_link_mode_inc = custom_target(
-        input : ['ethtool-link-mode.py', '../include/uapi/linux/ethtool.h'],
+        input : [ethtool_link_mode_py, ethtool_link_mode_sources],
         output : fname,
-        command : [python, '@INPUT0@', '--header', cpp, '@INPUT1@'],
+        command : [python, ethtool_link_mode_py, '--header', cpp, system_include_args],
         capture : true)
 
 generated_sources += ethtool_link_mode_inc
@@ -307,9 +309,9 @@ sources += shared_sources
 
 fname = 'ethtool-link-mode.xml'
 ethtool_link_mode_xml = custom_target(
-        input : ['ethtool-link-mode.py', '../include/uapi/linux/ethtool.h'],
+        input : [ethtool_link_mode_py, ethtool_link_mode_sources],
         output : fname,
-        command : [python, '@INPUT0@', '--xml', cpp, '@INPUT1@'],
+        command : [python, ethtool_link_mode_py, '--xml', cpp, system_include_args],
         capture : true)
 man_page_depends += ethtool_link_mode_xml
 
index fc34e4bd809d14a2850cabacb9bf67ecd54ecf56..e263cb09795c1023cd0c233c6325458cede1582e 100755 (executable)
@@ -10,6 +10,7 @@ _Pragma(\"GCC diagnostic ignored \\\"-Wimplicit-fallthrough\\\"\")\n\
 #if __GNUC__ >= 15\n\
 _Pragma(\"GCC diagnostic ignored \\\"-Wzero-as-null-pointer-constant\\\"\")\n\
 #endif\n\
+#include <linux/input.h>\n\
 %}"
         print "struct key_name { const char* name; unsigned short id; };"
         print "%null-strings"
index 4cac5073220e7ba701d06e377c52474891c7ef5c..580911922488294315477e855323ad3bc9d5e093 100755 (executable)
@@ -3,7 +3,10 @@
 set -eu
 set -o pipefail
 
-${1:?} -dM -include "${2:?}" - </dev/null | awk '
+CC=${1:?}
+shift
+
+$CC -dM -include linux/input.h "$@" - </dev/null | awk '
     /\<(KEY_(MAX|MIN_INTERESTING))|(BTN_(MISC|MOUSE|JOYSTICK|GAMEPAD|DIGI|WHEEL|TRIGGER_HAPPY))\>/  { next }
     /^#define[ \t]+(KEY|BTN)_[^ ]+[ \t]+[0-9BK]/                                                    { print $2 }
 '
index 6b37b669d0ad5741b78fb62121e998777159184f..7e49959bc5d1c0ea94ac47c608913280e5e856d3 100644 (file)
@@ -61,19 +61,19 @@ endif
 
 ############################################################
 
-generate_keyboard_keys_list = find_program('generate-keyboard-keys-list.sh')
+generate_keyboard_keys_list = files('generate-keyboard-keys-list.sh')
 keyboard_keys_list_txt = custom_target(
-        input : files('../include/uapi/linux/input.h'),
+        input : [generate_keyboard_keys_list, keyboard_sources],
         output : 'keyboard-keys-list.txt',
-        command : [generate_keyboard_keys_list, cpp, '@INPUT@'],
+        command : [env, 'bash', generate_keyboard_keys_list, cpp, system_include_args],
         capture : true)
 
-generate_keyboard_keys_gperf = find_program('generate-keyboard-keys-gperf.sh')
+generate_keyboard_keys_gperf = files('generate-keyboard-keys-gperf.sh')
 fname = 'keyboard-keys-from-name.gperf'
 gperf_file = custom_target(
-        input : keyboard_keys_list_txt,
+        input : [generate_keyboard_keys_gperf, keyboard_keys_list_txt],
         output : fname,
-        command : [generate_keyboard_keys_gperf, '@INPUT@'],
+        command : [env, 'bash', '@INPUT@'],
         capture : true)
 
 fname = 'keyboard-keys-from-name.inc'
index 294630ded15e155e1714362cb63b158b3ecf3341..0383ef71879951b45b6bc9606ac885851aa3a77c 100755 (executable)
@@ -11,7 +11,7 @@ class CustomResolver(tree.Resolver):
         if 'ethtool-link-mode' in url:
             return self.resolve_filename('src/shared/ethtool-link-mode.xml', context)
         if 'bpf-delegate' in url:
-            return self.resolve_filename('man/bpf-delegate.xml', context)
+            return self.resolve_filename('src/core/bpf-delegate.xml', context)
 
         return None