Skip to content

Commit

Permalink
Merge tag 'perf-core-for-mingo-20160310' of git://git.kernel.org/pub/…
Browse files Browse the repository at this point in the history
…scm/linux/kernel/git/acme/linux into perf/core

Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:

User visible changes:

  - Implement 'perf stat --metric-only' (Andi Kleen)

  - Fix perf script python database export crash (Chris Phlipot)

Infrastructure changes:

  - perf top/report --hierarchy assorted fixes for problems introduced in this
    perf/core cycle (Namhyung Kim)

  - Support '~' operation in libtraceevent (Steven Rosted)

Build fixes:

  - Fix bulding of jitdump on opensuse on ubuntu systems when the DWARF
    devel files are not installed (Arnaldo Carvalho de Melo)

  - Do not try building jitdump on unsupported arches (Jiri Olsa)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Ingo Molnar committed Mar 11, 2016
2 parents 3a99e6d + 206cab6 commit ced30bc
Show file tree
Hide file tree
Showing 18 changed files with 542 additions and 146 deletions.
6 changes: 6 additions & 0 deletions tools/lib/traceevent/event-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -2398,6 +2398,12 @@ static int arg_num_eval(struct print_arg *arg, long long *val)
break;
*val = left + right;
break;
case '~':
ret = arg_num_eval(arg->op.right, &right);
if (!ret)
break;
*val = ~right;
break;
default:
do_warning("unknown op '%s'", arg->op.op);
ret = 0;
Expand Down
27 changes: 27 additions & 0 deletions tools/perf/Documentation/perf-stat.txt
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ Print count deltas every N milliseconds (minimum: 10ms)
The overhead percentage could be high in some cases, for instance with small, sub 100ms intervals. Use with caution.
example: 'perf stat -I 1000 -e cycles -a sleep 5'

--metric-only::
Only print computed metrics. Print them in a single line.
Don't show any raw values. Not supported with --per-thread.

--per-socket::
Aggregate counts per processor socket for system-wide mode measurements. This
is a useful mode to detect imbalance between sockets. To enable this mode,
Expand Down Expand Up @@ -219,6 +223,29 @@ $ perf stat -- make -j

Wall-clock time elapsed: 719.554352 msecs

CSV FORMAT
----------

With -x, perf stat is able to output a not-quite-CSV format output
Commas in the output are not put into "". To make it easy to parse
it is recommended to use a different character like -x \;

The fields are in this order:

- optional usec time stamp in fractions of second (with -I xxx)
- optional CPU, core, or socket identifier
- optional number of logical CPUs aggregated
- counter value
- unit of the counter value or empty
- event name
- run time of counter
- percentage of measurement time the counter was running
- optional variance if multiple values are collected with -r
- optional metric value
- optional unit of metric

Additional metrics may be printed with all earlier fields being empty.

SEE ALSO
--------
linkperf:perf-top[1], linkperf:perf-list[1]
1 change: 1 addition & 0 deletions tools/perf/arch/arm/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ifndef NO_DWARF
PERF_HAVE_DWARF_REGS := 1
endif
PERF_HAVE_JITDUMP := 1
1 change: 1 addition & 0 deletions tools/perf/arch/arm64/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ifndef NO_DWARF
PERF_HAVE_DWARF_REGS := 1
endif
PERF_HAVE_JITDUMP := 1
1 change: 1 addition & 0 deletions tools/perf/arch/powerpc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ PERF_HAVE_DWARF_REGS := 1
endif

HAVE_KVM_STAT_SUPPORT := 1
PERF_HAVE_JITDUMP := 1
1 change: 1 addition & 0 deletions tools/perf/arch/x86/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ PERF_HAVE_DWARF_REGS := 1
endif
HAVE_KVM_STAT_SUPPORT := 1
PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET := 1
PERF_HAVE_JITDUMP := 1
12 changes: 7 additions & 5 deletions tools/perf/builtin-inject.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ static int perf_event__repipe_oe_synth(struct perf_tool *tool,
return perf_event__repipe_synth(tool, event);
}

#ifdef HAVE_LIBELF_SUPPORT
#ifdef HAVE_JITDUMP
static int perf_event__drop_oe(struct perf_tool *tool __maybe_unused,
union perf_event *event __maybe_unused,
struct ordered_events *oe __maybe_unused)
Expand Down Expand Up @@ -245,7 +245,7 @@ static int perf_event__repipe_mmap(struct perf_tool *tool,
return err;
}

#ifdef HAVE_LIBELF_SUPPORT
#ifdef HAVE_JITDUMP
static int perf_event__jit_repipe_mmap(struct perf_tool *tool,
union perf_event *event,
struct perf_sample *sample,
Expand Down Expand Up @@ -283,7 +283,7 @@ static int perf_event__repipe_mmap2(struct perf_tool *tool,
return err;
}

#ifdef HAVE_LIBELF_SUPPORT
#ifdef HAVE_JITDUMP
static int perf_event__jit_repipe_mmap2(struct perf_tool *tool,
union perf_event *event,
struct perf_sample *sample,
Expand Down Expand Up @@ -778,7 +778,9 @@ int cmd_inject(int argc, const char **argv, const char *prefix __maybe_unused)
OPT_BOOLEAN('s', "sched-stat", &inject.sched_stat,
"Merge sched-stat and sched-switch for getting events "
"where and how long tasks slept"),
#ifdef HAVE_JITDUMP
OPT_BOOLEAN('j', "jit", &inject.jit_mode, "merge jitdump files into perf.data file"),
#endif
OPT_INCR('v', "verbose", &verbose,
"be more verbose (show build ids, etc)"),
OPT_STRING(0, "kallsyms", &symbol_conf.kallsyms_name, "file",
Expand All @@ -795,7 +797,7 @@ int cmd_inject(int argc, const char **argv, const char *prefix __maybe_unused)
"perf inject [<options>]",
NULL
};
#ifndef HAVE_LIBELF_SUPPORT
#ifndef HAVE_JITDUMP
set_option_nobuild(options, 'j', "jit", "NO_LIBELF=1", true);
#endif
argc = parse_options(argc, argv, options, inject_usage, 0);
Expand Down Expand Up @@ -833,7 +835,7 @@ int cmd_inject(int argc, const char **argv, const char *prefix __maybe_unused)
inject.tool.ordered_events = true;
inject.tool.ordering_requires_timestamps = true;
}
#ifdef HAVE_LIBELF_SUPPORT
#ifdef HAVE_JITDUMP
if (inject.jit_mode) {
inject.tool.mmap2 = perf_event__jit_repipe_mmap2;
inject.tool.mmap = perf_event__jit_repipe_mmap;
Expand Down
Loading

0 comments on commit ced30bc

Please sign in to comment.