]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kernel-add-kcov-code-coverage-fix
authorAndrew Morton <akpm@linux-foundation.org>
Tue, 9 Feb 2016 23:13:58 +0000 (10:13 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 9 Feb 2016 23:13:58 +0000 (10:13 +1100)
make task_struct.kcov_mode have type `enum kcov_mode'.

Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Kees Cook <keescook@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/kcov.h
include/linux/sched.h
kernel/kcov.c

index 72ff663ae2038d7b05c29c87cf8a04418b43d0aa..01b4845a408641bee9bd1d55f0e2eb22c11b0f48 100644 (file)
@@ -10,6 +10,14 @@ struct task_struct;
 void kcov_task_init(struct task_struct *t);
 void kcov_task_exit(struct task_struct *t);
 
+enum kcov_mode {
+       /*
+        * Tracing coverage collection mode.
+        * Covered PCs are collected in a per-task buffer.
+        */
+       KCOV_MODE_TRACE = 1,
+};
+
 #else
 
 static inline void kcov_task_init(struct task_struct *t) {}
index 9079df61673e94d19fe22463a1fbcac552484dc1..67e48c06ec64f1ea32db4c27541458e348051492 100644 (file)
@@ -51,6 +51,7 @@ struct sched_param {
 #include <linux/resource.h>
 #include <linux/timer.h>
 #include <linux/hrtimer.h>
+#include <linux/kcov.h>
 #include <linux/task_io_accounting.h>
 #include <linux/latencytop.h>
 #include <linux/cred.h>
@@ -1814,7 +1815,7 @@ struct task_struct {
 #endif /* CONFIG_TRACING */
 #ifdef CONFIG_KCOV
        /* Coverage collection mode enabled for this task (0 if disabled). */
-       int             kcov_mode;
+       enum kcov_mode kcov_mode;
        /* Size of the kcov_area. */
        unsigned        kcov_size;
        /* Buffer for coverage collection. */
index 662c4019e3af35f313902f8aa181286adc3fff4c..230279c2454ef10b3536ac2e89c87eeb5bd6b1a9 100644 (file)
 #include <linux/uaccess.h>
 #include <linux/kcov.h>
 
-enum kcov_mode {
-       /*
-        * Tracing coverage collection mode.
-        * Covered PCs are collected in a per-task buffer.
-        */
-       KCOV_MODE_TRACE = 1,
-};
-
 /*
  * kcov descriptor (one per opened debugfs file).
  * State transitions of the descriptor: