Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore external maps during retrieving type id's #2196

Merged
merged 1 commit into from
Feb 12, 2019
Merged

Conversation

yonghong-song
Copy link
Collaborator

When running example UseExternalMap or test test_libbcc,
the following warning showed up:

  -bash-4.4$ sudo ./UseExternalMap
  libbpf: map:control btf_key_type_size:4 != map_def_key_size:0
  .....
  -bash-4.4$ sudo ./test_libbcc
  libbpf: map:mysharedtable btf_key_type_size:4 != map_def_key_size:0
  .....

This is related to external maps. When the application
defines an external maps, the extra .maps.<map_name> section
gets generated. But the map is not in fake_fd_map_
as the external map does not require an explicit bpf_create_map
syscall. It merely duplicates fd from an existing map.

The warning showed up because the external map was not
in fake_fd_map_ and expected_ksize and expected_vsize are based
on fake_fd_map_ hence is 0, which does not match the real map.

There is really no reason to find type ids for external maps.
So just skip them and the warnings are gone as well.

Signed-off-by: Yonghong Song [email protected]

When running example UseExternalMap or test test_libbcc,
the following warning showed up:
  -bash-4.4$ sudo ./UseExternalMap
  libbpf: map:control btf_key_type_size:4 != map_def_key_size:0
  .....
  -bash-4.4$ sudo ./test_libbcc
  libbpf: map:mysharedtable btf_key_type_size:4 != map_def_key_size:0
  .....

This is related to external maps. When the application
defines an external maps, the extra .maps.<map_name> section
gets generated. But the map is not in fake_fd_map_
as the external map does not require an explicit bpf_create_map
syscall. It merely duplicates fd from an existing map.

The warning showed up because the external map was not
in fake_fd_map_ and expected_ksize and expected_vsize are based
on fake_fd_map_ hence is 0, which does not match the real map.

There is really no reason to find type ids for external maps.
So just skip them and the warnings are gone as well.

Signed-off-by: Yonghong Song <[email protected]>
@yonghong-song yonghong-song merged commit ac2229c into master Feb 12, 2019
palexster pushed a commit to palexster/bcc that referenced this pull request Jul 7, 2019
When running example UseExternalMap or test test_libbcc,
the following warning showed up:
  -bash-4.4$ sudo ./UseExternalMap
  libbpf: map:control btf_key_type_size:4 != map_def_key_size:0
  .....
  -bash-4.4$ sudo ./test_libbcc
  libbpf: map:mysharedtable btf_key_type_size:4 != map_def_key_size:0
  .....

This is related to external maps. When the application
defines an external maps, the extra .maps.<map_name> section
gets generated. But the map is not in fake_fd_map_
as the external map does not require an explicit bpf_create_map
syscall. It merely duplicates fd from an existing map.

The warning showed up because the external map was not
in fake_fd_map_ and expected_ksize and expected_vsize are based
on fake_fd_map_ hence is 0, which does not match the real map.

There is really no reason to find type ids for external maps.
So just skip them and the warnings are gone as well.

Signed-off-by: Yonghong Song <[email protected]>
CrackerCat pushed a commit to CrackerCat/bcc that referenced this pull request Jul 31, 2024
When running example UseExternalMap or test test_libbcc,
the following warning showed up:
  -bash-4.4$ sudo ./UseExternalMap
  libbpf: map:control btf_key_type_size:4 != map_def_key_size:0
  .....
  -bash-4.4$ sudo ./test_libbcc
  libbpf: map:mysharedtable btf_key_type_size:4 != map_def_key_size:0
  .....

This is related to external maps. When the application
defines an external maps, the extra .maps.<map_name> section
gets generated. But the map is not in fake_fd_map_
as the external map does not require an explicit bpf_create_map
syscall. It merely duplicates fd from an existing map.

The warning showed up because the external map was not
in fake_fd_map_ and expected_ksize and expected_vsize are based
on fake_fd_map_ hence is 0, which does not match the real map.

There is really no reason to find type ids for external maps.
So just skip them and the warnings are gone as well.

Signed-off-by: Yonghong Song <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants