• Home
  • Raw
  • Download

Lines Matching +full:key +full:- +full:home

1 // SPDX-License-Identifier: GPL-2.0
16 #include <subcmd/exec-cmd.h>
19 #include "util/llvm-utils.h" /* perf_llvm_config */
21 #include "build-id.h"
82 if (len >= sizeof(value) - 1) in parse_value()
132 quote = 1-quote; in parse_value()
141 return isalnum(c) || c == '-' || c == '_'; in iskeychar()
158 return -1; in get_value()
167 return -1; in get_value()
170 return -1; in get_value()
179 return -1; in get_extended_base_var()
185 return -1; in get_extended_base_var()
192 return -1; in get_extended_base_var()
198 return -1; in get_extended_base_var()
202 return -1; in get_extended_base_var()
207 return -1; in get_extended_base_var()
218 return -1; in get_base_var()
224 return -1; in get_base_var()
226 return -1; in get_base_var()
245 /* We are at the file beginning; skip UTF8-encoded BOM in perf_parse_file()
294 return -1; in perf_parse_file()
359 return -1; in perf_config_u64()
371 return -1; in perf_config_int()
383 return -1; in perf_config_u8()
403 return perf_config_int(&ret, name, value) < 0 ? -1 : ret; in perf_config_bool_or_int()
427 return -1; in perf_buildid_config()
429 strncpy(buildid_dir, dir, MAXPATHLEN-1); in perf_buildid_config()
430 buildid_dir[MAXPATHLEN-1] = '\0'; in perf_buildid_config()
439 if (!strcmp(var, "core.proc-map-timeout")) in perf_default_core_config()
449 if (!strcmp(var, "ui.show-headers")) in perf_ui_config()
457 if (!strcmp(var, "stat.big-num")) in perf_stat_config()
476 if (strstarts(var, "call-graph.")) in perf_default_config()
497 ret = -1; in perf_config_from_file()
540 if (!strcmp(section->name, section_name)) in find_section()
551 list_for_each_entry(item, &section->items, node) in find_config_item()
552 if (!strcmp(item->name, name)) in find_config_item()
566 INIT_LIST_HEAD(&section->items); in add_section()
567 section->name = strdup(section_name); in add_section()
568 if (!section->name) { in add_section()
574 list_add_tail(&section->node, sections); in add_section()
586 item->name = strdup(name); in add_config_item()
587 if (!item->name) { in add_config_item()
593 list_add_tail(&item->node, &section->items); in add_config_item()
602 return -1; in set_value()
604 zfree(&item->value); in set_value()
605 item->value = val; in set_value()
612 int ret = -1; in collect_config()
613 char *ptr, *key; in collect_config() local
621 return -1; in collect_config()
623 sections = &set->sections; in collect_config()
624 key = ptr = strdup(var); in collect_config()
625 if (!key) { in collect_config()
627 return -1; in collect_config()
655 section->from_system_config = true; in collect_config()
656 item->from_system_config = true; in collect_config()
658 section->from_system_config = false; in collect_config()
659 item->from_system_config = false; in collect_config()
665 free(key); in collect_config()
678 int ret = -1; in perf_config_set__init()
679 const char *home = NULL; in perf_config_set__init() local
691 home = getenv("HOME"); in perf_config_set__init()
695 * - there is no place to read it from (HOME) in perf_config_set__init()
696 * - we are asked not to (PERF_CONFIG_NOGLOBAL=1) in perf_config_set__init()
698 if (!home || !*home || !perf_config_global()) in perf_config_set__init()
701 user_config = strdup(mkpath("%s/.perfconfig", home)); in perf_config_set__init()
703 pr_warning("Not enough memory to process %s/.perfconfig, ignoring it.", home); in perf_config_set__init()
734 INIT_LIST_HEAD(&set->sections); in perf_config_set__new()
752 char key[BUFSIZ]; in perf_config() local
757 return -1; in perf_config()
760 char *value = item->value; in perf_config()
763 scnprintf(key, sizeof(key), "%s.%s", in perf_config()
764 section->name, item->name); in perf_config()
765 ret = fn(key, value, data); in perf_config()
767 pr_err("Error: wrong config key-value pair %s=%s\n", in perf_config()
768 key, value); in perf_config()
795 zfree(&item->name); in perf_config_item__delete()
796 zfree(&item->value); in perf_config_item__delete()
804 list_for_each_entry_safe(item, tmp, &section->items, node) { in perf_config_section__purge()
805 list_del_init(&item->node); in perf_config_section__purge()
813 zfree(&section->name); in perf_config_section__delete()
821 list_for_each_entry_safe(section, tmp, &set->sections, node) { in perf_config_set__purge()
822 list_del_init(&section->node); in perf_config_set__purge()
843 return -1; in config_error_nonbool()
851 /* default to $HOME/.debug */ in set_buildid_dir()
853 char *home = getenv("HOME"); in set_buildid_dir() local
855 if (home) { in set_buildid_dir()
857 home, DEBUG_CACHE_DIR); in set_buildid_dir()
859 strncpy(buildid_dir, DEBUG_CACHE_DIR, MAXPATHLEN-1); in set_buildid_dir()
861 buildid_dir[MAXPATHLEN-1] = '\0'; in set_buildid_dir()