MCPcopy Create free account
hub / github.com/F-Stack/f-stack / xstats_print

Function xstats_print

dpdk/drivers/event/sw/sw_evdev_selftest.c:90–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90static void
91xstats_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++) {

Callers 1

worker_loopbackFunction · 0.85

Calls 3

rte_event_dev_xstats_getFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected