[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-efb3d17240d80e27508d238809168120fe4b93a4@git.kernel.org>
Date: Fri, 29 May 2009 17:16:09 GMT
From: tip-bot for Peter Zijlstra <a.p.zijlstra@...llo.nl>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, acme@...hat.com, paulus@...ba.org,
hpa@...or.com, mingo@...hat.com, jkacur@...hat.com,
a.p.zijlstra@...llo.nl, efault@....de, mtosatti@...hat.com,
tglx@...utronix.de, cjashfor@...ux.vnet.ibm.com, mingo@...e.hu
Subject: [tip:perfcounters/core] perf_counter: Fix COMM and MMAP events for cpu wide counters
Commit-ID: efb3d17240d80e27508d238809168120fe4b93a4
Gitweb: http://git.kernel.org/tip/efb3d17240d80e27508d238809168120fe4b93a4
Author: Peter Zijlstra <a.p.zijlstra@...llo.nl>
AuthorDate: Fri, 29 May 2009 14:25:58 +0200
Committer: Ingo Molnar <mingo@...e.hu>
CommitDate: Fri, 29 May 2009 16:21:51 +0200
perf_counter: Fix COMM and MMAP events for cpu wide counters
Commit a63eaf34ae6 ("perf_counter: Dynamically allocate tasks'
perf_counter_context struct") broke COMM and MMAP notification for
cpu wide counters by dropping out early if there was no task context,
thereby also not iterating the cpu context.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Mike Galbraith <efault@....de>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Corey Ashford <cjashfor@...ux.vnet.ibm.com>
Cc: Marcelo Tosatti <mtosatti@...hat.com>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: John Kacur <jkacur@...hat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
kernel/perf_counter.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c
index 616c524..58d6d19 100644
--- a/kernel/perf_counter.c
+++ b/kernel/perf_counter.c
@@ -2443,9 +2443,9 @@ static void perf_counter_comm_event(struct perf_comm_event *comm_event)
cpuctx = &get_cpu_var(perf_cpu_context);
perf_counter_comm_ctx(&cpuctx->ctx, comm_event);
+ if (cpuctx->task_ctx)
+ perf_counter_comm_ctx(cpuctx->task_ctx, comm_event);
put_cpu_var(perf_cpu_context);
-
- perf_counter_comm_ctx(current->perf_counter_ctxp, comm_event);
}
void perf_counter_comm(struct task_struct *task)
@@ -2454,8 +2454,6 @@ void perf_counter_comm(struct task_struct *task)
if (!atomic_read(&nr_comm_tracking))
return;
- if (!current->perf_counter_ctxp)
- return;
comm_event = (struct perf_comm_event){
.task = task,
@@ -2570,10 +2568,10 @@ got_name:
cpuctx = &get_cpu_var(perf_cpu_context);
perf_counter_mmap_ctx(&cpuctx->ctx, mmap_event);
+ if (cpuctx->task_ctx)
+ perf_counter_mmap_ctx(cpuctx->task_ctx, mmap_event);
put_cpu_var(perf_cpu_context);
- perf_counter_mmap_ctx(current->perf_counter_ctxp, mmap_event);
-
kfree(buf);
}
@@ -2584,8 +2582,6 @@ void perf_counter_mmap(unsigned long addr, unsigned long len,
if (!atomic_read(&nr_mmap_tracking))
return;
- if (!current->perf_counter_ctxp)
- return;
mmap_event = (struct perf_mmap_event){
.file = file,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists