]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
Merge branch 'linus' into perf/core, to pick up fixes
authorIngo Molnar <mingo@kernel.org>
Thu, 24 Nov 2016 04:09:08 +0000 (05:09 +0100)
committerIngo Molnar <mingo@kernel.org>
Thu, 24 Nov 2016 04:09:08 +0000 (05:09 +0100)
Signed-off-by: Ingo Molnar <mingo@kernel.org>
1  2 
tools/perf/ui/browsers/hists.c
tools/perf/util/hist.c

index 66676cb8effe8f488d93ece2373ce1adb32d2e8d,a53fef0c673bbbfcf8669ffb66f5de079dbc7e18..641b40234a9d7c4d420840c9812dc1bbaceba697
@@@ -30,7 -30,7 +30,7 @@@ static struct rb_node *hists__filter_en
  
  static bool hist_browser__has_filter(struct hist_browser *hb)
  {
 -      return hists__has_filter(hb->hists) || hb->min_pcnt || symbol_conf.has_filter;
 +      return hists__has_filter(hb->hists) || hb->min_pcnt || symbol_conf.has_filter || hb->c2c_filter;
  }
  
  static int hist_browser__get_folding(struct hist_browser *browser)
@@@ -738,7 -738,6 +738,7 @@@ static int hist_browser__show_callchain
                                             struct callchain_print_arg *arg)
  {
        char bf[1024], *alloc_str;
 +      char buf[64], *alloc_str2;
        const char *str;
  
        if (arg->row_offset != 0) {
        }
  
        alloc_str = NULL;
 +      alloc_str2 = NULL;
 +
        str = callchain_list__sym_name(chain, bf, sizeof(bf),
                                       browser->show_dso);
  
 -      if (need_percent) {
 -              char buf[64];
 +      if (symbol_conf.show_branchflag_count) {
 +              if (need_percent)
 +                      callchain_list_counts__printf_value(node, chain, NULL,
 +                                                          buf, sizeof(buf));
 +              else
 +                      callchain_list_counts__printf_value(NULL, chain, NULL,
 +                                                          buf, sizeof(buf));
 +
 +              if (asprintf(&alloc_str2, "%s%s", str, buf) < 0)
 +                      str = "Not enough memory!";
 +              else
 +                      str = alloc_str2;
 +      }
  
 +      if (need_percent) {
                callchain_node__scnprintf_value(node, buf, sizeof(buf),
                                                total);
  
        print(browser, chain, str, offset, row, arg);
  
        free(alloc_str);
 +      free(alloc_str2);
        return 1;
  }
  
@@@ -1353,8 -1337,8 +1353,8 @@@ static int hist_browser__show_hierarchy
                }
  
                if (first) {
-                       ui_browser__printf(&browser->b, "%c", folded_sign);
-                       width--;
+                       ui_browser__printf(&browser->b, "%c ", folded_sign);
+                       width -= 2;
                        first = false;
                } else {
                        ui_browser__printf(&browser->b, "  ");
                width -= hpp.buf - s;
        }
  
-       ui_browser__write_nstring(&browser->b, "", hierarchy_indent);
-       width -= hierarchy_indent;
+       if (!first) {
+               ui_browser__write_nstring(&browser->b, "", hierarchy_indent);
+               width -= hierarchy_indent;
+       }
  
        if (column >= browser->b.horiz_scroll) {
                char s[2048];
                }
  
                perf_hpp_list__for_each_format(entry->hpp_list, fmt) {
-                       ui_browser__write_nstring(&browser->b, "", 2);
+                       if (first) {
+                               ui_browser__printf(&browser->b, "%c ", folded_sign);
+                               first = false;
+                       } else {
+                               ui_browser__write_nstring(&browser->b, "", 2);
+                       }
                        width -= 2;
  
                        /*
@@@ -1571,10 -1563,11 +1579,11 @@@ static int hists_browser__scnprintf_hie
        int indent = hists->nr_hpp_node - 2;
        bool first_node, first_col;
  
-       ret = scnprintf(buf, size, " ");
+       ret = scnprintf(buf, size, "  ");
        if (advance_hpp_check(&dummy_hpp, ret))
                return ret;
  
+       first_node = true;
        /* the first hpp_list_node is for overhead columns */
        fmt_node = list_first_entry(&hists->hpp_formats,
                                    struct perf_hpp_list_node, list);
                ret = scnprintf(dummy_hpp.buf, dummy_hpp.size, "  ");
                if (advance_hpp_check(&dummy_hpp, ret))
                        break;
+               first_node = false;
        }
  
-       ret = scnprintf(dummy_hpp.buf, dummy_hpp.size, "%*s",
-                       indent * HIERARCHY_INDENT, "");
-       if (advance_hpp_check(&dummy_hpp, ret))
-               return ret;
+       if (!first_node) {
+               ret = scnprintf(dummy_hpp.buf, dummy_hpp.size, "%*s",
+                               indent * HIERARCHY_INDENT, "");
+               if (advance_hpp_check(&dummy_hpp, ret))
+                       return ret;
+       }
  
        first_node = true;
        list_for_each_entry_continue(fmt_node, &hists->hpp_formats, list) {
@@@ -2836,10 -2833,7 +2849,10 @@@ static int perf_evsel__hists_browse(str
                        do_zoom_dso(browser, actions);
                        continue;
                case 'V':
 -                      browser->show_dso = !browser->show_dso;
 +                      verbose = (verbose + 1) % 4;
 +                      browser->show_dso = verbose > 0;
 +                      ui_helpline__fpush("Verbosity level set to %d\n",
 +                                         verbose);
                        continue;
                case 't':
                        actions->thread = thread;
diff --combined tools/perf/util/hist.c
index e1be4132054dea6fcbc40e72f518bc53cc47865d,a69f027368ef49caf0c259e035cf886fb7062d32..6770a964560954e0b7d028698a50b8bcab0cf891
@@@ -1195,7 -1195,6 +1195,7 @@@ static void hist_entry__check_and_remov
        case HIST_FILTER__GUEST:
        case HIST_FILTER__HOST:
        case HIST_FILTER__SOCKET:
 +      case HIST_FILTER__C2C:
        default:
                return;
        }
@@@ -1601,18 -1600,18 +1601,18 @@@ static void hists__hierarchy_output_res
                if (prog)
                        ui_progress__update(prog, 1);
  
+               hists->nr_entries++;
+               if (!he->filtered) {
+                       hists->nr_non_filtered_entries++;
+                       hists__calc_col_len(hists, he);
+               }
                if (!he->leaf) {
                        hists__hierarchy_output_resort(hists, prog,
                                                       &he->hroot_in,
                                                       &he->hroot_out,
                                                       min_callchain_hits,
                                                       use_callchain);
-                       hists->nr_entries++;
-                       if (!he->filtered) {
-                               hists->nr_non_filtered_entries++;
-                               hists__calc_col_len(hists, he);
-                       }
                        continue;
                }