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

Commit 22402cd0 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull tracking updates from 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.

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

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

   - 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.

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

   - 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"

* tag 'trace-v4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (68 commits)
  tracefs: Fix refcount imbalance in start_creating()
  tracing: Put back comma for empty fields in boot string parsing
  tracing: Apply tracer specific options from kernel command line.
  tracing: Add some documentation about set_event_pid
  ring_buffer: Remove unneeded smp_wmb() before wakeup of reader benchmark
  tracing: Allow dumping traces without tracking trace started cpus
  ring_buffer: Fix more races when terminating the producer in the benchmark
  ring_buffer: Do no not complete benchmark reader too early
  tracing: Remove redundant TP_ARGS redefining
  tracing: Rename max_stack_lock to stack_trace_max_lock
  tracing: Allow arch-specific stack tracer
  recordmcount: arm64: Replace the ignored mcount call into nop
  recordmcount: Fix endianness handling bug for nop_mcount
  tracepoints: Fix documentation of RCU lockdep checks
  tracing: ftrace_event_is_function() can return boolean
  tracing: is_legal_op() can return boolean
  ring-buffer: rb_event_is_commit() can return boolean
  ring-buffer: rb_per_cpu_empty() can return boolean
  ring_buffer: ring_buffer_empty{cpu}() can return boolean
  ring-buffer: rb_is_reader_page() can return boolean
  ...
parents 7c623cac d227c3ae
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -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
=================

+23 −0
Original line number Diff line number Diff line
@@ -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
+4 −0
Original line number Diff line number Diff line
@@ -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();
+5 −1
Original line number Diff line number Diff line
@@ -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;
}

+11 −0
Original line number Diff line number Diff line
@@ -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,
Loading