All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2 0/3] perf kvm stat report: extend the title bar output
@ 2014-09-01 13:44 Alexander Yarygin
  2014-09-01 13:44 ` [PATCH 1/3] perf kvm stat report: Save pid string in opts.target.pid Alexander Yarygin
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Alexander Yarygin @ 2014-09-01 13:44 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexander Yarygin, Arnaldo Carvalho de Melo,
	Christian Borntraeger, David Ahern, Ingo Molnar, Jiri Olsa,
	Paul Mackerras, Peter Zijlstra

Hello,

This patchset is intended to add information about current pid to the
"Analyze events for " title bar for the 'perf kvm stat report' command,
when it's running with --pid option. To do so, patches 1-2 sync values
of kvm->opts.target in 'report' with 'live' command and patch 3 reuses
'live' specific code to print desirable information.

v2 changes:
   - Split the big patch into 3 small patches
   - Simplified the way to enable target.system_wide flag

Thanks.

Alexander Yarygin (3):
  perf kvm stat report: Save pid string in kvm->opts.target.pid
  perf kvm stat report: Enable the target.system_wide flag
  perf kvm stat report: Unify the title bar output

 tools/perf/builtin-kvm.c   |   23 ++++++++++++-----------
 tools/perf/util/kvm-stat.h |    1 -
 2 files changed, 12 insertions(+), 12 deletions(-)

--
1.7.9.5


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/3] perf kvm stat report: Save pid string in opts.target.pid
  2014-09-01 13:44 [PATCHv2 0/3] perf kvm stat report: extend the title bar output Alexander Yarygin
@ 2014-09-01 13:44 ` Alexander Yarygin
  2014-09-19  5:19   ` [tip:perf/core] " tip-bot for Alexander Yarygin
  2014-09-01 13:44 ` [PATCH 2/3] perf kvm stat report: Enable the target.system_wide flag Alexander Yarygin
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Alexander Yarygin @ 2014-09-01 13:44 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexander Yarygin, Arnaldo Carvalho de Melo,
	Christian Borntraeger, David Ahern, Ingo Molnar, Jiri Olsa,
	Paul Mackerras, Peter Zijlstra

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.

Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
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>
Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
---
 tools/perf/builtin-kvm.c   |    6 +++---
 tools/perf/util/kvm-stat.h |    1 -
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index 43367eb..ad73476 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -1088,8 +1088,8 @@ static int read_events(struct perf_kvm_stat *kvm)

 static int parse_target_str(struct perf_kvm_stat *kvm)
 {
-	if (kvm->pid_str) {
-		kvm->pid_list = intlist__new(kvm->pid_str);
+	if (kvm->opts.target.pid) {
+		kvm->pid_list = intlist__new(kvm->opts.target.pid);
 		if (kvm->pid_list == NULL) {
 			pr_err("Error parsing process id string\n");
 			return -EINVAL;
@@ -1191,7 +1191,7 @@ kvm_events_report(struct perf_kvm_stat *kvm, int argc, const char **argv)
 		OPT_STRING('k', "key", &kvm->sort_key, "sort-key",
 			    "key for sorting: sample(sort by samples number)"
 			    " 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)"),
 		OPT_END()
 	};
diff --git a/tools/perf/util/kvm-stat.h b/tools/perf/util/kvm-stat.h
index 0b5a8cd..cf1d7913 100644
--- a/tools/perf/util/kvm-stat.h
+++ b/tools/perf/util/kvm-stat.h
@@ -92,7 +92,6 @@ struct perf_kvm_stat {
 	u64 lost_events;
 	u64 duration;

-	const char *pid_str;
 	struct intlist *pid_list;

 	struct rb_root result;
--
1.7.9.5


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/3] perf kvm stat report: Enable the target.system_wide flag
  2014-09-01 13:44 [PATCHv2 0/3] perf kvm stat report: extend the title bar output Alexander Yarygin
  2014-09-01 13:44 ` [PATCH 1/3] perf kvm stat report: Save pid string in opts.target.pid Alexander Yarygin
@ 2014-09-01 13:44 ` Alexander Yarygin
  2014-09-19  5:19   ` [tip:perf/core] " tip-bot for Alexander Yarygin
  2014-09-01 13:44 ` [PATCH 3/3] perf kvm stat report: Unify the title bar output Alexander Yarygin
  2014-09-01 18:13 ` [PATCHv2 0/3] perf kvm stat report: extend " David Ahern
  3 siblings, 1 reply; 8+ messages in thread
From: Alexander Yarygin @ 2014-09-01 13:44 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexander Yarygin, Arnaldo Carvalho de Melo,
	Christian Borntraeger, David Ahern, Ingo Molnar, Jiri Olsa,
	Paul Mackerras, Peter Zijlstra

The 'perf kvm stat report' command can be used to analyze events either
for system wide or for specific pids. Let's enable
kvm->opts.target.system_wide flag when 'report' command is running for
system-wide analyzing. This helps to sync kvm->opts.target values in
'report' and 'live' commands.

Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
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>
Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
---
 tools/perf/builtin-kvm.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index ad73476..b7fa0bc 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -1212,6 +1212,9 @@ kvm_events_report(struct perf_kvm_stat *kvm, int argc, const char **argv)
 					   kvm_events_report_options);
 	}
 
+	if (!kvm->opts.target.pid)
+		kvm->opts.target.system_wide = true;
+
 	return kvm_events_report_vcpu(kvm);
 }
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/3] perf kvm stat report: Unify the title bar output
  2014-09-01 13:44 [PATCHv2 0/3] perf kvm stat report: extend the title bar output Alexander Yarygin
  2014-09-01 13:44 ` [PATCH 1/3] perf kvm stat report: Save pid string in opts.target.pid Alexander Yarygin
  2014-09-01 13:44 ` [PATCH 2/3] perf kvm stat report: Enable the target.system_wide flag Alexander Yarygin
@ 2014-09-01 13:44 ` Alexander Yarygin
  2014-09-19  5:19   ` [tip:perf/core] " tip-bot for Alexander Yarygin
  2014-09-01 18:13 ` [PATCHv2 0/3] perf kvm stat report: extend " David Ahern
  3 siblings, 1 reply; 8+ messages in thread
From: Alexander Yarygin @ 2014-09-01 13:44 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexander Yarygin, Arnaldo Carvalho de Melo,
	Christian Borntraeger, David Ahern, Ingo Molnar, Jiri Olsa,
	Paul Mackerras, Peter Zijlstra

The 'live' command prints additional information to the
"Analyze events for " title bar about the current target.
Let's print the same title for the 'report' command.

Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
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>
Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
---
 tools/perf/builtin-kvm.c |   14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index b7fa0bc..c3af7ee 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -543,14 +543,12 @@ static void print_vcpu_info(struct perf_kvm_stat *kvm)

 	pr_info("Analyze events for ");

-	if (kvm->live) {
-		if (kvm->opts.target.system_wide)
-			pr_info("all VMs, ");
-		else if (kvm->opts.target.pid)
-			pr_info("pid(s) %s, ", kvm->opts.target.pid);
-		else
-			pr_info("dazed and confused on what is monitored, ");
-	}
+	if (kvm->opts.target.system_wide)
+		pr_info("all VMs, ");
+	else if (kvm->opts.target.pid)
+		pr_info("pid(s) %s, ", kvm->opts.target.pid);
+	else
+		pr_info("dazed and confused on what is monitored, ");

 	if (vcpu == -1)
 		pr_info("all VCPUs:\n\n");
--
1.7.9.5


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCHv2 0/3] perf kvm stat report: extend the title bar output
  2014-09-01 13:44 [PATCHv2 0/3] perf kvm stat report: extend the title bar output Alexander Yarygin
                   ` (2 preceding siblings ...)
  2014-09-01 13:44 ` [PATCH 3/3] perf kvm stat report: Unify the title bar output Alexander Yarygin
@ 2014-09-01 18:13 ` David Ahern
  3 siblings, 0 replies; 8+ messages in thread
From: David Ahern @ 2014-09-01 18:13 UTC (permalink / raw)
  To: Alexander Yarygin, linux-kernel
  Cc: Arnaldo Carvalho de Melo, Christian Borntraeger, Ingo Molnar,
	Jiri Olsa, Paul Mackerras, Peter Zijlstra

On 9/1/14, 7:44 AM, Alexander Yarygin wrote:
> Hello,
>
> This patchset is intended to add information about current pid to the
> "Analyze events for " title bar for the 'perf kvm stat report' command,
> when it's running with --pid option. To do so, patches 1-2 sync values
> of kvm->opts.target in 'report' with 'live' command and patch 3 reuses
> 'live' specific code to print desirable information.
>
> v2 changes:
>     - Split the big patch into 3 small patches
>     - Simplified the way to enable target.system_wide flag
>
> Thanks.
>
> Alexander Yarygin (3):
>    perf kvm stat report: Save pid string in kvm->opts.target.pid
>    perf kvm stat report: Enable the target.system_wide flag
>    perf kvm stat report: Unify the title bar output
>
>   tools/perf/builtin-kvm.c   |   23 ++++++++++++-----------
>   tools/perf/util/kvm-stat.h |    1 -
>   2 files changed, 12 insertions(+), 12 deletions(-)

All 3 look good to me.

Acked-by: David Ahern <dsahern@gmail.com>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [tip:perf/core] perf kvm stat report: Save pid string in opts.target.pid
  2014-09-01 13:44 ` [PATCH 1/3] perf kvm stat report: Save pid string in opts.target.pid Alexander Yarygin
@ 2014-09-19  5:19   ` tip-bot for Alexander Yarygin
  0 siblings, 0 replies; 8+ messages in thread
From: tip-bot for Alexander Yarygin @ 2014-09-19  5:19 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, linux-kernel, paulus, hpa, mingo, jolsa, a.p.zijlstra,
	borntraeger, yarygin, dsahern, tglx

Commit-ID:  3ae4a76ac840021294c091884e04af7c92e481ae
Gitweb:     http://git.kernel.org/tip/3ae4a76ac840021294c091884e04af7c92e481ae
Author:     Alexander Yarygin <yarygin@linux.vnet.ibm.com>
AuthorDate: Mon, 1 Sep 2014 17:44:53 +0400
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 17 Sep 2014 17:08:07 -0300

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: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
Acked-by: David 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.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-kvm.c   | 6 +++---
 tools/perf/util/kvm-stat.h | 1 -
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index 1a4ef9c..646ec5d 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -1085,8 +1085,8 @@ static int read_events(struct perf_kvm_stat *kvm)
 
 static int parse_target_str(struct perf_kvm_stat *kvm)
 {
-	if (kvm->pid_str) {
-		kvm->pid_list = intlist__new(kvm->pid_str);
+	if (kvm->opts.target.pid) {
+		kvm->pid_list = intlist__new(kvm->opts.target.pid);
 		if (kvm->pid_list == NULL) {
 			pr_err("Error parsing process id string\n");
 			return -EINVAL;
@@ -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",
 			    "key for sorting: sample(sort by samples number)"
 			    " 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)"),
 		OPT_END()
 	};
diff --git a/tools/perf/util/kvm-stat.h b/tools/perf/util/kvm-stat.h
index 0b5a8cd..cf1d7913 100644
--- a/tools/perf/util/kvm-stat.h
+++ b/tools/perf/util/kvm-stat.h
@@ -92,7 +92,6 @@ struct perf_kvm_stat {
 	u64 lost_events;
 	u64 duration;
 
-	const char *pid_str;
 	struct intlist *pid_list;
 
 	struct rb_root result;

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [tip:perf/core] perf kvm stat report: Enable the target.system_wide flag
  2014-09-01 13:44 ` [PATCH 2/3] perf kvm stat report: Enable the target.system_wide flag Alexander Yarygin
@ 2014-09-19  5:19   ` tip-bot for Alexander Yarygin
  0 siblings, 0 replies; 8+ messages in thread
From: tip-bot for Alexander Yarygin @ 2014-09-19  5:19 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, linux-kernel, paulus, hpa, mingo, jolsa, a.p.zijlstra,
	borntraeger, yarygin, dsahern, tglx

Commit-ID:  f181957c2849478fc963a8ac3c7dacf0a87c6b05
Gitweb:     http://git.kernel.org/tip/f181957c2849478fc963a8ac3c7dacf0a87c6b05
Author:     Alexander Yarygin <yarygin@linux.vnet.ibm.com>
AuthorDate: Mon, 1 Sep 2014 17:44:54 +0400
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 17 Sep 2014 17:08:07 -0300

perf kvm stat report: Enable the target.system_wide flag

The 'perf kvm stat report' command can be used to analyze events either
for system wide or for specific pids.

Let's enable kvm->opts.target.system_wide flag when 'report' command is
running for system-wide analyzing. This helps to sync kvm->opts.target
values in 'report' and 'live' commands.

Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
Acked-by: David 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-3-git-send-email-yarygin@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-kvm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index 646ec5d..84295ab 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -1207,6 +1207,9 @@ kvm_events_report(struct perf_kvm_stat *kvm, int argc, const char **argv)
 					   kvm_events_report_options);
 	}
 
+	if (!kvm->opts.target.pid)
+		kvm->opts.target.system_wide = true;
+
 	return kvm_events_report_vcpu(kvm);
 }
 

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [tip:perf/core] perf kvm stat report: Unify the title bar output
  2014-09-01 13:44 ` [PATCH 3/3] perf kvm stat report: Unify the title bar output Alexander Yarygin
@ 2014-09-19  5:19   ` tip-bot for Alexander Yarygin
  0 siblings, 0 replies; 8+ messages in thread
From: tip-bot for Alexander Yarygin @ 2014-09-19  5:19 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, linux-kernel, paulus, hpa, mingo, jolsa, a.p.zijlstra,
	borntraeger, yarygin, dsahern, tglx

Commit-ID:  1f3e5b55035549311e42c3f84007e6c799ed991f
Gitweb:     http://git.kernel.org/tip/1f3e5b55035549311e42c3f84007e6c799ed991f
Author:     Alexander Yarygin <yarygin@linux.vnet.ibm.com>
AuthorDate: Mon, 1 Sep 2014 17:44:55 +0400
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 17 Sep 2014 17:08:08 -0300

perf kvm stat report: Unify the title bar output

The 'live' command prints additional information to the "Analyze events
for " title bar about the current target.  Let's print the same title
for the 'report' command.

Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
Acked-by: David 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-4-git-send-email-yarygin@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-kvm.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index 84295ab..f5d3ae4 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -543,14 +543,12 @@ static void print_vcpu_info(struct perf_kvm_stat *kvm)
 
 	pr_info("Analyze events for ");
 
-	if (kvm->live) {
-		if (kvm->opts.target.system_wide)
-			pr_info("all VMs, ");
-		else if (kvm->opts.target.pid)
-			pr_info("pid(s) %s, ", kvm->opts.target.pid);
-		else
-			pr_info("dazed and confused on what is monitored, ");
-	}
+	if (kvm->opts.target.system_wide)
+		pr_info("all VMs, ");
+	else if (kvm->opts.target.pid)
+		pr_info("pid(s) %s, ", kvm->opts.target.pid);
+	else
+		pr_info("dazed and confused on what is monitored, ");
 
 	if (vcpu == -1)
 		pr_info("all VCPUs:\n\n");

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-09-19  5:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-01 13:44 [PATCHv2 0/3] perf kvm stat report: extend the title bar output Alexander Yarygin
2014-09-01 13:44 ` [PATCH 1/3] perf kvm stat report: Save pid string in opts.target.pid Alexander Yarygin
2014-09-19  5:19   ` [tip:perf/core] " tip-bot for Alexander Yarygin
2014-09-01 13:44 ` [PATCH 2/3] perf kvm stat report: Enable the target.system_wide flag Alexander Yarygin
2014-09-19  5:19   ` [tip:perf/core] " tip-bot for Alexander Yarygin
2014-09-01 13:44 ` [PATCH 3/3] perf kvm stat report: Unify the title bar output Alexander Yarygin
2014-09-19  5:19   ` [tip:perf/core] " tip-bot for Alexander Yarygin
2014-09-01 18:13 ` [PATCHv2 0/3] perf kvm stat report: extend " David Ahern

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.