diff mbox

[1/4] powerpc/kprobe: introduce a new thread flag

Message ID 1323679853-31751-2-git-send-email-tiejun.chen@windriver.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Tiejun Chen Dec. 12, 2011, 8:50 a.m. UTC
We need to add a new thread flag, TIF_KPROBE/_TIF_DELAYED_KPROBE,
for handling kprobe operation while exiting exception.

Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
---
 arch/powerpc/include/asm/thread_info.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Comments

Benjamin Herrenschmidt Dec. 12, 2011, 10:58 p.m. UTC | #1
On Mon, 2011-12-12 at 16:50 +0800, Tiejun Chen wrote:
> We need to add a new thread flag, TIF_KPROBE/_TIF_DELAYED_KPROBE,
> for handling kprobe operation while exiting exception.

The basic idea is sane, however the instruction emulation isn't per-se
kprobe specific. It could be used by xmon too for example. I'd rather
use a different name, something like TIF_EMULATE_STACK_STORE or
something like that.

Cheers,
Ben.

> Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
> ---
>  arch/powerpc/include/asm/thread_info.h |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h
> index 836f231..3378734 100644
> --- a/arch/powerpc/include/asm/thread_info.h
> +++ b/arch/powerpc/include/asm/thread_info.h
> @@ -112,6 +112,7 @@ static inline struct thread_info *current_thread_info(void)
>  #define TIF_FREEZE		14	/* Freezing for suspend */
>  #define TIF_SYSCALL_TRACEPOINT	15	/* syscall tracepoint instrumentation */
>  #define TIF_RUNLATCH		16	/* Is the runlatch enabled? */
> +#define TIF_KPROBE		17	/* Is the delayed kprobe operation? */
>  
>  /* as above, but as bit values */
>  #define _TIF_SYSCALL_TRACE	(1<<TIF_SYSCALL_TRACE)
> @@ -130,6 +131,7 @@ static inline struct thread_info *current_thread_info(void)
>  #define _TIF_FREEZE		(1<<TIF_FREEZE)
>  #define _TIF_SYSCALL_TRACEPOINT	(1<<TIF_SYSCALL_TRACEPOINT)
>  #define _TIF_RUNLATCH		(1<<TIF_RUNLATCH)
> +#define _TIF_DELAYED_KPROBE	(1<<TIF_KPROBE)
>  #define _TIF_SYSCALL_T_OR_A	(_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \
>  				 _TIF_SECCOMP | _TIF_SYSCALL_TRACEPOINT)
>
Tiejun Chen Dec. 13, 2011, 4:56 a.m. UTC | #2
Benjamin Herrenschmidt wrote:
> On Mon, 2011-12-12 at 16:50 +0800, Tiejun Chen wrote:
>> We need to add a new thread flag, TIF_KPROBE/_TIF_DELAYED_KPROBE,
>> for handling kprobe operation while exiting exception.
> 
> The basic idea is sane, however the instruction emulation isn't per-se
> kprobe specific. It could be used by xmon too for example. I'd rather
> use a different name, something like TIF_EMULATE_STACK_STORE or

Its good term so I'll use this directly :)

Thanks
Tiejun

> something like that.
> 
> Cheers,
> Ben.
> 
>> Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
>> ---
>>  arch/powerpc/include/asm/thread_info.h |    2 ++
>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h
>> index 836f231..3378734 100644
>> --- a/arch/powerpc/include/asm/thread_info.h
>> +++ b/arch/powerpc/include/asm/thread_info.h
>> @@ -112,6 +112,7 @@ static inline struct thread_info *current_thread_info(void)
>>  #define TIF_FREEZE		14	/* Freezing for suspend */
>>  #define TIF_SYSCALL_TRACEPOINT	15	/* syscall tracepoint instrumentation */
>>  #define TIF_RUNLATCH		16	/* Is the runlatch enabled? */
>> +#define TIF_KPROBE		17	/* Is the delayed kprobe operation? */
>>  
>>  /* as above, but as bit values */
>>  #define _TIF_SYSCALL_TRACE	(1<<TIF_SYSCALL_TRACE)
>> @@ -130,6 +131,7 @@ static inline struct thread_info *current_thread_info(void)
>>  #define _TIF_FREEZE		(1<<TIF_FREEZE)
>>  #define _TIF_SYSCALL_TRACEPOINT	(1<<TIF_SYSCALL_TRACEPOINT)
>>  #define _TIF_RUNLATCH		(1<<TIF_RUNLATCH)
>> +#define _TIF_DELAYED_KPROBE	(1<<TIF_KPROBE)
>>  #define _TIF_SYSCALL_T_OR_A	(_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \
>>  				 _TIF_SECCOMP | _TIF_SYSCALL_TRACEPOINT)
>>  
> 
> 
>
diff mbox

Patch

diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h
index 836f231..3378734 100644
--- a/arch/powerpc/include/asm/thread_info.h
+++ b/arch/powerpc/include/asm/thread_info.h
@@ -112,6 +112,7 @@  static inline struct thread_info *current_thread_info(void)
 #define TIF_FREEZE		14	/* Freezing for suspend */
 #define TIF_SYSCALL_TRACEPOINT	15	/* syscall tracepoint instrumentation */
 #define TIF_RUNLATCH		16	/* Is the runlatch enabled? */
+#define TIF_KPROBE		17	/* Is the delayed kprobe operation? */
 
 /* as above, but as bit values */
 #define _TIF_SYSCALL_TRACE	(1<<TIF_SYSCALL_TRACE)
@@ -130,6 +131,7 @@  static inline struct thread_info *current_thread_info(void)
 #define _TIF_FREEZE		(1<<TIF_FREEZE)
 #define _TIF_SYSCALL_TRACEPOINT	(1<<TIF_SYSCALL_TRACEPOINT)
 #define _TIF_RUNLATCH		(1<<TIF_RUNLATCH)
+#define _TIF_DELAYED_KPROBE	(1<<TIF_KPROBE)
 #define _TIF_SYSCALL_T_OR_A	(_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \
 				 _TIF_SECCOMP | _TIF_SYSCALL_TRACEPOINT)