Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'probes-fixes-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace

Pull probes fixes from Masami Hiramatsu:

- Documentation update: Add a note about argument and return value
fetching is the best effort because it depends on the type.

- objpool: Fix to make internal global variables static in
test_objpool.c.

- kprobes: Unify kprobes_exceptions_nofify() prototypes. There are the
same prototypes in asm/kprobes.h for some architectures, but some of
them are missing the prototype and it causes a warning. So move the
prototype into linux/kprobes.h.

- tracing: Fix to check the tracepoint event and return event at
parsing stage. The tracepoint event doesn't support %return but if
$retval exists, it will be converted to %return silently. This finds
that case and rejects it.

- tracing: Fix the order of the descriptions about the parameters of
__kprobe_event_gen_cmd_start() to be consistent with the argument
list of the function.

* tag 'probes-fixes-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
tracing/kprobes: Fix the order of argument descriptions
tracing: fprobe-event: Fix to check tracepoint event and return
kprobes: unify kprobes_exceptions_nofify() prototypes
lib: test_objpool: make global variables static
Documentation: tracing: Add a note about argument and retval access

+25 -31
+6 -2
Documentation/trace/fprobetrace.rst
··· 59 59 and bitfield are supported. 60 60 61 61 (\*1) This is available only when BTF is enabled. 62 - (\*2) only for the probe on function entry (offs == 0). 63 - (\*3) only for return probe. 62 + (\*2) only for the probe on function entry (offs == 0). Note, this argument access 63 + is best effort, because depending on the argument type, it may be passed on 64 + the stack. But this only support the arguments via registers. 65 + (\*3) only for return probe. Note that this is also best effort. Depending on the 66 + return value type, it might be passed via a pair of registers. But this only 67 + accesses one register. 64 68 (\*4) this is useful for fetching a field of data structures. 65 69 (\*5) "u" means user-space dereference. 66 70
+6 -2
Documentation/trace/kprobetrace.rst
··· 61 61 (x8/x16/x32/x64), "char", "string", "ustring", "symbol", "symstr" 62 62 and bitfield are supported. 63 63 64 - (\*1) only for the probe on function entry (offs == 0). 65 - (\*2) only for return probe. 64 + (\*1) only for the probe on function entry (offs == 0). Note, this argument access 65 + is best effort, because depending on the argument type, it may be passed on 66 + the stack. But this only support the arguments via registers. 67 + (\*2) only for return probe. Note that this is also best effort. Depending on the 68 + return value type, it might be passed via a pair of registers. But this only 69 + accesses one register. 66 70 (\*3) this is useful for fetching a field of data structures. 67 71 (\*4) "u" means user-space dereference. See :ref:`user_mem_access`. 68 72
-3
arch/arc/include/asm/kprobes.h
··· 32 32 33 33 void arch_remove_kprobe(struct kprobe *p); 34 34 35 - int kprobe_exceptions_notify(struct notifier_block *self, 36 - unsigned long val, void *data); 37 - 38 35 struct prev_kprobe { 39 36 struct kprobe *kp; 40 37 unsigned long status;
-2
arch/arm/include/asm/kprobes.h
··· 40 40 41 41 void arch_remove_kprobe(struct kprobe *); 42 42 int kprobe_fault_handler(struct pt_regs *regs, unsigned int fsr); 43 - int kprobe_exceptions_notify(struct notifier_block *self, 44 - unsigned long val, void *data); 45 43 46 44 /* optinsn template addresses */ 47 45 extern __visible kprobe_opcode_t optprobe_template_entry[];
-2
arch/arm64/include/asm/kprobes.h
··· 37 37 38 38 void arch_remove_kprobe(struct kprobe *); 39 39 int kprobe_fault_handler(struct pt_regs *regs, unsigned int fsr); 40 - int kprobe_exceptions_notify(struct notifier_block *self, 41 - unsigned long val, void *data); 42 40 void __kretprobe_trampoline(void); 43 41 void __kprobes *trampoline_probe_handler(struct pt_regs *regs); 44 42
-2
arch/mips/include/asm/kprobes.h
··· 71 71 struct prev_kprobe prev_kprobe; 72 72 }; 73 73 74 - extern int kprobe_exceptions_notify(struct notifier_block *self, 75 - unsigned long val, void *data); 76 74 77 75 #endif /* CONFIG_KPROBES */ 78 76 #endif /* _ASM_KPROBES_H */
-2
arch/powerpc/include/asm/kprobes.h
··· 84 84 kprobe_opcode_t *insn; 85 85 }; 86 86 87 - extern int kprobe_exceptions_notify(struct notifier_block *self, 88 - unsigned long val, void *data); 89 87 extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr); 90 88 extern int kprobe_handler(struct pt_regs *regs); 91 89 extern int kprobe_post_handler(struct pt_regs *regs);
-2
arch/s390/include/asm/kprobes.h
··· 73 73 void arch_remove_kprobe(struct kprobe *p); 74 74 75 75 int kprobe_fault_handler(struct pt_regs *regs, int trapnr); 76 - int kprobe_exceptions_notify(struct notifier_block *self, 77 - unsigned long val, void *data); 78 76 79 77 #define flush_insn_slot(p) do { } while (0) 80 78
-2
arch/sh/include/asm/kprobes.h
··· 46 46 }; 47 47 48 48 extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr); 49 - extern int kprobe_exceptions_notify(struct notifier_block *self, 50 - unsigned long val, void *data); 51 49 extern int kprobe_handle_illslot(unsigned long pc); 52 50 #else 53 51
-2
arch/sparc/include/asm/kprobes.h
··· 47 47 struct prev_kprobe prev_kprobe; 48 48 }; 49 49 50 - int kprobe_exceptions_notify(struct notifier_block *self, 51 - unsigned long val, void *data); 52 50 int kprobe_fault_handler(struct pt_regs *regs, int trapnr); 53 51 asmlinkage void __kprobes kprobe_trap(unsigned long trap_level, 54 52 struct pt_regs *regs);
-2
arch/x86/include/asm/kprobes.h
··· 113 113 }; 114 114 115 115 extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr); 116 - extern int kprobe_exceptions_notify(struct notifier_block *self, 117 - unsigned long val, void *data); 118 116 extern int kprobe_int3_handler(struct pt_regs *regs); 119 117 120 118 #else
+4
include/linux/kprobes.h
··· 445 445 446 446 int arch_kprobe_get_kallsym(unsigned int *symnum, unsigned long *value, 447 447 char *type, char *sym); 448 + 449 + int kprobe_exceptions_notify(struct notifier_block *self, 450 + unsigned long val, void *data); 451 + 448 452 #else /* !CONFIG_KPROBES: */ 449 453 450 454 static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
+5 -4
kernel/trace/trace_fprobe.c
··· 927 927 for (i = 2; i < argc; i++) { 928 928 tmp = strstr(argv[i], "$retval"); 929 929 if (tmp && !isalnum(tmp[7]) && tmp[7] != '_') { 930 + if (is_tracepoint) { 931 + trace_probe_log_set_index(i); 932 + trace_probe_log_err(tmp - argv[i], RETVAL_ON_PROBE); 933 + return -EINVAL; 934 + } 930 935 *is_return = true; 931 - /* 932 - * NOTE: Don't check is_tracepoint here, because it will 933 - * be checked when the argument is parsed. 934 - */ 935 936 break; 936 937 } 937 938 }
+1 -1
kernel/trace/trace_kprobe.c
··· 1020 1020 /** 1021 1021 * __kprobe_event_gen_cmd_start - Generate a kprobe event command from arg list 1022 1022 * @cmd: A pointer to the dynevent_cmd struct representing the new event 1023 + * @kretprobe: Is this a return probe? 1023 1024 * @name: The name of the kprobe event 1024 1025 * @loc: The location of the kprobe event 1025 - * @kretprobe: Is this a return probe? 1026 1026 * @...: Variable number of arg (pairs), one pair for each field 1027 1027 * 1028 1028 * NOTE: Users normally won't want to call this function directly, but
+3 -3
lib/test_objpool.c
··· 311 311 ot_kfree(sop->test, sop, sizeof(*sop)); 312 312 } 313 313 314 - struct { 314 + static struct { 315 315 struct ot_context * (*init)(struct ot_test *oc); 316 316 void (*fini)(struct ot_context *sop); 317 317 } g_ot_sync_ops[] = { ··· 475 475 return sop; 476 476 } 477 477 478 - struct { 478 + static struct { 479 479 struct ot_context * (*init)(struct ot_test *oc); 480 480 void (*fini)(struct ot_context *sop); 481 481 } g_ot_async_ops[] = { ··· 632 632 #define NODE_COMPACT sizeof(struct ot_node) 633 633 #define NODE_VMALLOC (512) 634 634 635 - struct ot_test g_testcases[] = { 635 + static struct ot_test g_testcases[] = { 636 636 637 637 /* sync & normal */ 638 638 {0, 0, NODE_COMPACT, 1000, 0, 1, 0, 0, "sync: percpu objpool"},