Skip to contentSkip to conversation

perf fixes

GIT PULL Ingo Molnar 1 participant 1 message Sep 10, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Linus,

Please pull the latest perf-fixes-for-linus git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git perf-fixes-for-linus

Thanks,

Ingo

------------------>
Chris Wright (1):
tracing: t_start: reset FTRACE_ITER_HASH in case of seek/pread

Jovi Zhang (1):
perf symbols: Fix multiple initialization of symbol system

Li Zefan (1):
perf, trace: Fix module leak

Masami Hiramatsu (5):
tracing/kprobe: Fix a memory leak in error case perf probe: Fix return probe support
perf probe: Fix handling of arguments names tracing/kprobes: Fix handling of argument names tracing/kprobe: Fix handling of C-unlike argument names

Peter Zijlstra (1):
perf: Fix CPU hotplug

Steven Rostedt (1):
tracing: Do not allow llseek to set_ftrace_filter

 kernel/perf_event.c             |    6 ++--
 kernel/trace/ftrace.c           |    4 ++-
 kernel/trace/trace_event_perf.c |    3 ++
 kernel/trace/trace_kprobe.c     |   43 ++++++++++++++++++++++----------------
 tools/perf/util/probe-event.c   |    1 +
 tools/perf/util/probe-finder.c  |   42 ++++++++++++++++++++++++++-----------
 tools/perf/util/symbol.c        |    7 ++++++
 tools/perf/util/symbol.h        |    3 +-
 8 files changed, 73 insertions(+), 36 deletions(-)
kernel/perf_event.c +3 -3
index 657555a..db5b560 100644
@@ -5761,15 +5761,15 @@ perf_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu)
 {
 	unsigned int cpu = (long)hcpu;
 
-	switch (action) {
+	switch (action & ~CPU_TASKS_FROZEN) {
 
 	case CPU_UP_PREPARE:
-	case CPU_UP_PREPARE_FROZEN:
+	case CPU_DOWN_FAILED:
 		perf_event_init_cpu(cpu);
 		break;
 
+	case CPU_UP_CANCELED:
 	case CPU_DOWN_PREPARE:
-	case CPU_DOWN_PREPARE_FROZEN:
 		perf_event_exit_cpu(cpu);
 		break;
 
kernel/trace/ftrace.c +3 -1
index 7cb1f45..fa7ece6 100644
@@ -1510,6 +1510,8 @@ static void *t_start(struct seq_file *m, loff_t *pos)
 		if (*pos > 0)
 			return t_hash_start(m, pos);
 		iter->flags |= FTRACE_ITER_PRINTALL;
+		/* reset in case of seek/pread */
+		iter->flags &= ~FTRACE_ITER_HASH;
 		return iter;
 	}
 
@@ -2416,7 +2418,7 @@ static const struct file_operations ftrace_filter_fops = {
 	.open = ftrace_filter_open,
 	.read = seq_read,
 	.write = ftrace_filter_write,
-	.llseek = ftrace_regex_lseek,
+	.llseek = no_llseek,
 	.release = ftrace_filter_release,
 };
 
kernel/trace/trace_event_perf.c +3 -0
index 000e6e8..31cc4cb 100644
@@ -91,6 +91,8 @@ int perf_trace_init(struct perf_event *p_event)
 		    tp_event->class && tp_event->class->reg &&
 		    try_module_get(tp_event->mod)) {
 			ret = perf_trace_event_init(tp_event, p_event);
+			if (ret)
+				module_put(tp_event->mod);
 			break;
 		}
 	}
@@ -146,6 +148,7 @@ void perf_trace_destroy(struct perf_event *p_event)
 		}
 	}
 out:
+	module_put(tp_event->mod);
 	mutex_unlock(&event_mutex);
 }
 
kernel/trace/trace_kprobe.c +25 -18

92 lines not on this page · raw message

tools/perf/util/probe-event.c +1 -0
index e72f05c..fcc16e4 100644
@@ -1539,6 +1539,7 @@ static int convert_to_probe_trace_events(struct perf_probe_event *pev,
 		goto error;
 	}
 	tev->point.offset = pev->point.offset;
+	tev->point.retprobe = pev->point.retprobe;
 	tev->nargs = pev->nargs;
 	if (tev->nargs) {
 		tev->args = zalloc(sizeof(struct probe_trace_arg)
tools/perf/util/probe-finder.c +29 -13

60 lines not on this page · raw message

tools/perf/util/symbol.c +7 -0
index 1a36773..b2f5ae9 100644
@@ -2268,6 +2268,9 @@ static int setup_list(struct strlist **list, const char *list_str,
 
 int symbol__init(void)
 {
+	if (symbol_conf.initialized)
+		return 0;
+
 	elf_version(EV_CURRENT);
 	if (symbol_conf.sort_by_name)
 		symbol_conf.priv_size += (sizeof(struct symbol_name_rb_node) -
@@ -2293,6 +2296,7 @@ int symbol__init(void)
 		       symbol_conf.sym_list_str, "symbol") < 0)
 		goto out_free_comm_list;
 
+	symbol_conf.initialized = true;
 	return 0;
 
 out_free_dso_list:
@@ -2304,11 +2308,14 @@ out_free_comm_list:
 
 void symbol__exit(void)
 {
+	if (!symbol_conf.initialized)
+		return;
 	strlist__delete(symbol_conf.sym_list);
 	strlist__delete(symbol_conf.dso_list);
 	strlist__delete(symbol_conf.comm_list);
 	vmlinux_path__exit();
 	symbol_conf.sym_list = symbol_conf.dso_list = symbol_conf.comm_list = NULL;
+	symbol_conf.initialized = false;
 }
 
 int machines__create_kernel_maps(struct rb_root *self, pid_t pid)
tools/perf/util/symbol.h +2 -1
index b7a8da4..ea95c27 100644
@@ -69,7 +69,8 @@ struct symbol_conf {
 			show_nr_samples,
 			use_callchain,
 			exclude_other,
-			show_cpu_utilization;
+			show_cpu_utilization,
+			initialized;
 	const char	*vmlinux_name,
 			*source_prefix,
 			*field_sep;