Commit d786f0fe authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull tracing fixes from Steven Rostedt:

 - Fix filter memory leak by calling ftrace_free_filter()

 - Initialize trace_printk() earlier so that ftrace_dump_on_oops shows
   data on early crashes.

 - Update the outdated instructions in scripts/tracing/ftrace-bisect.sh

 - Add lockdep_is_held() to fix lockdep warning

 - Add allocation failure check in create_hist_field()

 - Don't initialize pointer that gets set right away in enabled_monitors_write()

 - Update MAINTAINER entries

 - Fix help messages in Kconfigs

 - Fix kernel-doc header for update_preds()

* tag 'trace-v6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
  bootconfig: Update MAINTAINERS file to add tree and mailing list
  rv: remove redundant initialization of pointer ptr
  ftrace: Maintain samples/ftrace
  tracing/filter: fix kernel-doc warnings
  lib: Kconfig: fix spellos
  trace_events_hist: add check for return value of 'create_hist_field'
  tracing/osnoise: Use built-in RCU list checking
  tracing: Kconfig: Fix spelling/grammar/punctuation
  ftrace/scripts: Update the instructions for ftrace-bisect.sh
  tracing: Make sure trace_printk() can output as soon as it can be used
  ftrace: Export ftrace_free_filter() to modules
parents e6f2f6ac 78020233
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -7893,7 +7893,11 @@ F: include/linux/extcon/
EXTRA BOOT CONFIG
M:	Masami Hiramatsu <mhiramat@kernel.org>
L:	linux-kernel@vger.kernel.org
L:	linux-trace-kernel@vger.kernel.org
Q:	https://patchwork.kernel.org/project/linux-trace-kernel/list/
S:	Maintained
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
F:	Documentation/admin-guide/bootconfig.rst
F:	fs/proc/bootconfig.c
F:	include/linux/bootconfig.h
@@ -8569,6 +8573,7 @@ F: kernel/trace/fgraph.c
F:	arch/*/*/*/*ftrace*
F:	arch/*/*/*ftrace*
F:	include/*/ftrace.h
F:	samples/ftrace
FUNGIBLE ETHERNET DRIVERS
M:	Dimitris Michailidis <dmichail@fungible.com>
+4 −4
Original line number Diff line number Diff line
@@ -933,8 +933,8 @@ config RING_BUFFER_RECORD_RECURSION
	default y
	help
	  The ring buffer has its own internal recursion. Although when
	  recursion happens it wont cause harm because of the protection,
	  but it does cause an unwanted overhead. Enabling this option will
	  recursion happens it won't cause harm because of the protection,
	  but it does cause unwanted overhead. Enabling this option will
	  place where recursion was detected into the ftrace "recursed_functions"
	  file.

@@ -1017,8 +1017,8 @@ config RING_BUFFER_STARTUP_TEST
	 The test runs for 10 seconds. This will slow your boot time
	 by at least 10 more seconds.

	 At the end of the test, statics and more checks are done.
	 It will output the stats of each per cpu buffer. What
	 At the end of the test, statistics and more checks are done.
	 It will output the stats of each per cpu buffer: What
	 was written, the sizes, what was read, what was lost, and
	 other similar details.

+22 −1
Original line number Diff line number Diff line
@@ -1248,12 +1248,17 @@ static void free_ftrace_hash_rcu(struct ftrace_hash *hash)
	call_rcu(&hash->rcu, __free_ftrace_hash_rcu);
}

/**
 * ftrace_free_filter - remove all filters for an ftrace_ops
 * @ops - the ops to remove the filters from
 */
void ftrace_free_filter(struct ftrace_ops *ops)
{
	ftrace_ops_init(ops);
	free_ftrace_hash(ops->func_hash->filter_hash);
	free_ftrace_hash(ops->func_hash->notrace_hash);
}
EXPORT_SYMBOL_GPL(ftrace_free_filter);

static struct ftrace_hash *alloc_ftrace_hash(int size_bits)
{
@@ -5839,6 +5844,10 @@ EXPORT_SYMBOL_GPL(modify_ftrace_direct_multi);
 *
 * Filters denote which functions should be enabled when tracing is enabled
 * If @ip is NULL, it fails to update filter.
 *
 * This can allocate memory which must be freed before @ops can be freed,
 * either by removing each filtered addr or by using
 * ftrace_free_filter(@ops).
 */
int ftrace_set_filter_ip(struct ftrace_ops *ops, unsigned long ip,
			 int remove, int reset)
@@ -5858,6 +5867,10 @@ EXPORT_SYMBOL_GPL(ftrace_set_filter_ip);
 *
 * Filters denote which functions should be enabled when tracing is enabled
 * If @ips array or any ip specified within is NULL , it fails to update filter.
 *
 * This can allocate memory which must be freed before @ops can be freed,
 * either by removing each filtered addr or by using
 * ftrace_free_filter(@ops).
*/
int ftrace_set_filter_ips(struct ftrace_ops *ops, unsigned long *ips,
			  unsigned int cnt, int remove, int reset)
@@ -5900,6 +5913,10 @@ ftrace_set_regex(struct ftrace_ops *ops, unsigned char *buf, int len,
 *
 * Filters denote which functions should be enabled when tracing is enabled.
 * If @buf is NULL and reset is set, all functions will be enabled for tracing.
 *
 * This can allocate memory which must be freed before @ops can be freed,
 * either by removing each filtered addr or by using
 * ftrace_free_filter(@ops).
 */
int ftrace_set_filter(struct ftrace_ops *ops, unsigned char *buf,
		       int len, int reset)
@@ -5919,6 +5936,10 @@ EXPORT_SYMBOL_GPL(ftrace_set_filter);
 * Notrace Filters denote which functions should not be enabled when tracing
 * is enabled. If @buf is NULL and reset is set, all functions will be enabled
 * for tracing.
 *
 * This can allocate memory which must be freed before @ops can be freed,
 * either by removing each filtered addr or by using
 * ftrace_free_filter(@ops).
 */
int ftrace_set_notrace(struct ftrace_ops *ops, unsigned char *buf,
			int len, int reset)
+1 −1
Original line number Diff line number Diff line
@@ -516,7 +516,7 @@ static ssize_t enabled_monitors_write(struct file *filp, const char __user *user
	struct rv_monitor_def *mdef;
	int retval = -EINVAL;
	bool enable = true;
	char *ptr = buff;
	char *ptr;
	int len;

	if (count < 1 || count > MAX_RV_MONITOR_NAME_SIZE + 1)
+2 −0
Original line number Diff line number Diff line
@@ -10295,6 +10295,8 @@ void __init early_trace_init(void)
			static_key_enable(&tracepoint_printk_key.key);
	}
	tracer_alloc_buffers();

	init_events();
}

void __init trace_init(void)
Loading