[PATCH v6 03/11] perf util: Create the runtime_stat init/exit function

2017-12-04 Thread Jin Yao
It mainly initializes and releases the rblist which is defined in struct runtime_stat. For the original rblist 'runtime_saved_values', it's still kept there for keeping the patch bisectable. The rblist 'runtime_saved_values' will be removed in later patch at switching time. Signed-off-by: Jin

[PATCH v6 00/11] perf stat: Enable '--per-thread' on all thread

2017-12-04 Thread Jin Yao
r/u16:2-23146 2,654 cycles watchdog/6-442,017 cycles watchdog/7-502,017 cycles 2.175726600 seconds time elapsed Jin Yao (11): perf util: Define a structure for per-thread shadow stats perf stat:

[PATCH v6 11/11] perf stat: Resort '--per-thread' result

2017-12-04 Thread Jin Yao
2,654 cycles watchdog/6-442,017 cycles watchdog/7-502,017 cycles 2.175726600 seconds time elapsed Signed-off-by: Jin Yao <yao@linux.intel.com> --- tools/perf/builtin-stat.

[PATCH v6 08/11] perf stat: Update or print per-thread stats

2017-12-04 Thread Jin Yao
If the stats pointer in stat_config structure is not null, it will update the per-thread stats or print the per-thread stats on this buffer. Signed-off-by: Jin Yao <yao@linux.intel.com> --- tools/perf/builtin-stat.c | 9 +++-- tools/perf/util/stat.c| 11 --- 2 files c

[PATCH v6 00/11] perf stat: Enable '--per-thread' on all thread

2017-12-04 Thread Jin Yao
r/u16:2-23146 2,654 cycles watchdog/6-442,017 cycles watchdog/7-502,017 cycles 2.175726600 seconds time elapsed Jin Yao (11): perf util: Define a structure for per-thread shadow stats perf stat:

[PATCH v6 11/11] perf stat: Resort '--per-thread' result

2017-12-04 Thread Jin Yao
2,654 cycles watchdog/6-442,017 cycles watchdog/7-502,017 cycles 2.175726600 seconds time elapsed Signed-off-by: Jin Yao --- tools/perf/builtin-stat.c | 77

[PATCH v6 08/11] perf stat: Update or print per-thread stats

2017-12-04 Thread Jin Yao
If the stats pointer in stat_config structure is not null, it will update the per-thread stats or print the per-thread stats on this buffer. Signed-off-by: Jin Yao --- tools/perf/builtin-stat.c | 9 +++-- tools/perf/util/stat.c| 11 --- 2 files changed, 15 insertions(+), 5

[PATCH v6 10/11] perf stat: Remove --per-thread pid/tid limitation

2017-12-04 Thread Jin Yao
stat events on existing thread id This patch removes this limitation. If no pid/tid specified, it returns all threads (get threads from /proc). Note that it doesn't support cpu_list yet so if it's a cpu_list case, then skip. Signed-off-by: Jin Yao <yao@linux.intel.com> --- tools/perf/b

[PATCH v6 07/11] perf stat: Allocate shadow stats buffer for threads

2017-12-04 Thread Jin Yao
in stat_config. Signed-off-by: Jin Yao <yao@linux.intel.com> --- tools/perf/builtin-stat.c | 46 +- tools/perf/util/stat.h| 2 ++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c

[PATCH v6 10/11] perf stat: Remove --per-thread pid/tid limitation

2017-12-04 Thread Jin Yao
stat events on existing thread id This patch removes this limitation. If no pid/tid specified, it returns all threads (get threads from /proc). Note that it doesn't support cpu_list yet so if it's a cpu_list case, then skip. Signed-off-by: Jin Yao --- tools/perf/builtin-stat.c | 23

[PATCH v6 07/11] perf stat: Allocate shadow stats buffer for threads

2017-12-04 Thread Jin Yao
in stat_config. Signed-off-by: Jin Yao --- tools/perf/builtin-stat.c | 46 +- tools/perf/util/stat.h| 2 ++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 1edc082..8ff3348 100644

Re: [PATCH v9 3/5] perf utils: use pmu->is_uncore to detect PMU UNCORE devices

2017-12-04 Thread Jin, Yao
stat-1754 cpu_clk_unhalted.thread 3.051274166 seconds time elapsed Could you please help to take a look? Thanks Jin Yao On 10/17/2017 2:32 AM, Ganapatrao Kulkarni wrote: PMU CORE devices are identified using sysfs filename cpu, however on some platforms(like arm/arm64), PMU CORE s

Re: [PATCH v9 3/5] perf utils: use pmu->is_uncore to detect PMU UNCORE devices

2017-12-04 Thread Jin, Yao
ead 3.051274166 seconds time elapsed Could you please help to take a look? Thanks Jin Yao On 10/17/2017 2:32 AM, Ganapatrao Kulkarni wrote: PMU CORE devices are identified using sysfs filename cpu, however on some platforms(like arm/arm64), PMU CORE sysfs name is not cpu. Hence cpu can

Re: [PATCH v5 10/12] perf util: Reuse thread_map__new_by_uid to enumerate threads from /proc

2017-12-01 Thread Jin, Yao
On 12/1/2017 11:02 PM, Arnaldo Carvalho de Melo wrote: Em Fri, Dec 01, 2017 at 11:44:25AM -0300, Arnaldo Carvalho de Melo escreveu: Em Fri, Dec 01, 2017 at 06:57:34PM +0800, Jin Yao escreveu: Perf already has a function thread_map__new_by_uid() which can enumerate all threads from /proc

Re: [PATCH v5 10/12] perf util: Reuse thread_map__new_by_uid to enumerate threads from /proc

2017-12-01 Thread Jin, Yao
On 12/1/2017 11:02 PM, Arnaldo Carvalho de Melo wrote: Em Fri, Dec 01, 2017 at 11:44:25AM -0300, Arnaldo Carvalho de Melo escreveu: Em Fri, Dec 01, 2017 at 06:57:34PM +0800, Jin Yao escreveu: Perf already has a function thread_map__new_by_uid() which can enumerate all threads from /proc

Re: [PATCH v5 10/12] perf util: Reuse thread_map__new_by_uid to enumerate threads from /proc

2017-12-01 Thread Jin, Yao
On 12/1/2017 10:44 PM, Arnaldo Carvalho de Melo wrote: Em Fri, Dec 01, 2017 at 06:57:34PM +0800, Jin Yao escreveu: Perf already has a function thread_map__new_by_uid() which can enumerate all threads from /proc by uid. This patch creates a static function enumerate_threads() which reuses

Re: [PATCH v5 10/12] perf util: Reuse thread_map__new_by_uid to enumerate threads from /proc

2017-12-01 Thread Jin, Yao
On 12/1/2017 10:44 PM, Arnaldo Carvalho de Melo wrote: Em Fri, Dec 01, 2017 at 06:57:34PM +0800, Jin Yao escreveu: Perf already has a function thread_map__new_by_uid() which can enumerate all threads from /proc by uid. This patch creates a static function enumerate_threads() which reuses

Re: [PATCH v5 06/12] perf util: Update and print per-thread shadow stats

2017-12-01 Thread Jin, Yao
On 12/1/2017 10:21 PM, Arnaldo Carvalho de Melo wrote: Em Fri, Dec 01, 2017 at 06:57:30PM +0800, Jin Yao escreveu: The functions perf_stat__update_shadow_stats() and perf_stat__print_shadow_statss() are called to update and print the shadow stats on a set of static variables. But the static

Re: [PATCH v5 06/12] perf util: Update and print per-thread shadow stats

2017-12-01 Thread Jin, Yao
On 12/1/2017 10:21 PM, Arnaldo Carvalho de Melo wrote: Em Fri, Dec 01, 2017 at 06:57:30PM +0800, Jin Yao escreveu: The functions perf_stat__update_shadow_stats() and perf_stat__print_shadow_statss() are called to update and print the shadow stats on a set of static variables. But the static

Re: [PATCH v5 03/12] perf util: Extend rbtree to support shadow stats

2017-12-01 Thread Jin, Yao
On 12/1/2017 10:10 PM, Arnaldo Carvalho de Melo wrote: Em Fri, Dec 01, 2017 at 06:57:27PM +0800, Jin Yao escreveu: Previously the rbtree was used to link generic metrics. Try to make the one line subject more descriptive, I'm changing it to: perf stat: Extend rbtree to support per-thread

Re: [PATCH v5 03/12] perf util: Extend rbtree to support shadow stats

2017-12-01 Thread Jin, Yao
On 12/1/2017 10:10 PM, Arnaldo Carvalho de Melo wrote: Em Fri, Dec 01, 2017 at 06:57:27PM +0800, Jin Yao escreveu: Previously the rbtree was used to link generic metrics. Try to make the one line subject more descriptive, I'm changing it to: perf stat: Extend rbtree to support per-thread

Re: [PATCH v5 02/12] perf util: Define a structure for runtime shadow stats

2017-12-01 Thread Jin, Yao
On 12/1/2017 10:02 PM, Arnaldo Carvalho de Melo wrote: Em Fri, Dec 01, 2017 at 06:57:26PM +0800, Jin Yao escreveu: Perf has a set of static variables to record the runtime shadow metrics stats. While if we want to record the runtime shadow stats for per-thread, it will be the limitation

Re: [PATCH v5 02/12] perf util: Define a structure for runtime shadow stats

2017-12-01 Thread Jin, Yao
On 12/1/2017 10:02 PM, Arnaldo Carvalho de Melo wrote: Em Fri, Dec 01, 2017 at 06:57:26PM +0800, Jin Yao escreveu: Perf has a set of static variables to record the runtime shadow metrics stats. While if we want to record the runtime shadow stats for per-thread, it will be the limitation

[PATCH v5 02/12] perf util: Define a structure for runtime shadow stats

2017-11-30 Thread Jin Yao
-thread. Signed-off-by: Jin Yao <yao@linux.intel.com> --- tools/perf/util/stat-shadow.c | 11 --- tools/perf/util/stat.h| 44 ++- 2 files changed, 43 insertions(+), 12 deletions(-) diff --git a/tools/perf/util/stat-shadow.c b/tools/per

[PATCH v5 02/12] perf util: Define a structure for runtime shadow stats

2017-11-30 Thread Jin Yao
-thread. Signed-off-by: Jin Yao --- tools/perf/util/stat-shadow.c | 11 --- tools/perf/util/stat.h| 44 ++- 2 files changed, 43 insertions(+), 12 deletions(-) diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c index

[PATCH v5 06/12] perf util: Update and print per-thread shadow stats

2017-11-30 Thread Jin Yao
'. It will not directly get value from static variable. Instead, it now uses runtime_stat_avg() and runtime_stat_n() to get and compute the values. Signed-off-by: Jin Yao <yao@linux.intel.com> --- tools/perf/builtin-script.c | 6 +- tools/perf/builtin-stat.c | 27 ++-- tools/per

[PATCH v5 06/12] perf util: Update and print per-thread shadow stats

2017-11-30 Thread Jin Yao
'. It will not directly get value from static variable. Instead, it now uses runtime_stat_avg() and runtime_stat_n() to get and compute the values. Signed-off-by: Jin Yao --- tools/perf/builtin-script.c | 6 +- tools/perf/builtin-stat.c | 27 ++-- tools/perf/util/stat-shadow.c | 293

[PATCH v5 04/12] perf util: Add rbtree node_delete ops

2017-11-30 Thread Jin Yao
In current stat-shadow.c, the rbtree deleting is ignored. The patch adds the implementation to node_delete method of rblist. Signed-off-by: Jin Yao <yao@linux.intel.com> --- tools/perf/util/stat-shadow.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a

[PATCH v5 04/12] perf util: Add rbtree node_delete ops

2017-11-30 Thread Jin Yao
In current stat-shadow.c, the rbtree deleting is ignored. The patch adds the implementation to node_delete method of rblist. Signed-off-by: Jin Yao --- tools/perf/util/stat-shadow.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/stat-shadow.c b

[PATCH v5 11/12] perf stat: Remove --per-thread pid/tid limitation

2017-11-30 Thread Jin Yao
stat events on existing thread id This patch removes this limitation. If no pid/tid specified, it returns all threads (get threads from /proc). Note that it doesn't support cpu_list yet so if it's a cpu_list case, then skip. Signed-off-by: Jin Yao <yao@linux.intel.com> --- tools/perf/b

[PATCH v5 07/12] perf util: Remove a set of shadow stats static variables

2017-11-30 Thread Jin Yao
In previous patches, we have reconstructed the code and let it not access the static variables directly. This patch removes these static variables. Signed-off-by: Jin Yao <yao@linux.intel.com> --- tools/perf/util/stat-shadow.c | 68 ++- tool

[PATCH v5 09/12] perf stat: Update or print per-thread stats

2017-11-30 Thread Jin Yao
If the stats pointer in stat_config structure is not null, it will update the per-thread stats or print the per-thread stats on this buffer. Signed-off-by: Jin Yao <yao@linux.intel.com> --- tools/perf/builtin-stat.c | 9 +++-- tools/perf/util/stat.c| 11 --- 2 files c

[PATCH v5 07/12] perf util: Remove a set of shadow stats static variables

2017-11-30 Thread Jin Yao
In previous patches, we have reconstructed the code and let it not access the static variables directly. This patch removes these static variables. Signed-off-by: Jin Yao --- tools/perf/util/stat-shadow.c | 68 ++- tools/perf/util/stat.h| 1 + 2

[PATCH v5 09/12] perf stat: Update or print per-thread stats

2017-11-30 Thread Jin Yao
If the stats pointer in stat_config structure is not null, it will update the per-thread stats or print the per-thread stats on this buffer. Signed-off-by: Jin Yao --- tools/perf/builtin-stat.c | 9 +++-- tools/perf/util/stat.c| 11 --- 2 files changed, 15 insertions(+), 5

[PATCH v5 11/12] perf stat: Remove --per-thread pid/tid limitation

2017-11-30 Thread Jin Yao
stat events on existing thread id This patch removes this limitation. If no pid/tid specified, it returns all threads (get threads from /proc). Note that it doesn't support cpu_list yet so if it's a cpu_list case, then skip. Signed-off-by: Jin Yao --- tools/perf/builtin-stat.c | 23

[PATCH v5 10/12] perf util: Reuse thread_map__new_by_uid to enumerate threads from /proc

2017-11-30 Thread Jin Yao
by thread_map__new_by_uid() and a new function thread_map__new_threads(). The new function thread_map__new_threads() is called to enumerate all threads from /proc. Signed-off-by: Jin Yao <yao@linux.intel.com> --- tools/perf/tests/thread-map.c | 2 +- tools/perf/util/evlist.c | 3 ++- tool

[PATCH v5 10/12] perf util: Reuse thread_map__new_by_uid to enumerate threads from /proc

2017-11-30 Thread Jin Yao
by thread_map__new_by_uid() and a new function thread_map__new_threads(). The new function thread_map__new_threads() is called to enumerate all threads from /proc. Signed-off-by: Jin Yao --- tools/perf/tests/thread-map.c | 2 +- tools/perf/util/evlist.c | 3 ++- tools/perf/util/thread_map.c | 19

[PATCH v5 12/12] perf stat: Resort '--per-thread' result

2017-11-30 Thread Jin Yao
2,654 cycles watchdog/6-442,017 cycles watchdog/7-502,017 cycles 2.175726600 seconds time elapsed Signed-off-by: Jin Yao <yao@linux.intel.com> --- tools/perf/builtin-stat.

[PATCH v5 03/12] perf util: Extend rbtree to support shadow stats

2017-11-30 Thread Jin Yao
Previously the rbtree was used to link generic metrics. This patches adds new ctx/type/stat into rbtree keys because we will use this rbtree to maintain shadow metrics to replace original a couple of static arrays for supporting per-thread shadow stats. Signed-off-by: Jin Yao <

[PATCH v5 01/12] perf util: Create rblist__exit() function

2017-11-30 Thread Jin Yao
. This patch creates a new function rblist__exit() which is similar as rblist__delete() but it will not free the pointer of rblist. Signed-off-by: Jin Yao <yao@linux.intel.com> --- tools/perf/util/rblist.c | 19 --- tools/perf/util/rblist.h | 1 + 2 files changed, 13 inse

[PATCH v5 05/12] perf util: Create the runtime_stat init/exit function

2017-11-30 Thread Jin Yao
It mainly initializes and releases the rblist which is defined in struct runtime_stat. For the original rblist 'runtime_saved_values', it's still kept there for keeping the patch bisectable. The rblist 'runtime_saved_values' will be removed in later patch at switching time. Signed-off-by: Jin

[PATCH v5 00/12] perf stat: Enable '--per-thread' on all thread

2017-11-30 Thread Jin Yao
2,017 cycles watchdog/7-502,017 cycles 2.175726600 seconds time elapsed Jin Yao (12): perf util: Create rblist__exit() function perf util: Define a structure for runtime shadow stats perf util: Extend rbtree to support

[PATCH v5 08/12] perf stat: Allocate shadow stats buffer for threads

2017-11-30 Thread Jin Yao
in stat_config. Signed-off-by: Jin Yao <yao@linux.intel.com> --- tools/perf/builtin-stat.c | 46 +- tools/perf/util/stat.h| 2 ++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c

[PATCH v5 12/12] perf stat: Resort '--per-thread' result

2017-11-30 Thread Jin Yao
2,654 cycles watchdog/6-442,017 cycles watchdog/7-502,017 cycles 2.175726600 seconds time elapsed Signed-off-by: Jin Yao --- tools/perf/builtin-stat.c | 77

[PATCH v5 03/12] perf util: Extend rbtree to support shadow stats

2017-11-30 Thread Jin Yao
Previously the rbtree was used to link generic metrics. This patches adds new ctx/type/stat into rbtree keys because we will use this rbtree to maintain shadow metrics to replace original a couple of static arrays for supporting per-thread shadow stats. Signed-off-by: Jin Yao --- tools/perf

[PATCH v5 01/12] perf util: Create rblist__exit() function

2017-11-30 Thread Jin Yao
. This patch creates a new function rblist__exit() which is similar as rblist__delete() but it will not free the pointer of rblist. Signed-off-by: Jin Yao --- tools/perf/util/rblist.c | 19 --- tools/perf/util/rblist.h | 1 + 2 files changed, 13 insertions(+), 7 deletions(-) diff

[PATCH v5 05/12] perf util: Create the runtime_stat init/exit function

2017-11-30 Thread Jin Yao
It mainly initializes and releases the rblist which is defined in struct runtime_stat. For the original rblist 'runtime_saved_values', it's still kept there for keeping the patch bisectable. The rblist 'runtime_saved_values' will be removed in later patch at switching time. Signed-off-by: Jin

[PATCH v5 00/12] perf stat: Enable '--per-thread' on all thread

2017-11-30 Thread Jin Yao
2,017 cycles watchdog/7-502,017 cycles 2.175726600 seconds time elapsed Jin Yao (12): perf util: Create rblist__exit() function perf util: Define a structure for runtime shadow stats perf util: Extend rbtree to support

[PATCH v5 08/12] perf stat: Allocate shadow stats buffer for threads

2017-11-30 Thread Jin Yao
in stat_config. Signed-off-by: Jin Yao --- tools/perf/builtin-stat.c | 46 +- tools/perf/util/stat.h| 2 ++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 1edc082..8ff3348 100644

Re: [PATCH v4 00/12] perf stat: Enable '--per-thread' on all thread

2017-11-30 Thread Jin, Yao
On 11/30/2017 6:05 PM, Jiri Olsa wrote: On Thu, Nov 30, 2017 at 07:56:30PM +0800, Jin Yao wrote: v4: --- Update according to Jiri's comments. The major modification is: Move struct perf_stat_config::*stats|stats_num to 'perf stat: Allocate shadow stats buffer for threads'. I also move

Re: [PATCH v4 00/12] perf stat: Enable '--per-thread' on all thread

2017-11-30 Thread Jin, Yao
On 11/30/2017 6:05 PM, Jiri Olsa wrote: On Thu, Nov 30, 2017 at 07:56:30PM +0800, Jin Yao wrote: v4: --- Update according to Jiri's comments. The major modification is: Move struct perf_stat_config::*stats|stats_num to 'perf stat: Allocate shadow stats buffer for threads'. I also move

Re: [PATCH v4 01/12] perf util: Create rblist__reset() function

2017-11-30 Thread Jin, Yao
On 12/1/2017 3:30 AM, Arnaldo Carvalho de Melo wrote: Em Thu, Nov 30, 2017 at 07:56:31PM +0800, Jin Yao escreveu: Currently we have a rblist__delete() which is used to delete a rblist. While rblist__delete() will free the pointer of rblist at the end. It's inconvenience for user to delete

Re: [PATCH v4 01/12] perf util: Create rblist__reset() function

2017-11-30 Thread Jin, Yao
On 12/1/2017 3:30 AM, Arnaldo Carvalho de Melo wrote: Em Thu, Nov 30, 2017 at 07:56:31PM +0800, Jin Yao escreveu: Currently we have a rblist__delete() which is used to delete a rblist. While rblist__delete() will free the pointer of rblist at the end. It's inconvenience for user to delete

[PATCH v4 01/12] perf util: Create rblist__reset() function

2017-11-29 Thread Jin Yao
. This patch creates a new function rblist__reset() which function is similar as rblist__delete() but it will not free the rblist. Signed-off-by: Jin Yao <yao@linux.intel.com> --- tools/perf/util/rblist.c | 24 +--- tools/perf/util/rblist.h | 1 + 2 files changed, 18 inse

[PATCH v4 01/12] perf util: Create rblist__reset() function

2017-11-29 Thread Jin Yao
. This patch creates a new function rblist__reset() which function is similar as rblist__delete() but it will not free the rblist. Signed-off-by: Jin Yao --- tools/perf/util/rblist.c | 24 +--- tools/perf/util/rblist.h | 1 + 2 files changed, 18 insertions(+), 7 deletions(-) diff

[PATCH v4 03/12] perf util: Extend rbtree to support shadow stats

2017-11-29 Thread Jin Yao
Previously the rbtree was used to link generic metrics. This patches adds new ctx/type/stat into rbtree keys because we will use this rbtree to maintain shadow metrics to replace original a couple of static arrays for supporting per-thread shadow stats. Signed-off-by: Jin Yao <

[PATCH v4 03/12] perf util: Extend rbtree to support shadow stats

2017-11-29 Thread Jin Yao
Previously the rbtree was used to link generic metrics. This patches adds new ctx/type/stat into rbtree keys because we will use this rbtree to maintain shadow metrics to replace original a couple of static arrays for supporting per-thread shadow stats. Signed-off-by: Jin Yao --- tools/perf

[PATCH v4 02/12] perf util: Define a structure for runtime shadow stats

2017-11-29 Thread Jin Yao
-thread. Signed-off-by: Jin Yao <yao@linux.intel.com> --- tools/perf/util/stat-shadow.c | 11 --- tools/perf/util/stat.h| 44 ++- 2 files changed, 43 insertions(+), 12 deletions(-) diff --git a/tools/perf/util/stat-shadow.c b/tools/per

[PATCH v4 05/12] perf util: Create the runtime_stat init/free function

2017-11-29 Thread Jin Yao
It mainly initializes the rblist in struct runtime_stat. For the original rblist 'runtime_saved_values', it's still there for keeping the patch bisectable. The rblist 'runtime_saved_values' will be removed in later patch at switching time. Signed-off-by: Jin Yao <yao@linux.intel.

[PATCH v4 02/12] perf util: Define a structure for runtime shadow stats

2017-11-29 Thread Jin Yao
-thread. Signed-off-by: Jin Yao --- tools/perf/util/stat-shadow.c | 11 --- tools/perf/util/stat.h| 44 ++- 2 files changed, 43 insertions(+), 12 deletions(-) diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c index

[PATCH v4 05/12] perf util: Create the runtime_stat init/free function

2017-11-29 Thread Jin Yao
It mainly initializes the rblist in struct runtime_stat. For the original rblist 'runtime_saved_values', it's still there for keeping the patch bisectable. The rblist 'runtime_saved_values' will be removed in later patch at switching time. Signed-off-by: Jin Yao --- tools/perf/util/stat

[PATCH v4 07/12] perf util: Remove a set of shadow stats static variables

2017-11-29 Thread Jin Yao
In previous patches, we have reconstructed the code and let it not access the static variables directly. This patch removes these static variables. Signed-off-by: Jin Yao <yao@linux.intel.com> --- tools/perf/util/stat-shadow.c | 68 ++- tool

[PATCH v4 07/12] perf util: Remove a set of shadow stats static variables

2017-11-29 Thread Jin Yao
In previous patches, we have reconstructed the code and let it not access the static variables directly. This patch removes these static variables. Signed-off-by: Jin Yao --- tools/perf/util/stat-shadow.c | 68 ++- tools/perf/util/stat.h| 1 + 2

[PATCH v4 08/12] perf stat: Allocate shadow stats buffer for threads

2017-11-29 Thread Jin Yao
in stat_config. Signed-off-by: Jin Yao <yao@linux.intel.com> --- tools/perf/builtin-stat.c | 46 +- tools/perf/util/stat.h| 2 ++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c

[PATCH v4 08/12] perf stat: Allocate shadow stats buffer for threads

2017-11-29 Thread Jin Yao
in stat_config. Signed-off-by: Jin Yao --- tools/perf/builtin-stat.c | 46 +- tools/perf/util/stat.h| 2 ++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 1edc082..4b88803 100644

[PATCH v4 12/12] perf stat: Resort '--per-thread' result

2017-11-29 Thread Jin Yao
2,654 cycles watchdog/6-442,017 cycles watchdog/7-502,017 cycles 2.175726600 seconds time elapsed Signed-off-by: Jin Yao <yao@linux.intel.com> --- tools/perf/builtin-stat.

[PATCH v4 11/12] perf stat: Remove --per-thread pid/tid limitation

2017-11-29 Thread Jin Yao
stat events on existing thread id This patch removes this limitation. If no pid/tid specified, it returns all threads (get threads from /proc). Note that it doesn't support cpu_list yet so if it's a cpu_list case, then skip. Signed-off-by: Jin Yao <yao@linux.intel.com> --- tools/perf/b

[PATCH v4 04/12] perf util: Add rbtree node_delete ops

2017-11-29 Thread Jin Yao
In current stat-shadow.c, the rbtree deleting is ignored. The patch adds the implementation to node_delete method of rblist. Signed-off-by: Jin Yao <yao@linux.intel.com> --- tools/perf/util/stat-shadow.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a

[PATCH v4 06/12] perf util: Update and print per-thread shadow stats

2017-11-29 Thread Jin Yao
'. It will not directly get value from static variable. Instead, it now uses runtime_stat_avg() and runtime_stat_n() to get and compute the values. Signed-off-by: Jin Yao <yao@linux.intel.com> --- tools/perf/builtin-script.c | 6 +- tools/perf/builtin-stat.c | 27 ++-- tools/per

[PATCH v4 12/12] perf stat: Resort '--per-thread' result

2017-11-29 Thread Jin Yao
2,654 cycles watchdog/6-442,017 cycles watchdog/7-502,017 cycles 2.175726600 seconds time elapsed Signed-off-by: Jin Yao --- tools/perf/builtin-stat.c | 77

[PATCH v4 11/12] perf stat: Remove --per-thread pid/tid limitation

2017-11-29 Thread Jin Yao
stat events on existing thread id This patch removes this limitation. If no pid/tid specified, it returns all threads (get threads from /proc). Note that it doesn't support cpu_list yet so if it's a cpu_list case, then skip. Signed-off-by: Jin Yao --- tools/perf/builtin-stat.c | 23

[PATCH v4 04/12] perf util: Add rbtree node_delete ops

2017-11-29 Thread Jin Yao
In current stat-shadow.c, the rbtree deleting is ignored. The patch adds the implementation to node_delete method of rblist. Signed-off-by: Jin Yao --- tools/perf/util/stat-shadow.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/stat-shadow.c b

[PATCH v4 06/12] perf util: Update and print per-thread shadow stats

2017-11-29 Thread Jin Yao
'. It will not directly get value from static variable. Instead, it now uses runtime_stat_avg() and runtime_stat_n() to get and compute the values. Signed-off-by: Jin Yao --- tools/perf/builtin-script.c | 6 +- tools/perf/builtin-stat.c | 27 ++-- tools/perf/util/stat-shadow.c | 293

[PATCH v4 10/12] perf util: Reuse thread_map__new_by_uid to enumerate threads from /proc

2017-11-29 Thread Jin Yao
by thread_map__new_by_uid() and a new function thread_map__new_threads(). The new function thread_map__new_threads() is called to enumerate all threads from /proc. Signed-off-by: Jin Yao <yao@linux.intel.com> --- tools/perf/tests/thread-map.c | 2 +- tools/perf/util/evlist.c | 3 ++- tool

[PATCH v4 10/12] perf util: Reuse thread_map__new_by_uid to enumerate threads from /proc

2017-11-29 Thread Jin Yao
by thread_map__new_by_uid() and a new function thread_map__new_threads(). The new function thread_map__new_threads() is called to enumerate all threads from /proc. Signed-off-by: Jin Yao --- tools/perf/tests/thread-map.c | 2 +- tools/perf/util/evlist.c | 3 ++- tools/perf/util/thread_map.c | 19

[PATCH v4 09/12] perf stat: Update or print per-thread stats

2017-11-29 Thread Jin Yao
If the stats pointer in stat_config structure is not null, it will update the per-thread stats or print the per-thread stats on this buffer. Signed-off-by: Jin Yao <yao@linux.intel.com> --- tools/perf/builtin-stat.c | 9 +++-- tools/perf/util/stat.c| 11 --- 2 files c

[PATCH v4 09/12] perf stat: Update or print per-thread stats

2017-11-29 Thread Jin Yao
If the stats pointer in stat_config structure is not null, it will update the per-thread stats or print the per-thread stats on this buffer. Signed-off-by: Jin Yao --- tools/perf/builtin-stat.c | 9 +++-- tools/perf/util/stat.c| 11 --- 2 files changed, 15 insertions(+), 5

[PATCH v4 00/12] perf stat: Enable '--per-thread' on all thread

2017-11-29 Thread Jin Yao
watchdog/6-442,017 cycles watchdog/7-502,017 cycles 2.175726600 seconds time elapsed Jin Yao (12): perf util: Create rblist__reset() function perf util: Define a structure for runtime shadow stats perf util: Extend rbtree to support shadow

[PATCH v4 00/12] perf stat: Enable '--per-thread' on all thread

2017-11-29 Thread Jin Yao
watchdog/6-442,017 cycles watchdog/7-502,017 cycles 2.175726600 seconds time elapsed Jin Yao (12): perf util: Create rblist__reset() function perf util: Define a structure for runtime shadow stats perf util: Extend rbtree to support shadow

Re: [PATCH v3 00/11] perf stat: Enable '--per-thread' on all thread

2017-11-29 Thread Jin, Yao
On 11/29/2017 11:16 PM, Jiri Olsa wrote: On Wed, Nov 29, 2017 at 08:05:47PM +0800, Jin Yao wrote: v3: --- Update according to Jiri's comments. The major modifications are: 1. Fix the crash issue when performing the git bisect. Move the removing of runtime_saved_values to the switching

Re: [PATCH v3 00/11] perf stat: Enable '--per-thread' on all thread

2017-11-29 Thread Jin, Yao
On 11/29/2017 11:16 PM, Jiri Olsa wrote: On Wed, Nov 29, 2017 at 08:05:47PM +0800, Jin Yao wrote: v3: --- Update according to Jiri's comments. The major modifications are: 1. Fix the crash issue when performing the git bisect. Move the removing of runtime_saved_values to the switching

[PATCH v3 04/11] perf util: Add rbtree node_delete ops

2017-11-28 Thread Jin Yao
In current stat-shadow.c, the rbtree deleting is ignored. The patch adds the implementation to node_delete method of rblist. Signed-off-by: Jin Yao <yao@linux.intel.com> --- tools/perf/util/stat-shadow.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a

[PATCH v3 04/11] perf util: Add rbtree node_delete ops

2017-11-28 Thread Jin Yao
In current stat-shadow.c, the rbtree deleting is ignored. The patch adds the implementation to node_delete method of rblist. Signed-off-by: Jin Yao --- tools/perf/util/stat-shadow.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/stat-shadow.c b

[PATCH v3 02/11] perf util: Define a structure for runtime shadow stats

2017-11-28 Thread Jin Yao
-thread. Signed-off-by: Jin Yao <yao@linux.intel.com> --- tools/perf/util/stat-shadow.c | 11 --- tools/perf/util/stat.h| 46 ++- 2 files changed, 45 insertions(+), 12 deletions(-) diff --git a/tools/perf/util/stat-shadow.c b/tools/per

[PATCH v3 02/11] perf util: Define a structure for runtime shadow stats

2017-11-28 Thread Jin Yao
-thread. Signed-off-by: Jin Yao --- tools/perf/util/stat-shadow.c | 11 --- tools/perf/util/stat.h| 46 ++- 2 files changed, 45 insertions(+), 12 deletions(-) diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c index

[PATCH v3 05/11] perf util: Create the runtime_stat init/free function

2017-11-28 Thread Jin Yao
It mainly initializes the rblist in struct runtime_stat. For the original rblist 'runtime_saved_values', it's still there for keeping the patch bisectable. The rblist 'runtime_saved_values' will be removed in later patch at switching time. Signed-off-by: Jin Yao <yao@linux.intel.

[PATCH v3 05/11] perf util: Create the runtime_stat init/free function

2017-11-28 Thread Jin Yao
It mainly initializes the rblist in struct runtime_stat. For the original rblist 'runtime_saved_values', it's still there for keeping the patch bisectable. The rblist 'runtime_saved_values' will be removed in later patch at switching time. Signed-off-by: Jin Yao --- tools/perf/util/stat

[PATCH v3 06/11] perf util: Update and print per-thread shadow stats

2017-11-28 Thread Jin Yao
'. It will not directly get value from static variable. Instead, it now uses runtime_stat_avg() and runtime_stat_n() to get and compute the values. Signed-off-by: Jin Yao <yao@linux.intel.com> --- tools/perf/builtin-script.c | 6 +- tools/perf/builtin-stat.c | 34 +++-- tool

[PATCH v3 06/11] perf util: Update and print per-thread shadow stats

2017-11-28 Thread Jin Yao
'. It will not directly get value from static variable. Instead, it now uses runtime_stat_avg() and runtime_stat_n() to get and compute the values. Signed-off-by: Jin Yao --- tools/perf/builtin-script.c | 6 +- tools/perf/builtin-stat.c | 34 +++-- tools/perf/util/stat-shadow.c | 293

[PATCH v3 01/11] perf util: Create rblist__reset() function

2017-11-28 Thread Jin Yao
. This patch creates a new function rblist__reset() which function is similar as rblist__delete() but it will not free the rblist. Signed-off-by: Jin Yao <yao@linux.intel.com> --- tools/perf/util/rblist.c | 24 +--- tools/perf/util/rblist.h | 1 + 2 files changed, 18 inse

[PATCH v3 01/11] perf util: Create rblist__reset() function

2017-11-28 Thread Jin Yao
. This patch creates a new function rblist__reset() which function is similar as rblist__delete() but it will not free the rblist. Signed-off-by: Jin Yao --- tools/perf/util/rblist.c | 24 +--- tools/perf/util/rblist.h | 1 + 2 files changed, 18 insertions(+), 7 deletions(-) diff

[PATCH v3 10/11] perf stat: Remove --per-thread pid/tid limitation

2017-11-28 Thread Jin Yao
stat events on existing thread id This patch removes this limitation. If no pid/tid specified, it returns all threads (get threads from /proc). Note that it doesn't support cpu_list yet so if it's a cpu_list case, then skip. Signed-off-by: Jin Yao <yao@linux.intel.com> --- tools/perf/b

[PATCH v3 10/11] perf stat: Remove --per-thread pid/tid limitation

2017-11-28 Thread Jin Yao
stat events on existing thread id This patch removes this limitation. If no pid/tid specified, it returns all threads (get threads from /proc). Note that it doesn't support cpu_list yet so if it's a cpu_list case, then skip. Signed-off-by: Jin Yao --- tools/perf/builtin-stat.c | 23

[PATCH v3 08/11] perf stat: Allocate shadow stats buffer for threads

2017-11-28 Thread Jin Yao
in stat_config. Signed-off-by: Jin Yao <yao@linux.intel.com> --- tools/perf/builtin-stat.c | 46 +- tools/perf/util/stat.c| 11 --- 2 files changed, 53 insertions(+), 4 deletions(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/b

[PATCH v3 08/11] perf stat: Allocate shadow stats buffer for threads

2017-11-28 Thread Jin Yao
in stat_config. Signed-off-by: Jin Yao --- tools/perf/builtin-stat.c | 46 +- tools/perf/util/stat.c| 11 --- 2 files changed, 53 insertions(+), 4 deletions(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index c7fe582

[PATCH v3 11/11] perf stat: Resort '--per-thread' result

2017-11-28 Thread Jin Yao
2,654 cycles watchdog/6-442,017 cycles watchdog/7-502,017 cycles 2.175726600 seconds time elapsed Signed-off-by: Jin Yao <yao@linux.intel.com> --- tools/perf/builtin-stat.

[PATCH v3 11/11] perf stat: Resort '--per-thread' result

2017-11-28 Thread Jin Yao
2,654 cycles watchdog/6-442,017 cycles watchdog/7-502,017 cycles 2.175726600 seconds time elapsed Signed-off-by: Jin Yao --- tools/perf/builtin-stat.c | 73

[PATCH v3 07/11] perf util: Remove a set of shadow stats static variables

2017-11-28 Thread Jin Yao
In previous patches, we have reconstructed the code and let it not access the static variables directly. This patch removes these static variables. Signed-off-by: Jin Yao <yao@linux.intel.com> --- tools/perf/util/stat-shadow.c | 68 ++- tool

[PATCH v3 07/11] perf util: Remove a set of shadow stats static variables

2017-11-28 Thread Jin Yao
In previous patches, we have reconstructed the code and let it not access the static variables directly. This patch removes these static variables. Signed-off-by: Jin Yao --- tools/perf/util/stat-shadow.c | 68 ++- tools/perf/util/stat.h| 1 + 2

[PATCH v3 00/11] perf stat: Enable '--per-thread' on all thread

2017-11-28 Thread Jin Yao
6 cycles watchdog/2-203,850 cycles kworker/u16:2-23146 2,654 cycles watchdog/6-442,017 cycles watchdog/7-502,017 cycles 2.175726600 seconds time elapsed Jin Yao

<    7   8   9   10   11   12   13   14   15   16   >