mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-08 14:13:53 +00:00
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()
This commit is contained in:
commit
66cfb32772
@ -1271,6 +1271,17 @@ static int p4_pmu_schedule_events(struct cpu_hw_events *cpuc, int n, int *assign
|
|||||||
return num ? -EINVAL : 0;
|
return num ? -EINVAL : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PMU_FORMAT_ATTR(cccr, "config:0-31" );
|
||||||
|
PMU_FORMAT_ATTR(escr, "config:32-62");
|
||||||
|
PMU_FORMAT_ATTR(ht, "config:63" );
|
||||||
|
|
||||||
|
static struct attribute *intel_p4_formats_attr[] = {
|
||||||
|
&format_attr_cccr.attr,
|
||||||
|
&format_attr_escr.attr,
|
||||||
|
&format_attr_ht.attr,
|
||||||
|
NULL,
|
||||||
|
};
|
||||||
|
|
||||||
static __initconst const struct x86_pmu p4_pmu = {
|
static __initconst const struct x86_pmu p4_pmu = {
|
||||||
.name = "Netburst P4/Xeon",
|
.name = "Netburst P4/Xeon",
|
||||||
.handle_irq = p4_pmu_handle_irq,
|
.handle_irq = p4_pmu_handle_irq,
|
||||||
@ -1305,6 +1316,8 @@ static __initconst const struct x86_pmu p4_pmu = {
|
|||||||
* the former idea is taken from OProfile code
|
* the former idea is taken from OProfile code
|
||||||
*/
|
*/
|
||||||
.perfctr_second_write = 1,
|
.perfctr_second_write = 1,
|
||||||
|
|
||||||
|
.format_attrs = intel_p4_formats_attr,
|
||||||
};
|
};
|
||||||
|
|
||||||
__init int p4_pmu_init(void)
|
__init int p4_pmu_init(void)
|
||||||
|
@ -1371,7 +1371,7 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
|
|||||||
unsigned int depth = bprm->recursion_depth;
|
unsigned int depth = bprm->recursion_depth;
|
||||||
int try,retval;
|
int try,retval;
|
||||||
struct linux_binfmt *fmt;
|
struct linux_binfmt *fmt;
|
||||||
pid_t old_pid;
|
pid_t old_pid, old_vpid;
|
||||||
|
|
||||||
retval = security_bprm_check(bprm);
|
retval = security_bprm_check(bprm);
|
||||||
if (retval)
|
if (retval)
|
||||||
@ -1382,8 +1382,9 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
|
|||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
/* Need to fetch pid before load_binary changes it */
|
/* Need to fetch pid before load_binary changes it */
|
||||||
|
old_pid = current->pid;
|
||||||
rcu_read_lock();
|
rcu_read_lock();
|
||||||
old_pid = task_pid_nr_ns(current, task_active_pid_ns(current->parent));
|
old_vpid = task_pid_nr_ns(current, task_active_pid_ns(current->parent));
|
||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
|
|
||||||
retval = -ENOENT;
|
retval = -ENOENT;
|
||||||
@ -1406,7 +1407,7 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
|
|||||||
if (retval >= 0) {
|
if (retval >= 0) {
|
||||||
if (depth == 0) {
|
if (depth == 0) {
|
||||||
trace_sched_process_exec(current, old_pid, bprm);
|
trace_sched_process_exec(current, old_pid, bprm);
|
||||||
ptrace_event(PTRACE_EVENT_EXEC, old_pid);
|
ptrace_event(PTRACE_EVENT_EXEC, old_vpid);
|
||||||
}
|
}
|
||||||
put_binfmt(fmt);
|
put_binfmt(fmt);
|
||||||
allow_write_access(bprm->file);
|
allow_write_access(bprm->file);
|
||||||
|
@ -295,7 +295,7 @@ TRACE_EVENT(sched_process_exec,
|
|||||||
TP_fast_assign(
|
TP_fast_assign(
|
||||||
__assign_str(filename, bprm->filename);
|
__assign_str(filename, bprm->filename);
|
||||||
__entry->pid = p->pid;
|
__entry->pid = p->pid;
|
||||||
__entry->old_pid = p->pid;
|
__entry->old_pid = old_pid;
|
||||||
),
|
),
|
||||||
|
|
||||||
TP_printk("filename=%s pid=%d old_pid=%d", __get_str(filename),
|
TP_printk("filename=%s pid=%d old_pid=%d", __get_str(filename),
|
||||||
|
Loading…
Reference in New Issue
Block a user