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

1 // SPDX-License-Identifier: GPL-2.0
16 #include <subcmd/exec-cmd.h>
22 #include "build-id.h"
83 if (len >= sizeof(value) - 1)
133 quote = 1-quote;
142 return isalnum(c) || c == '-' || c == '_';
159 return -1;
168 return -1;
171 return -1;
180 return -1;
186 return -1;
193 return -1;
199 return -1;
203 return -1;
208 return -1;
219 return -1;
225 return -1;
227 return -1;
246 /* We are at the file beginning; skip UTF8-encoded BOM
295 return -1;
360 return -1;
372 return -1;
384 return -1;
404 return perf_config_int(&ret, name, value) < 0 ? -1 : ret;
428 return -1;
430 strncpy(buildid_dir, dir, MAXPATHLEN-1);
431 buildid_dir[MAXPATHLEN-1] = '\0';
439 if (!strcmp(var, "core.proc-map-timeout"))
442 if (!strcmp(var, "core.addr2line-timeout"))
452 if (!strcmp(var, "ui.show-headers"))
460 if (!strcmp(var, "stat.big-num"))
463 if (!strcmp(var, "stat.no-csv-summary"))
466 if (!strcmp(var, "stat.bpf-counter-events"))
485 if (strstarts(var, "call-graph."))
503 ret = -1;
542 const char *home = NULL;
547 home = getenv("HOME");
551 * - there is no place to read it from (HOME)
552 * - we are asked not to (PERF_CONFIG_NOGLOBAL=1)
554 if (!home || !*home || !perf_config_global())
557 config = strdup(mkpath(path, sizeof(path), "%s/.perfconfig", home));
559 pr_warning("Not enough memory to process %s/.perfconfig, ignoring it.\n", home);
600 if (!strcmp(section->name, section_name))
611 list_for_each_entry(item, &section->items, node)
612 if (!strcmp(item->name, name))
626 INIT_LIST_HEAD(&section->items);
627 section->name = strdup(section_name);
628 if (!section->name) {
634 list_add_tail(&section->node, sections);
646 item->name = strdup(name);
647 if (!item->name) {
653 list_add_tail(&item->node, &section->items);
662 return -1;
664 zfree(&item->value);
665 item->value = val;
672 int ret = -1;
673 char *ptr, *key;
681 return -1;
683 sections = &set->sections;
684 key = ptr = strdup(var);
685 if (!key) {
687 return -1;
715 section->from_system_config = true;
716 item->from_system_config = true;
718 section->from_system_config = false;
719 item->from_system_config = false;
725 free(key);
738 int ret = -1;
761 INIT_LIST_HEAD(&set->sections);
773 INIT_LIST_HEAD(&set->sections);
792 char key[BUFSIZ];
797 char *value = item->value;
800 scnprintf(key, sizeof(key), "%s.%s",
801 section->name, item->name);
802 ret = fn(key, value, data);
804 pr_err("Error in the given config file: wrong config key-value pair %s=%s\n",
805 key, value);
821 return -1;
840 zfree(&item->name);
841 zfree(&item->value);
849 list_for_each_entry_safe(item, tmp, &section->items, node) {
850 list_del_init(&item->node);
858 zfree(&section->name);
866 list_for_each_entry_safe(section, tmp, &set->sections, node) {
867 list_del_init(&section->node);
888 return -1;
896 /* default to $HOME/.debug */
898 char *home = getenv("HOME");
900 if (home) {
902 home, DEBUG_CACHE_DIR);
904 strncpy(buildid_dir, DEBUG_CACHE_DIR, MAXPATHLEN-1);
906 buildid_dir[MAXPATHLEN-1] = '\0';
924 if (!strcmp(var, d->name))
925 d->ret = vsscanf(value, d->fmt, d->args);
948 if (!strcmp(var, d->name))
949 d->value = value;