summaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-mem.c
diff options
context:
space:
mode:
authorWang Nan <wangnan0@huawei.com>2015-03-20 03:57:52 +0100
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-03-20 21:49:51 +0100
commit8b8ca6e15e392b366a7d69c6bf1abaae005f2b63 (patch)
tree64df00847713dd35e37580f5bf9ff615e0574a1b /tools/perf/builtin-mem.c
parentperf tools: Fix race in build_id_cache__add_s() (diff)
downloadlinux-8b8ca6e15e392b366a7d69c6bf1abaae005f2b63.tar.xz
linux-8b8ca6e15e392b366a7d69c6bf1abaae005f2b63.zip
perf tools: Don't allow empty argument for field-separator
Both 'perf diff' and 'perf mem' have 'field-separator' option, which causes segfault if passed with empty string. This patch uses previously introduced 'OPT_STRING_NOEMPTY' option macro to prevent fault. Signed-off-by: Wang Nan <wangnan0@huawei.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: pi3orama@163.com Cc: Namhyung Kim <namhyung@kernel.org> Cc: Zefan Li <lizefan@huawei.com> Link: http://lkml.kernel.org/r/1426820272-23302-1-git-send-email-wangnan0@huawei.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-mem.c')
-rw-r--r--tools/perf/builtin-mem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c
index 46c69318de84..b4dcf0bfc029 100644
--- a/tools/perf/builtin-mem.c
+++ b/tools/perf/builtin-mem.c
@@ -286,7 +286,7 @@ int cmd_mem(int argc, const char **argv, const char *prefix __maybe_unused)
"input file name"),
OPT_STRING('C', "cpu", &mem.cpu_list, "cpu",
"list of cpus to profile"),
- OPT_STRING('x', "field-separator", &symbol_conf.field_sep,
+ OPT_STRING_NOEMPTY('x', "field-separator", &symbol_conf.field_sep,
"separator",
"separator for columns, no spaces will be added"
" between columns '.' is reserved."),