Skip to content

Commit

Permalink
Merge tag 'perf-core-for-mingo-20160330' 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:

User visible changes:

  - Add support for skipping itrace instructions, useful to fast forward
    processor trace (Intel PT, BTS) to right after initialization code at the start
    of a workload (Andi Kleen)

  - Add support for backtraces in perl 'perf script's (Dima Kogan)

  - Add -U/-K (--all-user/--all-kernel) options to 'perf mem' (Jiri Olsa)

  - Make -f/--force option documentation consistent across tools (Jiri Olsa)

Infrastructure changes:

  - Add 'perf test' to check for event times (Jiri Olsa)

  - 'perf config' cleanups (Taeung Song)

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 31, 2016
2 parents c932cf0 + d1706b3 commit 643cb15
Show file tree
Hide file tree
Showing 21 changed files with 448 additions and 55 deletions.
7 changes: 7 additions & 0 deletions tools/perf/Documentation/intel-pt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,7 @@ The letters are:
d create a debug log
g synthesize a call chain (use with i or x)
l synthesize last branch entries (use with i or x)
s skip initial number of events

"Instructions" events look like they were recorded by "perf record -e
instructions".
Expand Down Expand Up @@ -730,6 +731,12 @@ from one sample to the next.

To disable trace decoding entirely, use the option --no-itrace.

It is also possible to skip events generated (instructions, branches, transactions)
at the beginning. This is useful to ignore initialization code.

--itrace=i0nss1000000

skips the first million instructions.

dump option
-----------
Expand Down
8 changes: 8 additions & 0 deletions tools/perf/Documentation/itrace.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
d create a debug log
g synthesize a call chain (use with i or x)
l synthesize last branch entries (use with i or x)
s skip initial number of events

The default is all events i.e. the same as --itrace=ibxe

Expand All @@ -24,3 +25,10 @@

Also the number of last branch entries (default 64, max. 1024) for
instructions or transactions events can be specified.

It is also possible to skip events generated (instructions, branches, transactions)
at the beginning. This is useful to ignore initialization code.

--itrace=i0nss1000000

skips the first million instructions.
2 changes: 1 addition & 1 deletion tools/perf/Documentation/perf-annotate.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ OPTIONS

-f::
--force::
Don't complain, do it.
Don't do ownership validation.

-v::
--verbose::
Expand Down
2 changes: 1 addition & 1 deletion tools/perf/Documentation/perf-diff.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ OPTIONS

-f::
--force::
Don't complain, do it.
Don't do ownership validation.

--symfs=<directory>::
Look for files with symbols relative to this directory.
Expand Down
8 changes: 8 additions & 0 deletions tools/perf/Documentation/perf-mem.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ OPTIONS
option can be passed in record mode. It will be interpreted the same way as perf
record.

-K::
--all-kernel::
Configure all used events to run in kernel space.

-U::
--all-user::
Configure all used events to run in user space.

SEE ALSO
--------
linkperf:perf-record[1], linkperf:perf-report[1]
2 changes: 1 addition & 1 deletion tools/perf/Documentation/perf-report.txt
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ OPTIONS

-f::
--force::
Don't complain, do it.
Don't do ownership validation.

--symfs=<directory>::
Look for files with symbols relative to this directory.
Expand Down
4 changes: 4 additions & 0 deletions tools/perf/Documentation/perf-script.txt
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ include::itrace.txt[]
--ns::
Use 9 decimal places when displaying time (i.e. show the nanoseconds)

-f::
--force::
Don't do ownership validation.

SEE ALSO
--------
linkperf:perf-record[1], linkperf:perf-script-perl[1],
Expand Down
11 changes: 10 additions & 1 deletion tools/perf/builtin-mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,22 @@ static int __cmd_record(int argc, const char **argv, struct perf_mem *mem)
int rec_argc, i = 0, j;
const char **rec_argv;
int ret;
bool all_user = false, all_kernel = false;
struct option options[] = {
OPT_CALLBACK('e', "event", &mem, "event",
"event selector. use 'perf mem record -e list' to list available events",
parse_record_events),
OPT_INCR('v', "verbose", &verbose,
"be more verbose (show counter open errors, etc)"),
OPT_BOOLEAN('U', "--all-user", &all_user, "collect only user level data"),
OPT_BOOLEAN('K', "--all-kernel", &all_kernel, "collect only kernel level data"),
OPT_END()
};

argc = parse_options(argc, argv, options, record_mem_usage,
PARSE_OPT_STOP_AT_NON_OPTION);

rec_argc = argc + 7; /* max number of arguments */
rec_argc = argc + 9; /* max number of arguments */
rec_argv = calloc(rec_argc + 1, sizeof(char *));
if (!rec_argv)
return -1;
Expand Down Expand Up @@ -103,6 +106,12 @@ static int __cmd_record(int argc, const char **argv, struct perf_mem *mem)
rec_argv[i++] = perf_mem_events__name(j);
};

if (all_user)
rec_argv[i++] = "--all-user";

if (all_kernel)
rec_argv[i++] = "--all-kernel";

for (j = 0; j < argc; j++, i++)
rec_argv[i] = argv[j];

Expand Down
3 changes: 1 addition & 2 deletions tools/perf/perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ int main(int argc, const char **argv)
srandom(time(NULL));

perf_config(perf_default_config, NULL);
set_buildid_dir(NULL);

/* get debugfs/tracefs mount point from /proc/mounts */
tracing_path_mount();
Expand All @@ -572,7 +573,6 @@ int main(int argc, const char **argv)
}
if (!prefixcmp(cmd, "trace")) {
#ifdef HAVE_LIBAUDIT_SUPPORT
set_buildid_dir(NULL);
setup_path();
argv[0] = "trace";
return cmd_trace(argc, argv, NULL);
Expand All @@ -587,7 +587,6 @@ int main(int argc, const char **argv)
argc--;
handle_options(&argv, &argc, NULL);
commit_pager_choice();
set_buildid_dir(NULL);

if (argc > 0) {
if (!prefixcmp(argv[0], "--"))
Expand Down
1 change: 1 addition & 0 deletions tools/perf/tests/Build
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ perf-y += topology.o
perf-y += cpumap.o
perf-y += stat.o
perf-y += event_update.o
perf-y += event-times.o

$(OUTPUT)tests/llvm-src-base.c: tests/bpf-script-example.c tests/Build
$(call rule_mkdir)
Expand Down
4 changes: 4 additions & 0 deletions tools/perf/tests/builtin-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ static struct test generic_tests[] = {
.desc = "Test attr update synthesize",
.func = test__event_update,
},
{
.desc = "Test events times",
.func = test__event_times,
},
{
.func = NULL,
},
Expand Down
Loading

0 comments on commit 643cb15

Please sign in to comment.