forked from torvalds/linux
-
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.17-20180403' 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: - Show only failing syscalls with 'perf trace --failure' (Arnaldo Carvalho de Melo) e.g: See what 'openat' syscalls are failing: # perf trace --failure -e openat 762.323 ( 0.007 ms): VideoCapture/4566 openat(dfd: CWD, filename: /dev/video2) = -1 ENOENT No such file or directory <SNIP N /dev/videoN open attempts... sigh, where is that improvised camera lid?!? > 790.228 ( 0.008 ms): VideoCapture/4566 openat(dfd: CWD, filename: /dev/video63) = -1 ENOENT No such file or directory ^C# - Show information about the event (freq, nr_samples, total period/nr_events) in the annotate --tui and --stdio2 'perf annotate' output, similar to the first line in the 'perf report --tui', but just for the samples for a the annotated symbol (Arnaldo Carvalho de Melo) - Introduce 'perf version --build-options' to show what features were linked, aliased as well as a shorter 'perf -vv' (Jin Yao) - Add a "dso_size" sort order (Kim Phillips) - Remove redundant ')' in the tracepoint output in 'perf trace' (Changbin Du) - Synchronize x86's cpufeatures.h, no effect on toolss (Arnaldo Carvalho de Melo) Signed-off-by: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
- Loading branch information
Showing
22 changed files
with
418 additions
and
116 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
#ifndef _TOOLS_CONFIG_H | ||
#define _TOOLS_CONFIG_H | ||
|
||
/* Subset of include/linux/kconfig.h */ | ||
|
||
#define __ARG_PLACEHOLDER_1 0, | ||
#define __take_second_arg(__ignored, val, ...) val | ||
|
||
/* | ||
* Helper macros to use CONFIG_ options in C/CPP expressions. Note that | ||
* these only work with boolean and tristate options. | ||
*/ | ||
|
||
/* | ||
* Getting something that works in C and CPP for an arg that may or may | ||
* not be defined is tricky. Here, if we have "#define CONFIG_BOOGER 1" | ||
* we match on the placeholder define, insert the "0," for arg1 and generate | ||
* the triplet (0, 1, 0). Then the last step cherry picks the 2nd arg (a one). | ||
* When CONFIG_BOOGER is not defined, we generate a (... 1, 0) pair, and when | ||
* the last step cherry picks the 2nd arg, we get a zero. | ||
*/ | ||
#define __is_defined(x) ___is_defined(x) | ||
#define ___is_defined(val) ____is_defined(__ARG_PLACEHOLDER_##val) | ||
#define ____is_defined(arg1_or_junk) __take_second_arg(arg1_or_junk 1, 0) | ||
|
||
/* | ||
* IS_BUILTIN(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y', 0 | ||
* otherwise. For boolean options, this is equivalent to | ||
* IS_ENABLED(CONFIG_FOO). | ||
*/ | ||
#define IS_BUILTIN(option) __is_defined(option) | ||
|
||
#endif /* _TOOLS_CONFIG_H */ |
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-version(1) | ||
=============== | ||
|
||
NAME | ||
---- | ||
perf-version - display the version of perf binary | ||
|
||
SYNOPSIS | ||
-------- | ||
'perf version' [--build-options] | ||
|
||
DESCRIPTION | ||
----------- | ||
With no options given, the 'perf version' prints the perf version | ||
on the standard output. | ||
|
||
If the option '--build-options' is given, then the status of | ||
compiled-in libraries are printed on the standard output. | ||
|
||
OPTIONS | ||
------- | ||
--build-options:: | ||
Prints the status of compiled-in libraries on the | ||
standard output. |
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 |
---|---|---|
@@ -1,11 +1,91 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
#include "builtin.h" | ||
#include "perf.h" | ||
#include "color.h" | ||
#include <linux/compiler.h> | ||
#include <tools/config.h> | ||
#include <stdio.h> | ||
#include <string.h> | ||
#include <subcmd/parse-options.h> | ||
|
||
int cmd_version(int argc __maybe_unused, const char **argv __maybe_unused) | ||
int version_verbose; | ||
|
||
struct version { | ||
bool build_options; | ||
}; | ||
|
||
static struct version version; | ||
|
||
static struct option version_options[] = { | ||
OPT_BOOLEAN(0, "build-options", &version.build_options, | ||
"display the build options"), | ||
}; | ||
|
||
static const char * const version_usage[] = { | ||
"perf version [<options>]", | ||
NULL | ||
}; | ||
|
||
static void on_off_print(const char *status) | ||
{ | ||
printf("[ "); | ||
|
||
if (!strcmp(status, "OFF")) | ||
color_fprintf(stdout, PERF_COLOR_RED, "%-3s", status); | ||
else | ||
color_fprintf(stdout, PERF_COLOR_GREEN, "%-3s", status); | ||
|
||
printf(" ]"); | ||
} | ||
|
||
static void status_print(const char *name, const char *macro, | ||
const char *status) | ||
{ | ||
printf("%22s: ", name); | ||
on_off_print(status); | ||
printf(" # %s\n", macro); | ||
} | ||
|
||
#define STATUS(__d, __m) \ | ||
do { \ | ||
if (IS_BUILTIN(__d)) \ | ||
status_print(#__m, #__d, "on"); \ | ||
else \ | ||
status_print(#__m, #__d, "OFF"); \ | ||
} while (0) | ||
|
||
static void library_status(void) | ||
{ | ||
STATUS(HAVE_DWARF_SUPPORT, dwarf); | ||
STATUS(HAVE_DWARF_GETLOCATIONS_SUPPORT, dwarf_getlocations); | ||
STATUS(HAVE_GLIBC_SUPPORT, glibc); | ||
STATUS(HAVE_GTK2_SUPPORT, gtk2); | ||
STATUS(HAVE_LIBAUDIT_SUPPORT, libaudit); | ||
STATUS(HAVE_LIBBFD_SUPPORT, libbfd); | ||
STATUS(HAVE_LIBELF_SUPPORT, libelf); | ||
STATUS(HAVE_LIBNUMA_SUPPORT, libnuma); | ||
STATUS(HAVE_LIBNUMA_SUPPORT, numa_num_possible_cpus); | ||
STATUS(HAVE_LIBPERL_SUPPORT, libperl); | ||
STATUS(HAVE_LIBPYTHON_SUPPORT, libpython); | ||
STATUS(HAVE_SLANG_SUPPORT, libslang); | ||
STATUS(HAVE_LIBCRYPTO_SUPPORT, libcrypto); | ||
STATUS(HAVE_LIBUNWIND_SUPPORT, libunwind); | ||
STATUS(HAVE_DWARF_SUPPORT, libdw-dwarf-unwind); | ||
STATUS(HAVE_ZLIB_SUPPORT, zlib); | ||
STATUS(HAVE_LZMA_SUPPORT, lzma); | ||
STATUS(HAVE_AUXTRACE_SUPPORT, get_cpuid); | ||
STATUS(HAVE_LIBBPF_SUPPORT, bpf); | ||
} | ||
|
||
int cmd_version(int argc, const char **argv) | ||
{ | ||
argc = parse_options(argc, argv, version_options, version_usage, | ||
PARSE_OPT_STOP_AT_NON_OPTION); | ||
|
||
printf("perf version %s\n", perf_version_string); | ||
|
||
if (version.build_options || version_verbose == 1) | ||
library_status(); | ||
|
||
return 0; | ||
} |
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
Oops, something went wrong.