Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\test_kprobes.c Create Date:2022-07-28 11:21:25
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:test_kprobes

Proto:static int test_kprobes(void)

Type:int

Parameter:Nothing

112  struct kprobe * kps[2] = { & kp, & kp2}
115  location of the probe point = NULL
116  * Indicates various status flags. * Protected by kprobe_mutex after this kprobe is registered. = 0
117  ret = register_kprobes(kps, 2)
118  If ret < 0 Then
119  pr_err("register_kprobes returned %d\n", ret)
120  Return ret
123  preh_val = 0
124  posth_val = 0
125  ret = target(rand1)
127  If preh_val == 0 Then
128  pr_err("kprobe pre_handler not called\n")
129  handler_errors++
132  If posth_val == 0 Then
133  pr_err("kprobe post_handler not called\n")
134  handler_errors++
137  preh_val = 0
138  posth_val = 0
139  ret = target2(rand1)
141  If preh_val == 0 Then
142  pr_err("kprobe pre_handler2 not called\n")
143  handler_errors++
146  If posth_val == 0 Then
147  pr_err("kprobe post_handler2 not called\n")
148  handler_errors++
151  unregister_kprobes(kps, 2)
152  Return 0
Caller
NameDescribe
init_test_probes