Skip to content

Commit 6f86ab9

Browse files
vnagarnaikrostedt
authored andcommitted
tracing: Cleanup unnecessary function declarations
The functions defined in include/trace/syscalls.h are not used directly since struct ftrace_event_class was introduced. Remove them from the header file and rearrange the ftrace_event_class declarations in trace_syscalls.c. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Vaibhav Nagarnaik <[email protected]> Signed-off-by: Steven Rostedt <[email protected]>
1 parent 01e3e71 commit 6f86ab9

File tree

2 files changed

+29
-53
lines changed

2 files changed

+29
-53
lines changed

include/trace/syscall.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,4 @@ struct syscall_metadata {
3131
struct ftrace_event_call *exit_event;
3232
};
3333

34-
#ifdef CONFIG_FTRACE_SYSCALLS
35-
extern unsigned long arch_syscall_addr(int nr);
36-
extern int init_syscall_trace(struct ftrace_event_call *call);
37-
38-
extern int reg_event_syscall_enter(struct ftrace_event_call *call);
39-
extern void unreg_event_syscall_enter(struct ftrace_event_call *call);
40-
extern int reg_event_syscall_exit(struct ftrace_event_call *call);
41-
extern void unreg_event_syscall_exit(struct ftrace_event_call *call);
42-
enum print_line_t print_syscall_enter(struct trace_iterator *iter, int flags,
43-
struct trace_event *event);
44-
enum print_line_t print_syscall_exit(struct trace_iterator *iter, int flags,
45-
struct trace_event *event);
46-
#endif
47-
48-
#ifdef CONFIG_PERF_EVENTS
49-
int perf_sysenter_enable(struct ftrace_event_call *call);
50-
void perf_sysenter_disable(struct ftrace_event_call *call);
51-
int perf_sysexit_enable(struct ftrace_event_call *call);
52-
void perf_sysexit_disable(struct ftrace_event_call *call);
53-
#endif
54-
5534
#endif /* _TRACE_SYSCALL_H */

kernel/trace/trace_syscalls.c

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ static int syscall_enter_register(struct ftrace_event_call *event,
2121
static int syscall_exit_register(struct ftrace_event_call *event,
2222
enum trace_reg type, void *data);
2323

24-
static int syscall_enter_define_fields(struct ftrace_event_call *call);
25-
static int syscall_exit_define_fields(struct ftrace_event_call *call);
26-
2724
static struct list_head *
2825
syscall_get_enter_fields(struct ftrace_event_call *call)
2926
{
@@ -32,30 +29,6 @@ syscall_get_enter_fields(struct ftrace_event_call *call)
3229
return &entry->enter_fields;
3330
}
3431

35-
struct trace_event_functions enter_syscall_print_funcs = {
36-
.trace = print_syscall_enter,
37-
};
38-
39-
struct trace_event_functions exit_syscall_print_funcs = {
40-
.trace = print_syscall_exit,
41-
};
42-
43-
struct ftrace_event_class event_class_syscall_enter = {
44-
.system = "syscalls",
45-
.reg = syscall_enter_register,
46-
.define_fields = syscall_enter_define_fields,
47-
.get_fields = syscall_get_enter_fields,
48-
.raw_init = init_syscall_trace,
49-
};
50-
51-
struct ftrace_event_class event_class_syscall_exit = {
52-
.system = "syscalls",
53-
.reg = syscall_exit_register,
54-
.define_fields = syscall_exit_define_fields,
55-
.fields = LIST_HEAD_INIT(event_class_syscall_exit.fields),
56-
.raw_init = init_syscall_trace,
57-
};
58-
5932
extern struct syscall_metadata *__start_syscalls_metadata[];
6033
extern struct syscall_metadata *__stop_syscalls_metadata[];
6134

@@ -432,7 +405,7 @@ void unreg_event_syscall_exit(struct ftrace_event_call *call)
432405
mutex_unlock(&syscall_trace_lock);
433406
}
434407

435-
int init_syscall_trace(struct ftrace_event_call *call)
408+
static int init_syscall_trace(struct ftrace_event_call *call)
436409
{
437410
int id;
438411
int num;
@@ -457,6 +430,30 @@ int init_syscall_trace(struct ftrace_event_call *call)
457430
return id;
458431
}
459432

433+
struct trace_event_functions enter_syscall_print_funcs = {
434+
.trace = print_syscall_enter,
435+
};
436+
437+
struct trace_event_functions exit_syscall_print_funcs = {
438+
.trace = print_syscall_exit,
439+
};
440+
441+
struct ftrace_event_class event_class_syscall_enter = {
442+
.system = "syscalls",
443+
.reg = syscall_enter_register,
444+
.define_fields = syscall_enter_define_fields,
445+
.get_fields = syscall_get_enter_fields,
446+
.raw_init = init_syscall_trace,
447+
};
448+
449+
struct ftrace_event_class event_class_syscall_exit = {
450+
.system = "syscalls",
451+
.reg = syscall_exit_register,
452+
.define_fields = syscall_exit_define_fields,
453+
.fields = LIST_HEAD_INIT(event_class_syscall_exit.fields),
454+
.raw_init = init_syscall_trace,
455+
};
456+
460457
unsigned long __init __weak arch_syscall_addr(int nr)
461458
{
462459
return (unsigned long)sys_call_table[nr];
@@ -537,7 +534,7 @@ static void perf_syscall_enter(void *ignore, struct pt_regs *regs, long id)
537534
perf_trace_buf_submit(rec, size, rctx, 0, 1, regs, head, NULL);
538535
}
539536

540-
int perf_sysenter_enable(struct ftrace_event_call *call)
537+
static int perf_sysenter_enable(struct ftrace_event_call *call)
541538
{
542539
int ret = 0;
543540
int num;
@@ -558,7 +555,7 @@ int perf_sysenter_enable(struct ftrace_event_call *call)
558555
return ret;
559556
}
560557

561-
void perf_sysenter_disable(struct ftrace_event_call *call)
558+
static void perf_sysenter_disable(struct ftrace_event_call *call)
562559
{
563560
int num;
564561

@@ -615,7 +612,7 @@ static void perf_syscall_exit(void *ignore, struct pt_regs *regs, long ret)
615612
perf_trace_buf_submit(rec, size, rctx, 0, 1, regs, head, NULL);
616613
}
617614

618-
int perf_sysexit_enable(struct ftrace_event_call *call)
615+
static int perf_sysexit_enable(struct ftrace_event_call *call)
619616
{
620617
int ret = 0;
621618
int num;
@@ -636,7 +633,7 @@ int perf_sysexit_enable(struct ftrace_event_call *call)
636633
return ret;
637634
}
638635

639-
void perf_sysexit_disable(struct ftrace_event_call *call)
636+
static void perf_sysexit_disable(struct ftrace_event_call *call)
640637
{
641638
int num;
642639

0 commit comments

Comments
 (0)