Changeset ff16da5f in mainline for uspace/app/tmon/stress_test.c


Ignore:
Timestamp:
2017-12-21T14:37:30Z (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:
119a794
Parents:
74c0de0
git-author:
Petr Mánek <petr.manek@…> (2017-12-21 14:37:23)
git-committer:
Petr Mánek <petr.manek@…> (2017-12-21 14:37:30)
Message:

usbdiag: added isochronous test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/tmon/stress_test.c

    r74c0de0 rff16da5f  
    130130}
    131131
     132static int run_isoch_in(async_exch_t *exch, const tmon_test_params_t *generic_params)
     133{
     134        const tmon_stress_test_params_t *params = (tmon_stress_test_params_t *) generic_params;
     135        printf("Executing isochronous in stress test.\n"
     136            "      Packet count: %d\n"
     137            "      Packet size: %ld\n", params->cycles, params->size);
     138
     139        int rc = usbdiag_stress_isoch_in(exch, params->cycles, params->size);
     140        if (rc) {
     141                printf(NAME ": Test failed. %s\n", str_error(rc));
     142                return 1;
     143        }
     144
     145        return 0;
     146}
     147
     148static int run_isoch_out(async_exch_t *exch, const tmon_test_params_t *generic_params)
     149{
     150        const tmon_stress_test_params_t *params = (tmon_stress_test_params_t *) generic_params;
     151        printf("Executing isochronous out stress test.\n"
     152            "      Packet count: %d\n"
     153            "      Packet size: %ld\n", params->cycles, params->size);
     154
     155        int rc = usbdiag_stress_isoch_out(exch, params->cycles, params->size);
     156        if (rc) {
     157                printf(NAME ": Test failed. %s\n", str_error(rc));
     158                return 1;
     159        }
     160
     161        return 0;
     162}
     163
    132164int tmon_stress_intr_in(int argc, char *argv[])
    133165{
     
    170202}
    171203
     204int tmon_stress_isoch_in(int argc, char *argv[])
     205{
     206        static const tmon_test_ops_t ops = {
     207                .run = run_isoch_in,
     208                .read_params = read_params
     209        };
     210
     211        return tmon_test_main(argc, argv, &ops);
     212}
     213
     214int tmon_stress_isoch_out(int argc, char *argv[])
     215{
     216        static const tmon_test_ops_t ops = {
     217                .run = run_isoch_out,
     218                .read_params = read_params
     219        };
     220
     221        return tmon_test_main(argc, argv, &ops);
     222}
     223
    172224/** @}
    173225 */
Note: See TracChangeset for help on using the changeset viewer.