aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-04-04 13:04:42 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-04-04 13:04:42 -0400
commit66cfb32772495068fbb5627b2dc88649ad66c3e5 (patch)
tree4ce3537afdbd9be92a7a3e6ef4e8e8519ee11543
parent6742259866d03d5bc19815441ba928e8378343dc (diff)
parent7b8e6da46b921d30ac1553cac56d8fb74f0b431d (diff)
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Ingo Molnar. * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/x86/p4: Add format attributes tracing, sched, vfs: Fix 'old_pid' usage in trace_sched_process_exec()
-rw-r--r--arch/x86/kernel/cpu/perf_event_p4.c13
-rw-r--r--fs/exec.c7
-rw-r--r--include/trace/events/sched.h2
3 files changed, 18 insertions, 4 deletions
diff --git a/arch/x86/kernel/cpu/perf_event_p4.c b/arch/x86/kernel/cpu/perf_event_p4.c
index ef484d9d0a25..a2dfacfd7103 100644
--- a/arch/x86/kernel/cpu/perf_event_p4.c
+++ b/arch/x86/kernel/cpu/perf_event_p4.c
@@ -1271,6 +1271,17 @@ done:
1271 return num ? -EINVAL : 0; 1271 return num ? -EINVAL : 0;
1272} 1272}
1273 1273
1274PMU_FORMAT_ATTR(cccr, "config:0-31" );
1275PMU_FORMAT_ATTR(escr, "config:32-62");
1276PMU_FORMAT_ATTR(ht, "config:63" );
1277
1278static struct attribute *intel_p4_formats_attr[] = {
1279 &format_attr_cccr.attr,
1280 &format_attr_escr.attr,
1281 &format_attr_ht.attr,
1282 NULL,
1283};
1284
1274static __initconst const struct x86_pmu p4_pmu = { 1285static __initconst const struct x86_pmu p4_pmu = {
1275 .name = "Netburst P4/Xeon", 1286 .name = "Netburst P4/Xeon",
1276 .handle_irq = p4_pmu_handle_irq, 1287 .handle_irq = p4_pmu_handle_irq,
@@ -1305,6 +1316,8 @@ static __initconst const struct x86_pmu p4_pmu = {
1305 * the former idea is taken from OProfile code 1316 * the former idea is taken from OProfile code
1306 */ 1317 */
1307 .perfctr_second_write = 1, 1318 .perfctr_second_write = 1,
1319
1320 .format_attrs = intel_p4_formats_attr,
1308}; 1321};
1309 1322
1310__init int p4_pmu_init(void) 1323__init int p4_pmu_init(void)
diff --git a/fs/exec.c b/fs/exec.c
index 9a1d9f0a60ab..b1fd2025e59a 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1371,7 +1371,7 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
1371 unsigned int depth = bprm->recursion_depth; 1371 unsigned int depth = bprm->recursion_depth;
1372 int try,retval; 1372 int try,retval;
1373 struct linux_binfmt *fmt; 1373 struct linux_binfmt *fmt;
1374 pid_t old_pid; 1374 pid_t old_pid, old_vpid;
1375 1375
1376 retval = security_bprm_check(bprm); 1376 retval = security_bprm_check(bprm);
1377 if (retval) 1377 if (retval)
@@ -1382,8 +1382,9 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
1382 return retval; 1382 return retval;
1383 1383
1384 /* Need to fetch pid before load_binary changes it */ 1384 /* Need to fetch pid before load_binary changes it */
1385 old_pid = current->pid;
1385 rcu_read_lock(); 1386 rcu_read_lock();
1386 old_pid = task_pid_nr_ns(current, task_active_pid_ns(current->parent)); 1387 old_vpid = task_pid_nr_ns(current, task_active_pid_ns(current->parent));
1387 rcu_read_unlock(); 1388 rcu_read_unlock();
1388 1389
1389 retval = -ENOENT; 1390 retval = -ENOENT;
@@ -1406,7 +1407,7 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
1406 if (retval >= 0) { 1407 if (retval >= 0) {
1407 if (depth == 0) { 1408 if (depth == 0) {
1408 trace_sched_process_exec(current, old_pid, bprm); 1409 trace_sched_process_exec(current, old_pid, bprm);
1409 ptrace_event(PTRACE_EVENT_EXEC, old_pid); 1410 ptrace_event(PTRACE_EVENT_EXEC, old_vpid);
1410 } 1411 }
1411 put_binfmt(fmt); 1412 put_binfmt(fmt);
1412 allow_write_access(bprm->file); 1413 allow_write_access(bprm->file);
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index fbc7b1ad929b..ea7a2035456d 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -295,7 +295,7 @@ TRACE_EVENT(sched_process_exec,
295 TP_fast_assign( 295 TP_fast_assign(
296 __assign_str(filename, bprm->filename); 296 __assign_str(filename, bprm->filename);
297 __entry->pid = p->pid; 297 __entry->pid = p->pid;
298 __entry->old_pid = p->pid; 298 __entry->old_pid = old_pid;
299 ), 299 ),
300 300
301 TP_printk("filename=%s pid=%d old_pid=%d", __get_str(filename), 301 TP_printk("filename=%s pid=%d old_pid=%d", __get_str(filename),