All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] perf tools: Do not set O_NONBLOCK flag for perf event fd
@ 2014-10-01 16:00 Jiri Olsa
  2014-10-01 16:00 ` [PATCH 2/5] perf tools: Move callchain_param to util object in to fix python test Jiri Olsa
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Jiri Olsa @ 2014-10-01 16:00 UTC (permalink / raw
  To: linux-kernel
  Cc: Jiri Olsa, Adrian Hunter, Arnaldo Carvalho de Melo, Corey Ashford,
	David Ahern, Frederic Weisbecker, Ingo Molnar, Milian Wolff,
	Namhyung Kim, Paul Mackerras, Peter Zijlstra

We don't need O_NONBLOCK flag on perf event file descriptors.

Aside the fact that file descriptors in evlist::pollfd are
never used in read syscall (write syscall is not supported),
the kernel perf read syscall path could never block anyway.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Milian Wolff <mail@milianw.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/util/evlist.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index 3cebc9a8d52e..0fbc5f082308 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -434,12 +434,9 @@ static int __perf_evlist__add_pollfd(struct perf_evlist *evlist, int fd, int idx
 	 * Save the idx so that when we filter out fds POLLHUP'ed we can
 	 * close the associated evlist->mmap[] entry.
 	 */
-	if (pos >= 0) {
+	if (pos >= 0)
 		evlist->pollfd.priv[pos].idx = idx;
 
-		fcntl(fd, F_SETFL, O_NONBLOCK);
-	}
-
 	return pos;
 }
 
-- 
1.9.3


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

* [PATCH 2/5] perf tools: Move callchain_param to util object in to fix python test
  2014-10-01 16:00 [PATCH 1/5] perf tools: Do not set O_NONBLOCK flag for perf event fd Jiri Olsa
@ 2014-10-01 16:00 ` Jiri Olsa
       [not found]   ` <20141002145949.GK2799@kernel.org>
  2014-10-15 10:02   ` [tip:perf/urgent] perf callchain: " tip-bot for Jiri Olsa
  2014-10-01 16:00 ` [PATCH 3/5] perf kvm stat live: Fix perf_evlist__add_pollfd error handling Jiri Olsa
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 11+ messages in thread
From: Jiri Olsa @ 2014-10-01 16:00 UTC (permalink / raw
  To: linux-kernel
  Cc: Jiri Olsa, Adrian Hunter, Arnaldo Carvalho de Melo, Corey Ashford,
	David Ahern, Frederic Weisbecker, Ingo Molnar, Milian Wolff,
	Namhyung Kim, Paul Mackerras, Peter Zijlstra

In following commit we changed the location of callchains data:
  b016b5ba554b perf tools: Move callchain config from record_opts to callchain_param

Now all callchains stuff stays in callchain_param struct,
which adds its dependency for evsel.c object and breaks
python perf.so usage (unresolved callchain_param).

Moving callchain_param into callchain.c and adding it into
python-ext-sources unleash just another dependency hell,
so I ended up adding callchain_param into util.c for now.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Milian Wolff <mail@milianw.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/util/hist.c | 7 -------
 tools/perf/util/util.c | 8 ++++++++
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 86569fa3651d..b47595697140 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -14,13 +14,6 @@ static bool hists__filter_entry_by_thread(struct hists *hists,
 static bool hists__filter_entry_by_symbol(struct hists *hists,
 					  struct hist_entry *he);
 
-struct callchain_param	callchain_param = {
-	.mode	= CHAIN_GRAPH_REL,
-	.min_percent = 0.5,
-	.order  = ORDER_CALLEE,
-	.key	= CCKEY_FUNCTION
-};
-
 u16 hists__col_len(struct hists *hists, enum hist_column col)
 {
 	return hists->col_len[col];
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index 24e8d871b74e..d5eab3f3323f 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -14,6 +14,14 @@
 #include <byteswap.h>
 #include <linux/kernel.h>
 #include <unistd.h>
+#include "callchain.h"
+
+struct callchain_param	callchain_param = {
+	.mode	= CHAIN_GRAPH_REL,
+	.min_percent = 0.5,
+	.order  = ORDER_CALLEE,
+	.key	= CCKEY_FUNCTION
+};
 
 /*
  * XXX We need to find a better place for these things...
-- 
1.9.3


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

* [PATCH 3/5] perf kvm stat live: Fix perf_evlist__add_pollfd error handling
  2014-10-01 16:00 [PATCH 1/5] perf tools: Do not set O_NONBLOCK flag for perf event fd Jiri Olsa
  2014-10-01 16:00 ` [PATCH 2/5] perf tools: Move callchain_param to util object in to fix python test Jiri Olsa
@ 2014-10-01 16:00 ` Jiri Olsa
  2014-10-15 10:01   ` [tip:perf/urgent] " tip-bot for Jiri Olsa
  2014-10-01 16:00 ` [PATCH 4/5] perf kvm stat live: Use perf_evlist__add_pollfd return fd position Jiri Olsa
  2014-10-01 16:00 ` [PATCH 5/5] perf kvm stat live: Use fdarray object instead pollfd Jiri Olsa
  3 siblings, 1 reply; 11+ messages in thread
From: Jiri Olsa @ 2014-10-01 16:00 UTC (permalink / raw
  To: linux-kernel
  Cc: Jiri Olsa, Adrian Hunter, Arnaldo Carvalho de Melo, Corey Ashford,
	David Ahern, Frederic Weisbecker, Ingo Molnar, Milian Wolff,
	Namhyung Kim, Paul Mackerras, Peter Zijlstra

With the interface changed in following commit:
  2171a9256862 tools lib fd array: Allow associating an integer cookie with each entry
the perf_evlist__add_pollfd function now returns the fd
position in the pollfd array.

We need to change this function's error check condition.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Milian Wolff <mail@milianw.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/builtin-kvm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index d8bf2271f4ea..663d6eda0822 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -928,12 +928,12 @@ static int kvm_events_live_report(struct perf_kvm_stat *kvm)
 		goto out;
 	}
 
-	if (perf_evlist__add_pollfd(kvm->evlist, kvm->timerfd))
+	if (perf_evlist__add_pollfd(kvm->evlist, kvm->timerfd) < 0)
 		goto out;
 
 	nr_fds++;
 
-	if (perf_evlist__add_pollfd(kvm->evlist, fileno(stdin)))
+	if (perf_evlist__add_pollfd(kvm->evlist, fileno(stdin)) < 0)
 		goto out;
 
 	nr_stdin = nr_fds;
-- 
1.9.3


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

* [PATCH 4/5] perf kvm stat live: Use perf_evlist__add_pollfd return fd position
  2014-10-01 16:00 [PATCH 1/5] perf tools: Do not set O_NONBLOCK flag for perf event fd Jiri Olsa
  2014-10-01 16:00 ` [PATCH 2/5] perf tools: Move callchain_param to util object in to fix python test Jiri Olsa
  2014-10-01 16:00 ` [PATCH 3/5] perf kvm stat live: Fix perf_evlist__add_pollfd error handling Jiri Olsa
@ 2014-10-01 16:00 ` Jiri Olsa
  2014-10-15 10:01   ` [tip:perf/urgent] " tip-bot for Jiri Olsa
  2014-10-01 16:00 ` [PATCH 5/5] perf kvm stat live: Use fdarray object instead pollfd Jiri Olsa
  3 siblings, 1 reply; 11+ messages in thread
From: Jiri Olsa @ 2014-10-01 16:00 UTC (permalink / raw
  To: linux-kernel
  Cc: Jiri Olsa, Adrian Hunter, Arnaldo Carvalho de Melo, Corey Ashford,
	David Ahern, Frederic Weisbecker, Ingo Molnar, Milian Wolff,
	Namhyung Kim, Paul Mackerras, Peter Zijlstra

With the interface changed in following commit:
  2171a9256862 tools lib fd array: Allow associating an integer cookie with each entry
the perf_evlist__add_pollfd function now returns the
fd position in the pollfd array.

Hence we no longer need to count the fd position, because
we get it as the return value.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Milian Wolff <mail@milianw.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/builtin-kvm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index 663d6eda0822..dc7d704735bd 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -933,10 +933,10 @@ static int kvm_events_live_report(struct perf_kvm_stat *kvm)
 
 	nr_fds++;
 
-	if (perf_evlist__add_pollfd(kvm->evlist, fileno(stdin)) < 0)
+	nr_stdin = perf_evlist__add_pollfd(kvm->evlist, fileno(stdin));
+	if (nr_stdin < 0)
 		goto out;
 
-	nr_stdin = nr_fds;
 	nr_fds++;
 	if (fd_set_nonblock(fileno(stdin)) != 0)
 		goto out;
-- 
1.9.3


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

* [PATCH 5/5] perf kvm stat live: Use fdarray object instead pollfd
  2014-10-01 16:00 [PATCH 1/5] perf tools: Do not set O_NONBLOCK flag for perf event fd Jiri Olsa
                   ` (2 preceding siblings ...)
  2014-10-01 16:00 ` [PATCH 4/5] perf kvm stat live: Use perf_evlist__add_pollfd return fd position Jiri Olsa
@ 2014-10-01 16:00 ` Jiri Olsa
  2014-10-15 10:01   ` [tip:perf/urgent] perf kvm stat live: Use fdarray object instead of pollfd tip-bot for Jiri Olsa
  3 siblings, 1 reply; 11+ messages in thread
From: Jiri Olsa @ 2014-10-01 16:00 UTC (permalink / raw
  To: linux-kernel
  Cc: Jiri Olsa, Adrian Hunter, Arnaldo Carvalho de Melo, Corey Ashford,
	David Ahern, Frederic Weisbecker, Ingo Molnar, Milian Wolff,
	Namhyung Kim, Paul Mackerras, Peter Zijlstra

The reason is that we don't need to count the number of file
descriptors because it's already handled in fdarray object.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Milian Wolff <mail@milianw.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/builtin-kvm.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index dc7d704735bd..460a4ce9c044 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -896,8 +896,7 @@ static int perf_kvm__handle_stdin(void)
 
 static int kvm_events_live_report(struct perf_kvm_stat *kvm)
 {
-	struct pollfd *pollfds = NULL;
-	int nr_fds, nr_stdin, ret, err = -EINVAL;
+	int nr_stdin, ret, err = -EINVAL;
 	struct termios save;
 
 	/* live flag must be set first */
@@ -919,9 +918,6 @@ static int kvm_events_live_report(struct perf_kvm_stat *kvm)
 	signal(SIGINT, sig_handler);
 	signal(SIGTERM, sig_handler);
 
-	/* use pollfds -- need to add timerfd and stdin */
-	nr_fds = kvm->evlist->pollfd.nr;
-
 	/* add timer fd */
 	if (perf_kvm__timerfd_create(kvm) < 0) {
 		err = -1;
@@ -931,22 +927,18 @@ static int kvm_events_live_report(struct perf_kvm_stat *kvm)
 	if (perf_evlist__add_pollfd(kvm->evlist, kvm->timerfd) < 0)
 		goto out;
 
-	nr_fds++;
-
 	nr_stdin = perf_evlist__add_pollfd(kvm->evlist, fileno(stdin));
 	if (nr_stdin < 0)
 		goto out;
 
-	nr_fds++;
 	if (fd_set_nonblock(fileno(stdin)) != 0)
 		goto out;
 
-	pollfds	 = kvm->evlist->pollfd.entries;
-
 	/* everything is good - enable the events and process */
 	perf_evlist__enable(kvm->evlist);
 
 	while (!done) {
+		struct fdarray *fda = &kvm->evlist->pollfd;
 		int rc;
 
 		rc = perf_kvm__mmap_read(kvm);
@@ -957,11 +949,11 @@ static int kvm_events_live_report(struct perf_kvm_stat *kvm)
 		if (err)
 			goto out;
 
-		if (pollfds[nr_stdin].revents & POLLIN)
+		if (fda->entries[nr_stdin].revents & POLLIN)
 			done = perf_kvm__handle_stdin();
 
 		if (!rc && !done)
-			err = poll(pollfds, nr_fds, 100);
+			err = fdarray__poll(fda, 100);
 	}
 
 	perf_evlist__disable(kvm->evlist);
-- 
1.9.3


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

* Re: [PATCH 2/5] perf tools: Move callchain_param to util object in to fix python test
       [not found]   ` <20141002145949.GK2799@kernel.org>
@ 2014-10-02 15:08     ` Jiri Olsa
  2014-10-02 15:13       ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 11+ messages in thread
From: Jiri Olsa @ 2014-10-02 15:08 UTC (permalink / raw
  To: Arnaldo Carvalho de Melo
  Cc: Jiri Olsa, linux-kernel, Adrian Hunter, Corey Ashford,
	David Ahern, Frederic Weisbecker, Ingo Molnar, Milian Wolff,
	Namhyung Kim, Paul Mackerras, Peter Zijlstra

On Thu, Oct 02, 2014 at 11:59:49AM -0300, Arnaldo Carvalho de Melo wrote:
> Em Wed, Oct 01, 2014 at 06:00:26PM +0200, Jiri Olsa escreveu:
> > In following commit we changed the location of callchains data:
> >   b016b5ba554b perf tools: Move callchain config from record_opts to callchain_param
> > 
> > Now all callchains stuff stays in callchain_param struct,
> > which adds its dependency for evsel.c object and breaks
> > python perf.so usage (unresolved callchain_param).
> > 
> > Moving callchain_param into callchain.c and adding it into
> > python-ext-sources unleash just another dependency hell,
> > so I ended up adding callchain_param into util.c for now.
> 
> Against what branch is the patch? I am not finding b016b5ba554b in none

[jolsa@krava perf]$ git describe --contains b016b5ba554b
fatal: cannot describe 'b016b5ba554ba38c74241ef8739f8fde8878d3eb'
[jolsa@krava perf]$ git show --oneline b016b5ba554b | head -1
b016b5ba554b perf tools: Move callchain config from record_opts to callchain_param
[jolsa@krava perf]$ git show 72a128aa083a > /tmp/p
[jolsa@krava perf]$ git show b016b5ba554b > /tmp/p1
[jolsa@krava perf]$ diff -puw /tmp/p /tmp/p1 
--- /tmp/p      2014-10-02 17:06:20.072958720 +0200
+++ /tmp/p1     2014-10-02 17:06:26.035946113 +0200
@@ -1,4 +1,4 @@
-commit 72a128aa083a7f4cc4f800718aaae05d9c698e26
+commit b016b5ba554ba38c74241ef8739f8fde8878d3eb
 Author: Namhyung Kim <namhyung@kernel.org>
 Date:   Tue Sep 23 10:01:41 2014 +0900


I guess I took some version before your rebase

> of the branches in my linux git repo and the python 'perf test' entry
> works as expected:
> 
> [root@zoo ~]# perf test python
> 17: Try 'use perf' in python, checking link problems       : Ok
> [root@zoo ~]# 

hum.. yours acme/perf/core is failing for me:

[jolsa@krava perf]$ ./perf test python
17: Try 'use perf' in python, checking link problems       : FAILED!
[jolsa@krava perf]$ git show --oneline HEAD | head -1
281f92f233a5 perf record: Fix error message for --filter option not coming after tracepoint

maybe you need 'make clean && make' ?

jirka

> 
> - Arnaldo
>  
> > Cc: Adrian Hunter <adrian.hunter@intel.com>
> > Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
> > Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
> > Cc: David Ahern <dsahern@gmail.com>
> > Cc: Frederic Weisbecker <fweisbec@gmail.com>
> > Cc: Ingo Molnar <mingo@kernel.org>
> > Cc: Milian Wolff <mail@milianw.de>
> > Cc: Namhyung Kim <namhyung@kernel.org>
> > Cc: Paul Mackerras <paulus@samba.org>
> > Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
> > Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> > ---
> >  tools/perf/util/hist.c | 7 -------
> >  tools/perf/util/util.c | 8 ++++++++
> >  2 files changed, 8 insertions(+), 7 deletions(-)
> > 
> > diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
> > index 86569fa3651d..b47595697140 100644
> > --- a/tools/perf/util/hist.c
> > +++ b/tools/perf/util/hist.c
> > @@ -14,13 +14,6 @@ static bool hists__filter_entry_by_thread(struct hists *hists,
> >  static bool hists__filter_entry_by_symbol(struct hists *hists,
> >  					  struct hist_entry *he);
> >  
> > -struct callchain_param	callchain_param = {
> > -	.mode	= CHAIN_GRAPH_REL,
> > -	.min_percent = 0.5,
> > -	.order  = ORDER_CALLEE,
> > -	.key	= CCKEY_FUNCTION
> > -};
> > -
> >  u16 hists__col_len(struct hists *hists, enum hist_column col)
> >  {
> >  	return hists->col_len[col];
> > diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
> > index 24e8d871b74e..d5eab3f3323f 100644
> > --- a/tools/perf/util/util.c
> > +++ b/tools/perf/util/util.c
> > @@ -14,6 +14,14 @@
> >  #include <byteswap.h>
> >  #include <linux/kernel.h>
> >  #include <unistd.h>
> > +#include "callchain.h"
> > +
> > +struct callchain_param	callchain_param = {
> > +	.mode	= CHAIN_GRAPH_REL,
> > +	.min_percent = 0.5,
> > +	.order  = ORDER_CALLEE,
> > +	.key	= CCKEY_FUNCTION
> > +};
> >  
> >  /*
> >   * XXX We need to find a better place for these things...
> > -- 
> > 1.9.3
> > 
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at  http://www.tux.org/lkml/

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

* Re: [PATCH 2/5] perf tools: Move callchain_param to util object in to fix python test
  2014-10-02 15:08     ` Jiri Olsa
@ 2014-10-02 15:13       ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 11+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-10-02 15:13 UTC (permalink / raw
  To: Jiri Olsa
  Cc: Jiri Olsa, linux-kernel, Adrian Hunter, Corey Ashford,
	David Ahern, Frederic Weisbecker, Ingo Molnar, Milian Wolff,
	Namhyung Kim, Paul Mackerras, Peter Zijlstra

Em Thu, Oct 02, 2014 at 05:08:27PM +0200, Jiri Olsa escreveu:
> On Thu, Oct 02, 2014 at 11:59:49AM -0300, Arnaldo Carvalho de Melo wrote:
> > Em Wed, Oct 01, 2014 at 06:00:26PM +0200, Jiri Olsa escreveu:
> > > In following commit we changed the location of callchains data:
> > >   b016b5ba554b perf tools: Move callchain config from record_opts to callchain_param
> > > 
> > > Now all callchains stuff stays in callchain_param struct,
> > > which adds its dependency for evsel.c object and breaks
> > > python perf.so usage (unresolved callchain_param).
> > > 
> > > Moving callchain_param into callchain.c and adding it into
> > > python-ext-sources unleash just another dependency hell,
> > > so I ended up adding callchain_param into util.c for now.
> > 
> > Against what branch is the patch? I am not finding b016b5ba554b in none
> 
> [jolsa@krava perf]$ git describe --contains b016b5ba554b
> fatal: cannot describe 'b016b5ba554ba38c74241ef8739f8fde8878d3eb'
> [jolsa@krava perf]$ git show --oneline b016b5ba554b | head -1
> b016b5ba554b perf tools: Move callchain config from record_opts to callchain_param
> [jolsa@krava perf]$ git show 72a128aa083a > /tmp/p
> [jolsa@krava perf]$ git show b016b5ba554b > /tmp/p1
> [jolsa@krava perf]$ diff -puw /tmp/p /tmp/p1 
> --- /tmp/p      2014-10-02 17:06:20.072958720 +0200
> +++ /tmp/p1     2014-10-02 17:06:26.035946113 +0200
> @@ -1,4 +1,4 @@
> -commit 72a128aa083a7f4cc4f800718aaae05d9c698e26
> +commit b016b5ba554ba38c74241ef8739f8fde8878d3eb
>  Author: Namhyung Kim <namhyung@kernel.org>
>  Date:   Tue Sep 23 10:01:41 2014 +0900
> 
> 
> I guess I took some version before your rebase
> 
> > of the branches in my linux git repo and the python 'perf test' entry
> > works as expected:
> > 
> > [root@zoo ~]# perf test python
> > 17: Try 'use perf' in python, checking link problems       : Ok
> > [root@zoo ~]# 
> 
> hum.. yours acme/perf/core is failing for me:
> 
> [jolsa@krava perf]$ ./perf test python
> 17: Try 'use perf' in python, checking link problems       : FAILED!
> [jolsa@krava perf]$ git show --oneline HEAD | head -1
> 281f92f233a5 perf record: Fix error message for --filter option not coming after tracepoint
> 
> maybe you need 'make clean && make' ?

Yeap, I somehow thought that I had that covered :-\

Reproduced, yeah, 72a128aa083a7f4cc4f800718aaae05d9c698e26 is in, and
I'll take your patch, thanks.

Will update the comment to refer to the right cset.

- Arnaldo

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

* [tip:perf/urgent] perf kvm stat live: Fix perf_evlist__add_pollfd error handling
  2014-10-01 16:00 ` [PATCH 3/5] perf kvm stat live: Fix perf_evlist__add_pollfd error handling Jiri Olsa
@ 2014-10-15 10:01   ` tip-bot for Jiri Olsa
  0 siblings, 0 replies; 11+ messages in thread
From: tip-bot for Jiri Olsa @ 2014-10-15 10:01 UTC (permalink / raw
  To: linux-tip-commits
  Cc: mail, fweisbec, mingo, linux-kernel, adrian.hunter, tglx,
	namhyung, a.p.zijlstra, cjashfor, jolsa, acme, dsahern, hpa,
	paulus

Commit-ID:  fe636adda6caff6022e61b37202495dbf68e1410
Gitweb:     http://git.kernel.org/tip/fe636adda6caff6022e61b37202495dbf68e1410
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Wed, 1 Oct 2014 18:00:27 +0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 3 Oct 2014 09:39:47 -0300

perf kvm stat live: Fix perf_evlist__add_pollfd error handling

With the interface changed in following commit:

  2171a9256862 tools lib fd array: Allow associating an integer cookie with each entry

the perf_evlist__add_pollfd function now returns the fd position in the
pollfd array.

We need to change this function's error check condition.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Milian Wolff <mail@milianw.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1412179229-19466-3-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-kvm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index d8bf227..663d6ed 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -928,12 +928,12 @@ static int kvm_events_live_report(struct perf_kvm_stat *kvm)
 		goto out;
 	}
 
-	if (perf_evlist__add_pollfd(kvm->evlist, kvm->timerfd))
+	if (perf_evlist__add_pollfd(kvm->evlist, kvm->timerfd) < 0)
 		goto out;
 
 	nr_fds++;
 
-	if (perf_evlist__add_pollfd(kvm->evlist, fileno(stdin)))
+	if (perf_evlist__add_pollfd(kvm->evlist, fileno(stdin)) < 0)
 		goto out;
 
 	nr_stdin = nr_fds;

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

* [tip:perf/urgent] perf kvm stat live: Use perf_evlist__add_pollfd return fd position
  2014-10-01 16:00 ` [PATCH 4/5] perf kvm stat live: Use perf_evlist__add_pollfd return fd position Jiri Olsa
@ 2014-10-15 10:01   ` tip-bot for Jiri Olsa
  0 siblings, 0 replies; 11+ messages in thread
From: tip-bot for Jiri Olsa @ 2014-10-15 10:01 UTC (permalink / raw
  To: linux-tip-commits
  Cc: hpa, adrian.hunter, linux-kernel, mail, paulus, tglx,
	a.p.zijlstra, dsahern, fweisbec, mingo, cjashfor, namhyung, acme,
	jolsa

Commit-ID:  0cae013cf4450ea0ecb62241a2f3e7565db09f93
Gitweb:     http://git.kernel.org/tip/0cae013cf4450ea0ecb62241a2f3e7565db09f93
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Wed, 1 Oct 2014 18:00:28 +0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 3 Oct 2014 09:39:48 -0300

perf kvm stat live: Use perf_evlist__add_pollfd return fd position

With the interface changed in following commit:

  2171a9256862 tools lib fd array: Allow associating an integer cookie with each entry

the perf_evlist__add_pollfd function now returns the fd position in the
pollfd array.

Hence we no longer need to count the fd position, because we get it as
the return value.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Milian Wolff <mail@milianw.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1412179229-19466-4-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-kvm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index 663d6ed..dc7d704 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -933,10 +933,10 @@ static int kvm_events_live_report(struct perf_kvm_stat *kvm)
 
 	nr_fds++;
 
-	if (perf_evlist__add_pollfd(kvm->evlist, fileno(stdin)) < 0)
+	nr_stdin = perf_evlist__add_pollfd(kvm->evlist, fileno(stdin));
+	if (nr_stdin < 0)
 		goto out;
 
-	nr_stdin = nr_fds;
 	nr_fds++;
 	if (fd_set_nonblock(fileno(stdin)) != 0)
 		goto out;

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

* [tip:perf/urgent] perf kvm stat live: Use fdarray object instead of pollfd
  2014-10-01 16:00 ` [PATCH 5/5] perf kvm stat live: Use fdarray object instead pollfd Jiri Olsa
@ 2014-10-15 10:01   ` tip-bot for Jiri Olsa
  0 siblings, 0 replies; 11+ messages in thread
From: tip-bot for Jiri Olsa @ 2014-10-15 10:01 UTC (permalink / raw
  To: linux-tip-commits
  Cc: linux-kernel, fweisbec, hpa, namhyung, acme, paulus, dsahern,
	mail, jolsa, mingo, a.p.zijlstra, tglx, cjashfor, adrian.hunter

Commit-ID:  1ca72260e471a8b03f03fe9a6547deb088710042
Gitweb:     http://git.kernel.org/tip/1ca72260e471a8b03f03fe9a6547deb088710042
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Wed, 1 Oct 2014 18:00:29 +0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 3 Oct 2014 09:39:48 -0300

perf kvm stat live: Use fdarray object instead of pollfd

The reason is that we don't need to count the number of file descriptors
because it's already handled in fdarray object.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Milian Wolff <mail@milianw.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1412179229-19466-5-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-kvm.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index dc7d704..460a4ce 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -896,8 +896,7 @@ static int perf_kvm__handle_stdin(void)
 
 static int kvm_events_live_report(struct perf_kvm_stat *kvm)
 {
-	struct pollfd *pollfds = NULL;
-	int nr_fds, nr_stdin, ret, err = -EINVAL;
+	int nr_stdin, ret, err = -EINVAL;
 	struct termios save;
 
 	/* live flag must be set first */
@@ -919,9 +918,6 @@ static int kvm_events_live_report(struct perf_kvm_stat *kvm)
 	signal(SIGINT, sig_handler);
 	signal(SIGTERM, sig_handler);
 
-	/* use pollfds -- need to add timerfd and stdin */
-	nr_fds = kvm->evlist->pollfd.nr;
-
 	/* add timer fd */
 	if (perf_kvm__timerfd_create(kvm) < 0) {
 		err = -1;
@@ -931,22 +927,18 @@ static int kvm_events_live_report(struct perf_kvm_stat *kvm)
 	if (perf_evlist__add_pollfd(kvm->evlist, kvm->timerfd) < 0)
 		goto out;
 
-	nr_fds++;
-
 	nr_stdin = perf_evlist__add_pollfd(kvm->evlist, fileno(stdin));
 	if (nr_stdin < 0)
 		goto out;
 
-	nr_fds++;
 	if (fd_set_nonblock(fileno(stdin)) != 0)
 		goto out;
 
-	pollfds	 = kvm->evlist->pollfd.entries;
-
 	/* everything is good - enable the events and process */
 	perf_evlist__enable(kvm->evlist);
 
 	while (!done) {
+		struct fdarray *fda = &kvm->evlist->pollfd;
 		int rc;
 
 		rc = perf_kvm__mmap_read(kvm);
@@ -957,11 +949,11 @@ static int kvm_events_live_report(struct perf_kvm_stat *kvm)
 		if (err)
 			goto out;
 
-		if (pollfds[nr_stdin].revents & POLLIN)
+		if (fda->entries[nr_stdin].revents & POLLIN)
 			done = perf_kvm__handle_stdin();
 
 		if (!rc && !done)
-			err = poll(pollfds, nr_fds, 100);
+			err = fdarray__poll(fda, 100);
 	}
 
 	perf_evlist__disable(kvm->evlist);

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

* [tip:perf/urgent] perf callchain: Move callchain_param to util object in to fix python test
  2014-10-01 16:00 ` [PATCH 2/5] perf tools: Move callchain_param to util object in to fix python test Jiri Olsa
       [not found]   ` <20141002145949.GK2799@kernel.org>
@ 2014-10-15 10:02   ` tip-bot for Jiri Olsa
  1 sibling, 0 replies; 11+ messages in thread
From: tip-bot for Jiri Olsa @ 2014-10-15 10:02 UTC (permalink / raw
  To: linux-tip-commits
  Cc: jolsa, hpa, linux-kernel, adrian.hunter, fweisbec, acme, cjashfor,
	tglx, mail, a.p.zijlstra, mingo, namhyung, dsahern, paulus

Commit-ID:  23aadb1fcda27e79a134ec35a7fb68f243269bcb
Gitweb:     http://git.kernel.org/tip/23aadb1fcda27e79a134ec35a7fb68f243269bcb
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Wed, 1 Oct 2014 18:00:26 +0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 3 Oct 2014 09:39:48 -0300

perf callchain: Move callchain_param to util object in to fix python test

In following commit we changed the location of callchains data:

  72a128aa083a7f4cc4f800718aaae05d9c698e26
  perf tools: Move callchain config from record_opts to callchain_param

Now all callchains stuff stays in callchain_param struct, which adds its
dependency for evsel.c object and breaks python perf.so usage
(unresolved callchain_param).

Moving callchain_param into callchain.c and adding it into
python-ext-sources unleash just another dependency hell, so I ended up
adding callchain_param into util.c for now.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Milian Wolff <mail@milianw.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1412179229-19466-2-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/hist.c | 7 -------
 tools/perf/util/util.c | 8 ++++++++
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 86569fa..b475956 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -14,13 +14,6 @@ static bool hists__filter_entry_by_thread(struct hists *hists,
 static bool hists__filter_entry_by_symbol(struct hists *hists,
 					  struct hist_entry *he);
 
-struct callchain_param	callchain_param = {
-	.mode	= CHAIN_GRAPH_REL,
-	.min_percent = 0.5,
-	.order  = ORDER_CALLEE,
-	.key	= CCKEY_FUNCTION
-};
-
 u16 hists__col_len(struct hists *hists, enum hist_column col)
 {
 	return hists->col_len[col];
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index 24e8d87..d5eab3f 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -14,6 +14,14 @@
 #include <byteswap.h>
 #include <linux/kernel.h>
 #include <unistd.h>
+#include "callchain.h"
+
+struct callchain_param	callchain_param = {
+	.mode	= CHAIN_GRAPH_REL,
+	.min_percent = 0.5,
+	.order  = ORDER_CALLEE,
+	.key	= CCKEY_FUNCTION
+};
 
 /*
  * XXX We need to find a better place for these things...

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

end of thread, other threads:[~2014-10-15 10:02 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-01 16:00 [PATCH 1/5] perf tools: Do not set O_NONBLOCK flag for perf event fd Jiri Olsa
2014-10-01 16:00 ` [PATCH 2/5] perf tools: Move callchain_param to util object in to fix python test Jiri Olsa
     [not found]   ` <20141002145949.GK2799@kernel.org>
2014-10-02 15:08     ` Jiri Olsa
2014-10-02 15:13       ` Arnaldo Carvalho de Melo
2014-10-15 10:02   ` [tip:perf/urgent] perf callchain: " tip-bot for Jiri Olsa
2014-10-01 16:00 ` [PATCH 3/5] perf kvm stat live: Fix perf_evlist__add_pollfd error handling Jiri Olsa
2014-10-15 10:01   ` [tip:perf/urgent] " tip-bot for Jiri Olsa
2014-10-01 16:00 ` [PATCH 4/5] perf kvm stat live: Use perf_evlist__add_pollfd return fd position Jiri Olsa
2014-10-15 10:01   ` [tip:perf/urgent] " tip-bot for Jiri Olsa
2014-10-01 16:00 ` [PATCH 5/5] perf kvm stat live: Use fdarray object instead pollfd Jiri Olsa
2014-10-15 10:01   ` [tip:perf/urgent] perf kvm stat live: Use fdarray object instead of pollfd tip-bot for Jiri Olsa

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.