提交 e441298f 编写于 作者: L Li Huafei 提交者: Zheng Zengkai

Revert "perf kmem: Do not pass additional arguments

to 'perf record'"

hulk inclusion
category: bugfix
bugzilla: 51797
CVE: NA

--------------------------------

This reverts commit 5549b4660d62946828db854252e5fb66e6007e88.

There should be no problem with mainline. Follow the prompts given
by 'perf kmem -h' to use it.
Signed-off-by: NLi Huafei <lihuafei1@huawei.com>
Reviewed-by: NKuohai Xu <xukuohai@huawei.com>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 0a2c3dde
...@@ -82,9 +82,6 @@ static unsigned long nr_allocs, nr_cross_allocs; ...@@ -82,9 +82,6 @@ static unsigned long nr_allocs, nr_cross_allocs;
static struct perf_time_interval ptime; static struct perf_time_interval ptime;
const char *time_str; const char *time_str;
/* output file of 'perf kmem record' */
static const char *output_name;
static int insert_alloc_stat(unsigned long call_site, unsigned long ptr, static int insert_alloc_stat(unsigned long call_site, unsigned long ptr,
int bytes_req, int bytes_alloc, int cpu) int bytes_req, int bytes_alloc, int cpu)
{ {
...@@ -1851,8 +1848,6 @@ static int __cmd_record(int argc, const char **argv) ...@@ -1851,8 +1848,6 @@ static int __cmd_record(int argc, const char **argv)
rec_argc += ARRAY_SIZE(slab_events); rec_argc += ARRAY_SIZE(slab_events);
if (kmem_page) if (kmem_page)
rec_argc += ARRAY_SIZE(page_events) + 1; /* for -g */ rec_argc += ARRAY_SIZE(page_events) + 1; /* for -g */
if (output_name)
rec_argc += 2;
rec_argv = calloc(rec_argc + 1, sizeof(char *)); rec_argv = calloc(rec_argc + 1, sizeof(char *));
...@@ -1873,11 +1868,6 @@ static int __cmd_record(int argc, const char **argv) ...@@ -1873,11 +1868,6 @@ static int __cmd_record(int argc, const char **argv)
rec_argv[i] = strdup(page_events[j]); rec_argv[i] = strdup(page_events[j]);
} }
if (output_name) {
rec_argv[i++] = strdup("-o");
rec_argv[i++] = strdup(output_name);
}
for (j = 1; j < (unsigned int)argc; j++, i++) for (j = 1; j < (unsigned int)argc; j++, i++)
rec_argv[i] = argv[j]; rec_argv[i] = argv[j];
...@@ -1909,7 +1899,6 @@ int cmd_kmem(int argc, const char **argv) ...@@ -1909,7 +1899,6 @@ int cmd_kmem(int argc, const char **argv)
}; };
const struct option kmem_options[] = { const struct option kmem_options[] = {
OPT_STRING('i', "input", &input_name, "file", "input file name"), OPT_STRING('i', "input", &input_name, "file", "input file name"),
OPT_STRING('o', "output", &output_name, "file", "output file name"),
OPT_INCR('v', "verbose", &verbose, OPT_INCR('v', "verbose", &verbose,
"be more verbose (show symbol address, etc)"), "be more verbose (show symbol address, etc)"),
OPT_CALLBACK_NOOPT(0, "caller", NULL, NULL, OPT_CALLBACK_NOOPT(0, "caller", NULL, NULL,
...@@ -1944,7 +1933,8 @@ int cmd_kmem(int argc, const char **argv) ...@@ -1944,7 +1933,8 @@ int cmd_kmem(int argc, const char **argv)
return ret; return ret;
argc = parse_options_subcommand(argc, argv, kmem_options, argc = parse_options_subcommand(argc, argv, kmem_options,
kmem_subcommands, kmem_usage, 0); kmem_subcommands, kmem_usage,
PARSE_OPT_STOP_AT_NON_OPTION);
if (!argc) if (!argc)
usage_with_options(kmem_usage, kmem_options); usage_with_options(kmem_usage, kmem_options);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册