Skip to content

Commit 2425bcb

Browse files
committed
tracing: Rename ftrace_event_{call,class} to trace_event_{call,class}
The name "ftrace" really refers to the function hook infrastructure. It is not about the trace_events. The structures ftrace_event_call and ftrace_event_class have nothing to do with the function hooks, and are really trace_event structures. Rename ftrace_event_* to trace_event_*. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
1 parent 7f1d2f8 commit 2425bcb

22 files changed

Lines changed: 172 additions & 172 deletions

‎include/linux/module.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ struct module {
336336
const char **trace_bprintk_fmt_start;
337337
#endif
338338
#ifdef CONFIG_EVENT_TRACING
339-
struct ftrace_event_call **trace_events;
339+
struct trace_event_call **trace_events;
340340
unsigned int num_trace_events;
341341
struct trace_enum_map **trace_enums;
342342
unsigned int num_trace_enums;

‎include/linux/perf_event.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ struct perf_event {
483483
void *overflow_handler_context;
484484

485485
#ifdef CONFIG_EVENT_TRACING
486-
struct ftrace_event_call *tp_event;
486+
struct trace_event_call *tp_event;
487487
struct event_filter *filter;
488488
#ifdef CONFIG_FUNCTION_TRACER
489489
struct ftrace_ops ftrace_ops;

‎include/linux/syscalls.h‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,14 @@ union bpf_attr;
111111
#define __SC_STR_ADECL(t, a) #a
112112
#define __SC_STR_TDECL(t, a) #t
113113

114-
extern struct ftrace_event_class event_class_syscall_enter;
115-
extern struct ftrace_event_class event_class_syscall_exit;
114+
extern struct trace_event_class event_class_syscall_enter;
115+
extern struct trace_event_class event_class_syscall_exit;
116116
extern struct trace_event_functions enter_syscall_print_funcs;
117117
extern struct trace_event_functions exit_syscall_print_funcs;
118118

119119
#define SYSCALL_TRACE_ENTER_EVENT(sname) \
120120
static struct syscall_metadata __syscall_meta_##sname; \
121-
static struct ftrace_event_call __used \
121+
static struct trace_event_call __used \
122122
event_enter_##sname = { \
123123
.class = &event_class_syscall_enter, \
124124
{ \
@@ -128,13 +128,13 @@ extern struct trace_event_functions exit_syscall_print_funcs;
128128
.data = (void *)&__syscall_meta_##sname,\
129129
.flags = TRACE_EVENT_FL_CAP_ANY, \
130130
}; \
131-
static struct ftrace_event_call __used \
131+
static struct trace_event_call __used \
132132
__attribute__((section("_ftrace_events"))) \
133133
*__event_enter_##sname = &event_enter_##sname;
134134

135135
#define SYSCALL_TRACE_EXIT_EVENT(sname) \
136136
static struct syscall_metadata __syscall_meta_##sname; \
137-
static struct ftrace_event_call __used \
137+
static struct trace_event_call __used \
138138
event_exit_##sname = { \
139139
.class = &event_class_syscall_exit, \
140140
{ \
@@ -144,7 +144,7 @@ extern struct trace_event_functions exit_syscall_print_funcs;
144144
.data = (void *)&__syscall_meta_##sname,\
145145
.flags = TRACE_EVENT_FL_CAP_ANY, \
146146
}; \
147-
static struct ftrace_event_call __used \
147+
static struct trace_event_call __used \
148148
__attribute__((section("_ftrace_events"))) \
149149
*__event_exit_##sname = &event_exit_##sname;
150150

‎include/linux/trace_events.h‎

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -200,23 +200,23 @@ enum trace_reg {
200200
#endif
201201
};
202202

203-
struct ftrace_event_call;
203+
struct trace_event_call;
204204

205-
struct ftrace_event_class {
205+
struct trace_event_class {
206206
const char *system;
207207
void *probe;
208208
#ifdef CONFIG_PERF_EVENTS
209209
void *perf_probe;
210210
#endif
211-
int (*reg)(struct ftrace_event_call *event,
211+
int (*reg)(struct trace_event_call *event,
212212
enum trace_reg type, void *data);
213-
int (*define_fields)(struct ftrace_event_call *);
214-
struct list_head *(*get_fields)(struct ftrace_event_call *);
213+
int (*define_fields)(struct trace_event_call *);
214+
struct list_head *(*get_fields)(struct trace_event_call *);
215215
struct list_head fields;
216-
int (*raw_init)(struct ftrace_event_call *);
216+
int (*raw_init)(struct trace_event_call *);
217217
};
218218

219-
extern int trace_event_reg(struct ftrace_event_call *event,
219+
extern int trace_event_reg(struct trace_event_call *event,
220220
enum trace_reg type, void *data);
221221

222222
struct ftrace_event_buffer {
@@ -269,9 +269,9 @@ enum {
269269
TRACE_EVENT_FL_KPROBE = (1 << TRACE_EVENT_FL_KPROBE_BIT),
270270
};
271271

272-
struct ftrace_event_call {
272+
struct trace_event_call {
273273
struct list_head list;
274-
struct ftrace_event_class *class;
274+
struct trace_event_class *class;
275275
union {
276276
char *name;
277277
/* Set TRACE_EVENT_FL_TRACEPOINT flag when using "tp" */
@@ -298,13 +298,13 @@ struct ftrace_event_call {
298298
struct hlist_head __percpu *perf_events;
299299
struct bpf_prog *prog;
300300

301-
int (*perf_perm)(struct ftrace_event_call *,
301+
int (*perf_perm)(struct trace_event_call *,
302302
struct perf_event *);
303303
#endif
304304
};
305305

306306
static inline const char *
307-
ftrace_event_name(struct ftrace_event_call *call)
307+
ftrace_event_name(struct trace_event_call *call)
308308
{
309309
if (call->flags & TRACE_EVENT_FL_TRACEPOINT)
310310
return call->tp ? call->tp->name : NULL;
@@ -351,7 +351,7 @@ enum {
351351

352352
struct trace_event_file {
353353
struct list_head list;
354-
struct ftrace_event_call *event_call;
354+
struct trace_event_call *event_call;
355355
struct event_filter *filter;
356356
struct dentry *dir;
357357
struct trace_array *tr;
@@ -388,7 +388,7 @@ struct trace_event_file {
388388
early_initcall(trace_init_flags_##name);
389389

390390
#define __TRACE_EVENT_PERF_PERM(name, expr...) \
391-
static int perf_perm_##name(struct ftrace_event_call *tp_event, \
391+
static int perf_perm_##name(struct trace_event_call *tp_event, \
392392
struct perf_event *p_event) \
393393
{ \
394394
return ({ expr; }); \
@@ -417,7 +417,7 @@ extern int filter_match_preds(struct event_filter *filter, void *rec);
417417
extern int filter_check_discard(struct trace_event_file *file, void *rec,
418418
struct ring_buffer *buffer,
419419
struct ring_buffer_event *event);
420-
extern int call_filter_check_discard(struct ftrace_event_call *call, void *rec,
420+
extern int call_filter_check_discard(struct trace_event_call *call, void *rec,
421421
struct ring_buffer *buffer,
422422
struct ring_buffer_event *event);
423423
extern enum event_trigger_type event_triggers_call(struct trace_event_file *file,
@@ -559,12 +559,12 @@ enum {
559559
FILTER_TRACE_FN,
560560
};
561561

562-
extern int trace_event_raw_init(struct ftrace_event_call *call);
563-
extern int trace_define_field(struct ftrace_event_call *call, const char *type,
562+
extern int trace_event_raw_init(struct trace_event_call *call);
563+
extern int trace_define_field(struct trace_event_call *call, const char *type,
564564
const char *name, int offset, int size,
565565
int is_signed, int filter_type);
566-
extern int trace_add_event_call(struct ftrace_event_call *call);
567-
extern int trace_remove_event_call(struct ftrace_event_call *call);
566+
extern int trace_add_event_call(struct trace_event_call *call);
567+
extern int trace_remove_event_call(struct trace_event_call *call);
568568

569569
#define is_signed_type(type) (((type)(-1)) < (type)1)
570570

@@ -613,4 +613,4 @@ perf_trace_buf_submit(void *raw_data, int size, int rctx, u64 addr,
613613
}
614614
#endif
615615

616-
#endif /* _LINUX_FTRACE_EVENT_H */
616+
#endif /* _LINUX_TRACE_EVENT_H */

‎include/trace/perf.h‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
*
66
* For those macros defined with TRACE_EVENT:
77
*
8-
* static struct ftrace_event_call event_<call>;
8+
* static struct trace_event_call event_<call>;
99
*
1010
* static void ftrace_raw_event_<call>(void *__data, proto)
1111
* {
1212
* struct trace_event_file *trace_file = __data;
13-
* struct ftrace_event_call *event_call = trace_file->event_call;
13+
* struct trace_event_call *event_call = trace_file->event_call;
1414
* struct ftrace_data_offsets_<call> __maybe_unused __data_offsets;
1515
* unsigned long eflags = trace_file->flags;
1616
* enum event_trigger_type __tt = ETT_NONE;
@@ -63,7 +63,7 @@
6363
*
6464
* static char print_fmt_<call>[] = <TP_printk>;
6565
*
66-
* static struct ftrace_event_class __used event_class_<template> = {
66+
* static struct trace_event_class __used event_class_<template> = {
6767
* .system = "<system>",
6868
* .define_fields = ftrace_define_fields_<call>,
6969
* .fields = LIST_HEAD_INIT(event_class_##call.fields),
@@ -72,7 +72,7 @@
7272
* .reg = trace_event_reg,
7373
* };
7474
*
75-
* static struct ftrace_event_call event_<call> = {
75+
* static struct trace_event_call event_<call> = {
7676
* .class = event_class_<template>,
7777
* {
7878
* .tp = &__tracepoint_<call>,
@@ -83,7 +83,7 @@
8383
* };
8484
* // its only safe to use pointers when doing linker tricks to
8585
* // create an array.
86-
* static struct ftrace_event_call __used
86+
* static struct trace_event_call __used
8787
* __attribute__((section("_ftrace_events"))) *__event_<call> = &event_<call>;
8888
*
8989
*/
@@ -213,7 +213,7 @@ static inline void ftrace_test_probe_##call(void) \
213213
#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
214214
_TRACE_PERF_PROTO(call, PARAMS(proto)); \
215215
static char print_fmt_##call[] = print; \
216-
static struct ftrace_event_class __used __refdata event_class_##call = { \
216+
static struct trace_event_class __used __refdata event_class_##call = { \
217217
.system = TRACE_SYSTEM_STRING, \
218218
.define_fields = ftrace_define_fields_##call, \
219219
.fields = LIST_HEAD_INIT(event_class_##call.fields),\
@@ -226,7 +226,7 @@ static struct ftrace_event_class __used __refdata event_class_##call = { \
226226
#undef DEFINE_EVENT
227227
#define DEFINE_EVENT(template, call, proto, args) \
228228
\
229-
static struct ftrace_event_call __used event_##call = { \
229+
static struct trace_event_call __used event_##call = { \
230230
.class = &event_class_##template, \
231231
{ \
232232
.tp = &__tracepoint_##call, \
@@ -235,15 +235,15 @@ static struct ftrace_event_call __used event_##call = { \
235235
.print_fmt = print_fmt_##template, \
236236
.flags = TRACE_EVENT_FL_TRACEPOINT, \
237237
}; \
238-
static struct ftrace_event_call __used \
238+
static struct trace_event_call __used \
239239
__attribute__((section("_ftrace_events"))) *__event_##call = &event_##call
240240

241241
#undef DEFINE_EVENT_PRINT
242242
#define DEFINE_EVENT_PRINT(template, call, proto, args, print) \
243243
\
244244
static char print_fmt_##call[] = print; \
245245
\
246-
static struct ftrace_event_call __used event_##call = { \
246+
static struct trace_event_call __used event_##call = { \
247247
.class = &event_class_##template, \
248248
{ \
249249
.tp = &__tracepoint_##call, \
@@ -252,7 +252,7 @@ static struct ftrace_event_call __used event_##call = { \
252252
.print_fmt = print_fmt_##call, \
253253
.flags = TRACE_EVENT_FL_TRACEPOINT, \
254254
}; \
255-
static struct ftrace_event_call __used \
255+
static struct trace_event_call __used \
256256
__attribute__((section("_ftrace_events"))) *__event_##call = &event_##call
257257

258258
#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
@@ -292,7 +292,7 @@ __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call
292292
static notrace void \
293293
perf_trace_##call(void *__data, proto) \
294294
{ \
295-
struct ftrace_event_call *event_call = __data; \
295+
struct trace_event_call *event_call = __data; \
296296
struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\
297297
struct ftrace_raw_##call *entry; \
298298
struct pt_regs *__regs; \

‎include/trace/syscall.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ struct syscall_metadata {
2929
const char **args;
3030
struct list_head enter_fields;
3131

32-
struct ftrace_event_call *enter_event;
33-
struct ftrace_event_call *exit_event;
32+
struct trace_event_call *enter_event;
33+
struct trace_event_call *exit_event;
3434
};
3535

3636
#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_HAVE_SYSCALL_TRACEPOINTS)

‎include/trace/trace_events.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ TRACE_MAKE_SYSTEM_STR();
101101
char __data[0]; \
102102
}; \
103103
\
104-
static struct ftrace_event_class event_class_##name;
104+
static struct trace_event_class event_class_##name;
105105

106106
#undef DEFINE_EVENT
107107
#define DEFINE_EVENT(template, name, proto, args) \
108-
static struct ftrace_event_call __used \
108+
static struct trace_event_call __used \
109109
__attribute__((__aligned__(4))) event_##name
110110

111111
#undef DEFINE_EVENT_FN
@@ -407,7 +407,7 @@ static struct trace_event_functions ftrace_event_type_funcs_##call = { \
407407
#undef DECLARE_EVENT_CLASS
408408
#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, func, print) \
409409
static int notrace __init \
410-
ftrace_define_fields_##call(struct ftrace_event_call *event_call) \
410+
ftrace_define_fields_##call(struct trace_event_call *event_call) \
411411
{ \
412412
struct ftrace_raw_##call field; \
413413
int ret; \

‎kernel/trace/trace.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ int filter_check_discard(struct trace_event_file *file, void *rec,
311311
}
312312
EXPORT_SYMBOL_GPL(filter_check_discard);
313313

314-
int call_filter_check_discard(struct ftrace_event_call *call, void *rec,
314+
int call_filter_check_discard(struct trace_event_call *call, void *rec,
315315
struct ring_buffer *buffer,
316316
struct ring_buffer_event *event)
317317
{
@@ -1761,7 +1761,7 @@ trace_function(struct trace_array *tr,
17611761
unsigned long ip, unsigned long parent_ip, unsigned long flags,
17621762
int pc)
17631763
{
1764-
struct ftrace_event_call *call = &event_function;
1764+
struct trace_event_call *call = &event_function;
17651765
struct ring_buffer *buffer = tr->trace_buffer.buffer;
17661766
struct ring_buffer_event *event;
17671767
struct ftrace_entry *entry;
@@ -1796,7 +1796,7 @@ static void __ftrace_trace_stack(struct ring_buffer *buffer,
17961796
unsigned long flags,
17971797
int skip, int pc, struct pt_regs *regs)
17981798
{
1799-
struct ftrace_event_call *call = &event_kernel_stack;
1799+
struct trace_event_call *call = &event_kernel_stack;
18001800
struct ring_buffer_event *event;
18011801
struct stack_entry *entry;
18021802
struct stack_trace trace;
@@ -1924,7 +1924,7 @@ static DEFINE_PER_CPU(int, user_stack_count);
19241924
void
19251925
ftrace_trace_userstack(struct ring_buffer *buffer, unsigned long flags, int pc)
19261926
{
1927-
struct ftrace_event_call *call = &event_user_stack;
1927+
struct trace_event_call *call = &event_user_stack;
19281928
struct ring_buffer_event *event;
19291929
struct userstack_entry *entry;
19301930
struct stack_trace trace;
@@ -2130,7 +2130,7 @@ static void trace_printk_start_stop_comm(int enabled)
21302130
*/
21312131
int trace_vbprintk(unsigned long ip, const char *fmt, va_list args)
21322132
{
2133-
struct ftrace_event_call *call = &event_bprint;
2133+
struct trace_event_call *call = &event_bprint;
21342134
struct ring_buffer_event *event;
21352135
struct ring_buffer *buffer;
21362136
struct trace_array *tr = &global_trace;
@@ -2188,7 +2188,7 @@ static int
21882188
__trace_array_vprintk(struct ring_buffer *buffer,
21892189
unsigned long ip, const char *fmt, va_list args)
21902190
{
2191-
struct ftrace_event_call *call = &event_print;
2191+
struct trace_event_call *call = &event_print;
21922192
struct ring_buffer_event *event;
21932193
int len = 0, size, pc;
21942194
struct print_entry *entry;

‎kernel/trace/trace.h‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ void ftrace_destroy_filter_files(struct ftrace_ops *ops);
858858
#define ftrace_destroy_filter_files(ops) do { } while (0)
859859
#endif /* CONFIG_FUNCTION_TRACER && CONFIG_DYNAMIC_FTRACE */
860860

861-
int ftrace_event_is_function(struct ftrace_event_call *call);
861+
int ftrace_event_is_function(struct trace_event_call *call);
862862

863863
/*
864864
* struct trace_parser - servers for reading the user input separated by spaces
@@ -1061,13 +1061,13 @@ extern int apply_subsystem_event_filter(struct ftrace_subsystem_dir *dir,
10611061
extern void print_subsystem_event_filter(struct event_subsystem *system,
10621062
struct trace_seq *s);
10631063
extern int filter_assign_type(const char *type);
1064-
extern int create_event_filter(struct ftrace_event_call *call,
1064+
extern int create_event_filter(struct trace_event_call *call,
10651065
char *filter_str, bool set_str,
10661066
struct event_filter **filterp);
10671067
extern void free_event_filter(struct event_filter *filter);
10681068

10691069
struct ftrace_event_field *
1070-
trace_find_event_field(struct ftrace_event_call *call, char *name);
1070+
trace_find_event_field(struct trace_event_call *call, char *name);
10711071

10721072
extern void trace_event_enable_cmd_record(bool enable);
10731073
extern int event_trace_add_tracer(struct dentry *parent, struct trace_array *tr);
@@ -1286,7 +1286,7 @@ int set_tracer_flag(struct trace_array *tr, unsigned int mask, int enabled);
12861286

12871287
#undef FTRACE_ENTRY
12881288
#define FTRACE_ENTRY(call, struct_name, id, tstruct, print, filter) \
1289-
extern struct ftrace_event_call \
1289+
extern struct trace_event_call \
12901290
__aligned(4) event_##call;
12911291
#undef FTRACE_ENTRY_DUP
12921292
#define FTRACE_ENTRY_DUP(call, struct_name, id, tstruct, print, filter) \
@@ -1295,7 +1295,7 @@ int set_tracer_flag(struct trace_array *tr, unsigned int mask, int enabled);
12951295
#include "trace_entries.h"
12961296

12971297
#if defined(CONFIG_PERF_EVENTS) && defined(CONFIG_FUNCTION_TRACER)
1298-
int perf_ftrace_event_register(struct ftrace_event_call *call,
1298+
int perf_ftrace_event_register(struct trace_event_call *call,
12991299
enum trace_reg type, void *data);
13001300
#else
13011301
#define perf_ftrace_event_register NULL

0 commit comments

Comments
 (0)