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

create-diff-object: __patchable_function_entries section support #1415

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Dec 3, 2024

  1. create-diff-object: Create __patchable_function_entries sections

    The __mcount_loc section contains the addresses of patchable ftrace
    sites which is used by the ftrace infrastructure in the kernel to create
    a list of tracable functions and to know where to patch to enable
    tracing of them.  On some kernel configurations, section is called
    __patchable_function_entries and is generated by the compiler.  Either of
    __mcount_loc or __patchable_function_entries is recognised by the kernel
    but for these configurations, use __patchable_function_entries as it is
    what is expected.
    
    The x86_64 arch is special (of course).  Unlike other arches (ppc64le
    and aarch64) a x86_64 kernel built with -fpatchable-function-entry will
    generate nops AND create rela__patchable_function_entries for functions even
    marked as notrace.  For this arch, always create __mount_loc sections and
    rely on __fentry__ relocations to indicate ftrace call sites.
    
    Note: this patch is a refactoring of original code by Pete Swain
    <swine@google.com> for aarch64.  At the same time, this version squashes
    several follow up commits from him and zimao <zimao@microsoft.com>.  The
    intent is minimize the eventual changeset for aarch64 support now that
    other arches are making use of __patchable_function_entries sections.
    
    Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
    joe-lawrence committed Dec 3, 2024
    Configuration menu
    Copy the full SHA
    7b6fee6 View commit details
    Browse the repository at this point in the history