|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
18 #include <perfmon/perfmon.h>
23 .class_name =
"perfmon",
24 .subclass_name =
"intel-uncore",
27 #define log_debug(fmt, ...) \
28 vlib_log_debug (if_intel_uncore_log.class, fmt, __VA_ARGS__)
29 #define log_warn(fmt, ...) \
30 vlib_log_warn (if_intel_uncore_log.class, fmt, __VA_ARGS__)
31 #define log_err(fmt, ...) \
32 vlib_log_err (if_intel_uncore_log.class, fmt, __VA_ARGS__)
34 #define PERF_INTEL_CODE(event, umask, edge, any, inv, cmask) \
35 ((event) | (umask) << 8 | (edge) << 18 | (any) << 21 | (inv) << 23 | \
39 #define _(unit, event, umask, n, suffix, desc) \
40 [INTEL_UNCORE_E_##unit##_##n##_##suffix] = { \
41 .config = (event) | (umask) << 8, \
42 .name = #n "." #suffix, \
43 .description = desc, \
44 .type_from_instance = 1, \
45 .instance_type = INTEL_UNCORE_UNIT_##unit, \
62 char *
name,
char *type_str,
char *
fmt,
63 int *socket_by_cpu_id)
65 static char *base_path =
"/sys/bus/event_source/devices/uncore";
80 s =
format (s,
"%s_%s_%u/type%c", base_path,
name,
i, 0);
85 s =
format (s,
"%s_%s_%u/cpumask%c", base_path,
name,
i, 0);
113 int *numa_by_cpu_id = 0;
126 s =
format (s,
"/sys/devices/system/node/node%u/cpulist%c",
i, 0);
138 numa_by_cpu_id[j] =
i;
144 #define _(t, n, name, fmt) \
145 intel_uncore_add_unit (src, INTEL_UNCORE_UNIT_##t, n, name, fmt, \
150 for (
i = 0, j = 0;
i <
vec_len (
src->instances_by_type);
i++)
176 .name =
"intel-uncore",
177 .description =
"intel uncore events",
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
#define clib_error_return(e, args...)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
#define foreach_intel_uncore_event
#define foreach_intel_uncore_unit_type
__clib_export clib_error_t * clib_sysfs_read(char *file_name, char *fmt,...)
static void intel_uncore_add_unit(perfmon_source_t *src, intel_uncore_unit_type_t u, char *name, char *type_str, char *fmt, int *socket_by_cpu_id)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
VLIB_REGISTER_LOG_CLASS(if_intel_uncore_log, static)
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
#define clib_bitmap_free(v)
Free a bitmap.
sll srl srl sll sra u16x4 i
PERFMON_REGISTER_SOURCE(intel_uncore)
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
save_rewrite_length must be aligned so that reass doesn t overwrite it
static clib_error_t * intel_uncore_init(vlib_main_t *vm, perfmon_source_t *src)
#define vec_free(V)
Free vector's memory (no header).
description fragment has unexpected format
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header,...
#define vec_sort_with_function(vec, f)
Sort a vector using the supplied element comparison function.
format_function_t format_intel_core_config
static int intel_uncore_instance_name_cmp(void *v1, void *v2)
#define vec_terminate_c_string(V)
(If necessary) NULL terminate a vector containing a c-string.
#define clib_error_free(e)
#define clib_bitmap_foreach(i, ai)
Macro to iterate across set bits in a bitmap.
__clib_export uword unformat_bitmap_list(unformat_input_t *input, va_list *va)
unformat a list of bit ranges into a bitmap (eg "0-3,5-7,11" )
#define log_debug(fmt,...)
static perfmon_event_t intel_uncore_events[]