perfcounters fixes
Linus,
Please pull the latest perfcounters-fixes-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git perfcounters-fixes-for-linus
Thanks,
Ingo
------------------>
Arnaldo Carvalho de Melo (1):
perf record: Fix typo in pid_synthesize_comm_event
Carlos R. Mafra (1):
perf: Rename perf-examples.txt to examples.txt
Paul Mackerras (1):
perf_counter: Check task on counter read IPI
kernel/perf_counter.c | 11 +++++++++++
.../{perf-examples.txt => examples.txt} | 0
tools/perf/builtin-record.c | 2 +-
3 files changed, 12 insertions(+), 1 deletions(-)
rename tools/perf/Documentation/{perf-examples.txt => examples.txt} (100%)kernel/perf_counter.c +11 -0
@@ -1503,10 +1503,21 @@ static void perf_counter_enable_on_exec(struct task_struct *task)*/ static void __perf_counter_read (void *info) { +struct perf_cpu_context *cpuctx = &__get_cpu_var (perf_cpu_context);struct perf_counter *counter = info;struct perf_counter_context *ctx = counter->ctx;unsigned long flags; +/* +* If this is a task context, we need to check whether it is +* the current task context of this cpu. If not it has been +* scheduled out before the smp call arrived. In that case +* counter->count would have been updated to a recent sample +* when the counter was scheduled out. +*/ +if (ctx->task && cpuctx->task_ctx != ctx) +return ; +local_irq_save (flags);if (ctx->is_active)update_context_time (ctx);
tools/perf/Documentation/examples.txt renamed from tools/perf/Documentation/perf-examples.txt +0 -0
tools/perf/builtin-record.c +1 -1
@@ -219,7 +219,7 @@ static pid_t pid_synthesize_comm_event(pid_t pid, int full)snprintf (filename,sizeof (filename),"/proc/%d/status" , pid); fp =fopen (filename,"r" ); -if (fd ==NULL ) { +if (fp ==NULL ) {/* * We raced with a task exiting - just return: */