#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <linux/limits.h>
#include "ut/ut.h"
#include "lib/ub.h"
#include "lib/assert.h"
#include "lib/memory.h"
#include "lib/processor.h"
#include "lib/string.h"
Go to the source code of this file.
|
static int | ub_init (const char *opts M0_UNUSED) |
|
static void | ub_fini (void) |
|
static void | ub_init1 (int i) |
|
static void | ub_init2 (int i) |
|
static void | ub_init3 (int i) |
|
static uint32_t | get_num_from_file (const char *file) |
|
static void | maptostr (struct m0_bitmap *map, char *str, size_t sz) |
|
static void | verify_id_get (void) |
|
static void | verify_map (int mapid) |
|
static void | verify_max_processors () |
|
static void | verify_a_processor (m0_processor_nr_t id, struct m0_processor_descr *pd) |
|
static void | verify_processors () |
|
static void | write_str_to_file (const char *file, const char *str) |
|
static void | write_num_to_file (const char *file, uint32_t num) |
|
static void | populate_cpu_summary (struct psummary *sum) |
|
static void | populate_cpus (struct pinfo cpus[], uint32_t sz) |
|
static void | clean_test_dataset (void) |
|
static void | verify_all_params () |
|
static struct psummary * | psummary_new (m0_processor_nr_t cpu_max, struct m0_bitmap *map_poss, struct m0_bitmap *map_avail, struct m0_bitmap *map_onln) |
|
static void | psummary_destroy (struct psummary *ps) |
|
static struct pinfo * | pinfo_new (m0_processor_nr_t cpu_max, struct m0_bitmap *map_poss, struct m0_bitmap *map_avail, struct m0_bitmap *map_onln, size_t *nr_out) |
|
void | pinfo_destroy (struct pinfo *pi) |
|
void | test_processor (void) |
|
◆ AVAIL_PROCESSOR_FILE
#define AVAIL_PROCESSOR_FILE "cpu/present" |
◆ BUF_SZ
◆ C0_LVL_FILE
◆ C0_SHMAP_FILE
#define C0_SHMAP_FILE "cpu/cpu%u/cache/index0/shared_cpu_map" |
◆ C1_LVL_FILE
◆ C1_SHMAP_FILE
#define C1_SHMAP_FILE "cpu/cpu%u/cache/index1/shared_cpu_map" |
◆ COREID_FILE
#define COREID_FILE "cpu/cpu%u/topology/core_id" |
◆ L1SZ_FILE
◆ L2SZ_FILE1
◆ L2SZ_FILE2
◆ M0_LVL_FILE
◆ M0_SHMAP_FILE
#define M0_SHMAP_FILE "cpu/cpu%u/cache/index2/shared_cpu_map" |
◆ MAX_PROCESSOR_FILE
#define MAX_PROCESSOR_FILE "cpu/kernel_max" |
◆ NUMA_FILE1
#define NUMA_FILE1 "cpu/cpu%u/node%u" |
◆ NUMA_FILE2
#define NUMA_FILE2 "node/node%u/cpu%u" |
◆ ONLN_PROCESSOR_FILE
#define ONLN_PROCESSOR_FILE "cpu/online" |
◆ PHYSID_FILE
#define PHYSID_FILE "cpu/cpu%u/topology/physical_package_id" |
◆ POSS_PROCESSOR_FILE
#define POSS_PROCESSOR_FILE "cpu/possible" |
◆ SYSFS_PATH
#define SYSFS_PATH "/sys/devices/system" |
◆ TEST_SYSFS_PATH
#define TEST_SYSFS_PATH "./cpu_test" |
◆ anonymous enum
◆ anonymous enum
Enumerator |
---|
POSS_MAP | |
AVAIL_MAP | |
ONLN_MAP | |
Definition at line 90 of file processor.c.
◆ clean_test_dataset()
static void clean_test_dataset |
( |
void |
| ) |
|
|
static |
◆ get_num_from_file()
static uint32_t get_num_from_file |
( |
const char * |
file | ) |
|
|
static |
◆ maptostr()
static void maptostr |
( |
struct m0_bitmap * |
map, |
|
|
char * |
str, |
|
|
size_t |
sz |
|
) |
| |
|
static |
◆ pinfo_destroy()
void pinfo_destroy |
( |
struct pinfo * |
pi | ) |
|
◆ pinfo_new()
◆ populate_cpu_summary()
static void populate_cpu_summary |
( |
struct psummary * |
sum | ) |
|
|
static |
◆ populate_cpus()
static void populate_cpus |
( |
struct pinfo |
cpus[], |
|
|
uint32_t |
sz |
|
) |
| |
|
static |
◆ psummary_destroy()
static void psummary_destroy |
( |
struct psummary * |
ps | ) |
|
|
static |
◆ psummary_new()
◆ test_processor()
void test_processor |
( |
void |
| ) |
|
◆ ub_fini()
static void ub_fini |
( |
void |
| ) |
|
|
static |
◆ ub_init()
static int ub_init |
( |
const char *opts |
M0_UNUSED | ) |
|
|
static |
◆ ub_init1()
static void ub_init1 |
( |
int |
i | ) |
|
|
static |
◆ ub_init2()
static void ub_init2 |
( |
int |
i | ) |
|
|
static |
◆ ub_init3()
static void ub_init3 |
( |
int |
i | ) |
|
|
static |
◆ verify_a_processor()
◆ verify_all_params()
static void verify_all_params |
( |
| ) |
|
|
static |
◆ verify_id_get()
static void verify_id_get |
( |
void |
| ) |
|
|
static |
◆ verify_map()
static void verify_map |
( |
int |
mapid | ) |
|
|
static |
◆ verify_max_processors()
static void verify_max_processors |
( |
| ) |
|
|
static |
◆ verify_processors()
static void verify_processors |
( |
| ) |
|
|
static |
◆ write_num_to_file()
static void write_num_to_file |
( |
const char * |
file, |
|
|
uint32_t |
num |
|
) |
| |
|
static |
◆ write_str_to_file()
static void write_str_to_file |
( |
const char * |
file, |
|
|
const char * |
str |
|
) |
| |
|
static |
◆ cpu_masks
uint64_t cpu_masks[] = { 1, 3, 5, 13, 21, 43, 107, 219 } |
◆ m0_processor_ub
Initial value:= {
.us_name = "processor-ub",
.us_run = {
{.ub_name = "Init1",
{.ub_name = "Init2",
{.ub_name = "Init3",
}
}
static void ub_init3(int i)
static void ub_fini(void)
static int ub_init(const char *opts M0_UNUSED)
static void ub_init2(int i)
static void ub_init1(int i)
Definition at line 728 of file processor.c.
◆ processor_info_dirp
char* processor_info_dirp |