Skip to contentSkip to conversation

tracing: Updates for 4.4

GIT PULL Steven Rostedt 3 participants 6 messages Nov 6, 2015

Subsystems (8)
lore
Share & tools
lore

Steven Rostedt

author maintainer
#0 lore raw

Linus,

Most of the changes are clean ups and small fixes. Some of them have stable tags to them. I searched through my INBOX just as the merge window opened and found lots of patches to pull. I ran them through all my tests and they were in linux-next for a few days.

Features added this release:
----------------------------

o Module globbing. You can now filter function tracing to several modules. # echo '*:mod:*snd*' > set_ftrace_filter (Dmitry Safonov)

o Tracer specific options are now visible even when the tracer is not active. It was rather annoying that you can only see and modify tracer options after enabling the tracer. Now they are in the options/ directory even when the tracer is not active. Although they are still only visible when the tracer is active in the trace_options file.

o Trace options are now per instance (although some of the tracer specific options are global)

o New tracefs file: set_event_pid. If any pid is added to this file, then all events in the instance will filter out events that are not part of this pid. sched_switch and sched_wakeup events handle next and the wakee pids.

Please pull the latest trace-v4.4 tree, which can be found at:

git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
trace-v4.4

Tag SHA1: cffaf0f2f6b471dc6a15d8ff5370fb50c5a4b9c7 Head SHA1: d227c3ae4e94e5eb11dd780a811f59e1a7b74ccd

AKASHI Takahiro (1):
tracing: Allow arch-specific stack tracer

Chunyan Zhang (2):
tracing: Only benchmark the time tracepoints take if tracing is on
Sample: Trace_event: Correct the comments

Daniel Borkmann (1):
tracefs: Fix refcount imbalance in start_creating()

Dmitry Safonov (7):
ftrace: Remove redundant strsep in mod_callback
ftrace: Clarify code for mod command
ftrace: Introduce ftrace_glob structure
ftrace: add module globbing
Documentation: ftrace: Module globbing usage
tracing: Remove {start,stop}_branch_trace
tracing: Remove redundant TP_ARGS redefining

Jiaxing Wang (2):
tracing: Update instance_rmdir() to use tracefs_remove_recursive
tracing: Apply tracer specific options from kernel command line.

Li Bin (2):
recordmcount: x86: Assign a meaningful value to rel_type_nop
recordmcount: arm64: Replace the ignored mcount call into nop

Mathieu Desnoyers (1):
tracepoints: Fix documentation of RCU lockdep checks

Minfei Huang (1):
ftrace: Calculate the correct dyn_ftrace number to report to the userspace

Petr Mladek (2):
ring_buffer: Do no not complete benchmark reader too early
ring_buffer: Fix more races when terminating the producer in the benchmark

Rasmus Villemoes (2):
tracing: Use kstrdup_const instead of private implementation
ftrace: Remove redundant swap function

Sasha Levin (1):
tracing: Allow dumping traces without tracking trace started cpus

Steven Rostedt (Red Hat) (34):
tracing: Move non perf code out of perf.h
tracing: Remove ftrace_trace_stack_regs()
tracing: Remove unused function trace_current_buffer_lock_reserve()
tracing: Pass trace_array into trace_buffer_unlock_commit()
tracing: Make ftrace_trace_stack() static
tracing: Inject seq_print_userip_objs() into its only user
tracing: Turn seq_print_user_ip() into a static function
tracing: Move "display-graph" option to main options
tracing: Remove unused tracing option "ftrace_preempt"
tracing: Use enums instead of hard coded bitmasks for TRACE_ITER flags
tracing: Use TRACE_FLAGS macro to keep enums and strings matched
tracing: Only create function graph options when it is compiled in
tracing: Only create branch tracer options when compiled in
tracing: Do not create function tracer options when not compiled in
tracing: Only create stacktrace option when STACKTRACE is configured
tracing: Always show all tracer options in the options directory
tracing: Add build bug if we have more trace_flags than bits
tracing: Remove access to trace_flags in trace_printk.c
tracing: Move sleep-time and graph-time options out of the core trace_flags
tracing: Move trace_flags from global to a trace_array field
tracing: Add a method to pass in trace_array descriptor to option files
tracing: Make ftrace_trace_stack() depend on general trace_array flag
tracing: Add trace options for core options to instances
tracing: Add trace options for tracer options to instances
tracepoint: Give priority to probes of tracepoints
tracing: Add set_event_pid directory for future use
tracing: Implement event pid filtering
tracing: Check all tasks on each CPU when filtering pids
tracing: Fix sparse RCU warning
tracing: Call on_each_cpu() when adding or removing single pids from set_event_pid
tracing: Rename max_stack_lock to stack_trace_max_lock
ring_buffer: Remove unneeded smp_wmb() before wakeup of reader benchmark
tracing: Add some documentation about set_event_pid
tracing: Put back comma for empty fields in boot string parsing

Tal Shorer (2):
tracing: Allow disabling compilation of specific trace systems
tracing: gpio: Add Kconfig option for enabling/disabling trace events

Yaowei Bai (9):
kernel/trace_probe: is_good_name can be boolean
tracing: report_latency() in trace_sched_wakeup.c can return boolean
tracing: report_latency() in trace_irqsoff.c can return boolean
ring-buffer: rb_is_reader_page() can return boolean
ring_buffer: ring_buffer_empty{cpu}() can return boolean
ring-buffer: rb_per_cpu_empty() can return boolean
ring-buffer: rb_event_is_commit() can return boolean
tracing: is_legal_op() can return boolean
tracing: ftrace_event_is_function() can return boolean

libin (1):
recordmcount: Fix endianness handling bug for nop_mcount

----

 Documentation/trace/events.txt             |  18 +
 Documentation/trace/ftrace.txt             |  23 ++
 arch/x86/kernel/ftrace.c                   |   4 +
 fs/tracefs/inode.c                         |   6 +-
 include/linux/ftrace.h                     |  11 +
 include/linux/ring_buffer.h                |   4 +-
 include/linux/trace_events.h               |  20 +-
 include/linux/tracepoint.h                 |  39 ++-
 include/trace/define_trace.h               |   2 +-
 include/trace/events/gpio.h                |   4 +
 include/trace/perf.h                       | 258 ---------------
 include/trace/trace_events.h               | 258 +++++++++++++++
 kernel/trace/Kconfig                       |   7 +
 kernel/trace/blktrace.c                    |  11 +-
 kernel/trace/ftrace.c                      | 197 +++++------
 kernel/trace/ring_buffer.c                 |  20 +-
 kernel/trace/ring_buffer_benchmark.c       |  79 +++--
 kernel/trace/trace.c                       | 454 ++++++++++++++++----------
 kernel/trace/trace.h                       | 168 +++++++---
 kernel/trace/trace_benchmark.c             |   2 +-
 kernel/trace/trace_branch.c                |  15 +-
 kernel/trace/trace_events.c                | 506 +++++++++++++++++++++++++++--
 kernel/trace/trace_events_filter.c         |   8 +-
 kernel/trace/trace_export.c                |   2 +-
 kernel/trace/trace_functions_graph.c       |  63 ++--
 kernel/trace/trace_irqsoff.c               | 106 +++---
 kernel/trace/trace_kdb.c                   |   8 +-
 kernel/trace/trace_mmiotrace.c             |   4 +-
 kernel/trace/trace_output.c                |  97 +++---
 kernel/trace/trace_output.h                |   4 -
 kernel/trace/trace_printk.c                |  14 +-
 kernel/trace/trace_probe.h                 |   8 +-
 kernel/trace/trace_sched_wakeup.c          | 120 ++++---
 kernel/trace/trace_stack.c                 |  92 +++---
 kernel/trace/trace_syscalls.c              |   3 +-
 kernel/tracepoint.c                        |  61 +++-
 samples/trace_events/trace-events-sample.h |   6 +-
 scripts/recordmcount.c                     |  26 +-
 scripts/recordmcount.h                     |   2 +-
 39 files changed, 1787 insertions(+), 943 deletions(-)

---------------------------

Documentation/trace/events.txt +18 -0
index 75d25a1d6e42..c010be8c85d7 100644
@@ -288,6 +288,24 @@ prev_pid == 0
 # cat sched_wakeup/filter
 common_pid == 0
 
+5.4 PID filtering
+-----------------
+
+The set_event_pid file in the same directory as the top events directory
+exists, will filter all events from tracing any task that does not have the
+PID listed in the set_event_pid file.
+
+# cd /sys/kernel/debug/tracing
+# echo $$ > set_event_pid
+# echo 1 > events/enabled
+
+Will only trace events for the current task.
+
+To add more PIDs without losing the PIDs already included, use '>>'.
+
+# echo 123 244 1 >> set_event_pid
+
+
 6. Event triggers
 =================
 
Documentation/trace/ftrace.txt +23 -0
index ef621d34ba5b..f52f297cb406 100644
@@ -204,6 +204,12 @@ of ftrace. Here is a list of some of the key files:
 
 	Have the function tracer only trace a single thread.
 
+  set_event_pid:
+
+	Have the events only trace a task with a PID listed in this file.
+	Note, sched_switch and sched_wake_up will also trace events
+	listed in this file.
+
   set_graph_function:
 
 	Set a "trigger" function where tracing should start
@@ -2437,6 +2443,23 @@ The following commands are supported:
 
    echo '!writeback*:mod:ext3' >> set_ftrace_filter
 
+  Mod command supports module globbing. Disable tracing for all
+  functions except a specific module:
+
+   echo '!*:mod:!ext3' >> set_ftrace_filter
+
+  Disable tracing for all modules, but still trace kernel:
+
+   echo '!*:mod:*' >> set_ftrace_filter
+
+  Enable filter only for kernel:
+
+   echo '*write*:mod:!*' >> set_ftrace_filter
+
+  Enable filter for module globbing:
+
+   echo '*write*:mod:*snd*' >> set_ftrace_filter
+
 - traceon/traceoff
   These commands turn tracing on and off when the specified
   functions are hit. The parameter determines how many times the
arch/x86/kernel/ftrace.c +4 -0
index 8b7b0a51e742..311bcf338f07 100644
@@ -556,6 +556,7 @@ void ftrace_replace_code(int enable)
 	run_sync();
 
 	report = "updating code";
+	count = 0;
 
 	for_ftrace_rec_iter(iter) {
 		rec = ftrace_rec_iter_record(iter);
@@ -563,11 +564,13 @@ void ftrace_replace_code(int enable)
 		ret = add_update(rec, enable);
 		if (ret)
 			goto remove_breakpoints;
+		count++;
 	}
 
 	run_sync();
 
 	report = "removing breakpoints";
+	count = 0;
 
 	for_ftrace_rec_iter(iter) {
 		rec = ftrace_rec_iter_record(iter);
@@ -575,6 +578,7 @@ void ftrace_replace_code(int enable)
 		ret = finish_update(rec, enable);
 		if (ret)
 			goto remove_breakpoints;
+		count++;
 	}
 
 	run_sync();
fs/tracefs/inode.c +5 -1
index cbc8d5d2755a..c66f2423e1f5 100644
@@ -340,8 +340,12 @@ static struct dentry *start_creating(const char *name, struct dentry *parent)
 		dput(dentry);
 		dentry = ERR_PTR(-EEXIST);
 	}
-	if (IS_ERR(dentry))
+
+	if (IS_ERR(dentry)) {
 		mutex_unlock(&parent->d_inode->i_mutex);
+		simple_release_fs(&tracefs_mount, &tracefs_mount_count);
+	}
+
 	return dentry;
 }
 
include/linux/ftrace.h +11 -0
index 6cd8c0ee4b6f..eae6548efbf0 100644
@@ -263,7 +263,18 @@ static inline void ftrace_kill(void) { }
 #endif /* CONFIG_FUNCTION_TRACER */
 
 #ifdef CONFIG_STACK_TRACER
+
+#define STACK_TRACE_ENTRIES 500
+
+struct stack_trace;
+
+extern unsigned stack_trace_index[];
+extern struct stack_trace stack_trace_max;
+extern unsigned long stack_trace_max_size;
+extern arch_spinlock_t stack_trace_max_lock;
+
 extern int stack_tracer_enabled;
+void stack_trace_print(void);
 int
 stack_trace_sysctl(struct ctl_table *table, int write,
 		   void __user *buffer, size_t *lenp,
include/linux/ring_buffer.h +2 -2
index e2c13cd863bd..4acc552e9279 100644
@@ -154,8 +154,8 @@ ring_buffer_swap_cpu(struct ring_buffer *buffer_a,
 }
 #endif
 
-int ring_buffer_empty(struct ring_buffer *buffer);
-int ring_buffer_empty_cpu(struct ring_buffer *buffer, int cpu);
+bool ring_buffer_empty(struct ring_buffer *buffer);
+bool ring_buffer_empty_cpu(struct ring_buffer *buffer, int cpu);
 
 void ring_buffer_record_disable(struct ring_buffer *buffer);
 void ring_buffer_record_enable(struct ring_buffer *buffer);
include/linux/trace_events.h +13 -7
index ed27917cabc9..429fdfc3baf5 100644
@@ -168,13 +168,12 @@ struct ring_buffer_event *
 trace_current_buffer_lock_reserve(struct ring_buffer **current_buffer,
 				  int type, unsigned long len,
 				  unsigned long flags, int pc);
-void trace_current_buffer_unlock_commit(struct ring_buffer *buffer,
-					struct ring_buffer_event *event,
-					unsigned long flags, int pc);
-void trace_buffer_unlock_commit(struct ring_buffer *buffer,
+void trace_buffer_unlock_commit(struct trace_array *tr,
+				struct ring_buffer *buffer,
 				struct ring_buffer_event *event,
 				unsigned long flags, int pc);
-void trace_buffer_unlock_commit_regs(struct ring_buffer *buffer,
+void trace_buffer_unlock_commit_regs(struct trace_array *tr,
+				     struct ring_buffer *buffer,
 				     struct ring_buffer_event *event,
 				     unsigned long flags, int pc,
 				     struct pt_regs *regs);
@@ -329,6 +328,7 @@ enum {
 	EVENT_FILE_FL_SOFT_DISABLED_BIT,
 	EVENT_FILE_FL_TRIGGER_MODE_BIT,
 	EVENT_FILE_FL_TRIGGER_COND_BIT,
+	EVENT_FILE_FL_PID_FILTER_BIT,
 };
 
 /*
@@ -342,6 +342,7 @@ enum {
  *                   tracepoint may be enabled)
  *  TRIGGER_MODE  - When set, invoke the triggers associated with the event
  *  TRIGGER_COND  - When set, one or more triggers has an associated filter
+ *  PID_FILTER    - When set, the event is filtered based on pid
  */
 enum {
 	EVENT_FILE_FL_ENABLED		= (1 << EVENT_FILE_FL_ENABLED_BIT),
@@ -352,6 +353,7 @@ enum {
 	EVENT_FILE_FL_SOFT_DISABLED	= (1 << EVENT_FILE_FL_SOFT_DISABLED_BIT),
 	EVENT_FILE_FL_TRIGGER_MODE	= (1 << EVENT_FILE_FL_TRIGGER_MODE_BIT),
 	EVENT_FILE_FL_TRIGGER_COND	= (1 << EVENT_FILE_FL_TRIGGER_COND_BIT),
+	EVENT_FILE_FL_PID_FILTER	= (1 << EVENT_FILE_FL_PID_FILTER_BIT),
 };
 
 struct trace_event_file {
@@ -430,6 +432,8 @@ extern enum event_trigger_type event_triggers_call(struct trace_event_file *file
 extern void event_triggers_post_call(struct trace_event_file *file,
 				     enum event_trigger_type tt);
 
+bool trace_event_ignore_this_pid(struct trace_event_file *trace_file);
+
 /**
  * trace_trigger_soft_disabled - do triggers and test if soft disabled
  * @file: The file pointer of the event to test
@@ -449,6 +453,8 @@ trace_trigger_soft_disabled(struct trace_event_file *file)
 			event_triggers_call(file, NULL);
 		if (eflags & EVENT_FILE_FL_SOFT_DISABLED)
 			return true;
+		if (eflags & EVENT_FILE_FL_PID_FILTER)
+			return trace_event_ignore_this_pid(file);
 	}
 	return false;
 }
@@ -508,7 +514,7 @@ event_trigger_unlock_commit(struct trace_event_file *file,
 	enum event_trigger_type tt = ETT_NONE;
 
 	if (!__event_trigger_test_discard(file, buffer, event, entry, &tt))
-		trace_buffer_unlock_commit(buffer, event, irq_flags, pc);
+		trace_buffer_unlock_commit(file->tr, buffer, event, irq_flags, pc);
 
 	if (tt)
 		event_triggers_post_call(file, tt);
@@ -540,7 +546,7 @@ event_trigger_unlock_commit_regs(struct trace_event_file *file,
 	enum event_trigger_type tt = ETT_NONE;
 
 	if (!__event_trigger_test_discard(file, buffer, event, entry, &tt))
-		trace_buffer_unlock_commit_regs(buffer, event,
+		trace_buffer_unlock_commit_regs(file->tr, buffer, event,
 						irq_flags, pc, regs);
 
 	if (tt)
include/linux/tracepoint.h +32 -7
index a5f7f3ecafa3..696a339c592c 100644
@@ -26,6 +26,7 @@ struct notifier_block;
 struct tracepoint_func {
 	void *func;
 	void *data;
+	int prio;
 };
 
 struct tracepoint {
@@ -42,9 +43,14 @@ struct trace_enum_map {
 	unsigned long		enum_value;
 };
 
+#define TRACEPOINT_DEFAULT_PRIO	10
+
 extern int
 tracepoint_probe_register(struct tracepoint *tp, void *probe, void *data);
 extern int
+tracepoint_probe_register_prio(struct tracepoint *tp, void *probe, void *data,
+			       int prio);
+extern int
 tracepoint_probe_unregister(struct tracepoint *tp, void *probe, void *data);
 extern void
 for_each_kernel_tracepoint(void (*fct)(struct tracepoint *tp, void *priv),
@@ -111,7 +117,18 @@ extern void syscall_unregfunc(void);
 #define TP_ARGS(args...)	args
 #define TP_CONDITION(args...)	args
 
-#ifdef CONFIG_TRACEPOINTS
+/*
+ * Individual subsystem my have a separate configuration to
+ * enable their tracepoints. By default, this file will create
+ * the tracepoints if CONFIG_TRACEPOINT is defined. If a subsystem
+ * wants to be able to disable its tracepoints from being created
+ * it can define NOTRACE before including the tracepoint headers.
+ */
+#if defined(CONFIG_TRACEPOINTS) && !defined(NOTRACE)
+#define TRACEPOINTS_ENABLED
+#endif
+
+#ifdef TRACEPOINTS_ENABLED
 
 /*
  * it_func[0] is never NULL because there is at least one element in the array
@@ -167,10 +184,11 @@ extern void syscall_unregfunc(void);
  * structure. Force alignment to the same alignment as the section start.
  *
  * When lockdep is enabled, we make sure to always do the RCU portions of
- * the tracepoint code, regardless of whether tracing is on or we match the
- * condition.  This lets us find RCU issues triggered with tracepoints even
- * when this tracepoint is off.  This code has no purpose other than poking
- * RCU a bit.
+ * the tracepoint code, regardless of whether tracing is on. However,
+ * don't check if the condition is false, due to interaction with idle
+ * instrumentation. This lets us find RCU issues triggered with tracepoints
+ * even when this tracepoint is off. This code has no purpose other than
+ * poking RCU a bit.
  */
 #define __DECLARE_TRACE(name, proto, args, cond, data_proto, data_args) \
 	extern struct tracepoint __tracepoint_##name;			\
@@ -196,6 +214,13 @@ extern void syscall_unregfunc(void);
 						(void *)probe, data);	\
 	}								\
 	static inline int						\
+	register_trace_prio_##name(void (*probe)(data_proto), void *data,\
+				   int prio)				\
+	{								\
+		return tracepoint_probe_register_prio(&__tracepoint_##name, \
+					      (void *)probe, data, prio); \
+	}								\
+	static inline int						\
 	unregister_trace_##name(void (*probe)(data_proto), void *data)	\
 	{								\
 		return tracepoint_probe_unregister(&__tracepoint_##name,\
@@ -234,7 +259,7 @@ extern void syscall_unregfunc(void);
 #define EXPORT_TRACEPOINT_SYMBOL(name)					\
 	EXPORT_SYMBOL(__tracepoint_##name)
 
-#else /* !CONFIG_TRACEPOINTS */
+#else /* !TRACEPOINTS_ENABLED */
 #define __DECLARE_TRACE(name, proto, args, cond, data_proto, data_args) \
 	static inline void trace_##name(proto)				\
 	{ }								\
@@ -266,7 +291,7 @@ extern void syscall_unregfunc(void);
 #define EXPORT_TRACEPOINT_SYMBOL_GPL(name)
 #define EXPORT_TRACEPOINT_SYMBOL(name)
 
-#endif /* CONFIG_TRACEPOINTS */
+#endif /* TRACEPOINTS_ENABLED */
 
 #ifdef CONFIG_TRACING
 /**
include/trace/define_trace.h +1 -1
index 09b3880105a9..2d8639ea64d5 100644
@@ -86,7 +86,7 @@
 #undef DECLARE_TRACE
 #define DECLARE_TRACE(name, proto, args)
 
-#ifdef CONFIG_EVENT_TRACING
+#ifdef TRACEPOINTS_ENABLED
 #include <trace/trace_events.h>
 #include <trace/perf.h>
 #endif
include/trace/events/gpio.h +4 -0
index 927a8ad9e51b..2da73b92d47e 100644
@@ -1,6 +1,10 @@
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM gpio
 
+#ifndef CONFIG_TRACING_EVENTS_GPIO
+#define NOTRACE
+#endif
+
 #if !defined(_TRACE_GPIO_H) || defined(TRACE_HEADER_MULTI_READ)
 #define _TRACE_GPIO_H
 
include/trace/perf.h +0 -258

261 lines not on this page · raw message

include/trace/trace_events.h +258 -0

261 lines not on this page · raw message

kernel/trace/Kconfig +7 -0
index 1153c43428f3..8d6363f42169 100644
@@ -635,6 +635,13 @@ config TRACE_ENUM_MAP_FILE
 
 	If unsure, say N
 
+config TRACING_EVENTS_GPIO
+	bool "Trace gpio events"
+	depends on GPIOLIB
+	default y
+	help
+	  Enable tracing events for gpio subsystem
+
 endif # FTRACE
 
 endif # TRACING_SUPPORT
kernel/trace/blktrace.c +6 -5
index 90e72a0c3047..b2fcf472774e 100644
@@ -103,7 +103,7 @@ record_it:
 		memcpy((void *) t + sizeof(*t), data, len);
 
 		if (blk_tracer)
-			trace_buffer_unlock_commit(buffer, event, 0, pc);
+			trace_buffer_unlock_commit(blk_tr, buffer, event, 0, pc);
 	}
 }
 
@@ -278,7 +278,7 @@ record_it:
 			memcpy((void *) t + sizeof(*t), pdu_data, pdu_len);
 
 		if (blk_tracer) {
-			trace_buffer_unlock_commit(buffer, event, 0, pc);
+			trace_buffer_unlock_commit(blk_tr, buffer, event, 0, pc);
 			return;
 		}
 	}
@@ -1343,6 +1343,7 @@ static const struct {
 static enum print_line_t print_one_line(struct trace_iterator *iter,
 					bool classic)
 {
+	struct trace_array *tr = iter->tr;
 	struct trace_seq *s = &iter->seq;
 	const struct blk_io_trace *t;
 	u16 what;
@@ -1351,7 +1352,7 @@ static enum print_line_t print_one_line(struct trace_iterator *iter,
 
 	t	   = te_blk_io_trace(iter->ent);
 	what	   = t->action & ((1 << BLK_TC_SHIFT) - 1);
-	long_act   = !!(trace_flags & TRACE_ITER_VERBOSE);
+	long_act   = !!(tr->trace_flags & TRACE_ITER_VERBOSE);
 	log_action = classic ? &blk_log_action_classic : &blk_log_action;
 
 	if (t->action == BLK_TN_MESSAGE) {
@@ -1413,9 +1414,9 @@ blk_tracer_set_flag(struct trace_array *tr, u32 old_flags, u32 bit, int set)
 	/* don't output context-info for blk_classic output */
 	if (bit == TRACE_BLK_OPT_CLASSIC) {
 		if (set)
-			trace_flags &= ~TRACE_ITER_CONTEXT_INFO;
+			tr->trace_flags &= ~TRACE_ITER_CONTEXT_INFO;
 		else
-			trace_flags |= TRACE_ITER_CONTEXT_INFO;
+			tr->trace_flags |= TRACE_ITER_CONTEXT_INFO;
 	}
 	return 0;
 }
kernel/trace/ftrace.c +104 -93

396 lines not on this page · raw message

kernel/trace/ring_buffer.c +10 -10
index fc347f8b1bca..75f1d05ea82d 100644
@@ -829,7 +829,7 @@ rb_is_head_page(struct ring_buffer_per_cpu *cpu_buffer,
  * writer is ever on it, the previous pointer never points
  * back to the reader page.
  */
-static int rb_is_reader_page(struct buffer_page *page)
+static bool rb_is_reader_page(struct buffer_page *page)
 {
 	struct list_head *list = page->list.prev;
 
@@ -2270,7 +2270,7 @@ rb_add_time_stamp(struct ring_buffer_event *event, u64 delta)
 	return skip_time_extend(event);
 }
 
-static inline int rb_event_is_commit(struct ring_buffer_per_cpu *cpu_buffer,
+static inline bool rb_event_is_commit(struct ring_buffer_per_cpu *cpu_buffer,
 				     struct ring_buffer_event *event);
 
 /**
@@ -2498,7 +2498,7 @@ static inline void rb_event_discard(struct ring_buffer_event *event)
 		event->time_delta = 1;
 }
 
-static inline int
+static inline bool
 rb_event_is_commit(struct ring_buffer_per_cpu *cpu_buffer,
 		   struct ring_buffer_event *event)
 {
@@ -3039,7 +3039,7 @@ int ring_buffer_write(struct ring_buffer *buffer,
 }
 EXPORT_SYMBOL_GPL(ring_buffer_write);
 
-static int rb_per_cpu_empty(struct ring_buffer_per_cpu *cpu_buffer)
+static bool rb_per_cpu_empty(struct ring_buffer_per_cpu *cpu_buffer)
 {
 	struct buffer_page *reader = cpu_buffer->reader_page;
 	struct buffer_page *head = rb_set_head_page(cpu_buffer);
@@ -3047,7 +3047,7 @@ static int rb_per_cpu_empty(struct ring_buffer_per_cpu *cpu_buffer)
 
 	/* In case of error, head will be NULL */
 	if (unlikely(!head))
-		return 1;
+		return true;
 
 	return reader->read == rb_page_commit(reader) &&
 		(commit == reader ||
@@ -4267,7 +4267,7 @@ EXPORT_SYMBOL_GPL(ring_buffer_reset);
  * rind_buffer_empty - is the ring buffer empty?
  * @buffer: The ring buffer to test
  */
-int ring_buffer_empty(struct ring_buffer *buffer)
+bool ring_buffer_empty(struct ring_buffer *buffer)
 {
 	struct ring_buffer_per_cpu *cpu_buffer;
 	unsigned long flags;
@@ -4285,10 +4285,10 @@ int ring_buffer_empty(struct ring_buffer *buffer)
 		local_irq_restore(flags);
 
 		if (!ret)
-			return 0;
+			return false;
 	}
 
-	return 1;
+	return true;
 }
 EXPORT_SYMBOL_GPL(ring_buffer_empty);
 
@@ -4297,7 +4297,7 @@ EXPORT_SYMBOL_GPL(ring_buffer_empty);
  * @buffer: The ring buffer
  * @cpu: The CPU buffer to test
  */
-int ring_buffer_empty_cpu(struct ring_buffer *buffer, int cpu)
+bool ring_buffer_empty_cpu(struct ring_buffer *buffer, int cpu)
 {
 	struct ring_buffer_per_cpu *cpu_buffer;
 	unsigned long flags;
@@ -4305,7 +4305,7 @@ int ring_buffer_empty_cpu(struct ring_buffer *buffer, int cpu)
 	int ret;
 
 	if (!cpumask_test_cpu(cpu, buffer->cpumask))
-		return 1;
+		return true;
 
 	cpu_buffer = buffer->buffers[cpu];
 	local_irq_save(flags);
kernel/trace/ring_buffer_benchmark.c +44 -35

219 lines not on this page · raw message

kernel/trace/trace.c +290 -164

957 lines not on this page · raw message

kernel/trace/trace.h +116 -52

273 lines not on this page · raw message

kernel/trace/trace_benchmark.c +1 -1
index 40a14cbcf8e0..0f109c4130d3 100644
@@ -43,7 +43,7 @@ static void trace_do_benchmark(void)
 	unsigned int std = 0;
 
 	/* Only run if the tracepoint is actually active */
-	if (!trace_benchmark_event_enabled())
+	if (!trace_benchmark_event_enabled() || !tracing_is_on())
 		return;
 
 	local_irq_disable();
kernel/trace/trace_branch.c +2 -13
index e2e12ad3186f..3a2a73716a5b 100644
@@ -125,25 +125,14 @@ void disable_branch_tracing(void)
 	mutex_unlock(&branch_tracing_mutex);
 }
 
-static void start_branch_trace(struct trace_array *tr)
-{
-	enable_branch_tracing(tr);
-}
-
-static void stop_branch_trace(struct trace_array *tr)
-{
-	disable_branch_tracing();
-}
-
 static int branch_trace_init(struct trace_array *tr)
 {
-	start_branch_trace(tr);
-	return 0;
+	return enable_branch_tracing(tr);
 }
 
 static void branch_trace_reset(struct trace_array *tr)
 {
-	stop_branch_trace(tr);
+	disable_branch_tracing();
 }
 
 static enum print_line_t trace_branch_print(struct trace_iterator *iter,
kernel/trace/trace_events.c +479 -27

168 lines not on this page · raw message

kernel/trace/trace_events_filter.c +4 -4
index bd1bf184c5c9..f93a219b18da 100644

Lines of this file are not shown. View the raw message.

kernel/trace/trace_export.c +1 -1
index adabf7da9113..39aa7aa66468 100644

Lines of this file are not shown. View the raw message.

kernel/trace/trace_functions_graph.c +41 -22

63 lines not on this page · raw message

kernel/trace/trace_irqsoff.c +55 -51

106 lines not on this page · raw message

kernel/trace/trace_kdb.c +5 -3
index 3ccf5c2c1320..57149bce6aad 100644

Lines of this file are not shown. View the raw message.

kernel/trace/trace_mmiotrace.c +2 -2
index 638e110c5bfd..2be8c4f2403d 100644

Lines of this file are not shown. View the raw message.

kernel/trace/trace_output.c +46 -51

97 lines not on this page · raw message

kernel/trace/trace_output.h +0 -4
index 4cbfe85b99c8..fabc49bcd493 100644

Lines of this file are not shown. View the raw message.

kernel/trace/trace_printk.c +10 -4
index 36c1455b7567..1c2b28536feb 100644

Lines of this file are not shown. View the raw message.

kernel/trace/trace_probe.h +4 -4
index b98dee914542..f6398db09114 100644

Lines of this file are not shown. View the raw message.

kernel/trace/trace_sched_wakeup.c +59 -61

120 lines not on this page · raw message

kernel/trace/trace_stack.c +49 -43

92 lines not on this page · raw message

kernel/trace/trace_syscalls.c +2 -1
index 7d567a4b9fa7..0655afbea83f 100644

Lines of this file are not shown. View the raw message.

kernel/tracepoint.c +50 -11

61 lines not on this page · raw message

samples/trace_events/trace-events-sample.h +3 -3
index 125d6402f64f..d6b75bb495b3 100644

Lines of this file are not shown. View the raw message.

scripts/recordmcount.c +25 -1
index 3d1984e59a30..698768bdc581 100644

Lines of this file are not shown. View the raw message.

scripts/recordmcount.h +1 -1
index 49b582a225b0..b9897e2be404 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.

#1 lore raw
Quoted 5 lines · Steven Rostedt

Most of the changes are clean ups and small fixes. Some of them have stable tags to them. I searched through my INBOX just as the merge window opened and found lots of patches to pull. I ran them through all my tests and they were in linux-next for a few days.

Clearly they got zero actual testing, though.

I get several very big and ugly warnings about scheduler tracing:

kernel/trace/trace_events.c: In function ‘__ftrace_clear_event_pids’:
kernel/trace/trace_events.c:579:32: warning: passing argument 1 of
‘unregister_trace_sched_switch’ from incompatible pointer type [-Wincompatible-pointer-types]

    unregister_trace_sched_switch(event_filter_pid_sched_switch_probe_pre, tr);
                                  ^

In file included from kernel/trace/trace_events.c:25:0:
include/trace/events/sched.h:124:1095: note: expected ‘void (*)(void
*, bool, struct task_struct *, struct task_struct *) {aka void (*)(void *, _Bool, struct task_struct *, struct task_struct *)}’ but argument is of type ‘void (*)(void *, struct task_struct *, struct task_struct *)’

which clearly can't work, and is due to the new "bool preempt" argument in scheduler tracing.

That *should* have shown up in linux-next, and you *should* have been aware of it, and in turn let me know about it. Yes, yes, I notice these things on my own, but I also expect that maintainers look out for these things, especially when they were involved on both sides, so it shouldn't have taken them - and this me - by surprise.

But something clearly failed in that whole process.

This is why we do *not* do some last-minute "let's just look through my mailbox as the merge window is opening" crap.

I've done the merge, and I have it fixed up in my tree, but I'm annoyed enough that I'm considering just unpulling. You *knew* about this, because you are marked as having reviewed that commit c73464b1c843 ("sched/core: Fix trace_sched_switch()") that added the preempt argument.

So where did this all fail? Nobody ever looked at the warnings from linux-next? Or it wasn't even in linux-next long enough to really ever trigger?

I very much suspect that "look through my INBOX as the merge window opened" is the real problem here. That is *not* how the merge window works, and you damn well should know it.

Linus

#2 lore raw

Hi Linus,

Quoted 4 lines · On Fri, 6 Nov 2015 13:37:48 -0800 Linus Torvalds…

So where did this all fail? Nobody ever looked at the warnings from linux-next? Or it wasn't even in linux-next long enough to really ever trigger?

This was reported against linux-next on Nov 2 by Sergey Senozhatsky who supplied a fix patch that I then used as the merge conflict resolution from Nov 3 onward (which everyone involved knew about) ...

I also noticed it, but was a bit under the weather and tired to do anything about it immediately.

Signature · 2 lines
Cheers,
Stephen Rothwell                    [email protected]
#3 lore raw
Quoted 4 lines · Stephen Rothwell

This was reported against linux-next on Nov 2 by Sergey Senozhatsky who supplied a fix patch that I then used as the merge conflict resolution from Nov 3 onward (which everyone involved knew about) ...

Ok, so the problem is that even though a maintainer is aware of the semantic conflict, the pull request doesn't talk about it.

A lot of maintainers *do* let me know, which I really appreciate, not only because it avoids the surprise, but because it happens that I miss these semantic conflicts.

Sometimes the semantic conflict is something that simply doesn't show up on x86-64 build I do. Or I was on the road and didn't do a full allmodconfig build. Or it needs very specific config options etc. Or I just screw up. When the pull message warns me about it, that will help.

But maybe it's one of those things that isn't written down, and people don't think about as part of doing their pull request, so they forget.

Linus

author maintainer
#4 lore raw
Quoted 8 lines · On Fri, 6 Nov 2015 14:15:48 -0800 Linus Torvalds…
Quoted 4 lines · Stephen Rothwell

This was reported against linux-next on Nov 2 by Sergey Senozhatsky who supplied a fix patch that I then used as the merge conflict resolution from Nov 3 onward (which everyone involved knew about) ...

Ok, so the problem is that even though a maintainer is aware of the semantic conflict, the pull request doesn't talk about it.

Damn, that was my fault. I simply forgot to mention it :-(

Quoted 5 lines

A lot of maintainers *do* let me know, which I really appreciate, not only because it avoids the surprise, but because it happens that I miss these semantic conflicts.

Quoted 9 lines

Sometimes the semantic conflict is something that simply doesn't show up on x86-64 build I do. Or I was on the road and didn't do a full allmodconfig build. Or it needs very specific config options etc. Or I just screw up. When the pull message warns me about it, that will help.

But maybe it's one of those things that isn't written down, and people don't think about as part of doing their pull request, so they forget.

Yep, I was going to add that, but I've been working on internal Red Hat Bugzilla's all week that my mind was not fully focused on that pull request.

I'll have to add something to my scripts that pulls in any merge breakage, such that when I run the scripts to generate the pull request, it adds them in automatically. Because obviously, the manual approach isn't working for me.

-- Steve

author maintainer
#5 lore raw
Quoted 4 lines · On Fri, 6 Nov 2015 17:52:06 -0500 Steven Rostedt <[email protected]> wrote:

I'll have to add something to my scripts that pulls in any merge breakage, such that when I run the scripts to generate the pull request, it adds them in automatically. Because obviously, the manual approach isn't working for me.

I updated my scripts such that if I add a 'notes' file in the repo that I'm pushing, it will include that into the pull request. Now if there's a conflict like this again, I can add a comment about it in the notes file and it will be included in my next pull request.

I just need to remember to delete it after I'm done ;-)

-- Steve