Merge branch 'perf/urgent' into perf/core
authorIngo Molnar <mingo@kernel.org>
Tue, 29 Oct 2013 10:23:32 +0000 (11:23 +0100)
committerIngo Molnar <mingo@kernel.org>
Tue, 29 Oct 2013 10:23:32 +0000 (11:23 +0100)
Conflicts:
tools/perf/builtin-record.c
tools/perf/builtin-top.c
tools/perf/util/hist.h

16 files changed:
1  2 
kernel/events/core.c
tools/perf/Documentation/perf-record.txt
tools/perf/Documentation/perf-top.txt
tools/perf/builtin-kvm.c
tools/perf/builtin-record.c
tools/perf/builtin-top.c
tools/perf/builtin-trace.c
tools/perf/tests/perf-record.c
tools/perf/tests/task-exit.c
tools/perf/util/callchain.h
tools/perf/util/evlist.c
tools/perf/util/evlist.h
tools/perf/util/evsel.c
tools/perf/util/hist.h
tools/perf/util/probe-finder.c
tools/perf/util/python.c

Simple merge
@@@ -87,13 -87,23 +87,25 @@@ OPTION
  
  -m::
  --mmap-pages=::
 -      Number of mmap data pages. Must be a power of two.
 +      Number of mmap data pages (must be a power of two) or size
 +      specification with appended unit character - B/K/M/G. The
 +      size is rounded up to have nearest pages power of two value.
  
  -g::
+       Enables call-graph (stack chain/backtrace) recording.
  --call-graph::
-       Do call-graph (stack chain/backtrace) recording.
+       Setup and enable call-graph (stack chain/backtrace) recording,
+       implies -g.
+       Allows specifying "fp" (frame pointer) or "dwarf"
+       (DWARF's CFI - Call Frame Information) as the method to collect
+       the information used to show the call graphs.
+       In some systems, where binaries are build with gcc
+       --fomit-frame-pointer, using the "fp" method will produce bogus
+       call graphs, using "dwarf", if available (perf tools linked to
+       the libunwind library) should be used instead.
  
  -q::
  --quiet::
@@@ -143,29 -140,13 +143,21 @@@ Default is to monitor all CPUS
  --asm-raw::
        Show raw instruction encoding of assembly instructions.
  
- -G [type,min,order]::
+ -G::
+       Enables call-graph (stack chain/backtrace) recording.
  --call-graph::
-         Display call chains using type, min percent threshold and order.
-       type can be either:
-       - flat: single column, linear exposure of call chains.
-       - graph: use a graph tree, displaying absolute overhead rates.
-       - fractal: like graph, but displays relative rates. Each branch of
-                the tree is considered as a new profiled object.
-       order can be either:
-       - callee: callee based call graph.
-       - caller: inverted caller based call graph.
-       Default: fractal,0.5,callee.
+       Setup and enable call-graph (stack chain/backtrace) recording,
+       implies -G.
  
 +--max-stack::
 +      Set the stack depth limit when parsing the callchain, anything
 +      beyond the specified depth will be ignored. This is a trade-off
 +      between information loss and faster processing especially for
 +      workloads that can have a very long callchain stack.
 +
 +      Default: 127
 +
  --ignore-callees=<regex>::
          Ignore callees of the function(s) matching the given regex.
          This has the effect of collecting the callers of each such
Simple merge
@@@ -676,12 -710,10 +676,10 @@@ static int get_stack_size(char *str, un
               max_size, str);
        return -1;
  }
 -#endif /* LIBUNWIND_SUPPORT */
 +#endif /* HAVE_LIBUNWIND_SUPPORT */
  
- int record_parse_callchain_opt(const struct option *opt,
-                              const char *arg, int unset)
+ int record_parse_callchain(const char *arg, struct perf_record_opts *opts)
  {
-       struct perf_record_opts *opts = opt->value;
        char *tok, *name, *saveptr = NULL;
        char *buf;
        int ret = -1;
                                ret = get_stack_size(tok, &size);
                                opts->stack_dump_size = size;
                        }
-                       if (!ret)
-                               pr_debug("callchain: stack dump size %d\n",
-                                        opts->stack_dump_size);
 -#endif /* LIBUNWIND_SUPPORT */
 +#endif /* HAVE_LIBUNWIND_SUPPORT */
                } else {
-                       pr_err("callchain: Unknown -g option "
+                       pr_err("callchain: Unknown --call-graph option "
                               "value: %s\n", arg);
                        break;
                }
@@@ -779,12 -839,12 +805,12 @@@ static struct perf_record record = 
        },
  };
  
- #define CALLCHAIN_HELP "do call-graph (stack chain/backtrace) recording: "
+ #define CALLCHAIN_HELP "setup and enables call-graph (stack chain/backtrace) recording: "
  
 -#ifdef LIBUNWIND_SUPPORT
 +#ifdef HAVE_LIBUNWIND_SUPPORT
- const char record_callchain_help[] = CALLCHAIN_HELP "[fp] dwarf";
+ const char record_callchain_help[] = CALLCHAIN_HELP "fp dwarf";
  #else
- const char record_callchain_help[] = CALLCHAIN_HELP "[fp]";
+ const char record_callchain_help[] = CALLCHAIN_HELP "fp";
  #endif
  
  /*
@@@ -820,14 -880,16 +846,17 @@@ const struct option record_options[] = 
        OPT_BOOLEAN('i', "no-inherit", &record.opts.no_inherit,
                    "child tasks do not inherit counters"),
        OPT_UINTEGER('F', "freq", &record.opts.user_freq, "profile at this frequency"),
 -      OPT_UINTEGER('m', "mmap-pages", &record.opts.mmap_pages,
 -                   "number of mmap data pages"),
 +      OPT_CALLBACK('m', "mmap-pages", &record.opts.mmap_pages, "pages",
 +                   "number of mmap data pages",
 +                   perf_evlist__parse_mmap_pages),
        OPT_BOOLEAN(0, "group", &record.opts.group,
                    "put the counters into a counter group"),
-       OPT_CALLBACK_DEFAULT('g', "call-graph", &record.opts,
-                            "mode[,dump_size]", record_callchain_help,
-                            &record_parse_callchain_opt, "fp"),
+       OPT_CALLBACK_NOOPT('g', NULL, &record.opts,
+                          NULL, "enables call-graph recording" ,
+                          &record_callchain_opt),
+       OPT_CALLBACK(0, "call-graph", &record.opts,
+                    "mode[,dump_size]", record_callchain_help,
+                    &record_parse_callchain_opt),
        OPT_INCR('v', "verbose", &verbose,
                    "be more verbose (show counter open errors, etc)"),
        OPT_BOOLEAN('q', "quiet", &quiet, "don't print any message"),
@@@ -1104,16 -1105,15 +1106,19 @@@ int cmd_top(int argc, const char **argv
        OPT_INCR('v', "verbose", &verbose,
                    "be more verbose (show counter open errors, etc)"),
        OPT_STRING('s', "sort", &sort_order, "key[,key2...]",
 -                 "sort by key(s): pid, comm, dso, symbol, parent, weight, local_weight"),
 +                 "sort by key(s): pid, comm, dso, symbol, parent, weight, local_weight,"
 +                 " abort, in_tx, transaction"),
        OPT_BOOLEAN('n', "show-nr-samples", &symbol_conf.show_nr_samples,
                    "Show a column with the number of samples"),
-       OPT_CALLBACK_DEFAULT('G', "call-graph", &top.record_opts,
-                            "mode[,dump_size]", record_callchain_help,
-                            &parse_callchain_opt, "fp"),
+       OPT_CALLBACK_NOOPT('G', NULL, &top.record_opts,
+                          NULL, "enables call-graph recording",
+                          &callchain_opt),
+       OPT_CALLBACK(0, "call-graph", &top.record_opts,
+                    "mode[,dump_size]", record_callchain_help,
+                    &parse_callchain_opt),
 +      OPT_INTEGER(0, "max-stack", &top.max_stack,
 +                  "Set the maximum stack depth when parsing the callchain. "
 +                  "Default: " __stringify(PERF_MAX_STACK_DEPTH)),
        OPT_CALLBACK(0, "ignore-callees", NULL, "regex",
                   "ignore callees of these functions in call graphs",
                   report_parse_ignore_callees_opt),
@@@ -1744,10 -987,10 +1744,10 @@@ again
                        err = perf_evlist__parse_sample(evlist, event, &sample);
                        if (err) {
                                fprintf(trace->output, "Can't parse sample, err = %d, skipping...\n", err);
-                               continue;
+                               goto next_event;
                        }
  
 -                      if (trace->base_time == 0)
 +                      if (!trace->full_time && trace->base_time == 0)
                                trace->base_time = sample.time;
  
                        if (type != PERF_RECORD_SAMPLE) {
  
                        handler = evsel->handler.func;
                        handler(trace, evsel, &sample);
+ next_event:
+                       perf_evlist__mmap_consume(evlist, i);
  
 -                      if (done)
 -                              goto out_unmap_evlist;
 +                      if (interrupted)
 +                              goto out_disable;
                }
        }
  
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -678,12 -678,8 +678,11 @@@ void perf_evsel__config(struct perf_evs
                attr->sample_type       |= PERF_SAMPLE_WEIGHT;
  
        attr->mmap  = track;
-       attr->mmap2 = track && !perf_missing_features.mmap2;
        attr->comm  = track;
  
 +      if (opts->sample_transaction)
 +              attr->sample_type       |= PERF_SAMPLE_TRANSACTION;
 +
        /*
         * XXX see the function comment above
         *
@@@ -5,7 -5,7 +5,8 @@@
  #include <pthread.h>
  #include "callchain.h"
  #include "header.h"
+ #include "color.h"
 +#include "ui/progress.h"
  
  extern struct callchain_param callchain_param;
  
Simple merge
Simple merge