perf probe: Correct probe syntax on command line help
Subsystems (2)
PATCH 1/2 perf probe: Correct probe syntax on command line help
Move @SRC right after FUNC in syntax according to syntax change on command line help.
---
tools/perf/builtin-probe.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
tools/perf/builtin-probe.c +1 -1
@@ -177,7 +177,7 @@ static const struct option options[] = {#ifdef NO_DWARF_SUPPORT "[EVENT=]FUNC[+OFF|%return] [ARG ...]" , #else -"[EVENT=]FUNC[+OFF|%return|:RL|;PT][@SRC]|SRC:AL|SRC;PT" +"[EVENT=]FUNC[@SRC][+OFF|%return|:RL|;PT]|SRC:AL|SRC;PT" " [ARG ...]" , #endif"probe point definition, where\n"
Signature · 7 lines
Masami Hiramatsu Software Engineer Hitachi Computer Products (America), Inc. Software Solutions Division e-mail: [email protected]
PATCH 2/2 x86: Issue at least one memory barrier in stop_machine_text_poke().
Fix stop_machine_text_poke() to issue smp_mb() before exiting waiting loop. Also, use ACCESS_ONCE() to check a flag according to Mathieu's comment.
---
arch/x86/kernel/alternative.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
arch/x86/kernel/alternative.c +3 -3
@@ -596,9 +596,9 @@ static int __kprobes stop_machine_text_poke(void *data)smp_wmb ();/* Make sure other cpus see that this has run */ wrote_text =1 ; }else { -while (!wrote_text) -smp_rmb (); -sync_core (); +while (!ACCESS_ONCE (wrote_text)) +cpu_relax (); +smp_mb ();/* Load wrote_text before following execution */ } flush_icache_range((unsigned long)tpp->addr,
Signature · 7 lines
Masami Hiramatsu Software Engineer Hitachi Computer Products (America), Inc. Software Solutions Division e-mail: [email protected]
Re: [PATCH -tip 2/2] x86: Issue at least one memory barrier in stop_machine_text_poke().
Quoted 18 lines · * Masami Hiramatsu ([email protected]) wrote:
Fix
stop_machine_text_poke()to issuesmp_mb()before exiting waiting loop. Also, useACCESS_ONCE()to check a flag according to Mathieu's comment.Signed-off-by Masami Hiramatsu <[email protected]>Cc Mathieu Desnoyers <[email protected]>Cc Ingo Molnar <[email protected]>Cc Jason Baron <[email protected]>---
arch/x86/kernel/alternative.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)arch/x86/kernel/alternative.c +0
-0
arch/x86/kernel/alternative.c static int __kprobes stop_machine_text_poke(void *data) · line 599
Quoted 7 lines
arch/x86/kernel/alternative.c +1
-3@@ -596,9 +596,9 @@ static int __kprobes stop_machine_text_poke(void *data)smp_wmb ();/* Make sure other cpus see that this has run */ wrote_text =1 ; }else { -while (!wrote_text) -smp_rmb (); -sync_core (); +while (!ACCESS_ONCE (wrote_text))
Well, cpu_relax() has a "memory" clobber, so the access once is not required to ensure the variable is re-read. And, sorry to contradict my previous statement somewhat, but given that we don't care if the compiler fetches wrote_text in chunks or not, ACCESS_ONCE() is not required here. So rather than leaving people wondering why we put an ACCESS_ONCE() here, it's probably better to leave it out.
Thanks,
Mathieu
Quoted 15 lines
arch/x86/kernel/alternative.c +2
-0+cpu_relax (); +smp_mb ();/* Load wrote_text before following execution */ } flush_icache_range((unsigned long)tpp->addr,Signature · 8 lines
-- Masami Hiramatsu Software Engineer Hitachi Computer Products (America), Inc. Software Solutions Division e-mail: [email protected]
Signature · 4 lines
Mathieu Desnoyers Operating System Efficiency Consultant EfficiOS Inc. http://www.efficios.com
Re: [PATCH -tip 2/2] x86: Issue at least one memory barrier in stop_machine_text_poke().
Quoted 25 lines · Mathieu Desnoyers
Quoted 24 lines · * Masami Hiramatsu ([email protected]) wrote:
Fix
stop_machine_text_poke()to issuesmp_mb()before exiting waiting loop. Also, useACCESS_ONCE()to check a flag according to Mathieu's comment.Signed-off-by Masami Hiramatsu <[email protected]>Cc Mathieu Desnoyers <[email protected]>Cc Ingo Molnar <[email protected]>Cc Jason Baron <[email protected]>---
arch/x86/kernel/alternative.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)arch/x86/kernel/alternative.c +0
-3@@ -596,9 +596,9 @@ static int __kprobes stop_machine_text_poke(void *data)smp_wmb ();/* Make sure other cpus see that this has run */ wrote_text =1 ; }else { -while (!wrote_text) -smp_rmb (); -sync_core ();
Quoted 8 lines
arch/x86/kernel/alternative.c static int __kprobes stop_machine_text_poke(void *data) · line 599
Quoted 1 line
arch/x86/kernel/alternative.c +1
-0+while (!ACCESS_ONCE (wrote_text))Well,
cpu_relax()has a "memory" clobber, so the access once is not required to ensure the variable is re-read. And, sorry to contradict my previous statement somewhat, but given that we don't care if the compiler fetcheswrote_textin chunks or not,ACCESS_ONCE()is not required here. So rather than leaving people wondering why we put anACCESS_ONCE()here, it's probably better to leave it out.
Ah, OK. Indeed, volatile is for compiler...
Thank you,
Signature · 2 lines
Masami Hiramatsu e-mail: [email protected]
PATCH 1/1 x86: Issue at least one memory barrier in stop_machine_text_poke().
In reply to Mathieu DesnoyersFix stop_machine_text_poke() to issue smp_mb() before exiting waiting loop, and use cpu_relax() for waiting.
---
arch/x86/kernel/alternative.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/alternative.c +2 -2
@@ -597,8 +597,8 @@ static int __kprobes stop_machine_text_poke(void *data) wrote_text =1 ; }else {while (!wrote_text) -smp_rmb (); -sync_core (); +cpu_relax (); +smp_mb ();/* Load wrote_text before following execution */ } flush_icache_range((unsigned long)tpp->addr,
Signature · 7 lines
Masami Hiramatsu Software Engineer Hitachi Computer Products (America), Inc. Software Solutions Division e-mail: [email protected]
Re: [PATCH -tip] x86: Issue at least one memory barrier in stop_machine_text_poke().
Quoted 2 lines · * Masami Hiramatsu ([email protected]) wrote:
Fix
stop_machine_text_poke()to issuesmp_mb()before exiting waiting loop, and usecpu_relax()for waiting.
Quoted 35 lines
Signed-off-by Masami Hiramatsu <[email protected]>Cc Mathieu Desnoyers <[email protected]>Cc Ingo Molnar <[email protected]>Cc Jason Baron <[email protected]>---
arch/x86/kernel/alternative.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)arch/x86/kernel/alternative.c +2
-2@@ -597,8 +597,8 @@ static int __kprobes stop_machine_text_poke(void *data) wrote_text =1 ; }else {while (!wrote_text) -smp_rmb (); -sync_core (); +cpu_relax (); +smp_mb ();/* Load wrote_text before following execution */ } flush_icache_range((unsigned long)tpp->addr,Signature · 8 lines
-- Masami Hiramatsu Software Engineer Hitachi Computer Products (America), Inc. Software Solutions Division e-mail: [email protected]
Signature · 4 lines
Mathieu Desnoyers Operating System Efficiency Consultant EfficiOS Inc. http://www.efficios.com