Changeset 2986763 in mainline
- Timestamp:
- 2017-12-22T11:59:20Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- 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)
- Location:
- uspace/app/tmon
- Files:
-
- 3 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tmon/Makefile
rab8e0f5 r2986763 35 35 main.c\ 36 36 list.c\ 37 t est.c\38 stress_test.c\37 tf.c\ 38 burst_tests.c\ 39 39 resolve.c 40 40 -
uspace/app/tmon/burst_tests.c
rab8e0f5 r2986763 32 32 /** 33 33 * @file 34 * USB stresstests.34 * USB burst tests. 35 35 */ 36 36 … … 41 41 #include <usbdiag_iface.h> 42 42 #include "commands.h" 43 #include "t est.h"43 #include "tf.h" 44 44 45 45 #define NAME "tmon" 46 46 47 typedef struct tmon_ stress_test_params {47 typedef struct tmon_burst_test_params { 48 48 tmon_test_params_t base; /* inheritance */ 49 49 uint32_t cycles; 50 50 size_t size; 51 } tmon_ stress_test_params_t;51 } tmon_burst_test_params_t; 52 52 53 53 static struct option long_options[] = { … … 62 62 { 63 63 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)); 65 65 if (!p) 66 66 return ENOMEM; … … 105 105 static int run_intr_in(async_exch_t *exch, const tmon_test_params_t *generic_params) 106 106 { 107 const tmon_ stress_test_params_t *params = (tmon_stress_test_params_t *) generic_params;108 printf("Executing interrupt in stresstest.\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); 113 113 if (rc) { 114 114 printf(NAME ": Test failed. %s\n", str_error(rc)); … … 121 121 static int run_intr_out(async_exch_t *exch, const tmon_test_params_t *generic_params) 122 122 { 123 const tmon_ stress_test_params_t *params = (tmon_stress_test_params_t *) generic_params;124 printf("Executing interrupt out stresstest.\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); 129 129 if (rc) { 130 130 printf(NAME ": Test failed. %s\n", str_error(rc)); … … 137 137 static int run_bulk_in(async_exch_t *exch, const tmon_test_params_t *generic_params) 138 138 { 139 const tmon_ stress_test_params_t *params = (tmon_stress_test_params_t *) generic_params;140 printf("Executing bulk in stresstest.\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); 145 145 if (rc) { 146 146 printf(NAME ": Test failed. %s\n", str_error(rc)); … … 153 153 static int run_bulk_out(async_exch_t *exch, const tmon_test_params_t *generic_params) 154 154 { 155 const tmon_ stress_test_params_t *params = (tmon_stress_test_params_t *) generic_params;156 printf("Executing bulk out stresstest.\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); 161 161 if (rc) { 162 162 printf(NAME ": Test failed. %s\n", str_error(rc)); … … 169 169 static int run_isoch_in(async_exch_t *exch, const tmon_test_params_t *generic_params) 170 170 { 171 const tmon_ stress_test_params_t *params = (tmon_stress_test_params_t *) generic_params;172 printf("Executing isochronous in stresstest.\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); 177 177 if (rc) { 178 178 printf(NAME ": Test failed. %s\n", str_error(rc)); … … 185 185 static int run_isoch_out(async_exch_t *exch, const tmon_test_params_t *generic_params) 186 186 { 187 const tmon_ stress_test_params_t *params = (tmon_stress_test_params_t *) generic_params;188 printf("Executing isochronous out stresstest.\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 201 int tmon_burst_intr_in(int argc, char *argv[]) 202 202 { 203 203 static const tmon_test_ops_t ops = { … … 209 209 } 210 210 211 int tmon_ stress_intr_out(int argc, char *argv[])211 int tmon_burst_intr_out(int argc, char *argv[]) 212 212 { 213 213 static const tmon_test_ops_t ops = { … … 219 219 } 220 220 221 int tmon_ stress_bulk_in(int argc, char *argv[])221 int tmon_burst_bulk_in(int argc, char *argv[]) 222 222 { 223 223 static const tmon_test_ops_t ops = { … … 229 229 } 230 230 231 int tmon_ stress_bulk_out(int argc, char *argv[])231 int tmon_burst_bulk_out(int argc, char *argv[]) 232 232 { 233 233 static const tmon_test_ops_t ops = { … … 239 239 } 240 240 241 int tmon_ stress_isoch_in(int argc, char *argv[])241 int tmon_burst_isoch_in(int argc, char *argv[]) 242 242 { 243 243 static const tmon_test_ops_t ops = { … … 249 249 } 250 250 251 int tmon_ stress_isoch_out(int argc, char *argv[])251 int tmon_burst_isoch_out(int argc, char *argv[]) 252 252 { 253 253 static const tmon_test_ops_t ops = { -
uspace/app/tmon/commands.h
rab8e0f5 r2986763 38 38 39 39 int 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. */ 42 int tmon_burst_intr_in(int, char **); 43 int tmon_burst_intr_out(int, char **); 44 int tmon_burst_bulk_in(int, char **); 45 int tmon_burst_bulk_out(int, char **); 46 int tmon_burst_isoch_in(int, char **); 47 int tmon_burst_isoch_out(int, char **); 46 48 47 49 #endif /* TMON_COMMANDS_H_ */ -
uspace/app/tmon/main.c
rab8e0f5 r2986763 53 53 }, 54 54 { 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, 58 58 }, 59 59 { 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, 63 63 }, 64 64 { 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, 68 68 }, 69 69 { 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, 73 73 }, 74 74 { 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, 78 78 }, 79 79 { 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, 83 83 }, 84 84 { -
uspace/app/tmon/tf.c
rab8e0f5 r2986763 40 40 #include <usbdiag_iface.h> 41 41 #include "resolve.h" 42 #include "t est.h"42 #include "tf.h" 43 43 44 44 #define NAME "tmon" -
uspace/app/tmon/tf.h
rab8e0f5 r2986763 34 34 */ 35 35 36 #ifndef TMON_T EST_H_37 #define TMON_T EST_H_36 #ifndef TMON_TF_H_ 37 #define TMON_TF_H_ 38 38 39 39 #include <async.h> … … 51 51 int tmon_test_main(int, char **, const tmon_test_ops_t *); 52 52 53 #endif /* TMON_T EST_H_ */53 #endif /* TMON_TF_H_ */ 54 54 55 55 /** @}
Note:
See TracChangeset
for help on using the changeset viewer.