Skip to content

Conversation

@kernel-patches-daemon-bpf-rc
Copy link

Pull request for series with
subject: ftrace,bpf: Use single direct ops for bpf trampolines
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1026027

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: d088da9
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1026027
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: e0940c6
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1026027
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 792f258
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1026027
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 878ee3c
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1026027
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: ae24fc8
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1026027
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: b7f7d76
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1026027
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 4dd3a48
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1026027
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 8f7cf30
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1026027
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: c427320
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1026027
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 4617b30
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1026027
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 590699d
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1026027
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: f2cb066
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1026027
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 8c868a3
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1026027
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 8f6ddc0
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1026027
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 5262cb2
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1026027
version: 1

Make alloc_and_copy_ftrace_hash to copy also direct address
for each hash entry.

Signed-off-by: Jiri Olsa <[email protected]>
We are going to use these functions in following changes.

Signed-off-by: Jiri Olsa <[email protected]>
Adding update_ftrace_direct_add function that adds all entries
(ip -> addr) provided in hash argument to direct ftrace ops
and updates its attachments.

The difference to current register_ftrace_direct is
 - hash argument that allows to register multiple ip -> direct
   entries at once
 - we can call update_ftrace_direct_add multiple times on the
   same ftrace_ops object, becase after first registration with
   register_ftrace_function_nolock, it uses ftrace_update_ops to
   update the ftrace_ops object

This change will allow us to have simple ftrace_ops for all bpf
direct interface users in following changes.

Signed-off-by: Jiri Olsa <[email protected]>
Adding update_ftrace_direct_del function that removes all entries
(ip -> addr) provided in hash argument to direct ftrace ops and
updates its attachments.

The difference to current unregister_ftrace_direct is
 - hash argument that allows to unregister multiple ip -> direct
   entries at once
 - we can call update_ftrace_direct_del multiple times on the
   same ftrace_ops object, becase we do not need to unregister
   all entries at once, we can do it gradualy with the help of
   ftrace_update_ops function

This change will allow us to have simple ftrace_ops for all bpf
direct interface users in following changes.

Signed-off-by: Jiri Olsa <[email protected]>
Adding update_ftrace_direct_mod function that modifies all entries
(ip -> direct) provided in hash argument to direct ftrace ops and
updates its attachments.

The difference to current modify_ftrace_direct is:
- hash argument that allows to modify multiple ip -> direct
  entries at once

This change will allow us to have simple ftrace_ops for all bpf
direct interface users in following changes.

Signed-off-by: Jiri Olsa <[email protected]>
Following changes need to lookup trampoline based on its ip address,
adding hash table for that.

Signed-off-by: Jiri Olsa <[email protected]>
We are going to remove "ftrace_ops->private == bpf_trampoline" setup
in following changes.

Adding ip argument to ftrace_ops_func_t callback function, so we can
use it to look up the trampoline.

Signed-off-by: Jiri Olsa <[email protected]>
Using single ftrace_ops for direct calls update instead of allocating
ftrace_ops object for each trampoline.

With single ftrace_ops object we can use update_ftrace_direct_* api
that allows multiple ip sites updates on single ftrace_ops object.

Adding HAVE_SINGLE_FTRACE_DIRECT_OPS config option to be enabled on
each arch that supports this.

At the moment we can enable this only on x86 arch, because arm relies
on ftrace_ops object representing just single trampoline image (stored
in ftrace_ops::direct_call). Ach that do not support this will continue
to use *_ftrace_direct api.

Signed-off-by: Jiri Olsa <[email protected]>
@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 688b745
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1026027
version: 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants