ipc/ipdl/test/cxx/PTestLatency.ipdl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/ipc/ipdl/test/cxx/PTestLatency.ipdl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,75 @@
     1.4 +
     1.5 +namespace mozilla {
     1.6 +namespace _ipdltest {
     1.7 +
     1.8 +
     1.9 +intr protocol PTestLatency {
    1.10 +
    1.11 +child:
    1.12 +    __delete__();
    1.13 +    Ping();
    1.14 +    Ping5();
    1.15 +    intr Rpc();
    1.16 +    Spam();
    1.17 +    intr Synchro();
    1.18 +    CompressedSpam(uint32_t seqno) compress;
    1.19 +    intr Synchro2() returns (uint32_t lastSeqno,
    1.20 +                            uint32_t numMessagesDispatched);
    1.21 +
    1.22 +parent:
    1.23 +    Pong();
    1.24 +    Pong5();
    1.25 +
    1.26 +state START:
    1.27 +    // if the timing resolution is too low, abort the test
    1.28 +    send __delete__;
    1.29 +    // otherwise, kick off the ping/pong trials
    1.30 +    send Ping goto PONG;
    1.31 +
    1.32 +    // Trial 1: single ping/pong latency
    1.33 +state PING:
    1.34 +    send Ping goto PONG;
    1.35 +    send Ping5 goto PING4;
    1.36 +
    1.37 +state PONG:
    1.38 +    recv Pong goto PING;
    1.39 +
    1.40 +    // Trial 2: "overlapped" ping/pong latency
    1.41 +state PING5:
    1.42 +    send Ping5 goto PING4;
    1.43 +    call Rpc goto RPC;
    1.44 +
    1.45 +state PING4: send Ping5 goto PING3;
    1.46 +state PING3: send Ping5 goto PING2;
    1.47 +state PING2: send Ping5 goto PING1;
    1.48 +state PING1: send Ping5 goto PONG1;
    1.49 +
    1.50 +state PONG1: recv Pong5 goto PONG2;
    1.51 +state PONG2: recv Pong5 goto PONG3;
    1.52 +state PONG3: recv Pong5 goto PONG4;
    1.53 +state PONG4: recv Pong5 goto PONG5;
    1.54 +state PONG5: recv Pong5 goto PING5;
    1.55 +
    1.56 +    // Trial 3: lotsa RPC
    1.57 +state RPC:
    1.58 +    call Rpc goto RPC;
    1.59 +    send Spam goto SPAM;
    1.60 +
    1.61 +    // Trial 4: lots of sequential asyn messages, which tests pipelining
    1.62 +state SPAM:
    1.63 +    send Spam goto SPAM;
    1.64 +    call Synchro goto COMPRESSED_SPAM;
    1.65 +
    1.66 +    // Trial 5: lots of async spam, but compressed to cut down on
    1.67 +    // dispatch overhead
    1.68 +state COMPRESSED_SPAM:          // compressed spam, mmm
    1.69 +    send CompressedSpam goto COMPRESSED_SPAM;
    1.70 +    call Synchro2 goto DONE;
    1.71 +
    1.72 +state DONE:
    1.73 +    send __delete__;
    1.74 +};
    1.75 +
    1.76 +
    1.77 +} // namespace mozilla
    1.78 +} // namespace _ipdltest

mercurial