Re: [PATCH v3 01/13] perf report: remove code to handle inline frames from browsers

2017-09-18 Thread Milian Wolff
On Monday, September 18, 2017 1:56:19 PM CEST Jiri Olsa wrote:
> On Wed, Sep 06, 2017 at 03:54:49PM +0200, Milian Wolff wrote:
> > The follow-up commits will make inline frames first-class citizens
> > in the callchain, thereby obsoleting all of this special code.
> 
> so you're removing all the inline callchain implementation
> in this patch and adding it back in following patches?
> 
> any chance you could change it gradualy? it's hard to track
> in review if you added everything that you removed ;-)

As I said before, this approach is completely different from the previous one. 
There is no way to change it more gradually than what I have done. At least, I 
cannot think of one.

Bye

-- 
Milian Wolff | milian.wo...@kdab.com | Senior Software Engineer
KDAB (Deutschland) GmbH&Co KG, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt Experts

smime.p7s
Description: S/MIME cryptographic signature


Re: [PATCH v3 01/13] perf report: remove code to handle inline frames from browsers

2017-09-18 Thread Jiri Olsa
On Wed, Sep 06, 2017 at 03:54:49PM +0200, Milian Wolff wrote:
> The follow-up commits will make inline frames first-class citizens
> in the callchain, thereby obsoleting all of this special code.

so you're removing all the inline callchain implementation
in this patch and adding it back in following patches?

any chance you could change it gradualy? it's hard to track
in review if you added everything that you removed ;-)

jirka

> 
> Cc: Arnaldo Carvalho de Melo 
> Cc: David Ahern 
> Cc: Namhyung Kim 
> Cc: Peter Zijlstra 
> Cc: Yao Jin 
> Signed-off-by: Milian Wolff 
> ---
>  tools/perf/ui/browsers/hists.c  | 180 
> +++-
>  tools/perf/ui/stdio/hist.c  |  77 +
>  tools/perf/util/evsel_fprintf.c |  32 ---
>  tools/perf/util/hist.c  |   5 --
>  tools/perf/util/sort.h  |   1 -
>  5 files changed, 13 insertions(+), 282 deletions(-)
> 
> diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
> index 13dfb0a0bdeb..3a433f370e7f 100644
> --- a/tools/perf/ui/browsers/hists.c
> +++ b/tools/perf/ui/browsers/hists.c
> @@ -154,57 +154,9 @@ static void callchain_list__set_folding(struct 
> callchain_list *cl, bool unfold)
>   cl->unfolded = unfold ? cl->has_children : false;
>  }
>  
> -static struct inline_node *inline_node__create(struct map *map, u64 ip)
> -{
> - struct dso *dso;
> - struct inline_node *node;
> -
> - if (map == NULL)
> - return NULL;
> -
> - dso = map->dso;
> - if (dso == NULL)
> - return NULL;
> -
> - node = dso__parse_addr_inlines(dso,
> -map__rip_2objdump(map, ip));
> -
> - return node;
> -}
> -
> -static int inline__count_rows(struct inline_node *node)
> -{
> - struct inline_list *ilist;
> - int i = 0;
> -
> - if (node == NULL)
> - return 0;
> -
> - list_for_each_entry(ilist, &node->val, list) {
> - if ((ilist->filename != NULL) || (ilist->funcname != NULL))
> - i++;
> - }
> -
> - return i;
> -}
> -
> -static int callchain_list__inline_rows(struct callchain_list *chain)
> -{
> - struct inline_node *node;
> - int rows;
> -
> - node = inline_node__create(chain->ms.map, chain->ip);
> - if (node == NULL)
> - return 0;
> -
> - rows = inline__count_rows(node);
> - inline_node__delete(node);
> - return rows;
> -}
> -
>  static int callchain_node__count_rows_rb_tree(struct callchain_node *node)
>  {
> - int n = 0, inline_rows;
> + int n = 0;
>   struct rb_node *nd;
>  
>   for (nd = rb_first(&node->rb_root); nd; nd = rb_next(nd)) {
> @@ -215,12 +167,6 @@ static int callchain_node__count_rows_rb_tree(struct 
> callchain_node *node)
>   list_for_each_entry(chain, &child->val, list) {
>   ++n;
>  
> - if (symbol_conf.inline_name) {
> - inline_rows =
> - callchain_list__inline_rows(chain);
> - n += inline_rows;
> - }
> -
>   /* We need this because we may not have children */
>   folded_sign = callchain_list__folded(chain);
>   if (folded_sign == '+')
> @@ -272,7 +218,7 @@ static int callchain_node__count_rows(struct 
> callchain_node *node)
>  {
>   struct callchain_list *chain;
>   bool unfolded = false;
> - int n = 0, inline_rows;
> + int n = 0;
>  
>   if (callchain_param.mode == CHAIN_FLAT)
>   return callchain_node__count_flat_rows(node);
> @@ -281,10 +227,6 @@ static int callchain_node__count_rows(struct 
> callchain_node *node)
>  
>   list_for_each_entry(chain, &node->val, list) {
>   ++n;
> - if (symbol_conf.inline_name) {
> - inline_rows = callchain_list__inline_rows(chain);
> - n += inline_rows;
> - }
>  
>   unfolded = chain->unfolded;
>   }
> @@ -432,19 +374,6 @@ static void hist_entry__init_have_children(struct 
> hist_entry *he)
>   he->init_have_children = true;
>  }
>  
> -static void hist_entry_init_inline_node(struct hist_entry *he)
> -{
> - if (he->inline_node)
> - return;
> -
> - he->inline_node = inline_node__create(he->ms.map, he->ip);
> -
> - if (he->inline_node == NULL)
> - return;
> -
> - he->has_children = true;
> -}
> -
>  static bool hist_browser__toggle_fold(struct hist_browser *browser)
>  {
>   struct hist_entry *he = browser->he_selection;
> @@ -476,12 +405,8 @@ static bool hist_browser__toggle_fold(struct 
> hist_browser *browser)
>  
>   if (he->unfolded) {
>   if (he->leaf)
> - if (he->inline_node)
> - he->nr_rows = inline__count_rows(
> - 

[PATCH v3 01/13] perf report: remove code to handle inline frames from browsers

2017-09-06 Thread Milian Wolff
The follow-up commits will make inline frames first-class citizens
in the callchain, thereby obsoleting all of this special code.

Cc: Arnaldo Carvalho de Melo 
Cc: David Ahern 
Cc: Namhyung Kim 
Cc: Peter Zijlstra 
Cc: Yao Jin 
Signed-off-by: Milian Wolff 
---
 tools/perf/ui/browsers/hists.c  | 180 +++-
 tools/perf/ui/stdio/hist.c  |  77 +
 tools/perf/util/evsel_fprintf.c |  32 ---
 tools/perf/util/hist.c  |   5 --
 tools/perf/util/sort.h  |   1 -
 5 files changed, 13 insertions(+), 282 deletions(-)

diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 13dfb0a0bdeb..3a433f370e7f 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -154,57 +154,9 @@ static void callchain_list__set_folding(struct 
callchain_list *cl, bool unfold)
cl->unfolded = unfold ? cl->has_children : false;
 }
 
-static struct inline_node *inline_node__create(struct map *map, u64 ip)
-{
-   struct dso *dso;
-   struct inline_node *node;
-
-   if (map == NULL)
-   return NULL;
-
-   dso = map->dso;
-   if (dso == NULL)
-   return NULL;
-
-   node = dso__parse_addr_inlines(dso,
-  map__rip_2objdump(map, ip));
-
-   return node;
-}
-
-static int inline__count_rows(struct inline_node *node)
-{
-   struct inline_list *ilist;
-   int i = 0;
-
-   if (node == NULL)
-   return 0;
-
-   list_for_each_entry(ilist, &node->val, list) {
-   if ((ilist->filename != NULL) || (ilist->funcname != NULL))
-   i++;
-   }
-
-   return i;
-}
-
-static int callchain_list__inline_rows(struct callchain_list *chain)
-{
-   struct inline_node *node;
-   int rows;
-
-   node = inline_node__create(chain->ms.map, chain->ip);
-   if (node == NULL)
-   return 0;
-
-   rows = inline__count_rows(node);
-   inline_node__delete(node);
-   return rows;
-}
-
 static int callchain_node__count_rows_rb_tree(struct callchain_node *node)
 {
-   int n = 0, inline_rows;
+   int n = 0;
struct rb_node *nd;
 
for (nd = rb_first(&node->rb_root); nd; nd = rb_next(nd)) {
@@ -215,12 +167,6 @@ static int callchain_node__count_rows_rb_tree(struct 
callchain_node *node)
list_for_each_entry(chain, &child->val, list) {
++n;
 
-   if (symbol_conf.inline_name) {
-   inline_rows =
-   callchain_list__inline_rows(chain);
-   n += inline_rows;
-   }
-
/* We need this because we may not have children */
folded_sign = callchain_list__folded(chain);
if (folded_sign == '+')
@@ -272,7 +218,7 @@ static int callchain_node__count_rows(struct callchain_node 
*node)
 {
struct callchain_list *chain;
bool unfolded = false;
-   int n = 0, inline_rows;
+   int n = 0;
 
if (callchain_param.mode == CHAIN_FLAT)
return callchain_node__count_flat_rows(node);
@@ -281,10 +227,6 @@ static int callchain_node__count_rows(struct 
callchain_node *node)
 
list_for_each_entry(chain, &node->val, list) {
++n;
-   if (symbol_conf.inline_name) {
-   inline_rows = callchain_list__inline_rows(chain);
-   n += inline_rows;
-   }
 
unfolded = chain->unfolded;
}
@@ -432,19 +374,6 @@ static void hist_entry__init_have_children(struct 
hist_entry *he)
he->init_have_children = true;
 }
 
-static void hist_entry_init_inline_node(struct hist_entry *he)
-{
-   if (he->inline_node)
-   return;
-
-   he->inline_node = inline_node__create(he->ms.map, he->ip);
-
-   if (he->inline_node == NULL)
-   return;
-
-   he->has_children = true;
-}
-
 static bool hist_browser__toggle_fold(struct hist_browser *browser)
 {
struct hist_entry *he = browser->he_selection;
@@ -476,12 +405,8 @@ static bool hist_browser__toggle_fold(struct hist_browser 
*browser)
 
if (he->unfolded) {
if (he->leaf)
-   if (he->inline_node)
-   he->nr_rows = inline__count_rows(
-   he->inline_node);
-   else
-   he->nr_rows = callchain__count_rows(
-   &he->sorted_chain);
+   he->nr_rows = callchain__count_rows(
+   &he->sorted_chain);
else
he->nr_rows = hierarchy_count_rows(b