Linux Perf
config.c File Reference
#include <errno.h>
#include <sys/param.h>
#include "util.h"
#include "cache.h"
#include <subcmd/exec-cmd.h>
#include "util/hist.h"
#include "util/llvm-utils.h"
#include "config.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <linux/string.h>
#include "sane_ctype.h"
Include dependency graph for config.c:

Go to the source code of this file.

Macros

#define MAXNAME   (256)
 
#define DEBUG_CACHE_DIR   ".debug"
 

Functions

static int get_next_char (void)
 
static char * parse_value (void)
 
static int iskeychar (int c)
 
static int get_value (config_fn_t fn, void *data, char *name, unsigned int len)
 
static int get_extended_base_var (char *name, int baselen, int c)
 
static int get_base_var (char *name)
 
static int perf_parse_file (config_fn_t fn, void *data)
 
static int parse_unit_factor (const char *end, unsigned long *val)
 
static int perf_parse_llong (const char *value, long long *ret)
 
static int perf_parse_long (const char *value, long *ret)
 
static void bad_config (const char *name)
 
int perf_config_u64 (u64 *dest, const char *name, const char *value)
 
int perf_config_int (int *dest, const char *name, const char *value)
 
static int perf_config_bool_or_int (const char *name, const char *value, int *is_bool)
 
int perf_config_bool (const char *name, const char *value)
 
static const char * perf_config_dirname (const char *name, const char *value)
 
static int perf_buildid_config (const char *var, const char *value)
 
static int perf_default_core_config (const char *var __maybe_unused, const char *value __maybe_unused)
 
static int perf_ui_config (const char *var, const char *value)
 
int perf_default_config (const char *var, const char *value, void *dummy __maybe_unused)
 
static int perf_config_from_file (config_fn_t fn, const char *filename, void *data)
 
const char * perf_etc_perfconfig (void)
 
static int perf_env_bool (const char *k, int def)
 
static int perf_config_system (void)
 
static int perf_config_global (void)
 
static struct perf_config_sectionfind_section (struct list_head *sections, const char *section_name)
 
static struct perf_config_itemfind_config_item (const char *name, struct perf_config_section *section)
 
static struct perf_config_sectionadd_section (struct list_head *sections, const char *section_name)
 
static struct perf_config_itemadd_config_item (struct perf_config_section *section, const char *name)
 
static int set_value (struct perf_config_item *item, const char *value)
 
static int collect_config (const char *var, const char *value, void *perf_config_set)
 
int perf_config_set__collect (struct perf_config_set *set, const char *file_name, const char *var, const char *value)
 
static int perf_config_set__init (struct perf_config_set *set)
 
struct perf_config_setperf_config_set__new (void)
 
static int perf_config__init (void)
 
int perf_config (config_fn_t fn, void *data)
 
void perf_config__exit (void)
 
void perf_config__refresh (void)
 
static void perf_config_item__delete (struct perf_config_item *item)
 
static void perf_config_section__purge (struct perf_config_section *section)
 
static void perf_config_section__delete (struct perf_config_section *section)
 
static void perf_config_set__purge (struct perf_config_set *set)
 
void perf_config_set__delete (struct perf_config_set *set)
 
int config_error_nonbool (const char *var)
 
void set_buildid_dir (const char *dir)
 

Variables

char buildid_dir [MAXPATHLEN]
 
static FILE * config_file
 
static const char * config_file_name
 
static int config_linenr
 
static int config_file_eof
 
static struct perf_config_setconfig_set
 
const char * config_exclusive_filename
 

Macro Definition Documentation

◆ DEBUG_CACHE_DIR

#define DEBUG_CACHE_DIR   ".debug"

Definition at line 29 of file config.c.

◆ MAXNAME

#define MAXNAME   (256)

Definition at line 27 of file config.c.

Function Documentation

◆ add_config_item()

static struct perf_config_item* add_config_item ( struct perf_config_section section,
const char *  name 
)
static

Definition at line 546 of file config.c.

Here is the call graph for this function:

◆ add_section()

static struct perf_config_section* add_section ( struct list_head *  sections,
const char *  section_name 
)
static

Definition at line 526 of file config.c.

Here is the call graph for this function:

◆ bad_config()

static void bad_config ( const char *  name)
static

Definition at line 340 of file config.c.

◆ collect_config()

static int collect_config ( const char *  var,
const char *  value,
void *  perf_config_set 
)
static

Definition at line 577 of file config.c.

Here is the call graph for this function:

◆ config_error_nonbool()

int config_error_nonbool ( const char *  var)

Definition at line 805 of file config.c.

◆ find_config_item()

static struct perf_config_item* find_config_item ( const char *  name,
struct perf_config_section section 
)
static

Definition at line 514 of file config.c.

◆ find_section()

static struct perf_config_section* find_section ( struct list_head *  sections,
const char *  section_name 
)
static

Definition at line 502 of file config.c.

◆ get_base_var()

static int get_base_var ( char *  name)
static

Definition at line 206 of file config.c.

Here is the call graph for this function:

◆ get_extended_base_var()

static int get_extended_base_var ( char *  name,
int  baselen,
int  c 
)
static

Definition at line 170 of file config.c.

Here is the call graph for this function:

◆ get_next_char()

static int get_next_char ( void  )
static

Definition at line 42 of file config.c.

◆ get_value()

static int get_value ( config_fn_t  fn,
void *  data,
char *  name,
unsigned int  len 
)
static

Definition at line 139 of file config.c.

Here is the call graph for this function:

◆ iskeychar()

static int iskeychar ( int  c)
inlinestatic

Definition at line 134 of file config.c.

◆ parse_unit_factor()

static int parse_unit_factor ( const char *  end,
unsigned long *  val 
)
static

Definition at line 292 of file config.c.

◆ parse_value()

static char* parse_value ( void  )
static

Definition at line 68 of file config.c.

Here is the call graph for this function:

◆ perf_buildid_config()

static int perf_buildid_config ( const char *  var,
const char *  value 
)
static

Definition at line 402 of file config.c.

Here is the call graph for this function:

◆ perf_config()

int perf_config ( config_fn_t  fn,
void *  data 
)

Definition at line 718 of file config.c.

Here is the call graph for this function:

◆ perf_config__exit()

void perf_config__exit ( void  )

Definition at line 746 of file config.c.

Here is the call graph for this function:

◆ perf_config__init()

static int perf_config__init ( void  )
static

Definition at line 710 of file config.c.

Here is the call graph for this function:

◆ perf_config__refresh()

void perf_config__refresh ( void  )

Definition at line 752 of file config.c.

Here is the call graph for this function:

◆ perf_config_bool()

int perf_config_bool ( const char *  name,
const char *  value 
)

Definition at line 389 of file config.c.

Here is the call graph for this function:

◆ perf_config_bool_or_int()

static int perf_config_bool_or_int ( const char *  name,
const char *  value,
int *  is_bool 
)
static

Definition at line 372 of file config.c.

Here is the call graph for this function:

◆ perf_config_dirname()

static const char* perf_config_dirname ( const char *  name,
const char *  value 
)
static

Definition at line 395 of file config.c.

◆ perf_config_from_file()

static int perf_config_from_file ( config_fn_t  fn,
const char *  filename,
void *  data 
)
static

Definition at line 460 of file config.c.

Here is the call graph for this function:

◆ perf_config_global()

static int perf_config_global ( void  )
static

Definition at line 497 of file config.c.

Here is the call graph for this function:

◆ perf_config_int()

int perf_config_int ( int *  dest,
const char *  name,
const char *  value 
)

Definition at line 361 of file config.c.

Here is the call graph for this function:

◆ perf_config_item__delete()

static void perf_config_item__delete ( struct perf_config_item item)
static

Definition at line 758 of file config.c.

Here is the call graph for this function:

◆ perf_config_section__delete()

static void perf_config_section__delete ( struct perf_config_section section)
static

Definition at line 775 of file config.c.

Here is the call graph for this function:

◆ perf_config_section__purge()

static void perf_config_section__purge ( struct perf_config_section section)
static

Definition at line 765 of file config.c.

Here is the call graph for this function:

◆ perf_config_set__collect()

int perf_config_set__collect ( struct perf_config_set set,
const char *  file_name,
const char *  var,
const char *  value 
)

Definition at line 638 of file config.c.

Here is the call graph for this function:

◆ perf_config_set__delete()

void perf_config_set__delete ( struct perf_config_set set)

Definition at line 792 of file config.c.

Here is the call graph for this function:

◆ perf_config_set__init()

static int perf_config_set__init ( struct perf_config_set set)
static

Definition at line 645 of file config.c.

Here is the call graph for this function:

◆ perf_config_set__new()

struct perf_config_set* perf_config_set__new ( void  )

Definition at line 698 of file config.c.

Here is the call graph for this function:

◆ perf_config_set__purge()

static void perf_config_set__purge ( struct perf_config_set set)
static

Definition at line 782 of file config.c.

Here is the call graph for this function:

◆ perf_config_system()

static int perf_config_system ( void  )
static

Definition at line 492 of file config.c.

Here is the call graph for this function:

◆ perf_config_u64()

int perf_config_u64 ( u64 *  dest,
const char *  name,
const char *  value 
)

Definition at line 348 of file config.c.

Here is the call graph for this function:

◆ perf_default_config()

int perf_default_config ( const char *  var,
const char *  value,
void *dummy  __maybe_unused 
)

Definition at line 435 of file config.c.

Here is the call graph for this function:

◆ perf_default_core_config()

static int perf_default_core_config ( const char *var  __maybe_unused,
const char *value  __maybe_unused 
)
static

Definition at line 419 of file config.c.

◆ perf_env_bool()

static int perf_env_bool ( const char *  k,
int  def 
)
static

Definition at line 486 of file config.c.

Here is the call graph for this function:

◆ perf_etc_perfconfig()

const char* perf_etc_perfconfig ( void  )

Definition at line 478 of file config.c.

◆ perf_parse_file()

static int perf_parse_file ( config_fn_t  fn,
void *  data 
)
static

Definition at line 226 of file config.c.

Here is the call graph for this function:

◆ perf_parse_llong()

static int perf_parse_llong ( const char *  value,
long long *  ret 
)
static

Definition at line 311 of file config.c.

Here is the call graph for this function:

◆ perf_parse_long()

static int perf_parse_long ( const char *  value,
long *  ret 
)
static

Definition at line 326 of file config.c.

Here is the call graph for this function:

◆ perf_ui_config()

static int perf_ui_config ( const char *  var,
const char *  value 
)
static

Definition at line 426 of file config.c.

Here is the call graph for this function:

◆ set_buildid_dir()

void set_buildid_dir ( const char *  dir)

Definition at line 811 of file config.c.

◆ set_value()

static int set_value ( struct perf_config_item item,
const char *  value 
)
static

Definition at line 565 of file config.c.

Variable Documentation

◆ buildid_dir

char buildid_dir[MAXPATHLEN]

Definition at line 32 of file config.c.

◆ config_exclusive_filename

const char* config_exclusive_filename

Definition at line 40 of file config.c.

◆ config_file

FILE* config_file
static

Definition at line 34 of file config.c.

◆ config_file_eof

int config_file_eof
static

Definition at line 37 of file config.c.

◆ config_file_name

const char* config_file_name
static

Definition at line 35 of file config.c.

◆ config_linenr

int config_linenr
static

Definition at line 36 of file config.c.

◆ config_set

struct perf_config_set* config_set
static

Definition at line 38 of file config.c.