函数源码

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source File:include\linux\kprobes.h Create Date:2022-07-27 06:52:53
首页 Copyright©Brick

447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
#ifndef CONFIG_KPROBES
static inline bool is_kprobe_insn_slot(unsigned long addr)
{
    return false;
}
#endif
#ifndef CONFIG_OPTPROBES
static inline bool is_kprobe_optinsn_slot(unsigned long addr)
{
    return false;
}
#endif
 
/* Returns true if kprobes handled the fault */
static nokprobe_inline bool kprobe_page_fault(struct pt_regs *regs,
                          unsigned int trap)
{
    if (!kprobes_built_in())
        return false;
    if (user_mode(regs))
        return false;
    /*
     * To be potentially processing a kprobe fault and to be allowed
     * to call kprobe_running(), we have to be non-preemptible.
     */
    if (preemptible())
        return false;
    if (!kprobe_running())
        return false;
    return kprobe_fault_handler(regs, trap);
}