History

kcov: cleanup debug messages

Patch series "kcov: collect coverage from usb soft interrupts", v4. This patchset extends kcov to allow collecting coverage from soft interrupts and then uses the new functionality to collect coverage from USB code. This has allowed to find at least one new HID bug [1], which was recently fixed by Alan [2]. [1] https://syzkaller.appspot.com/bug?extid=09ef48aa58261464b621 [2] https://patchwork.kernel.org/patch/11283319/ Any subsystem that uses softirqs (e.g. timers) can make use of this in the future. Looking at the recent syzbot reports, an obvious candidate is the networking subsystem [3, 4, 5 and many more]. [3] https://syzkaller.appspot.com/bug?extid=522ab502c69badc66ab7 [4] https://syzkaller.appspot.com/bug?extid=57f89d05946c53dbbb31 [5] https://syzkaller.appspot.com/bug?extid=df358e65d9c1b9d3f5f4 This pach (of 7): Previous commit left a lot of excessive debug messages, clean them up. Link; http://lkml.kernel.org/r/cover.1585233617.git.andreyknvl@google.com Link; http://lkml.kernel.org/r/ab5e2885ce674ba6e04368551e51eeb6a2c11baf.1585233617.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov <andreyknvl@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Dmitry Vyukov <dvyukov@google.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Alexander Potapenko <glider@google.com> Cc: Marco Elver <elver@google.com> Cc: Andrey Konovalov <andreyknvl@gmail.com> Link: http://lkml.kernel.org/r/4a497134b2cf7a9d306d28e3dd2746f5446d1605.1584655448.git.andreyknvl@google.com Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Andrey Konovalov committed 6 years ago

Commit 3c61df31 parent 6929f711 file · +2 −20Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/kcov.c+2−20
@@ -98,6 +98,7 @@ static struct kcov_remote *kcov_remote_find(u64 handle) · 97 unmodified lines
9898 return NULL;
9999 }
100100
101+/* Must be called with kcov_remote_lock locked. */
101102 static struct kcov_remote *kcov_remote_add(struct kcov *kcov, u64 handle)
102103 {
103104 struct kcov_remote *remote;
@@ -119,16 +120,13 @@ static struct kcov_remote_area *kcov_remote_area_get(unsigned int size) · 15 unmodified lines
119120 struct kcov_remote_area *area;
120121 struct list_head *pos;
121122
122− kcov_debug("size = %u\n", size);
123123 list_for_each(pos, &kcov_remote_areas) {
124124 area = list_entry(pos, struct kcov_remote_area, list);
125125 if (area->size == size) {
126126 list_del(&area->list);
127− kcov_debug("rv = %px\n", area);
128127 return area;
129128 }
130129 }
131− kcov_debug("rv = NULL\n");
132130 return NULL;
133131 }
134132
@@ -136,7 +134,6 @@ static struct kcov_remote_area *kcov_remote_area_get(unsigned int size) · 1 unmodified line
136134 static void kcov_remote_area_put(struct kcov_remote_area *area,
137135 unsigned int size)
138136 {
139− kcov_debug("area = %px, size = %u\n", area, size);
140137 INIT_LIST_HEAD(&area->list);
141138 area->size = size;
142139 list_add(&area->list, &kcov_remote_areas);
@@ -366,7 +363,6 @@ static void kcov_remote_reset(struct kcov *kcov) · 223 unmodified lines
366363 hash_for_each_safe(kcov_remote_map, bkt, tmp, remote, hnode) {
367364 if (remote->kcov != kcov)
368365 continue;
369− kcov_debug("removing handle %llx\n", remote->handle);
370366 hash_del(&remote->hnode);
371367 kfree(remote);
372368 }
@@ -553,7 +549,6 @@ static int kcov_ioctl_locked(struct kcov *kcov, unsigned int cmd, · 180 unmodified lines
553549
554550 switch (cmd) {
555551 case KCOV_INIT_TRACE:
556− kcov_debug("KCOV_INIT_TRACE\n");
557552 /*
558553 * Enable kcov in trace mode and setup buffer size.
559554 * Must happen before anything else.
@@ -572,7 +567,6 @@ static int kcov_ioctl_locked(struct kcov *kcov, unsigned int cmd, · 12 unmodified lines
572567 kcov->mode = KCOV_MODE_INIT;
573568 return 0;
574569 case KCOV_ENABLE:
575− kcov_debug("KCOV_ENABLE\n");
576570 /*
577571 * Enable coverage for the current task.
578572 * At this point user must have been enabled trace mode,
@@ -598,7 +592,6 @@ static int kcov_ioctl_locked(struct kcov *kcov, unsigned int cmd, · 19 unmodified lines
598592 kcov_get(kcov);
599593 return 0;
600594 case KCOV_DISABLE:
601− kcov_debug("KCOV_DISABLE\n");
602595 /* Disable coverage for the current task. */
603596 unused = arg;
604597 if (unused != 0 || current->kcov != kcov)
@@ -610,7 +603,6 @@ static int kcov_ioctl_locked(struct kcov *kcov, unsigned int cmd, · 5 unmodified lines
610603 kcov_put(kcov);
611604 return 0;
612605 case KCOV_REMOTE_ENABLE:
613− kcov_debug("KCOV_REMOTE_ENABLE\n");
614606 if (kcov->mode != KCOV_MODE_INIT || !kcov->area)
615607 return -EINVAL;
616608 t = current;
@@ -629,7 +621,6 @@ static int kcov_ioctl_locked(struct kcov *kcov, unsigned int cmd, · 12 unmodified lines
629621 kcov->remote_size = remote_arg->area_size;
630622 spin_lock(&kcov_remote_lock);
631623 for (i = 0; i < remote_arg->num_handles; i++) {
632− kcov_debug("handle %llx\n", remote_arg->handles[i]);
633624 if (!kcov_check_handle(remote_arg->handles[i],
634625 false, true, false)) {
635626 spin_unlock(&kcov_remote_lock);
@@ -644,8 +635,6 @@ static int kcov_ioctl_locked(struct kcov *kcov, unsigned int cmd, · 8 unmodified lines
644635 }
645636 }
646637 if (remote_arg->common_handle) {
647− kcov_debug("common handle %llx\n",
648− remote_arg->common_handle);
649638 if (!kcov_check_handle(remote_arg->common_handle,
650639 true, false, false)) {
651640 spin_unlock(&kcov_remote_lock);
@@ -782,7 +771,6 @@ void kcov_remote_start(u64 handle) · 130 unmodified lines
782771 spin_lock(&kcov_remote_lock);
783772 remote = kcov_remote_find(handle);
784773 if (!remote) {
785− kcov_debug("no remote found");
786774 spin_unlock(&kcov_remote_lock);
787775 return;
788776 }
@@ -810,8 +798,6 @@ void kcov_remote_start(u64 handle) · 21 unmodified lines
810798 /* Reset coverage size. */
811799 *(u64 *)area = 0;
812800
813− kcov_debug("area = %px, size = %u", area, size);
814−
815801 kcov_start(t, size, area, mode, sequence);
816802
817803 }
@@ -881,10 +867,8 @@ void kcov_remote_stop(void) · 63 unmodified lines
881867 unsigned int size = t->kcov_size;
882868 int sequence = t->kcov_sequence;
883869
884− if (!kcov) {
885− kcov_debug("no kcov found\n");
870+ if (!kcov)
886871 return;
887− }
888872
889873 kcov_stop(t);
890874 t->kcov = NULL;
@@ -894,8 +878,6 @@ void kcov_remote_stop(void) · 3 unmodified lines
894878 * KCOV_DISABLE could have been called between kcov_remote_start()
895879 * and kcov_remote_stop(), hence the check.
896880 */
897− kcov_debug("move if: %d == %d && %d\n",
898− sequence, kcov->sequence, (int)kcov->remote);
899881 if (sequence == kcov->sequence && kcov->remote)
900882 kcov_move_area(kcov->mode, kcov->area, kcov->size, area);
901883 spin_unlock(&kcov->lock);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t