Changeset d230358 in mainline


Ignore:
Timestamp:
2018-11-16T15:58:30Z (6 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
af2d3e3
Parents:
b0beb9b1
Message:

Move ping_pong into a separate performance measuring tool 'perf'.

Files:
4 added
4 edited
2 moved

Legend:

Unmodified
Added
Removed
  • .gitignore

    rb0beb9b1 rd230358  
    129129uspace/app/nic/nic
    130130uspace/app/nterm/nterm
     131uspace/app/perf/perf
    131132uspace/app/ping/ping
    132133uspace/app/ping6/ping6
  • boot/Makefile.common

    rb0beb9b1 rd230358  
    190190        mkmfs \
    191191        nic \
     192        perf \
    192193        rcutest \
    193194        rcubench \
  • uspace/app/perf/ipc/ping_pong.c

    rb0beb9b1 rd230358  
    3434#include <async.h>
    3535#include <errno.h>
    36 #include "../tester.h"
     36#include "../perf.h"
    3737
    3838#define MIN_DURATION_SECS  10
     
    5050
    5151                if (retval != EOK) {
    52                         TPRINTF("Error sending ping message.\n");
     52                        printf("Error sending ping message.\n");
    5353                        return EIO;
    5454                }
     
    6464static void ping_pong_report(uint64_t niter, uint64_t duration)
    6565{
    66         TPRINTF("Completed %" PRIu64 " round trips in %" PRIu64 " us",
     66        printf("Completed %" PRIu64 " round trips in %" PRIu64 " us",
    6767            niter, duration);
    6868
    6969        if (duration > 0) {
    70                 TPRINTF(", %" PRIu64 " rt/s.\n", niter * 1000 * 1000 / duration);
     70                printf(", %" PRIu64 " rt/s.\n", niter * 1000 * 1000 / duration);
    7171        } else {
    72                 TPRINTF(".\n");
     72                printf(".\n");
    7373        }
    7474}
    7575
    76 const char *test_ping_pong(void)
     76const char *bench_ping_pong(void)
    7777{
    7878        errno_t rc;
     
    8080        uint64_t dsmp[NUM_SAMPLES];
    8181
    82         TPRINTF("Benchmark ns server ping time\n");
    83         TPRINTF("Warm up and determine work size...\n");
     82        printf("Benchmark ns server ping time\n");
     83        printf("Warm up and determine work size...\n");
    8484
    8585        struct timespec start;
     
    101101        }
    102102
    103         TPRINTF("Measure %d samples...\n", NUM_SAMPLES);
     103        printf("Measure %d samples...\n", NUM_SAMPLES);
    104104
    105105        int i;
     
    129129        double stddev = qd / (NUM_SAMPLES - 1); // XXX sqrt
    130130
    131         TPRINTF("Average: %.0f rt/s Std.dev^2: %.0f rt/s Samples: %d\n",
     131        printf("Average: %.0f rt/s Std.dev^2: %.0f rt/s Samples: %d\n",
    132132            avg, stddev, NUM_SAMPLES);
    133133
  • uspace/app/perf/ipc/ping_pong.def

    rb0beb9b1 rd230358  
    22        "ping_pong",
    33        "IPC ping-pong benchmark",
    4         &test_ping_pong,
    5         true
     4        &bench_ping_pong
    65},
  • uspace/app/tester/Makefile

    rb0beb9b1 rd230358  
    5656        float/float2.c \
    5757        vfs/vfs1.c \
    58         ipc/ping_pong.c \
    5958        ipc/starve.c \
    6059        loop/loop1.c \
  • uspace/app/tester/tester.c

    rb0beb9b1 rd230358  
    6666#include "float/float2.def"
    6767#include "vfs/vfs1.def"
    68 #include "ipc/ping_pong.def"
    6968#include "ipc/starve.def"
    7069#include "loop/loop1.def"
Note: See TracChangeset for help on using the changeset viewer.