Lines Matching +full:- +full:section
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()
537 struct perf_config_section *section; in find_section() local
539 list_for_each_entry(section, sections, node) in find_section()
540 if (!strcmp(section->name, section_name)) in find_section()
541 return section; in find_section()
547 struct perf_config_section *section) in find_config_item() argument
551 list_for_each_entry(item, §ion->items, node) in find_config_item()
552 if (!strcmp(item->name, name)) in find_config_item()
561 struct perf_config_section *section = zalloc(sizeof(*section)); in add_section() local
563 if (!section) in add_section()
566 INIT_LIST_HEAD(§ion->items); in add_section()
567 section->name = strdup(section_name); in add_section()
568 if (!section->name) { in add_section()
570 free(section); in add_section()
574 list_add_tail(§ion->node, sections); in add_section()
575 return section; in add_section()
578 static struct perf_config_item *add_config_item(struct perf_config_section *section, in add_config_item() argument
586 item->name = strdup(name); in add_config_item()
587 if (!item->name) { in add_config_item()
593 list_add_tail(&item->node, §ion->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()
615 struct perf_config_section *section = NULL; in collect_config() local
621 return -1; in collect_config()
623 sections = &set->sections; in collect_config()
627 return -1; in collect_config()
635 section = find_section(sections, section_name); in collect_config()
636 if (!section) { in collect_config()
637 section = add_section(sections, section_name); in collect_config()
638 if (!section) in collect_config()
642 item = find_config_item(name, section); in collect_config()
644 item = add_config_item(section, name); 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()
678 int ret = -1; 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()
734 INIT_LIST_HEAD(&set->sections); in perf_config_set__new()
753 struct perf_config_section *section; in perf_config() local
757 return -1; in perf_config()
759 perf_config_set__for_each_entry(config_set, section, item) { in perf_config()
760 char *value = item->value; in perf_config()
764 section->name, item->name); in perf_config()
767 pr_err("Error: wrong config key-value pair %s=%s\n", in perf_config()
795 zfree(&item->name); in perf_config_item__delete()
796 zfree(&item->value); in perf_config_item__delete()
800 static void perf_config_section__purge(struct perf_config_section *section) in perf_config_section__purge() argument
804 list_for_each_entry_safe(item, tmp, §ion->items, node) { in perf_config_section__purge()
805 list_del_init(&item->node); in perf_config_section__purge()
810 static void perf_config_section__delete(struct perf_config_section *section) in perf_config_section__delete() argument
812 perf_config_section__purge(section); in perf_config_section__delete()
813 zfree(§ion->name); in perf_config_section__delete()
814 free(section); in perf_config_section__delete()
819 struct perf_config_section *section, *tmp; in perf_config_set__purge() local
821 list_for_each_entry_safe(section, tmp, &set->sections, node) { in perf_config_set__purge()
822 list_del_init(§ion->node); in perf_config_set__purge()
823 perf_config_section__delete(section); in perf_config_set__purge()
843 return -1; in config_error_nonbool()
859 strncpy(buildid_dir, DEBUG_CACHE_DIR, MAXPATHLEN-1); in set_buildid_dir()
861 buildid_dir[MAXPATHLEN-1] = '\0'; in set_buildid_dir()