| 88 | } |
| 89 | |
| 90 | static void |
| 91 | xstats_print(void) |
| 92 | { |
| 93 | const uint32_t XSTATS_MAX = 1024; |
| 94 | uint32_t i; |
| 95 | uint64_t ids[XSTATS_MAX]; |
| 96 | uint64_t values[XSTATS_MAX]; |
| 97 | struct rte_event_dev_xstats_name xstats_names[XSTATS_MAX]; |
| 98 | |
| 99 | for (i = 0; i < XSTATS_MAX; i++) |
| 100 | ids[i] = i; |
| 101 | |
| 102 | /* Device names / values */ |
| 103 | int ret = rte_event_dev_xstats_names_get(evdev, |
| 104 | RTE_EVENT_DEV_XSTATS_DEVICE, 0, |
| 105 | xstats_names, ids, XSTATS_MAX); |
| 106 | if (ret < 0) { |
| 107 | printf("%d: xstats names get() returned error\n", |
| 108 | __LINE__); |
| 109 | return; |
| 110 | } |
| 111 | ret = rte_event_dev_xstats_get(evdev, |
| 112 | RTE_EVENT_DEV_XSTATS_DEVICE, |
| 113 | 0, ids, values, ret); |
| 114 | if (ret > (signed int)XSTATS_MAX) |
| 115 | printf("%s %d: more xstats available than space\n", |
| 116 | __func__, __LINE__); |
| 117 | for (i = 0; (signed int)i < ret; i++) { |
| 118 | printf("%d : %s : %"PRIu64"\n", |
| 119 | i, xstats_names[i].name, values[i]); |
| 120 | } |
| 121 | |
| 122 | /* Port names / values */ |
| 123 | ret = rte_event_dev_xstats_names_get(evdev, |
| 124 | RTE_EVENT_DEV_XSTATS_PORT, 0, |
| 125 | xstats_names, ids, XSTATS_MAX); |
| 126 | ret = rte_event_dev_xstats_get(evdev, |
| 127 | RTE_EVENT_DEV_XSTATS_PORT, 1, |
| 128 | ids, values, ret); |
| 129 | if (ret > (signed int)XSTATS_MAX) |
| 130 | printf("%s %d: more xstats available than space\n", |
| 131 | __func__, __LINE__); |
| 132 | for (i = 0; (signed int)i < ret; i++) { |
| 133 | printf("%d : %s : %"PRIu64"\n", |
| 134 | i, xstats_names[i].name, values[i]); |
| 135 | } |
| 136 | |
| 137 | /* Queue names / values */ |
| 138 | ret = rte_event_dev_xstats_names_get(evdev, |
| 139 | RTE_EVENT_DEV_XSTATS_QUEUE, 0, |
| 140 | xstats_names, ids, XSTATS_MAX); |
| 141 | ret = rte_event_dev_xstats_get(evdev, |
| 142 | RTE_EVENT_DEV_XSTATS_QUEUE, |
| 143 | 1, ids, values, ret); |
| 144 | if (ret > (signed int)XSTATS_MAX) |
| 145 | printf("%s %d: more xstats available than space\n", |
| 146 | __func__, __LINE__); |
| 147 | for (i = 0; (signed int)i < ret; i++) { |
no test coverage detected