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

kprobes: Make kprobe register via symbol name #135

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

kprobes: Make kprobe register via symbol name #135

wants to merge 1 commit into from

Commits on Jan 30, 2017

  1. kprobes: Make kprobe register via symbol name

    In Linux kernel, kprobe can register by function address or symbol name,
    but currently in F9 microkernel, can only register by address.
    
    9 microkernel already include ksymbols when compiling kernel with
    CONFIG_SYMMAP, which means F9 microkernel have the ability to regiser kprobe
    via symbol name, too.
    
    This commit change two parts in F9 microkernel, ksym and kprobes.
    
    * ksym
        - Adding ksym_lookup_name to search function address via symbol name.
    
    * kprobes
        - Adding new field `symbol_name` in struct kprobe.
        - When kprobe is registering, it will get the correct address via
          help function `kprobe_addr`, `kprobe_addr` will return correct
          function address. Also, `kprobe_addr` will failed when it cannot
          match the symbol name in symtab, or address and symbol name are
          used in the same time.
    
    Example usage:
    
    static struct kprobe kp = {
        .symbol_name = "ktimer_handler"
    };
    
    or
    
    extern void ktimer_handler(void);
    static struct kprobe kp = {
        .addr = ktimer_handler
    };
    Louie Lu authored and louisom committed Jan 30, 2017
    Configuration menu
    Copy the full SHA
    2d5164a View commit details
    Browse the repository at this point in the history