]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - tools/perf/util/config.c
Merge branches 'pm-core', 'pm-qos', 'pm-domains' and 'pm-opp'
[linux.git] / tools / perf / util / config.c
index 3d906dbbef74b768ed5c1f72f08af0948afc7535..0c7d5a4975cd4a8f798533cbd15660c058652d37 100644 (file)
@@ -386,8 +386,10 @@ static int perf_buildid_config(const char *var, const char *value)
        if (!strcmp(var, "buildid.dir")) {
                const char *dir = perf_config_dirname(var, value);
 
-               if (!dir)
+               if (!dir) {
+                       pr_err("Invalid buildid directory!\n");
                        return -1;
+               }
                strncpy(buildid_dir, dir, MAXPATHLEN-1);
                buildid_dir[MAXPATHLEN-1] = '\0';
        }
@@ -405,10 +407,9 @@ static int perf_default_core_config(const char *var __maybe_unused,
 static int perf_ui_config(const char *var, const char *value)
 {
        /* Add other config variables here. */
-       if (!strcmp(var, "ui.show-headers")) {
+       if (!strcmp(var, "ui.show-headers"))
                symbol_conf.show_hist_headers = perf_config_bool(var, value);
-               return 0;
-       }
+
        return 0;
 }
 
@@ -646,8 +647,13 @@ static int perf_config_set__init(struct perf_config_set *set)
                        goto out;
                }
 
-               if (stat(user_config, &st) < 0)
+               if (stat(user_config, &st) < 0) {
+                       if (errno == ENOENT)
+                               ret = 0;
                        goto out_free;
+               }
+
+               ret = 0;
 
                if (st.st_uid && (st.st_uid != geteuid())) {
                        warning("File %s not owned by current user or root, "
@@ -655,11 +661,8 @@ static int perf_config_set__init(struct perf_config_set *set)
                        goto out_free;
                }
 
-               if (!st.st_size)
-                       goto out_free;
-
-               ret = perf_config_from_file(collect_config, user_config, set);
-
+               if (st.st_size)
+                       ret = perf_config_from_file(collect_config, user_config, set);
 out_free:
                free(user_config);
        }