Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 1edd6d0 in mainline


Ignore:
Timestamp:
2018-11-17T00:53:52Z (20 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
e131833c
Parents:
af2d3e3
Message:

Add separate IPC test service. Keep ns_ping for now for the sake of comparison.

Files:
7 added
10 edited

Legend:

Unmodified
Added
Removed
  • .gitignore

    raf2d3e3 r1edd6d0  
    450450uspace/srv/taskmon/taskmon
    451451uspace/srv/test/chardev-test/chardev-test
     452uspace/srv/test/ipc-test/ipc-test
    452453uspace/srv/vfs/vfs
    453454uspace/srv/vfs/vfs.gz
  • abi/include/abi/ipc/interfaces.h

    raf2d3e3 r1edd6d0  
    181181            FOURCC_COMPACT('v', 'o', 'l', ' ') | IFACE_EXCHANGE_SERIALIZE,
    182182        INTERFACE_VBD =
    183             FOURCC_COMPACT('v', 'b', 'd', ' ') | IFACE_EXCHANGE_SERIALIZE
     183            FOURCC_COMPACT('v', 'b', 'd', ' ') | IFACE_EXCHANGE_SERIALIZE,
     184        INTERFACE_IPC_TEST =
     185            FOURCC_COMPACT('i', 'p', 'c', 't') | IFACE_EXCHANGE_SERIALIZE
    184186} iface_t;
    185187
  • boot/Makefile.common

    raf2d3e3 r1edd6d0  
    123123        taskmon \
    124124        test/chardev-test \
     125        test/ipc-test \
    125126        volsrv
    126127
  • uspace/Makefile

    raf2d3e3 r1edd6d0  
    142142        srv/hid/rfb \
    143143        srv/test/chardev-test \
     144        srv/test/ipc-test \
    144145        drv/audio/hdaudio \
    145146        drv/audio/sb16 \
  • uspace/app/perf/Makefile

    raf2d3e3 r1edd6d0  
    3535SOURCES = \
    3636        perf.c \
     37        ipc/ns_ping.c \
    3738        ipc/ping_pong.c
    3839
  • uspace/app/perf/ipc/ping_pong.c

    raf2d3e3 r1edd6d0  
    3131#include <stdlib.h>
    3232#include <time.h>
    33 #include <ns.h>
     33#include <ipc_test.h>
    3434#include <async.h>
    3535#include <errno.h>
     
    3939#define NUM_SAMPLES 10
    4040
    41 static errno_t ping_pong_measure(uint64_t niter, uint64_t *rduration)
     41static errno_t ping_pong_measure(ipc_test_t *test, uint64_t niter,
     42    uint64_t *rduration)
    4243{
    4344        struct timespec start;
     
    4748
    4849        for (count = 0; count < niter; count++) {
    49                 errno_t retval = ns_ping();
     50                errno_t retval = ipc_test_ping(test);
    5051
    5152                if (retval != EOK) {
     
    7980        uint64_t duration;
    8081        uint64_t dsmp[NUM_SAMPLES];
     82        ipc_test_t *test;
     83        const char *msg;
    8184
    82         printf("Benchmark ns server ping time\n");
     85        printf("Benchmark IPC test server ping time\n");
     86        rc = ipc_test_create(&test);
     87        if (rc != EOK)
     88                return "Failed contacting IPC test server.";
     89
    8390        printf("Warm up and determine work size...\n");
    8491
     
    8996
    9097        while (true) {
    91                 rc = ping_pong_measure(niter, &duration);
    92                 if (rc != EOK)
    93                         return "Failed.";
     98                rc = ping_pong_measure(test, niter, &duration);
     99                if (rc != EOK) {
     100                        msg = "Failed.";
     101                        goto error;
     102                }
    94103
    95104                ping_pong_report(niter, duration);
     
    106115
    107116        for (i = 0; i < NUM_SAMPLES; i++) {
    108                 rc = ping_pong_measure(niter, &dsmp[i]);
    109                 if (rc != EOK)
    110                         return "Failed.";
     117                rc = ping_pong_measure(test, niter, &dsmp[i]);
     118                if (rc != EOK) {
     119                        msg = "Failed.";
     120                        goto error;
     121                }
    111122
    112123                ping_pong_report(niter, dsmp[i]);
     
    132143            avg, stddev, NUM_SAMPLES);
    133144
     145        ipc_test_destroy(test);
    134146        return NULL;
     147error:
     148        ipc_test_destroy(test);
     149        return msg;
    135150}
  • uspace/app/perf/perf.c

    raf2d3e3 r1edd6d0  
    4242benchmark_t benchmarks[] = {
    4343#include "ipc/ping_pong.def"
     44#include "ipc/ns_ping.def"
    4445        { NULL, NULL, NULL }
    4546};
  • uspace/app/perf/perf.h

    raf2d3e3 r1edd6d0  
    4646} benchmark_t;
    4747
     48extern const char *bench_ns_ping(void);
    4849extern const char *bench_ping_pong(void);
    4950
  • uspace/lib/c/Makefile

    raf2d3e3 r1edd6d0  
    7070        generic/gsort.c \
    7171        generic/inttypes.c \
     72        generic/ipc_test.c \
    7273        generic/loc.c \
    7374        generic/mem.c \
  • uspace/lib/c/include/ipc/services.h

    raf2d3e3 r1edd6d0  
    5757#define SERVICE_NAME_DNSR     "net/dnsr"
    5858#define SERVICE_NAME_INET     "net/inet"
     59#define SERVICE_NAME_IPC_TEST "ipc-test"
    5960#define SERVICE_NAME_NETCONF  "net/netconf"
    6061#define SERVICE_NAME_UDP      "net/udp"
Note: See TracChangeset for help on using the changeset viewer.