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

Function command_help

dpdk/lib/telemetry/telemetry.c:138–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138static int
139command_help(const char *cmd __rte_unused, const char *params,
140 struct rte_tel_data *d)
141{
142 int i;
143 /* if no parameters return our own help text */
144 const char *to_lookup = (params == NULL ? cmd : params);
145
146 rte_tel_data_start_dict(d);
147 rte_spinlock_lock(&callback_sl);
148 for (i = 0; i < num_callbacks; i++)
149 if (strcmp(to_lookup, callbacks[i].cmd) == 0) {
150 if (params == NULL)
151 rte_tel_data_string(d, callbacks[i].help);
152 else
153 rte_tel_data_add_dict_string(d, params, callbacks[i].help);
154 break;
155 }
156 rte_spinlock_unlock(&callback_sl);
157 if (i == num_callbacks)
158 return -1;
159 return 0;
160}
161
162static int
163container_to_json(const struct rte_tel_data *d, char *out_buf, size_t buf_len)

Callers

nothing calls this directly

Calls 6

rte_tel_data_start_dictFunction · 0.85
strcmpFunction · 0.85
rte_tel_data_stringFunction · 0.85
rte_spinlock_lockFunction · 0.50
rte_spinlock_unlockFunction · 0.50

Tested by

no test coverage detected