Commit 3ae4a76a authored by Alexander Yarygin's avatar Alexander Yarygin Committed by Arnaldo Carvalho de Melo

perf kvm stat report: Save pid string in opts.target.pid

The 'perf kvm stat report' command uses the kvm->pid_str field to keep
the value of the --pid option. Let's use kvm->opts.target.pid instead.
Signed-off-by: default avatarAlexander Yarygin <yarygin@linux.vnet.ibm.com>
Acked-by: default avatarDavid Ahern <dsahern@gmail.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1409579095-12963-2-git-send-email-yarygin@linux.vnet.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 65ccb4fa
...@@ -1085,8 +1085,8 @@ static int read_events(struct perf_kvm_stat *kvm) ...@@ -1085,8 +1085,8 @@ static int read_events(struct perf_kvm_stat *kvm)
static int parse_target_str(struct perf_kvm_stat *kvm) static int parse_target_str(struct perf_kvm_stat *kvm)
{ {
if (kvm->pid_str) { if (kvm->opts.target.pid) {
kvm->pid_list = intlist__new(kvm->pid_str); kvm->pid_list = intlist__new(kvm->opts.target.pid);
if (kvm->pid_list == NULL) { if (kvm->pid_list == NULL) {
pr_err("Error parsing process id string\n"); pr_err("Error parsing process id string\n");
return -EINVAL; return -EINVAL;
...@@ -1188,7 +1188,7 @@ kvm_events_report(struct perf_kvm_stat *kvm, int argc, const char **argv) ...@@ -1188,7 +1188,7 @@ kvm_events_report(struct perf_kvm_stat *kvm, int argc, const char **argv)
OPT_STRING('k', "key", &kvm->sort_key, "sort-key", OPT_STRING('k', "key", &kvm->sort_key, "sort-key",
"key for sorting: sample(sort by samples number)" "key for sorting: sample(sort by samples number)"
" time (sort by avg time)"), " time (sort by avg time)"),
OPT_STRING('p', "pid", &kvm->pid_str, "pid", OPT_STRING('p', "pid", &kvm->opts.target.pid, "pid",
"analyze events only for given process id(s)"), "analyze events only for given process id(s)"),
OPT_END() OPT_END()
}; };
......
...@@ -92,7 +92,6 @@ struct perf_kvm_stat { ...@@ -92,7 +92,6 @@ struct perf_kvm_stat {
u64 lost_events; u64 lost_events;
u64 duration; u64 duration;
const char *pid_str;
struct intlist *pid_list; struct intlist *pid_list;
struct rb_root result; struct rb_root result;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment