Commit b3d7fe8
kcov: properly handle subsequent mmap calls
Allocate the kcov buffer during KCOV_MODE_INIT in order to untie mmapping
of a kcov instance and the actual coverage collection process. Modify
kcov_mmap, so that it can be reliably used any number of times once
KCOV_MODE_INIT has succeeded.
These changes to the user-facing interface of the tool only weaken the
preconditions, so all existing user space code should remain compatible
with the new version.
Link: https://lkml.kernel.org/r/20220117153634.150357-3-nogikh@google.com
Signed-off-by: Aleksandr Nogikh <nogikh@google.com>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Reviewed-by: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Marco Elver <elver@google.com>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Taras Madan <tarasmadan@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>1 parent 17581aa commit b3d7fe8
1 file changed
Lines changed: 15 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
459 | 459 | | |
460 | 460 | | |
461 | 461 | | |
462 | | - | |
463 | 462 | | |
464 | 463 | | |
465 | 464 | | |
466 | 465 | | |
467 | 466 | | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | 467 | | |
473 | 468 | | |
474 | | - | |
| 469 | + | |
475 | 470 | | |
476 | 471 | | |
477 | 472 | | |
478 | 473 | | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
489 | 480 | | |
| 481 | + | |
490 | 482 | | |
491 | 483 | | |
492 | | - | |
493 | 484 | | |
494 | 485 | | |
495 | 486 | | |
| |||
674 | 665 | | |
675 | 666 | | |
676 | 667 | | |
| 668 | + | |
677 | 669 | | |
678 | 670 | | |
679 | 671 | | |
| |||
683 | 675 | | |
684 | 676 | | |
685 | 677 | | |
686 | | - | |
687 | | - | |
| 678 | + | |
688 | 679 | | |
689 | 680 | | |
690 | 681 | | |
691 | 682 | | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
692 | 686 | | |
693 | 687 | | |
694 | 688 | | |
| 689 | + | |
695 | 690 | | |
696 | 691 | | |
| 692 | + | |
697 | 693 | | |
698 | 694 | | |
699 | 695 | | |
| |||
0 commit comments