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

Changeset d230358 in mainline for uspace/app/perf/ipc/ping_pong.c


Ignore:
Timestamp:
2018-11-16T15:58:30Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
Children:
af2d3e3
Parents:
b0beb9b1
Message:

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

File:
1 moved

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.