Changeset fd312d5 in mainline for uspace/app


Ignore:
Timestamp:
2017-12-20T16:06:56Z (8 years ago)
Author:
Petr Mánek <petr.manek@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cec130b
Parents:
f98f4b7
Message:

usbdiag: more robust testing framework, added bulk in stress test, refactored remote usbdiag interface, new command for tmon

Location:
uspace/app/tmon
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/tmon/commands.h

    rf98f4b7 rfd312d5  
    3838
    3939int tmon_list(int, char **);
    40 int tmon_test_bulk(int, char **);
     40int tmon_stress_bulk_in(int, char **);
     41int tmon_stress_bulk_out(int, char **);
    4142
    4243#endif /* TMON_COMMANDS_H_ */
  • uspace/app/tmon/main.c

    rf98f4b7 rfd312d5  
    4040#define NAME "tmon"
    4141
    42 static int fallback(int argc, char *argv[])
    43 {
    44         // FIXME
    45         printf(NAME ": Not implemented, lol!\n");
    46         return 1;
    47 }
    48 
    4942typedef struct {
    5043        const char *name;
     
    6053        },
    6154        {
    62                 .name = "test-bulk",
    63                 .description = "Benchmark bulk endpoints of a diagnostic device.",
    64                 .action = tmon_test_bulk,
     55                .name = "stress-bulk-in",
     56                .description = "Stress benchmark bulk in endpoints of a diagnostic device.",
     57                .action = tmon_stress_bulk_in,
    6558        },
    6659        {
    67                 .name = "test-intr",
    68                 .description = "Benchmark interrupt endpoints of a diagnostic device.",
    69                 .action = fallback,
    70         },
    71         {
    72                 .name = "test-isoch",
    73                 .description = "Benchmark isochronous endpoints of a diagnostic device.",
    74                 .action = fallback,
     60                .name = "stress-bulk-out",
     61                .description = "Benchmark bulk out endpoints of a diagnostic device.",
     62                .action = tmon_stress_bulk_out,
    7563        },
    7664        {
  • uspace/app/tmon/test.c

    rf98f4b7 rfd312d5  
    114114}
    115115
    116 static int bulk_worker(devman_handle_t fun) {
     116static int stress_bulk_in(devman_handle_t fun) {
    117117        async_sess_t *sess = usbdiag_connect(fun);
    118118        async_exch_t *exch = async_exchange_begin(sess);
    119119
    120         // TODO: do some testing
    121         int y;
    122         int rc = usbdiag_test(exch, 4200, &y);
     120        const int cycles = 1024;
     121        const size_t size = 65432;
     122        int rc = usbdiag_stress_bulk_in(exch, cycles, size);
    123123
    124124        if (rc) {
    125125                printf(NAME ": %s\n", str_error(rc));
    126         } else {
    127                 printf("The number is %d.\n", y);
    128126        }
    129127
     
    133131}
    134132
    135 int tmon_test_bulk(int argc, char *argv[])
     133static int stress_bulk_out(devman_handle_t fun) {
     134        async_sess_t *sess = usbdiag_connect(fun);
     135        async_exch_t *exch = async_exchange_begin(sess);
     136
     137        const int cycles = 1024;
     138        const size_t size = 65432;
     139        int rc = usbdiag_stress_bulk_out(exch, cycles, size);
     140
     141        if (rc) {
     142                printf(NAME ": %s\n", str_error(rc));
     143        }
     144
     145        async_exchange_end(exch);
     146        usbdiag_disconnect(sess);
     147        return 0;
     148}
     149
     150int tmon_stress_bulk_in(int argc, char *argv[])
    136151{
    137         return resolve_and_test(argc, argv, bulk_worker);
     152        return resolve_and_test(argc, argv, stress_bulk_in);
     153}
     154
     155int tmon_stress_bulk_out(int argc, char *argv[])
     156{
     157        return resolve_and_test(argc, argv, stress_bulk_out);
    138158}
    139159
Note: See TracChangeset for help on using the changeset viewer.