Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 46710f3a authored by Cong Wang's avatar Cong Wang Committed by Steven Rostedt (VMware)
Browse files

tracing: Pass type into tracing_generic_entry_update()

All callers of tracing_generic_entry_update() have to initialize
entry->type, so let's just simply move it inside.
Link: http://lkml.kernel.org/r/20190525165802.25944-2-xiyou.wangcong@gmail.com



Cc: Ingo Molnar <mingo@redhat.com>
Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
parent 6e55f320
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -142,6 +142,7 @@ enum print_line_t {
enum print_line_t trace_handle_return(struct trace_seq *s);

void tracing_generic_entry_update(struct trace_entry *entry,
				  unsigned short type,
				  unsigned long flags,
				  int pc);
struct trace_event_file;
+4 −4
Original line number Diff line number Diff line
@@ -743,8 +743,7 @@ trace_event_setup(struct ring_buffer_event *event,
{
	struct trace_entry *ent = ring_buffer_event_data(event);

	tracing_generic_entry_update(ent, flags, pc);
	ent->type = type;
	tracing_generic_entry_update(ent, type, flags, pc);
}

static __always_inline struct ring_buffer_event *
@@ -2312,13 +2311,14 @@ enum print_line_t trace_handle_return(struct trace_seq *s)
EXPORT_SYMBOL_GPL(trace_handle_return);

void
tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags,
			     int pc)
tracing_generic_entry_update(struct trace_entry *entry, unsigned short type,
			     unsigned long flags, int pc)
{
	struct task_struct *tsk = current;

	entry->preempt_count		= pc & 0xff;
	entry->pid			= (tsk) ? tsk->pid : 0;
	entry->type			= type;
	entry->flags =
#ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT
		(irqs_disabled_flags(flags) ? TRACE_FLAG_IRQS_OFF : 0) |
+1 −2
Original line number Diff line number Diff line
@@ -416,8 +416,7 @@ void perf_trace_buf_update(void *record, u16 type)
	unsigned long flags;

	local_save_flags(flags);
	tracing_generic_entry_update(entry, flags, pc);
	entry->type = type;
	tracing_generic_entry_update(entry, type, flags, pc);
}
NOKPROBE_SYMBOL(perf_trace_buf_update);