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

Changeset 2986763 in mainline


Ignore:
Timestamp:
2017-12-22T11:59:20Z (4 years ago)
Author:
Petr Mánek <petr.manek@…>
Branches:
lfn, master
Children:
b7b7898
Parents:
ab8e0f5
git-author:
Petr Mánek <petr.manek@…> (2017-12-22 11:57:34)
git-committer:
Petr Mánek <petr.manek@…> (2017-12-22 11:59:20)
Message:

tmon: refactoring

Stress tests have been renamed to burst tests because they do not fit the semantic definition of a stress tests. Instead, the read/write as much data as possible into given USB pipes, hence the name burst. They can be accessed using the tmon test-(intr|bulk|isoch)-(in|out) wildcard again. Files test.(c|h), which contain testing framework definitions now, have been renamed to more apt tf.(c.h).

Location:
uspace/app/tmon
Files:
3 edited
3 moved

Legend:

Unmodified
Added
Removed
  • uspace/app/tmon/Makefile

    rab8e0f5 r2986763  
    3535        main.c\
    3636        list.c\
    37         test.c\
    38         stress_test.c\
     37        tf.c\
     38        burst_tests.c\
    3939        resolve.c
    4040
  • uspace/app/tmon/burst_tests.c

    rab8e0f5 r2986763  
    3232/**
    3333 * @file
    34  * USB stress tests.
     34 * USB burst tests.
    3535 */
    3636
     
    4141#include <usbdiag_iface.h>
    4242#include "commands.h"
    43 #include "test.h"
     43#include "tf.h"
    4444
    4545#define NAME "tmon"
    4646
    47 typedef struct tmon_stress_test_params {
     47typedef struct tmon_burst_test_params {
    4848        tmon_test_params_t base; /* inheritance */
    4949        uint32_t cycles;
    5050        size_t size;
    51 } tmon_stress_test_params_t;
     51} tmon_burst_test_params_t;
    5252
    5353static struct option long_options[] = {
     
    6262{
    6363        int rc;
    64         tmon_stress_test_params_t *p = (tmon_stress_test_params_t *) malloc(sizeof(tmon_stress_test_params_t));
     64        tmon_burst_test_params_t *p = (tmon_burst_test_params_t *) malloc(sizeof(tmon_burst_test_params_t));
    6565        if (!p)
    6666                return ENOMEM;
     
    105105static int run_intr_in(async_exch_t *exch, const tmon_test_params_t *generic_params)
    106106{
    107         const tmon_stress_test_params_t *params = (tmon_stress_test_params_t *) generic_params;
    108         printf("Executing interrupt in stress test.\n"
    109             "      Number of cycles: %d\n"
    110             "      Data size: %ld B\n", params->cycles, params->size);
    111 
    112         int rc = usbdiag_stress_intr_in(exch, params->cycles, params->size);
     107        const tmon_burst_test_params_t *params = (tmon_burst_test_params_t *) generic_params;
     108        printf("Executing interrupt in test.\n"
     109            "      Number of cycles: %d\n"
     110            "      Data size: %ld B\n", params->cycles, params->size);
     111
     112        int rc = usbdiag_burst_intr_in(exch, params->cycles, params->size);
    113113        if (rc) {
    114114                printf(NAME ": Test failed. %s\n", str_error(rc));
     
    121121static int run_intr_out(async_exch_t *exch, const tmon_test_params_t *generic_params)
    122122{
    123         const tmon_stress_test_params_t *params = (tmon_stress_test_params_t *) generic_params;
    124         printf("Executing interrupt out stress test.\n"
    125             "      Number of cycles: %d\n"
    126             "      Data size: %ld B\n", params->cycles, params->size);
    127 
    128         int rc = usbdiag_stress_intr_out(exch, params->cycles, params->size);
     123        const tmon_burst_test_params_t *params = (tmon_burst_test_params_t *) generic_params;
     124        printf("Executing interrupt out test.\n"
     125            "      Number of cycles: %d\n"
     126            "      Data size: %ld B\n", params->cycles, params->size);
     127
     128        int rc = usbdiag_burst_intr_out(exch, params->cycles, params->size);
    129129        if (rc) {
    130130                printf(NAME ": Test failed. %s\n", str_error(rc));
     
    137137static int run_bulk_in(async_exch_t *exch, const tmon_test_params_t *generic_params)
    138138{
    139         const tmon_stress_test_params_t *params = (tmon_stress_test_params_t *) generic_params;
    140         printf("Executing bulk in stress test.\n"
    141             "      Number of cycles: %d\n"
    142             "      Data size: %ld B\n", params->cycles, params->size);
    143 
    144         int rc = usbdiag_stress_bulk_in(exch, params->cycles, params->size);
     139        const tmon_burst_test_params_t *params = (tmon_burst_test_params_t *) generic_params;
     140        printf("Executing bulk in test.\n"
     141            "      Number of cycles: %d\n"
     142            "      Data size: %ld B\n", params->cycles, params->size);
     143
     144        int rc = usbdiag_burst_bulk_in(exch, params->cycles, params->size);
    145145        if (rc) {
    146146                printf(NAME ": Test failed. %s\n", str_error(rc));
     
    153153static int run_bulk_out(async_exch_t *exch, const tmon_test_params_t *generic_params)
    154154{
    155         const tmon_stress_test_params_t *params = (tmon_stress_test_params_t *) generic_params;
    156         printf("Executing bulk out stress test.\n"
    157             "      Number of cycles: %d\n"
    158             "      Data size: %ld B\n", params->cycles, params->size);
    159 
    160         int rc = usbdiag_stress_bulk_out(exch, params->cycles, params->size);
     155        const tmon_burst_test_params_t *params = (tmon_burst_test_params_t *) generic_params;
     156        printf("Executing bulk out test.\n"
     157            "      Number of cycles: %d\n"
     158            "      Data size: %ld B\n", params->cycles, params->size);
     159
     160        int rc = usbdiag_burst_bulk_out(exch, params->cycles, params->size);
    161161        if (rc) {
    162162                printf(NAME ": Test failed. %s\n", str_error(rc));
     
    169169static int run_isoch_in(async_exch_t *exch, const tmon_test_params_t *generic_params)
    170170{
    171         const tmon_stress_test_params_t *params = (tmon_stress_test_params_t *) generic_params;
    172         printf("Executing isochronous in stress test.\n"
    173             "      Number of cycles: %d\n"
    174             "      Data size: %ld B\n", params->cycles, params->size);
    175 
    176         int rc = usbdiag_stress_isoch_in(exch, params->cycles, params->size);
     171        const tmon_burst_test_params_t *params = (tmon_burst_test_params_t *) generic_params;
     172        printf("Executing isochronous in test.\n"
     173            "      Number of cycles: %d\n"
     174            "      Data size: %ld B\n", params->cycles, params->size);
     175
     176        int rc = usbdiag_burst_isoch_in(exch, params->cycles, params->size);
    177177        if (rc) {
    178178                printf(NAME ": Test failed. %s\n", str_error(rc));
     
    185185static int run_isoch_out(async_exch_t *exch, const tmon_test_params_t *generic_params)
    186186{
    187         const tmon_stress_test_params_t *params = (tmon_stress_test_params_t *) generic_params;
    188         printf("Executing isochronous out stress test.\n"
    189             "      Number of cycles: %d\n"
    190             "      Data size: %ld B\n", params->cycles, params->size);
    191 
    192         int rc = usbdiag_stress_isoch_out(exch, params->cycles, params->size);
    193         if (rc) {
    194                 printf(NAME ": Test failed. %s\n", str_error(rc));
    195                 return 1;
    196         }
    197 
    198         return 0;
    199 }
    200 
    201 int tmon_stress_intr_in(int argc, char *argv[])
     187        const tmon_burst_test_params_t *params = (tmon_burst_test_params_t *) generic_params;
     188        printf("Executing isochronous out test.\n"
     189            "      Number of cycles: %d\n"
     190            "      Data size: %ld B\n", params->cycles, params->size);
     191
     192        int rc = usbdiag_burst_isoch_out(exch, params->cycles, params->size);
     193        if (rc) {
     194                printf(NAME ": Test failed. %s\n", str_error(rc));
     195                return 1;
     196        }
     197
     198        return 0;
     199}
     200
     201int tmon_burst_intr_in(int argc, char *argv[])
    202202{
    203203        static const tmon_test_ops_t ops = {
     
    209209}
    210210
    211 int tmon_stress_intr_out(int argc, char *argv[])
     211int tmon_burst_intr_out(int argc, char *argv[])
    212212{
    213213        static const tmon_test_ops_t ops = {
     
    219219}
    220220
    221 int tmon_stress_bulk_in(int argc, char *argv[])
     221int tmon_burst_bulk_in(int argc, char *argv[])
    222222{
    223223        static const tmon_test_ops_t ops = {
     
    229229}
    230230
    231 int tmon_stress_bulk_out(int argc, char *argv[])
     231int tmon_burst_bulk_out(int argc, char *argv[])
    232232{
    233233        static const tmon_test_ops_t ops = {
     
    239239}
    240240
    241 int tmon_stress_isoch_in(int argc, char *argv[])
     241int tmon_burst_isoch_in(int argc, char *argv[])
    242242{
    243243        static const tmon_test_ops_t ops = {
     
    249249}
    250250
    251 int tmon_stress_isoch_out(int argc, char *argv[])
     251int tmon_burst_isoch_out(int argc, char *argv[])
    252252{
    253253        static const tmon_test_ops_t ops = {
  • uspace/app/tmon/commands.h

    rab8e0f5 r2986763  
    3838
    3939int tmon_list(int, char **);
    40 int tmon_stress_intr_in(int, char **);
    41 int tmon_stress_intr_out(int, char **);
    42 int tmon_stress_bulk_in(int, char **);
    43 int tmon_stress_bulk_out(int, char **);
    44 int tmon_stress_isoch_in(int, char **);
    45 int tmon_stress_isoch_out(int, char **);
     40
     41/* Burst tests read/write into endpoints as fast as possible. */
     42int tmon_burst_intr_in(int, char **);
     43int tmon_burst_intr_out(int, char **);
     44int tmon_burst_bulk_in(int, char **);
     45int tmon_burst_bulk_out(int, char **);
     46int tmon_burst_isoch_in(int, char **);
     47int tmon_burst_isoch_out(int, char **);
    4648
    4749#endif /* TMON_COMMANDS_H_ */
  • uspace/app/tmon/main.c

    rab8e0f5 r2986763  
    5353        },
    5454        {
    55                 .name = "stress-intr-in",
    56                 .description = "Stress benchmark interrupt in endpoints of a device.",
    57                 .action = tmon_stress_intr_in,
     55                .name = "test-intr-in",
     56                .description = "Read from interrupt in endpoints as fast as possible.",
     57                .action = tmon_burst_intr_in,
    5858        },
    5959        {
    60                 .name = "stress-intr-out",
    61                 .description = "Stress benchmark interrupt out endpoints of a device.",
    62                 .action = tmon_stress_intr_out,
     60                .name = "test-intr-out",
     61                .description = "Write to interrupt out endpoints as fast as possible.",
     62                .action = tmon_burst_intr_out,
    6363        },
    6464        {
    65                 .name = "stress-bulk-in",
    66                 .description = "Stress benchmark bulk in endpoints of a device.",
    67                 .action = tmon_stress_bulk_in,
     65                .name = "test-bulk-in",
     66                .description = "Read from bulk in endpoints as fast as possible.",
     67                .action = tmon_burst_bulk_in,
    6868        },
    6969        {
    70                 .name = "stress-bulk-out",
    71                 .description = "Stress benchmark bulk out endpoints of a device.",
    72                 .action = tmon_stress_bulk_out,
     70                .name = "test-bulk-out",
     71                .description = "Write to bulk out endpoints as fast as possible.",
     72                .action = tmon_burst_bulk_out,
    7373        },
    7474        {
    75                 .name = "stress-isoch-in",
    76                 .description = "Stress benchmark isochronous in endpoints of a device.",
    77                 .action = tmon_stress_isoch_in,
     75                .name = "test-isoch-in",
     76                .description = "Read from isochronous in endpoints as fast as possible.",
     77                .action = tmon_burst_isoch_in,
    7878        },
    7979        {
    80                 .name = "stress-isoch-out",
    81                 .description = "Stress benchmark isochronous out endpoints of a device.",
    82                 .action = tmon_stress_isoch_out,
     80                .name = "test-isoch-out",
     81                .description = "Write to isochronouse out endpoints as fast as possible.",
     82                .action = tmon_burst_isoch_out,
    8383        },
    8484        {
  • uspace/app/tmon/tf.c

    rab8e0f5 r2986763  
    4040#include <usbdiag_iface.h>
    4141#include "resolve.h"
    42 #include "test.h"
     42#include "tf.h"
    4343
    4444#define NAME "tmon"
  • uspace/app/tmon/tf.h

    rab8e0f5 r2986763  
    3434 */
    3535
    36 #ifndef TMON_TEST_H_
    37 #define TMON_TEST_H_
     36#ifndef TMON_TF_H_
     37#define TMON_TF_H_
    3838
    3939#include <async.h>
     
    5151int tmon_test_main(int, char **, const tmon_test_ops_t *);
    5252
    53 #endif /* TMON_TEST_H_ */
     53#endif /* TMON_TF_H_ */
    5454
    5555/** @}
Note: See TracChangeset for help on using the changeset viewer.