Skip to contentSkip to conversation

perf_counter: Fix COMM and MMAP events for cpu wide counters

tip:perfcounters/core tip-bot for Peter Zijlstra 4 participants 5 messages May 29, 2009 – May 30, 2009

lore
Share & tools
lore
#0 lore raw
Commit-ID:  efb3d17240d80e27508d238809168120fe4b93a4
Gitweb:     http://git.kernel.org/tip/efb3d17240d80e27508d238809168120fe4b93a4
Author:     Peter Zijlstra <[email protected]>
AuthorDate: Fri, 29 May 2009 14:25:58 +0200
Committer:  Ingo Molnar <[email protected]>
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.

Cc Mike Galbraith <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Corey Ashford <[email protected]>
Cc Marcelo Tosatti <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc John Kacur <[email protected]>

LKML-Reference: <new-submission>

---
 kernel/perf_counter.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)
kernel/perf_counter.c +4 -8
index 616c524..58d6d19 100644
@@ -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,
#1 lore raw
Quoted 3 lines · tip-bot for Peter Zijlstra

Commit-ID:  efb3d17240d80e27508d238809168120fe4b93a4
Gitweb:     http://git.kernel.org/tip/efb3d17240d80e27508d238809168120fe4b93a4

I have one question about "tip-bot" and "-tip" word.
"tip" word is abbreviation. Can anyone explain me meaning of the "tip" word? Sorry for trivial question.
But I always wondered about this abbreviation in private.

Signature · 10 lines
Regards,
GeunSik Lim ( SAMSUNG ELECTRONICS)
Blog : http://blog.naver.com/invain/
e-Mail: [email protected]
           [email protected] , [email protected]
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
#2 lore raw
Quoted 10 lines · GeunSik Lim
Quoted 3 lines · tip-bot for Peter Zijlstra
Commit-ID:  efb3d17240d80e27508d238809168120fe4b93a4
Gitweb:     http://git.kernel.org/tip/efb3d17240d80e27508d238809168120fe4b93a4

I have one question about "tip-bot" and "-tip" word.
"tip" word is abbreviation. Can anyone explain me meaning of the "tip" word? Sorry for trivial question.
But I always wondered about this abbreviation in private.

T: Thomas
I: Ingo
P: hpa

YH

#3 lore raw
Quoted 9 lines · Yinghai Lu
Quoted 8 lines · GeunSik Lim
Quoted 3 lines · tip-bot for Peter Zijlstra
Commit-ID:  efb3d17240d80e27508d238809168120fe4b93a4
Gitweb:     http://git.kernel.org/tip/efb3d17240d80e27508d238809168120fe4b93a4

I have one question about "tip-bot" and "-tip" word.
"tip" word is abbreviation. Can anyone explain me meaning of the "tip" word? Sorry for trivial question.
But I always wondered about this abbreviation in private.

-tip is to signal the 'cutting edge/summit' of the trees we are maintaining and working on. "define:tip" on google gives:

tip:
[...]
peak: the top or extreme point of something (usually a mountain or hill); "the view from the peak was magnificent"; "they clambered to the tip of Monadnock"; "the region is a few molecules wide at the summit"

Quoted 3 lines

T: Thomas
I: Ingo
P: hpa

That secondary meaning is valid too ;-)

Ingo

#4 lore raw
Quoted 10 lines · Ingo Molnar

-tip is to signal the 'cutting edge/summit' of the trees we are maintaining and working on. "define:tip" on google gives:

tip:
 [...]
 peak: the top or extreme point of something (usually a mountain or hill); "the view from the peak was magnificent"; "they clambered to the tip of Monadnock"; "the region is a few molecules wide at the summit"

Quoted 8 lines
Quoted 3 lines

T: Thomas
I: Ingo
P: hpa

That secondary meaning is valid too ;-)

       Ingo

Thanks Yinghai and Ingo.
I'm so happy to hear about "-tip" meaning.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
--