FD.io VPP  v20.05.1-6-gf53edbc3b
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);
114  vec_validate (pm->rdpmc_indices, 1);
115  pm->page_size = getpagesize ();
116 
117  pm->perfmon_table = 0;
118  pm->pmc_event_by_name = 0;
119 
120  cpuid = get_cpuid ();
121  model = ((cpuid >> 12) & 0xf0) | ((cpuid >> 4) & 0xf);
122  stepping = cpuid & 0xf;
123 
125  model, stepping);
126 
127  if (pm->perfmon_table == 0)
128  {
129  vlib_log_err (pm->log_class, "No table for cpuid %x", cpuid);
130  vlib_log_err (pm->log_class, " model %x, stepping %x",
131  model, stepping);
132  }
133  else
134  {
135  pm->pmc_event_by_name = hash_create_string (0, sizeof (u32));
136  ev = pm->perfmon_table;
137 
138  for (; ev->event_name; ev++)
139  {
141  ev - pm->perfmon_table);
142  }
143  }
144 
145  return error;
146 }
147 
149 
150 /* *INDENT-OFF* */
152 {
153  .version = VPP_BUILD_VER,
154  .description = "Performance Monitor",
155 #if !defined(__x86_64__)
156  .default_disabled = 1,
157 #endif
158 };
159 /* *INDENT-ON* */
160 
161 static uword
163 {
164  perfmon_main_t *pm = va_arg (*args, perfmon_main_t *);
165  perfmon_event_config_t *ep = va_arg (*args, perfmon_event_config_t *);
166  u8 *s = 0;
167  hash_pair_t *hp;
168  u32 idx;
169  u32 pe_config = 0;
170 
171  if (pm->perfmon_table == 0 || pm->pmc_event_by_name == 0)
172  return 0;
173 
174  if (!unformat (input, "%s", &s))
175  return 0;
176 
177  hp = hash_get_pair_mem (pm->pmc_event_by_name, s);
178 
179  vec_free (s);
180 
181  if (hp == 0)
182  return 0;
183 
184  idx = (u32) (hp->value[0]);
185 
186  pe_config |= pm->perfmon_table[idx].event_code[0];
187  pe_config |= pm->perfmon_table[idx].umask << 8;
188 
189  ep->name = (char *) hp->key;
190  ep->pe_type = PERF_TYPE_RAW;
191  ep->pe_config = pe_config;
192  return 1;
193 }
194 
195 static clib_error_t *
197  unformat_input_t * input, vlib_cli_command_t * cmd)
198 {
201  int num_threads = 1 + vtm->n_threads;
202  unformat_input_t _line_input, *line_input = &_line_input;
204  f64 delay;
205  u32 timeout_seconds;
206  u32 deadman;
207  int last_set;
208  clib_error_t *error;
209 
212  pm->ipc_event_index = ~0;
213  pm->mispredict_event_index = ~0;
214 
215  if (!unformat_user (input, unformat_line_input, line_input))
216  return clib_error_return (0, "counter names required...");
217 
219 
220  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
221  {
222  if (unformat (line_input, "timeout %u", &timeout_seconds))
223  pm->timeout_interval = (f64) timeout_seconds;
224  else if (unformat (line_input, "instructions-per-clock"))
225  {
226  ec.name = "instructions";
227  ec.pe_type = PERF_TYPE_HARDWARE;
228  ec.pe_config = PERF_COUNT_HW_INSTRUCTIONS;
231  ec.name = "cpu-cycles";
232  ec.pe_type = PERF_TYPE_HARDWARE;
233  ec.pe_config = PERF_COUNT_HW_CPU_CYCLES;
235  }
236  else if (unformat (line_input, "branch-mispredict-rate"))
237  {
238  ec.name = "branch-misses";
239  ec.pe_type = PERF_TYPE_HARDWARE;
240  ec.pe_config = PERF_COUNT_HW_BRANCH_MISSES;
243  ec.name = "branches";
244  ec.pe_type = PERF_TYPE_HARDWARE;
245  ec.pe_config = PERF_COUNT_HW_BRANCH_INSTRUCTIONS;
247  }
248  else if (unformat (line_input, "threads %U",
249  unformat_bitmap_list, &pm->thread_bitmap))
250  ;
251  else if (unformat (line_input, "thread %U",
252  unformat_bitmap_list, &pm->thread_bitmap))
253  ;
254  else if (unformat (line_input, "%U", unformat_processor_event, pm, &ec))
255  {
257  }
258 #define _(type,event,str) \
259  else if (unformat (line_input, str)) \
260  { \
261  ec.name = str; \
262  ec.pe_type = type; \
263  ec.pe_config = event; \
264  vec_add1 (pm->single_events_to_collect, ec); \
265  }
267 #undef _
268  else
269  {
270  error = clib_error_return (0, "unknown input '%U'",
271  format_unformat_error, line_input);
272  unformat_free (line_input);
273  return error;
274  }
275  }
276 
277  unformat_free (line_input);
278 
279  last_set = clib_bitmap_last_set (pm->thread_bitmap);
280  if (last_set != ~0 && last_set >= num_threads)
281  return clib_error_return (0, "thread %d does not exist", last_set);
282 
283  /* Stick paired events at the front of the (unified) list */
284  if (vec_len (pm->paired_events_to_collect) > 0)
285  {
287  /* first 2n events are pairs... */
289  tmp = pm->single_events_to_collect;
291  pm->paired_events_to_collect = tmp;
292  }
293 
294  if (vec_len (pm->single_events_to_collect) == 0)
295  return clib_error_return (0, "no events specified...");
296 
297  /* Figure out how long data collection will take */
298  delay =
300  delay /= 2.0; /* collect 2 stats at once */
301 
302  vlib_cli_output (vm, "Start collection for %d events, wait %.2f seconds",
303  vec_len (pm->single_events_to_collect), delay);
304 
306  PERFMON_START, 0);
307 
308  /* Coarse-grained wait */
309  vlib_process_suspend (vm, delay);
310 
311  deadman = 0;
312  /* Reasonable to guess that collection may not be quite done... */
313  while (pm->state == PERFMON_STATE_RUNNING)
314  {
315  vlib_process_suspend (vm, 10e-3);
316  if (deadman++ > 200)
317  {
318  vlib_cli_output (vm, "DEADMAN: collection still running...");
319  break;
320  }
321  }
322 
323  vlib_cli_output (vm, "Data collection complete...");
324  return 0;
325 }
326 
327 /* *INDENT-OFF* */
328 VLIB_CLI_COMMAND (set_pmc_command, static) =
329 {
330  .path = "set pmc",
331  .short_help = "set pmc [threads n,n1-n2] c1... [see \"show pmc events\"]",
332  .function = set_pmc_command_fn,
333  .is_mp_safe = 1,
334 };
335 /* *INDENT-ON* */
336 
337 static int
338 capture_name_sort (void *a1, void *a2)
339 {
340  perfmon_capture_t *c1 = a1;
341  perfmon_capture_t *c2 = a2;
342 
343  return strcmp ((char *) c1->thread_and_node_name,
344  (char *) c2->thread_and_node_name);
345 }
346 
347 static u8 *
348 format_capture (u8 * s, va_list * args)
349 {
350  perfmon_main_t *pm = va_arg (*args, perfmon_main_t *);
351  perfmon_capture_t *c = va_arg (*args, perfmon_capture_t *);
352  int verbose __attribute__ ((unused)) = va_arg (*args, int);
353  f64 ticks_per_pkt;
354  int i;
355 
356  if (c == 0)
357  {
358  s = format (s, "%=40s%=20s%=16s%=16s%=16s",
359  "Name", "Counter", "Count", "Pkts", "Counts/Pkt");
360  return s;
361  }
362 
363  for (i = 0; i < vec_len (c->counter_names); i++)
364  {
365  u8 *name;
366 
367  if (i == 0)
368  name = c->thread_and_node_name;
369  else
370  {
371  vec_add1 (s, '\n');
372  name = (u8 *) "";
373  }
374 
375  /* Deal with synthetic events right here */
376  if (i == pm->ipc_event_index)
377  {
378  f64 ipc_rate;
379  ASSERT ((i + 1) < vec_len (c->counter_names));
380 
381  if (c->counter_values[i + 1] > 0)
382  ipc_rate = (f64) c->counter_values[i]
383  / (f64) c->counter_values[i + 1];
384  else
385  ipc_rate = 0.0;
386 
387  s = format (s, "%-40s%+20s%+16llu%+16llu%+16.2e\n",
388  name, "instructions-per-clock",
389  c->counter_values[i],
390  c->counter_values[i + 1], ipc_rate);
391  name = (u8 *) "";
392  }
393 
394  if (i == pm->mispredict_event_index)
395  {
396  f64 mispredict_rate;
397  ASSERT (i + 1 < vec_len (c->counter_names));
398 
399  if (c->counter_values[i + 1] > 0)
400  mispredict_rate = (f64) c->counter_values[i]
401  / (f64) c->counter_values[i + 1];
402  else
403  mispredict_rate = 0.0;
404 
405  s = format (s, "%-40s%+20s%+16llu%+16llu%+16.2e\n",
406  name, "branch-mispredict-rate",
407  c->counter_values[i],
408  c->counter_values[i + 1], mispredict_rate);
409  name = (u8 *) "";
410  }
411 
412  if (c->vectors_this_counter[i])
413  ticks_per_pkt =
414  ((f64) c->counter_values[i]) / ((f64) c->vectors_this_counter[i]);
415  else
416  ticks_per_pkt = 0.0;
417 
418  s = format (s, "%-40s%+20s%+16llu%+16llu%+16.2e",
419  name, c->counter_names[i],
420  c->counter_values[i],
421  c->vectors_this_counter[i], ticks_per_pkt);
422  }
423  return s;
424 }
425 
426 static u8 *
427 format_generic_events (u8 * s, va_list * args)
428 {
429  int verbose = va_arg (*args, int);
430 
431 #define _(type,config,name) \
432  if (verbose == 0) \
433  s = format (s, "\n %s", name); \
434  else \
435  s = format (s, "\n %s (%d, %d)", name, type, config);
437 #undef _
438  return s;
439 }
440 
441 typedef struct
442 {
445 } sort_nvp_t;
446 
447 static int
448 sort_nvps_by_name (void *a1, void *a2)
449 {
450  sort_nvp_t *nvp1 = a1;
451  sort_nvp_t *nvp2 = a2;
452 
453  return strcmp ((char *) nvp1->name, (char *) nvp2->name);
454 }
455 
456 static u8 *
457 format_pmc_event (u8 * s, va_list * args)
458 {
460 
461  s = format (s, "%s\n", ev->event_name);
462  s = format (s, " umask: 0x%x\n", ev->umask);
463  s = format (s, " code: 0x%x", ev->event_code[0]);
464 
465  if (ev->event_code[1])
466  s = format (s, " , 0x%x\n", ev->event_code[1]);
467  else
468  s = format (s, "\n");
469 
470  return s;
471 }
472 
473 static u8 *
474 format_processor_events (u8 * s, va_list * args)
475 {
476  perfmon_main_t *pm = va_arg (*args, perfmon_main_t *);
477  int verbose = va_arg (*args, int);
478  sort_nvp_t *sort_nvps = 0;
479  sort_nvp_t *sn;
480  u8 *key;
481  u32 value;
482 
483  /* *INDENT-OFF* */
484  hash_foreach_mem (key, value, pm->pmc_event_by_name,
485  ({
486  vec_add2 (sort_nvps, sn, 1);
487  sn->name = key;
488  sn->index = value;
489  }));
490 
492 
493  if (verbose == 0)
494  {
495  vec_foreach (sn, sort_nvps)
496  s = format (s, "\n %s ", sn->name);
497  }
498  else
499  {
500  vec_foreach (sn, sort_nvps)
501  s = format(s, "%U", format_pmc_event, &pm->perfmon_table[sn->index]);
502  }
503  vec_free (sort_nvps);
504  return s;
505 }
506 
507 
508 static clib_error_t *
510  unformat_input_t * input, vlib_cli_command_t * cmd)
511 {
513  int verbose = 0;
514  int events = 0;
515  int i;
517  perfmon_capture_t *captures = 0;
518 
520  {
521  if (unformat (input, "events"))
522  events = 1;
523  else if (unformat (input, "verbose"))
524  verbose = 1;
525  else
526  break;
527  }
528 
529  if (events)
530  {
531  vlib_cli_output (vm, "Generic Events %U",
532  format_generic_events, verbose);
533  vlib_cli_output (vm, "Synthetic Events");
534  vlib_cli_output (vm, " instructions-per-clock");
535  vlib_cli_output (vm, " branch-mispredict-rate");
536  if (pm->perfmon_table)
537  vlib_cli_output (vm, "Processor Events %U",
538  format_processor_events, pm, verbose);
539  return 0;
540  }
541 
542  if (pm->state == PERFMON_STATE_RUNNING)
543  {
544  vlib_cli_output (vm, "Data collection in progress...");
545  return 0;
546  }
547 
548  if (pool_elts (pm->capture_pool) == 0)
549  {
550  vlib_cli_output (vm, "No data...");
551  return 0;
552  }
553 
554  /* *INDENT-OFF* */
555  pool_foreach (c, pm->capture_pool,
556  ({
557  vec_add1 (captures, *c);
558  }));
559  /* *INDENT-ON* */
560 
562 
563  vlib_cli_output (vm, "%U", format_capture, pm, 0 /* header */ ,
564  0 /* verbose */ );
565 
566  for (i = 0; i < vec_len (captures); i++)
567  {
568  c = captures + i;
569 
570  vlib_cli_output (vm, "%U", format_capture, pm, c, verbose);
571  }
572 
573  vec_free (captures);
574 
575  return 0;
576 }
577 
578 /* *INDENT-OFF* */
579 VLIB_CLI_COMMAND (show_pmc_command, static) =
580 {
581  .path = "show pmc",
582  .short_help = "show pmc [verbose]",
583  .function = show_pmc_command_fn,
584  .is_mp_safe = 1,
585 };
586 /* *INDENT-ON* */
587 
588 static clib_error_t *
590  unformat_input_t * input, vlib_cli_command_t * cmd)
591 {
593  u8 *key;
594  u32 *value;
595 
596  if (pm->state == PERFMON_STATE_RUNNING)
597  {
598  vlib_cli_output (vm, "Performance monitor is still running...");
599  return 0;
600  }
601 
602  pool_free (pm->capture_pool);
603 
604  /* *INDENT-OFF* */
606  ({
607  vec_free (key);
608  }));
609  /* *INDENT-ON* */
612  hash_create_string (0, sizeof (uword));
613  return 0;
614 }
615 
616 /* *INDENT-OFF* */
617 VLIB_CLI_COMMAND (clear_pmc_command, static) =
618 {
619  .path = "clear pmc",
620  .short_help = "clear the performance monitor counters",
621  .function = clear_pmc_command_fn,
622 };
623 /* *INDENT-ON* */
624 
625 
626 /*
627  * fd.io coding-style-patch-verification: ON
628  *
629  * Local Variables:
630  * eval: (c-set-style "gnu")
631  * End:
632  */
vlib_log_class_t vlib_log_register_class(char *class, char *subclass)
Definition: log.c:209
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:507
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:196
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:338
u8 * name
Definition: perfmon.c:443
vnet_main_t * vnet_get_main(void)
Definition: misc.c:46
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:590
u32 mispredict_event_index
Definition: perfmon.h:107
uword unformat_user(unformat_input_t *input, unformat_function_t *func,...)
Definition: unformat.c:989
#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
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:513
#define VLIB_INIT_FUNCTION(x)
Definition: init.h:173
#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:509
u8 * thread_and_node_name
Definition: perfmon.h:67
static uword unformat_processor_event(unformat_input_t *input, va_list *args)
Definition: perfmon.c:162
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:283
vnet_main_t * vnet_main
Definition: perfmon.h:131
static u8 * format_pmc_event(u8 *s, va_list *args)
Definition: perfmon.c:457
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:444
static u8 * format_capture(u8 *s, va_list *args)
Definition: perfmon.c:348
#define hash_foreach_mem(key_var, value_var, h, body)
Definition: hash.h:461
vlib_main_t * vm
Definition: in2out_ed.c:1599
vlib_log_class_t log_class
Definition: perfmon.h:127
#define pool_free(p)
Free a pool.
Definition: pool.h:427
#define UNFORMAT_END_OF_INPUT
Definition: format.h:145
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:589
sll srl srl sll sra u16x4 i
Definition: vector_sse42.h:317
#define vec_free(V)
Free vector&#39;s memory (no header).
Definition: vec.h:380
static int sort_nvps_by_name(void *a1, void *a2)
Definition: perfmon.c:448
string name[64]
Definition: ip.api:44
#define VLIB_CLI_COMMAND(x,...)
Definition: cli.h:152
u8 value
Definition: qos.api:54
#define ASSERT(truth)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
Definition: cli.c:689
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:888
static u8 * format_processor_events(u8 *s, va_list *args)
Definition: perfmon.c:474
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:427
typedef key
Definition: ipsec_types.api:85
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:1053
static void unformat_free(unformat_input_t *i)
Definition: format.h:163
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:105
static int perfmon_cpu_model_matches(perfmon_intel_pmc_cpu_model_t *mt, u32 n_models, u8 model, u8 stepping)
Definition: perfmon.c:59
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:978
static uword unformat_check_input(unformat_input_t *i)
Definition: format.h:171
static uword pool_elts(void *v)
Number of active elements in a pool.
Definition: pool.h:128