-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'perf-core-for-mingo-4.11-20170111' of git://git.kernel.org…
…/pub/scm/linux/kernel/git/acme/linux into perf/core Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: New features: - Add more triggers to switch the output file (perf.data.TIMESTAMP). Now, in addition to switching to a different output file when receiving a SIGUSR2, one can also specify file size and time based triggers: perf record -a --switch-output=signal is equivalent to what we had before: perf record -a --switch-output While we can also ask for the file to be "sliced" by size, taking into account that that will happen only when we get woken up by the kernel, i.e. one has to take into account the --mmap-pages (the size of the perf mmap ring buffer): perf record -a --switch-output=2G will break the perf.data output into multiple files limited to 2GB of samples, right when generating the output. For time based samples, alert() will be used, so to have 1 minute limited perf.data output files: perf record -a --switch-output=1m (Jiri Olsa) - Remove the need to use -e only for syscalls and --event only for tracepoints/HW/SW/etc events, i.e. now one can use: perf trace -e nanosleep,futex,sched:sched_switch ./workload or: perf trace --event nanosleep,futex,sched:sched_switch ./workload And have it tracing raw_syscalls:sys_{enter,exit} for the nanosleep and futex syscalls, formatting those as strace does while also tracing sched:sched_switch, ordering it all into one strace like output. Using '!' as the first character in the -e/--event argument remains a way to negate the list of syscalls, i.e. all syscalls except for the ones specified, doesn't affect the other kinds of events. E.g: [root@jouet ~] # perf trace -e sched:sched_switch,nanosleep usleep 1 0.000 ( 0.028 ms): usleep/28150 nanosleep(rqtp: 0x7ffe4201b9f0) ... 0.028 ( ): sched:sched_switch:usleep:28150 [120] S ==> swapper/0:0 [120]) 0.000 ( 0.065 ms): usleep/28150 ... [continued]: nanosleep()) = 0 [root@jouet ~]# (Arnaldo Carvalho de Melo) - 'perf kallsyms' toy tool to look for extended symbol information on the running kernel and demonstrate the machine/thread/symbol APIs for use in other tools, such as 'perf probe' (Arnaldo Carvalho de Melo) Infrastructure improvements: - Add missing linux/kernel.h include to subcmd.h (Arnaldo Carvalho de Melo) tools: Sync x86's vmx.h with the kernel - Create libdir directory before installing libperf-jvmti.so (Laura Abbott) - Fix typo in perf_evlist__start_workload() (Soramichi Akiyama) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
- Loading branch information
Showing
24 changed files
with
439 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
perf-kallsyms(1) | ||
============== | ||
|
||
NAME | ||
---- | ||
perf-kallsyms - Searches running kernel for symbols | ||
|
||
SYNOPSIS | ||
-------- | ||
[verse] | ||
'perf kallsyms <options> symbol_name[,symbol_name...]' | ||
|
||
DESCRIPTION | ||
----------- | ||
This command searches the running kernel kallsyms file for the given symbol(s) | ||
and prints information about it, including the DSO, the kallsyms begin/end | ||
addresses and the addresses in the ELF kallsyms symbol table (for symbols in | ||
modules). | ||
|
||
OPTIONS | ||
------- | ||
-v:: | ||
--verbose=:: | ||
Increase verbosity level, showing details about symbol table loading, etc. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* builtin-kallsyms.c | ||
* | ||
* Builtin command: Look for a symbol in the running kernel and its modules | ||
* | ||
* Copyright (C) 2017, Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com> | ||
* | ||
* Released under the GPL v2. (and only v2, not any later version) | ||
*/ | ||
#include "builtin.h" | ||
#include <linux/compiler.h> | ||
#include <subcmd/parse-options.h> | ||
#include "debug.h" | ||
#include "machine.h" | ||
#include "symbol.h" | ||
|
||
static int __cmd_kallsyms(int argc, const char **argv) | ||
{ | ||
int i; | ||
struct machine *machine = machine__new_kallsyms(); | ||
|
||
if (machine == NULL) { | ||
pr_err("Couldn't read /proc/kallsyms\n"); | ||
return -1; | ||
} | ||
|
||
for (i = 0; i < argc; ++i) { | ||
struct map *map; | ||
struct symbol *symbol = machine__find_kernel_function_by_name(machine, argv[i], &map); | ||
|
||
if (symbol == NULL) { | ||
printf("%s: not found\n", argv[i]); | ||
continue; | ||
} | ||
|
||
printf("%s: %s %s %#" PRIx64 "-%#" PRIx64 " (%#" PRIx64 "-%#" PRIx64")\n", | ||
symbol->name, map->dso->short_name, map->dso->long_name, | ||
map->unmap_ip(map, symbol->start), map->unmap_ip(map, symbol->end), | ||
symbol->start, symbol->end); | ||
} | ||
|
||
machine__delete(machine); | ||
return 0; | ||
} | ||
|
||
int cmd_kallsyms(int argc, const char **argv, const char *prefix __maybe_unused) | ||
{ | ||
const struct option options[] = { | ||
OPT_INCR('v', "verbose", &verbose, "be more verbose (show counter open errors, etc)"), | ||
OPT_END() | ||
}; | ||
const char * const kallsyms_usage[] = { | ||
"perf kallsyms [<options>] symbol_name", | ||
NULL | ||
}; | ||
|
||
argc = parse_options(argc, argv, options, kallsyms_usage, 0); | ||
if (argc < 1) | ||
usage_with_options(kallsyms_usage, options); | ||
|
||
symbol_conf.sort_by_name = true; | ||
symbol_conf.try_vmlinux_path = (symbol_conf.vmlinux_name == NULL); | ||
if (symbol__init(NULL) < 0) | ||
return -1; | ||
|
||
return __cmd_kallsyms(argc, argv); | ||
} |
Oops, something went wrong.