Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Drop no longer needed macros KCOV_STORE() KCOV_LOAD() in kco...



details:   https://anonhg.NetBSD.org/src/rev/0158fb6e2de2
branches:  trunk
changeset: 456738:0158fb6e2de2
user:      kamil <kamil%NetBSD.org@localhost>
date:      Sun May 26 01:44:34 2019 +0000

description:
Drop no longer needed macros KCOV_STORE() KCOV_LOAD() in kcov(4)

Corrently KCOV_STORE() and KCOV_LOAD() are equivalent to x=y.

Obtained from <R3x>

diffstat:

 share/man/man4/kcov.4  |  10 +++++-----
 sys/sys/kcov.h         |   5 +----
 tests/modules/t_kcov.c |  14 +++++++-------
 3 files changed, 13 insertions(+), 16 deletions(-)

diffs (102 lines):

diff -r 6a61d09de389 -r 0158fb6e2de2 share/man/man4/kcov.4
--- a/share/man/man4/kcov.4     Sun May 26 00:30:35 2019 +0000
+++ b/share/man/man4/kcov.4     Sun May 26 01:44:34 2019 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: kcov.4,v 1.4 2019/03/10 17:51:00 kamil Exp $
+.\"    $NetBSD: kcov.4,v 1.5 2019/05/26 01:44:34 kamil Exp $
 .\"
 .\" Copyright (c) 2018 Anton Lindqvist <anton%openbsd.org@localhost>
 .\"
@@ -14,7 +14,7 @@
 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\"
-.Dd March 10, 2019
+.Dd May 26, 2019
 .Dt KCOV 4
 .Os
 .Sh NAME
@@ -171,12 +171,12 @@
        mode = KCOV_MODE_TRACE_PC;
        if (ioctl(fd, KCOV_IOC_ENABLE, &mode) == -1)
                err(1, "ioctl: KCOV_IOC_ENABLE");
-       KCOV_STORE(cover[0], 0);
+       cover[0] = 0;
        read(-1, NULL, 0); /* syscall paths to be traced */
-       n = KCOV_LOAD(cover[0]);
+       n = cover[0];
        if (ioctl(fd, KCOV_IOC_DISABLE) == -1)
                err(1, "ioctl: KCOV_IOC_DISABLE");
-       for (i = 0; i < cover[0]; i++)
+       for (i = 0; i < n; i++)
                printf("%p\en", (void *)cover[i + 1]);
        if (munmap(cover, size * KCOV_ENTRY_SIZE) == -1)
                err(1, "munmap");
diff -r 6a61d09de389 -r 0158fb6e2de2 sys/sys/kcov.h
--- a/sys/sys/kcov.h    Sun May 26 00:30:35 2019 +0000
+++ b/sys/sys/kcov.h    Sun May 26 01:44:34 2019 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: kcov.h,v 1.5 2019/04/11 11:20:46 kamil Exp $        */
+/*      $NetBSD: kcov.h,v 1.6 2019/05/26 01:44:34 kamil Exp $        */
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -47,7 +47,4 @@
 typedef volatile uint64_t kcov_int_t;
 #define KCOV_ENTRY_SIZE sizeof(kcov_int_t)
 
-#define KCOV_STORE(x,v)        (x) = (v)
-#define KCOV_LOAD(x)   (x)
-
 #endif /* !_SYS_KCOV_H_ */
diff -r 6a61d09de389 -r 0158fb6e2de2 tests/modules/t_kcov.c
--- a/tests/modules/t_kcov.c    Sun May 26 00:30:35 2019 +0000
+++ b/tests/modules/t_kcov.c    Sun May 26 01:44:34 2019 +0000
@@ -339,10 +339,10 @@
        ATF_REQUIRE_MSG(ioctl(fd, KCOV_IOC_ENABLE, &mode) == 0,
            "Unable to enable kcov ");
 
-       KCOV_STORE(buf[0], 0);
+       buf[0] = 0;
 
        sleep(0); /* XXX: Is it enough for all trace types? */
-       ATF_REQUIRE_MSG(KCOV_LOAD(buf[0]) != 0, "No records found");
+       ATF_REQUIRE_MSG(buf[0] != 0, "No records found");
 
        ATF_REQUIRE_MSG(ioctl(fd, KCOV_IOC_DISABLE) == 0,
            "Unable to disable kcov");
@@ -409,7 +409,7 @@
        kcov_int_t *buf = ptr;
 
        /* Test mapped buffer access from a custom thread */
-       KCOV_STORE(buf[0], KCOV_LOAD(buf[0]));
+       buf[0] = buf[0];
 
        return NULL;
 }
@@ -470,10 +470,10 @@
        /* The thread does something, does not matter what exactly. */
        pthread_create(&thread, NULL, thread_test_helper, __UNVOLATILE(buf));
 
-       KCOV_STORE(buf[0], 0);
+       buf[0] = 0;
        for (i = 0; i < 10000; i++)
                continue;
-       ATF_REQUIRE_EQ_MSG(KCOV_LOAD(buf[0]), 0,
+       ATF_REQUIRE_EQ_MSG(buf[0], 0,
            "Records changed in blocked thread");
 
        pthread_join(thread, NULL);
@@ -496,10 +496,10 @@
        ATF_REQUIRE_MSG(ioctl(fd, KCOV_IOC_ENABLE, &mode) == 0,
            "Unable to enable kcov ");
 
-       KCOV_STORE(buf[0], 0);
+       buf[0] = 0;
 
        sleep(0);
-       ATF_REQUIRE_MSG(KCOV_LOAD(buf[0]) != 0, "No records found");
+       ATF_REQUIRE_MSG(buf[0] != 0, "No records found");
 
        ATF_REQUIRE_MSG(ioctl(fd, KCOV_IOC_DISABLE) == 0,
            "Unable to disable kcov");



Home | Main Index | Thread Index | Old Index