[v8,1/5] Add KUnit Struct to Current Task
diff mbox series

Message ID 20200606040349.246780-2-davidgow@google.com
State New
Headers show
Series
  • KUnit-KASAN Integration
Related show

Commit Message

David Gow June 6, 2020, 4:03 a.m. UTC
From: Patricia Alfonso <trishalfonso@google.com>

In order to integrate debugging tools like KASAN into the KUnit
framework, add KUnit struct to the current task to keep track of the
current KUnit test.

Signed-off-by: Patricia Alfonso <trishalfonso@google.com>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Signed-off-by: David Gow <davidgow@google.com>
---
 include/linux/sched.h | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Shuah Khan June 9, 2020, 8:19 p.m. UTC | #1
On 6/5/20 10:03 PM, David Gow wrote:
> From: Patricia Alfonso <trishalfonso@google.com>
> 
> In order to integrate debugging tools like KASAN into the KUnit
> framework, add KUnit struct to the current task to keep track of the
> current KUnit test.
> 
> Signed-off-by: Patricia Alfonso <trishalfonso@google.com>
> Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
> Signed-off-by: David Gow <davidgow@google.com>
> ---
>   include/linux/sched.h | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/include/linux/sched.h b/include/linux/sched.h
> index 4418f5cb8324..e50c568a8dc7 100644
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -1188,6 +1188,10 @@ struct task_struct {
>   	unsigned int			kasan_depth;
>   #endif
>   
> +#if IS_ENABLED(CONFIG_KUNIT)
> +	struct kunit			*kunit_test;
> +#endif
> +
>   #ifdef CONFIG_FUNCTION_GRAPH_TRACER
>   	/* Index of current stored address in ret_stack: */
>   	int				curr_ret_stack;
> 

Peter, Ingo, Juri,

Okay for this patch to go through Kselftest tree?


thanks,
-- Shuah

Patch
diff mbox series

diff --git a/include/linux/sched.h b/include/linux/sched.h
index 4418f5cb8324..e50c568a8dc7 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1188,6 +1188,10 @@  struct task_struct {
 	unsigned int			kasan_depth;
 #endif
 
+#if IS_ENABLED(CONFIG_KUNIT)
+	struct kunit			*kunit_test;
+#endif
+
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
 	/* Index of current stored address in ret_stack: */
 	int				curr_ret_stack;