FD.io VPP  v19.04.4-rc0-5-ge88582fac
Vector Packet Processing
perfmon.c
Go to the documentation of this file.
1 /*
2  * perfmon.c - skeleton vpp engine plug-in
3  *
4  * Copyright (c) <current-year> <your-organization>
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at:
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #include <vnet/vnet.h>
19 #include <vnet/plugin/plugin.h>
20 #include <perfmon/perfmon.h>
21 #include <perfmon/perfmon_intel.h>
22 
23 #include <vlibapi/api.h>
24 #include <vlibmemory/api.h>
25 #include <vpp/app/version.h>
26 #include <linux/limits.h>
27 
29 
30 void
32  perfmon_intel_pmc_event_t * e, int n_events)
33 {
36 
37  r.events = e;
38  r.models = m;
39  r.n_events = n_events;
40  r.n_models = n_models;
41 
42  vec_add1 (pm->perfmon_tables, r);
43 }
44 
45 static inline u32
46 get_cpuid (void)
47 {
48 #if defined(__x86_64__)
49  u32 cpuid;
50  asm volatile ("mov $1, %%eax; cpuid; mov %%eax, %0":"=r" (cpuid)::"%eax",
51  "%edx", "%ecx", "%rbx");
52  return cpuid;
53 #else
54  return 0;
55 #endif
56 }
57 
58 static int
60  u32 n_models, u8 model, u8 stepping)
61 {
62  u32 i;
63  for (i = 0; i < n_models; i++)
64  {
65  if (mt[i].model != model)
66  continue;
67 
68  if (mt[i].has_stepping)
69  {
70  if (mt[i].stepping != stepping)
71  continue;
72  }
73 
74  return 1;
75  }
76  return 0;
77 }
78 
81  u8 model, u8 stepping)
82 {
84 
85  vec_foreach (rt, pm->perfmon_tables)
86  {
87  if (perfmon_cpu_model_matches (rt->models, rt->n_models, model, stepping))
88  return rt->events;
89  }
90  return 0;
91 }
92 
93 static clib_error_t *
95 {
97  clib_error_t *error = 0;
98  u32 cpuid;
99  u8 model, stepping;
101 
102  pm->vlib_main = vm;
103  pm->vnet_main = vnet_get_main ();
104 
106  hash_create_string (0, sizeof (uword));
107 
108  pm->log_class = vlib_log_register_class ("perfmon", 0);
109 
110  /* Default data collection interval */
111  pm->timeout_interval = 2.0; /* seconds */
112  vec_validate (pm->pm_fds, 1);
113  vec_validate (pm->pm_fds[0], vec_len (vlib_mains) - 1);
114  vec_validate (pm->pm_fds[1], vec_len (vlib_mains) - 1);
118  vec_validate (pm->rdpmc_indices, 1);
121  pm->page_size = getpagesize ();
122 
123  pm->perfmon_table = 0;
124  pm->pmc_event_by_name = 0;
125 
126  cpuid = get_cpuid ();
127  model = ((cpuid >> 12) & 0xf0) | ((cpuid >> 4) & 0xf);
128  stepping = cpuid & 0xf;
129 
131  model, stepping);
132 
133  if (pm->perfmon_table == 0)
134  {
135  vlib_log_err (pm->log_class, "No table for cpuid %x", cpuid);
136  vlib_log_err (pm->log_class, " model %x, stepping %x",
137  model, stepping);
138  }
139  else
140  {
141  pm->pmc_event_by_name = hash_create_string (0, sizeof (u32));
142  ev = pm->perfmon_table;
143 
144  for (; ev->event_name; ev++)
145  {
147  ev - pm->perfmon_table);
148  }
149  }
150 
151  return error;
152 }
153 
155 
156 /* *INDENT-OFF* */
158 {
159  .version = VPP_BUILD_VER,
160  .description = "Performance Monitor",
161 #if !defined(__x86_64__)
162  .default_disabled = 1,
163 #endif
164 };
165 /* *INDENT-ON* */
166 
167 static uword
169 {
170  perfmon_main_t *pm = va_arg (*args, perfmon_main_t *);
171  perfmon_event_config_t *ep = va_arg (*args, perfmon_event_config_t *);
172  u8 *s = 0;
173  hash_pair_t *hp;
174  u32 idx;
175  u32 pe_config = 0;
176 
177  if (pm->perfmon_table == 0 || pm->pmc_event_by_name == 0)
178  return 0;
179 
180  if (!unformat (input, "%s", &s))
181  return 0;
182 
183  hp = hash_get_pair_mem (pm->pmc_event_by_name, s);
184 
185  vec_free (s);
186 
187  if (hp == 0)
188  return 0;
189 
190  idx = (u32) (hp->value[0]);
191 
192  pe_config |= pm->perfmon_table[idx].event_code[0];
193  pe_config |= pm->perfmon_table[idx].umask << 8;
194 
195  ep->name = (char *) hp->key;
196  ep->pe_type = PERF_TYPE_RAW;
197  ep->pe_config = pe_config;
198  return 1;
199 }
200 
201 static clib_error_t *
203  unformat_input_t * input, vlib_cli_command_t * cmd)
204 {
207  int num_threads = 1 + vtm->n_threads;
208  unformat_input_t _line_input, *line_input = &_line_input;
210  f64 delay;
211  u32 timeout_seconds;
212  u32 deadman;
213  int last_set;
214  clib_error_t *error;
215 
218  pm->ipc_event_index = ~0;
219  pm->mispredict_event_index = ~0;
220 
221  if (!unformat_user (input, unformat_line_input, line_input))
222  return clib_error_return (0, "counter names required...");
223 
225 
226  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
227  {
228  if (unformat (line_input, "timeout %u", &timeout_seconds))
229  pm->timeout_interval = (f64) timeout_seconds;
230  else if (unformat (line_input, "instructions-per-clock"))
231  {
232  ec.name = "instructions";
233  ec.pe_type = PERF_TYPE_HARDWARE;
234  ec.pe_config = PERF_COUNT_HW_INSTRUCTIONS;
237  ec.name = "cpu-cycles";
238  ec.pe_type = PERF_TYPE_HARDWARE;
239  ec.pe_config = PERF_COUNT_HW_CPU_CYCLES;
241  }
242  else if (unformat (line_input, "branch-mispredict-rate"))
243  {
244  ec.name = "branch-misses";
245  ec.pe_type = PERF_TYPE_HARDWARE;
246  ec.pe_config = PERF_COUNT_HW_BRANCH_MISSES;
249  ec.name = "branches";
250  ec.pe_type = PERF_TYPE_HARDWARE;
251  ec.pe_config = PERF_COUNT_HW_BRANCH_INSTRUCTIONS;
253  }
254  else if (unformat (line_input, "threads %U",
255  unformat_bitmap_list, &pm->thread_bitmap))
256  ;
257  else if (unformat (line_input, "thread %U",
258  unformat_bitmap_list, &pm->thread_bitmap))
259  ;
260  else if (unformat (line_input, "%U", unformat_processor_event, pm, &ec))
261  {
263  }
264 #define _(type,event,str) \
265  else if (unformat (line_input, str)) \
266  { \
267  ec.name = str; \
268  ec.pe_type = type; \
269  ec.pe_config = event; \
270  vec_add1 (pm->single_events_to_collect, ec); \
271  }
273 #undef _
274  else
275  {
276  error = clib_error_return (0, "unknown input '%U'",
277  format_unformat_error, line_input);
278  unformat_free (line_input);
279  return error;
280  }
281  }
282 
283  unformat_free (line_input);
284 
285  last_set = clib_bitmap_last_set (pm->thread_bitmap);
286  if (last_set != ~0 && last_set >= num_threads)
287  return clib_error_return (0, "thread %d does not exist", last_set);
288 
289  /* Stick paired events at the front of the (unified) list */
290  if (vec_len (pm->paired_events_to_collect) > 0)
291  {
293  /* first 2n events are pairs... */
295  tmp = pm->single_events_to_collect;
297  pm->paired_events_to_collect = tmp;
298  }
299 
300  if (vec_len (pm->single_events_to_collect) == 0)
301  return clib_error_return (0, "no events specified...");
302 
303  /* Figure out how long data collection will take */
304  delay =
306  delay /= 2.0; /* collect 2 stats at once */
307 
308  vlib_cli_output (vm, "Start collection for %d events, wait %.2f seconds",
309  vec_len (pm->single_events_to_collect), delay);
310 
312  PERFMON_START, 0);
313 
314  /* Coarse-grained wait */
315  vlib_process_suspend (vm, delay);
316 
317  deadman = 0;
318  /* Reasonable to guess that collection may not be quite done... */
319  while (pm->state == PERFMON_STATE_RUNNING)
320  {
321  vlib_process_suspend (vm, 10e-3);
322  if (deadman++ > 200)
323  {
324  vlib_cli_output (vm, "DEADMAN: collection still running...");
325  break;
326  }
327  }
328 
329  vlib_cli_output (vm, "Data collection complete...");
330  return 0;
331 }
332 
333 /* *INDENT-OFF* */
334 VLIB_CLI_COMMAND (set_pmc_command, static) =
335 {
336  .path = "set pmc",
337  .short_help = "set pmc [threads n,n1-n2] c1... [see \"show pmc events\"]",
338  .function = set_pmc_command_fn,
339  .is_mp_safe = 1,
340 };
341 /* *INDENT-ON* */
342 
343 static int
344 capture_name_sort (void *a1, void *a2)
345 {
346  perfmon_capture_t *c1 = a1;
347  perfmon_capture_t *c2 = a2;
348 
349  return strcmp ((char *) c1->thread_and_node_name,
350  (char *) c2->thread_and_node_name);
351 }
352 
353 static u8 *
354 format_capture (u8 * s, va_list * args)
355 {
356  perfmon_main_t *pm = va_arg (*args, perfmon_main_t *);
357  perfmon_capture_t *c = va_arg (*args, perfmon_capture_t *);
358  int verbose __attribute__ ((unused)) = va_arg (*args, int);
359  f64 ticks_per_pkt;
360  int i;
361 
362  if (c == 0)
363  {
364  s = format (s, "%=40s%=20s%=16s%=16s%=16s",
365  "Name", "Counter", "Count", "Pkts", "Counts/Pkt");
366  return s;
367  }
368 
369  for (i = 0; i < vec_len (c->counter_names); i++)
370  {
371  u8 *name;
372 
373  if (i == 0)
374  name = c->thread_and_node_name;
375  else
376  {
377  vec_add1 (s, '\n');
378  name = (u8 *) "";
379  }
380 
381  /* Deal with synthetic events right here */
382  if (i == pm->ipc_event_index)
383  {
384  f64 ipc_rate;
385  ASSERT ((i + 1) < vec_len (c->counter_names));
386 
387  if (c->counter_values[i + 1] > 0)
388  ipc_rate = (f64) c->counter_values[i]
389  / (f64) c->counter_values[i + 1];
390  else
391  ipc_rate = 0.0;
392 
393  s = format (s, "%-40s%+20s%+16llu%+16llu%+16.2e\n",
394  name, "instructions-per-clock",
395  c->counter_values[i],
396  c->counter_values[i + 1], ipc_rate);
397  name = (u8 *) "";
398  }
399 
400  if (i == pm->mispredict_event_index)
401  {
402  f64 mispredict_rate;
403  ASSERT (i + 1 < vec_len (c->counter_names));
404 
405  if (c->counter_values[i + 1] > 0)
406  mispredict_rate = (f64) c->counter_values[i]
407  / (f64) c->counter_values[i + 1];
408  else
409  mispredict_rate = 0.0;
410 
411  s = format (s, "%-40s%+20s%+16llu%+16llu%+16.2e\n",
412  name, "branch-mispredict-rate",
413  c->counter_values[i],
414  c->counter_values[i + 1], mispredict_rate);
415  name = (u8 *) "";
416  }
417 
418  if (c->vectors_this_counter[i])
419  ticks_per_pkt =
420  ((f64) c->counter_values[i]) / ((f64) c->vectors_this_counter[i]);
421  else
422  ticks_per_pkt = 0.0;
423 
424  s = format (s, "%-40s%+20s%+16llu%+16llu%+16.2e",
425  name, c->counter_names[i],
426  c->counter_values[i],
427  c->vectors_this_counter[i], ticks_per_pkt);
428  }
429  return s;
430 }
431 
432 static u8 *
433 format_generic_events (u8 * s, va_list * args)
434 {
435  int verbose = va_arg (*args, int);
436 
437 #define _(type,config,name) \
438  if (verbose == 0) \
439  s = format (s, "\n %s", name); \
440  else \
441  s = format (s, "\n %s (%d, %d)", name, type, config);
443 #undef _
444  return s;
445 }
446 
447 typedef struct
448 {
451 } sort_nvp_t;
452 
453 static int
454 sort_nvps_by_name (void *a1, void *a2)
455 {
456  sort_nvp_t *nvp1 = a1;
457  sort_nvp_t *nvp2 = a2;
458 
459  return strcmp ((char *) nvp1->name, (char *) nvp2->name);
460 }
461 
462 static u8 *
463 format_pmc_event (u8 * s, va_list * args)
464 {
466 
467  s = format (s, "%s\n", ev->event_name);
468  s = format (s, " umask: 0x%x\n", ev->umask);
469  s = format (s, " code: 0x%x", ev->event_code[0]);
470 
471  if (ev->event_code[1])
472  s = format (s, " , 0x%x\n", ev->event_code[1]);
473  else
474  s = format (s, "\n");
475 
476  return s;
477 }
478 
479 static u8 *
480 format_processor_events (u8 * s, va_list * args)
481 {
482  perfmon_main_t *pm = va_arg (*args, perfmon_main_t *);
483  int verbose = va_arg (*args, int);
484  sort_nvp_t *sort_nvps = 0;
485  sort_nvp_t *sn;
486  u8 *key;
487  u32 value;
488 
489  /* *INDENT-OFF* */
490  hash_foreach_mem (key, value, pm->pmc_event_by_name,
491  ({
492  vec_add2 (sort_nvps, sn, 1);
493  sn->name = key;
494  sn->index = value;
495  }));
496 
498 
499  if (verbose == 0)
500  {
501  vec_foreach (sn, sort_nvps)
502  s = format (s, "\n %s ", sn->name);
503  }
504  else
505  {
506  vec_foreach (sn, sort_nvps)
507  s = format(s, "%U", format_pmc_event, &pm->perfmon_table[sn->index]);
508  }
509  vec_free (sort_nvps);
510  return s;
511 }
512 
513 
514 static clib_error_t *
516  unformat_input_t * input, vlib_cli_command_t * cmd)
517 {
519  int verbose = 0;
520  int events = 0;
521  int i;
523  perfmon_capture_t *captures = 0;
524 
526  {
527  if (unformat (input, "events"))
528  events = 1;
529  else if (unformat (input, "verbose"))
530  verbose = 1;
531  else
532  break;
533  }
534 
535  if (events)
536  {
537  vlib_cli_output (vm, "Generic Events %U",
538  format_generic_events, verbose);
539  vlib_cli_output (vm, "Synthetic Events");
540  vlib_cli_output (vm, " instructions-per-clock");
541  vlib_cli_output (vm, " branch-mispredict-rate");
542  if (pm->perfmon_table)
543  vlib_cli_output (vm, "Processor Events %U",
544  format_processor_events, pm, verbose);
545  return 0;
546  }
547 
548  if (pm->state == PERFMON_STATE_RUNNING)
549  {
550  vlib_cli_output (vm, "Data collection in progress...");
551  return 0;
552  }
553 
554  if (pool_elts (pm->capture_pool) == 0)
555  {
556  vlib_cli_output (vm, "No data...");
557  return 0;
558  }
559 
560  /* *INDENT-OFF* */
561  pool_foreach (c, pm->capture_pool,
562  ({
563  vec_add1 (captures, *c);
564  }));
565  /* *INDENT-ON* */
566 
568 
569  vlib_cli_output (vm, "%U", format_capture, pm, 0 /* header */ ,
570  0 /* verbose */ );
571 
572  for (i = 0; i < vec_len (captures); i++)
573  {
574  c = captures + i;
575 
576  vlib_cli_output (vm, "%U", format_capture, pm, c, verbose);
577  }
578 
579  vec_free (captures);
580 
581  return 0;
582 }
583 
584 /* *INDENT-OFF* */
585 VLIB_CLI_COMMAND (show_pmc_command, static) =
586 {
587  .path = "show pmc",
588  .short_help = "show pmc [verbose]",
589  .function = show_pmc_command_fn,
590  .is_mp_safe = 1,
591 };
592 /* *INDENT-ON* */
593 
594 static clib_error_t *
596  unformat_input_t * input, vlib_cli_command_t * cmd)
597 {
599  u8 *key;
600  u32 *value;
601 
602  if (pm->state == PERFMON_STATE_RUNNING)
603  {
604  vlib_cli_output (vm, "Performance monitor is still running...");
605  return 0;
606  }
607 
608  pool_free (pm->capture_pool);
609 
610  /* *INDENT-OFF* */
612  ({
613  vec_free (key);
614  }));
615  /* *INDENT-ON* */
618  hash_create_string (0, sizeof (uword));
619  return 0;
620 }
621 
622 /* *INDENT-OFF* */
623 VLIB_CLI_COMMAND (clear_pmc_command, static) =
624 {
625  .path = "clear pmc",
626  .short_help = "clear the performance monitor counters",
627  .function = clear_pmc_command_fn,
628 };
629 /* *INDENT-ON* */
630 
631 
632 /*
633  * fd.io coding-style-patch-verification: ON
634  *
635  * Local Variables:
636  * eval: (c-set-style "gnu")
637  * End:
638  */
vlib_log_class_t vlib_log_register_class(char *class, char *subclass)
Definition: log.c:227
perfmon_capture_t * capture_pool
Definition: perfmon.h:88
u32 ** rdpmc_indices
Definition: perfmon.h:115
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
Definition: vec.h:439
volatile u8 state
Definition: perfmon.h:85
f64 timeout_interval
Definition: perfmon.h:110
static clib_error_t * set_pmc_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: perfmon.c:202
u64 * vectors_this_counter
Definition: perfmon.h:70
int ** pm_fds
Definition: perfmon.h:121
perfmon_event_config_t * paired_events_to_collect
Definition: perfmon.h:103
static int capture_name_sort(void *a1, void *a2)
Definition: perfmon.c:344
u8 * name
Definition: perfmon.c:449
vnet_main_t * vnet_get_main(void)
Definition: misc.c:47
vlib_node_registration_t perfmon_periodic_node
(constructor) VLIB_REGISTER_NODE (perfmon_periodic_node)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
Definition: vec.h:522
u32 mispredict_event_index
Definition: perfmon.h:107
int i
uword unformat_user(unformat_input_t *input, unformat_function_t *func,...)
Definition: unformat.c:983
#define hash_set_mem(h, key, value)
Definition: hash.h:275
#define hash_get_pair_mem(h, key)
Definition: hash.h:272
u8 * format(u8 *s, const char *fmt,...)
Definition: format.c:424
vlib_main_t * vlib_main
Definition: perfmon.h:130
vlib_main_t ** vlib_mains
Definition: buffer.c:321
unsigned char u8
Definition: types.h:56
#define clib_bitmap_zero(v)
Clear a bitmap.
Definition: bitmap.h:102
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
double f64
Definition: types.h:142
uword value[0]
Definition: hash.h:165
static uword vlib_process_suspend(vlib_main_t *vm, f64 dt)
Suspend a vlib cooperative multi-tasking thread for a period of time.
Definition: node_funcs.h:422
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
Definition: pool.h:493
#define VLIB_INIT_FUNCTION(x)
Definition: init.h:163
#define clib_error_return(e, args...)
Definition: error.h:99
static clib_error_t * show_pmc_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: perfmon.c:515
u8 * thread_and_node_name
Definition: perfmon.h:67
static uword unformat_processor_event(unformat_input_t *input, va_list *args)
Definition: perfmon.c:168
unsigned int u32
Definition: types.h:88
#define hash_create_string(elts, value_bytes)
Definition: hash.h:690
unformat_function_t unformat_line_input
Definition: format.h:282
vnet_main_t * vnet_main
Definition: perfmon.h:131
static u8 * format_pmc_event(u8 *s, va_list *args)
Definition: perfmon.c:463
perfmon_intel_pmc_event_t * events
Definition: perfmon_intel.h:40
static perfmon_intel_pmc_event_t * perfmon_find_table_by_model_stepping(perfmon_main_t *pm, u8 model, u8 stepping)
Definition: perfmon.c:80
static void vlib_process_signal_event(vlib_main_t *vm, uword node_index, uword type_opaque, uword data)
Definition: node_funcs.h:934
u8 ** counter_names
Definition: perfmon.h:68
static uword clib_bitmap_last_set(uword *ai)
Return the higest numbered set bit in a bitmap.
Definition: bitmap.h:423
struct _unformat_input_t unformat_input_t
#define hash_free(h)
Definition: hash.h:310
uword * pmc_event_by_name
Definition: perfmon.h:97
perfmon_intel_pmc_cpu_model_t * models
Definition: perfmon_intel.h:41
perfmon_intel_pmc_event_t * perfmon_table
Definition: perfmon.h:95
u32 index
Definition: perfmon.c:450
static u8 * format_capture(u8 *s, va_list *args)
Definition: perfmon.c:354
#define hash_foreach_mem(key_var, value_var, h, body)
Definition: hash.h:461
u8 name[64]
Definition: memclnt.api:152
vlib_log_class_t log_class
Definition: perfmon.h:127
#define pool_free(p)
Free a pool.
Definition: pool.h:407
#define UNFORMAT_END_OF_INPUT
Definition: format.h:144
svmdb_client_t * c
static u32 get_cpuid(void)
Definition: perfmon.c:46
static clib_error_t * clear_pmc_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: perfmon.c:595
vlib_main_t * vm
Definition: buffer.c:312
#define vec_free(V)
Free vector&#39;s memory (no header).
Definition: vec.h:341
static int sort_nvps_by_name(void *a1, void *a2)
Definition: perfmon.c:454
#define VLIB_CLI_COMMAND(x,...)
Definition: cli.h:155
#define ASSERT(truth)
perfmon_event_config_t * single_events_to_collect
Definition: perfmon.h:100
VLIB_PLUGIN_REGISTER()
#define vec_append(v1, v2)
Append v2 after v1.
Definition: vec.h:818
static u8 * format_processor_events(u8 *s, va_list *args)
Definition: perfmon.c:480
u32 ipc_event_index
Definition: perfmon.h:106
static clib_error_t * perfmon_init(vlib_main_t *vm)
Definition: perfmon.c:94
perfmon_main_t perfmon_main
Definition: perfmon.c:28
void perfmon_register_intel_pmc(perfmon_intel_pmc_cpu_model_t *m, int n_models, perfmon_intel_pmc_event_t *e, int n_events)
Definition: perfmon.c:31
#define foreach_perfmon_event
Definition: perfmon.h:31
uword * capture_by_thread_and_node_name
Definition: perfmon.h:89
static u8 * format_generic_events(u8 *s, va_list *args)
Definition: perfmon.c:433
uword * thread_bitmap
Definition: perfmon.h:124
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
u8 *** perf_event_pages
Definition: perfmon.h:117
u64 * counter_values
Definition: perfmon.h:69
perfmon_intel_pmc_registration_t * perfmon_tables
Definition: perfmon.h:92
u64 uword
Definition: types.h:112
#define vec_sort_with_function(vec, f)
Sort a vector using the supplied element comparison function.
Definition: vec.h:980
static void unformat_free(unformat_input_t *i)
Definition: format.h:162
typedef key
Definition: ipsec.api:244
u8 * format_unformat_error(u8 *s, va_list *va)
Definition: unformat.c:91
static vlib_thread_main_t * vlib_get_thread_main()
Definition: global_funcs.h:32
#define vec_foreach(var, vec)
Vector iterator.
#define vlib_log_err(...)
Definition: log.h:48
static int perfmon_cpu_model_matches(perfmon_intel_pmc_cpu_model_t *mt, u32 n_models, u8 model, u8 stepping)
Definition: perfmon.c:59
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
Definition: cli.c:762
uword key
Definition: hash.h:162
#define PERFMON_START
Definition: perfmon.h:141
uword unformat(unformat_input_t *i, const char *fmt,...)
Definition: unformat.c:972
static uword unformat_check_input(unformat_input_t *i)
Definition: format.h:170
static uword pool_elts(void *v)
Number of active elements in a pool.
Definition: pool.h:128