Lines Matching +full:- +full:section

1 // SPDX-License-Identifier: GPL-2.0
17 #include <subcmd/exec-cmd.h>
23 #include "build-id.h"
50 .ctl_fd = -1,
51 .ctl_fd_ack = -1,
100 if (len >= sizeof(value) - 1) in parse_value()
150 quote = 1-quote; in parse_value()
159 return isalnum(c) || c == '-' || c == '_'; in iskeychar()
176 return -1; in get_value()
185 return -1; in get_value()
188 return -1; in get_value()
197 return -1; in get_extended_base_var()
203 return -1; in get_extended_base_var()
210 return -1; in get_extended_base_var()
216 return -1; in get_extended_base_var()
220 return -1; in get_extended_base_var()
225 return -1; in get_extended_base_var()
236 return -1; in get_base_var()
242 return -1; in get_base_var()
244 return -1; in get_base_var()
263 /* We are at the file beginning; skip UTF8-encoded BOM in perf_parse_file()
312 return -1; in perf_parse_file()
377 return -1; in perf_config_u64()
389 return -1; in perf_config_int()
401 return -1; in perf_config_u8()
421 return perf_config_int(&ret, name, value) < 0 ? -1 : ret; in perf_config_bool_or_int()
445 return -1; in perf_buildid_config()
447 strncpy(buildid_dir, dir, MAXPATHLEN-1); in perf_buildid_config()
448 buildid_dir[MAXPATHLEN-1] = '\0'; in perf_buildid_config()
456 if (!strcmp(var, "core.proc-map-timeout")) in perf_default_core_config()
459 if (!strcmp(var, "core.addr2line-timeout")) in perf_default_core_config()
469 if (!strcmp(var, "ui.show-headers")) in perf_ui_config()
487 if (!strcmp(var, "stat.big-num")) in perf_stat_config()
490 if (!strcmp(var, "stat.no-csv-summary")) in perf_stat_config()
493 if (!strcmp(var, "stat.bpf-counter-events")) in perf_stat_config()
512 if (strstarts(var, "call-graph.")) in perf_default_config()
530 ret = -1; in perf_config_from_file()
578 * - there is no place to read it from (HOME) in home_perfconfig()
579 * - we are asked not to (PERF_CONFIG_NOGLOBAL=1) in home_perfconfig()
624 struct perf_config_section *section; in find_section() local
626 list_for_each_entry(section, sections, node) in find_section()
627 if (!strcmp(section->name, section_name)) in find_section()
628 return section; in find_section()
634 struct perf_config_section *section) in find_config_item() argument
638 list_for_each_entry(item, &section->items, node) in find_config_item()
639 if (!strcmp(item->name, name)) in find_config_item()
648 struct perf_config_section *section = zalloc(sizeof(*section)); in add_section() local
650 if (!section) in add_section()
653 INIT_LIST_HEAD(&section->items); in add_section()
654 section->name = strdup(section_name); in add_section()
655 if (!section->name) { in add_section()
657 free(section); in add_section()
661 list_add_tail(&section->node, sections); in add_section()
662 return section; in add_section()
665 static struct perf_config_item *add_config_item(struct perf_config_section *section, in add_config_item() argument
673 item->name = strdup(name); in add_config_item()
674 if (!item->name) { in add_config_item()
680 list_add_tail(&item->node, &section->items); in add_config_item()
689 return -1; in set_value()
691 zfree(&item->value); in set_value()
692 item->value = val; in set_value()
699 int ret = -1; in collect_config()
702 struct perf_config_section *section = NULL; in collect_config() local
708 return -1; in collect_config()
710 sections = &set->sections; in collect_config()
714 return -1; in collect_config()
722 section = find_section(sections, section_name); in collect_config()
723 if (!section) { in collect_config()
724 section = add_section(sections, section_name); in collect_config()
725 if (!section) in collect_config()
729 item = find_config_item(name, section); in collect_config()
731 item = add_config_item(section, name); in collect_config()
742 section->from_system_config = true; in collect_config()
743 item->from_system_config = true; in collect_config()
745 section->from_system_config = false; in collect_config()
746 item->from_system_config = false; in collect_config()
765 int ret = -1; in perf_config_set__init()
788 INIT_LIST_HEAD(&set->sections); in perf_config_set__new()
800 INIT_LIST_HEAD(&set->sections); in perf_config_set__load_file()
820 struct perf_config_section *section; in perf_config_set() local
823 perf_config_set__for_each_entry(set, section, item) { in perf_config_set()
824 char *value = item->value; in perf_config_set()
828 section->name, item->name); in perf_config_set()
831 pr_err("Error in the given config file: wrong config key-value pair %s=%s\n", in perf_config_set()
848 return -1; in perf_config()
867 zfree(&item->name); in perf_config_item__delete()
868 zfree(&item->value); in perf_config_item__delete()
872 static void perf_config_section__purge(struct perf_config_section *section) in perf_config_section__purge() argument
876 list_for_each_entry_safe(item, tmp, &section->items, node) { in perf_config_section__purge()
877 list_del_init(&item->node); in perf_config_section__purge()
882 static void perf_config_section__delete(struct perf_config_section *section) in perf_config_section__delete() argument
884 perf_config_section__purge(section); in perf_config_section__delete()
885 zfree(&section->name); in perf_config_section__delete()
886 free(section); in perf_config_section__delete()
891 struct perf_config_section *section, *tmp; in perf_config_set__purge() local
893 list_for_each_entry_safe(section, tmp, &set->sections, node) { in perf_config_set__purge()
894 list_del_init(&section->node); in perf_config_set__purge()
895 perf_config_section__delete(section); in perf_config_set__purge()
915 return -1; in config_error_nonbool()
931 strncpy(buildid_dir, DEBUG_CACHE_DIR, MAXPATHLEN-1); in set_buildid_dir()
933 buildid_dir[MAXPATHLEN-1] = '\0'; in set_buildid_dir()
951 if (!strcmp(var, d->name)) in perf_config_scan_cb()
952 d->ret = vsscanf(value, d->fmt, d->args); in perf_config_scan_cb()
975 if (!strcmp(var, d->name)) in perf_config_get_cb()
976 d->value = value; in perf_config_get_cb()