mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2025-04-19 20:58:31 +09:00

Add a function to decode argument types with the help of BTF. Will be used to display arguments in the function and function graph tracer. It can only handle simply arguments and up to FTRACE_REGS_MAX_ARGS number of arguments. When it hits a max, it will print ", ...": page_to_skb(vi=0xffff8d53842dc980, rq=0xffff8d53843a0800, page=0xfffffc2e04337c00, offset=6160, len=64, truesize=1536, ...) And if it hits an argument that is not recognized, it will print the raw value and the type of argument it is: make_vfsuid(idmap=0xffffffff87f99db8, fs_userns=0xffffffff87e543c0, kuid=0x0 (STRUCT)) __pti_set_user_pgtbl(pgdp=0xffff8d5384ab47f8, pgd=0x110e74067 (STRUCT)) Cc: Mark Rutland <mark.rutland@arm.com> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Paul Walmsley <paul.walmsley@sifive.com> Cc: Palmer Dabbelt <palmer@dabbelt.com> Cc: Albert Ou <aou@eecs.berkeley.edu> Cc: Guo Ren <guoren@kernel.org> Cc: Donglin Peng <dolinux.peng@gmail.com> Cc: Zheng Yejian <zhengyejian@huaweicloud.com> Link: https://lore.kernel.org/20250227185822.639418500@goodmis.org Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Co-developed-by: Steven Rostedt (Google) <rostedt@goodmis.org> Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
55 lines
1.7 KiB
C
55 lines
1.7 KiB
C
// SPDX-License-Identifier: GPL-2.0
|
|
#ifndef __TRACE_EVENTS_H
|
|
#define __TRACE_EVENTS_H
|
|
|
|
#include <linux/trace_seq.h>
|
|
#include "trace.h"
|
|
|
|
extern enum print_line_t
|
|
trace_print_bputs_msg_only(struct trace_iterator *iter);
|
|
extern enum print_line_t
|
|
trace_print_bprintk_msg_only(struct trace_iterator *iter);
|
|
extern enum print_line_t
|
|
trace_print_printk_msg_only(struct trace_iterator *iter);
|
|
|
|
extern int
|
|
seq_print_ip_sym(struct trace_seq *s, unsigned long ip,
|
|
unsigned long sym_flags);
|
|
|
|
extern void trace_seq_print_sym(struct trace_seq *s, unsigned long address, bool offset);
|
|
extern int trace_print_context(struct trace_iterator *iter);
|
|
extern int trace_print_lat_context(struct trace_iterator *iter);
|
|
extern enum print_line_t print_event_fields(struct trace_iterator *iter,
|
|
struct trace_event *event);
|
|
|
|
extern void trace_event_read_lock(void);
|
|
extern void trace_event_read_unlock(void);
|
|
extern struct trace_event *ftrace_find_event(int type);
|
|
|
|
extern enum print_line_t trace_nop_print(struct trace_iterator *iter,
|
|
int flags, struct trace_event *event);
|
|
extern int
|
|
trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry);
|
|
|
|
/* used by module unregistering */
|
|
extern int __unregister_trace_event(struct trace_event *event);
|
|
extern struct rw_semaphore trace_event_sem;
|
|
|
|
#define SEQ_PUT_FIELD(s, x) \
|
|
trace_seq_putmem(s, &(x), sizeof(x))
|
|
|
|
#define SEQ_PUT_HEX_FIELD(s, x) \
|
|
trace_seq_putmem_hex(s, &(x), sizeof(x))
|
|
|
|
#ifdef CONFIG_FUNCTION_TRACE_ARGS
|
|
void print_function_args(struct trace_seq *s, unsigned long *args,
|
|
unsigned long func);
|
|
#else
|
|
static inline void print_function_args(struct trace_seq *s, unsigned long *args,
|
|
unsigned long func) {
|
|
trace_seq_puts(s, "()");
|
|
}
|
|
#endif
|
|
#endif
|
|
|