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
index f10ab63576d7550dbffade473f45332be969657c,ca0d3d9f4bac831d377fd90f9a38be1021c486ec..052f7c4dc00c25a47dbe6355f0f762744ad5a79a
@@@ -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::
index c16a09e2f182333cfa710d7f11df76240ad4634f,6a118e71d0032e15d3ce8d55b91c24a1be83e31f..7de01dd7968898c18e34f40914017ae549a3f618
@@@ -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
index ab8d15e6e8cca108489a8c7fd620250763c4dc5d,d0465148464022c82e5fcfb431513624edf34740..8b45fcead5f6ac27753d1e478c88f58152b0a5f2
@@@ -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"),
index 76c9264ed0708dee89b07691214f79542c5b8455,5a11f13e56f9f186cc7aa0926f4ee63008327358..a6ea956a533ee48deb72bf9392d14530a4812473
@@@ -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),
index fa620bc1db69bf9bd9c4ee059e1e48a8d07a01a0,99c8d9ad6729cabf6bebe5b65c753af1a28d9024..dc3da654ff12d5d3aa8fa901c24b617b1ef97fda
@@@ -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
index ec0cc1e21c626e3617820039e7a9df4ca60f43eb,9f1ef9bee2d0c96583dac31d4c12bcc220b519bf..3a334f0019979e88ed8fbaa152f2183470c973f5
@@@ -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
         *
index 0c7ce8bb8ebab0b71869cd5362727dd85aac0fef,ce8dc61ce2c358ddea5851079916292e6838a370..9d2d022cdb79f205f39678fe0a0397578e4f3a5c
@@@ -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