浏览代码

perf record: Avoid duplicate call of perf_default_config()

We have brought perf_default_config to the very beginning at main(), so
it no need to call perf_default_config() once more for most of config in
perf-record but only for record.call-graph.

Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1520853957-36106-2-git-send-email-xieyisheng1@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Yisheng Xie 7 年之前
父节点
当前提交
cff17205d6
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 5 3
      tools/perf/builtin-record.c

+ 5 - 3
tools/perf/builtin-record.c

@@ -1279,10 +1279,12 @@ static int perf_record_config(const char *var, const char *value, void *cb)
 			return -1;
 			return -1;
 		return 0;
 		return 0;
 	}
 	}
-	if (!strcmp(var, "record.call-graph"))
-		var = "call-graph.record-mode"; /* fall-through */
+	if (!strcmp(var, "record.call-graph")) {
+		var = "call-graph.record-mode";
+		return perf_default_config(var, value, cb);
+	}
 
 
-	return perf_default_config(var, value, cb);
+	return 0;
 }
 }
 
 
 struct clockid_map {
 struct clockid_map {