You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge tag 'perf-core-for-mingo' 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:
* kcore annotation improvements, including build-id cache support,
multi map 'call' instruction navigation fixes, kcore address
validation, objdump workarounds. From Adrian Hunter.
* 'trace' beautifiers for lots of syscall arguments, from Arnaldo Carvalho de Melo.
* More compact 'trace' output by suppressing zeroed args, from Arnaldo Carvalho de Melo.
* Show thread COMM by default in 'trace', from Arnaldo Carvalho de Melo.
* Show path associated with fd in live sessions, using a 'vfs_getname'
'perf probe' created dynamic tracepoint or by looking at /proc/pid/fd, from Arnaldo Carvalho de Melo.
* Memory and mmap leak fixes from Chenggang Qin.
* Add option to show full timestamp in 'trace', from David Ahern.
* Add 'record' command in 'trace', to record raw_syscalls:*, from David Ahern.
* Add summary option to dump syscall statistics in 'trace', from David Ahern.
* Fix comm resolution in 'trace' when reading events from file, from David Ahern.
* Improved messages when doing profiling in all or a subset of CPUs
using a workload as the session delimitator, as in:
'perf stat --cpu 0,2 sleep 10s'
from Arnaldo Carvalho de Melo.
* Add units to nanosec-based counters in 'perf stat', from David Ahern.
* Assorted build fixes for from David Ahern and Jiri Olsa.
* 'perf lock' fixes and cleanups, from Davidlohr Bueso.
* Memory leak fixes in 'perf test', from Felipe Pena.
* Build system super speedups, from Ingo Molnar.
* Fix mmap_read event overflow, from Jiri Olsa.
* Code cleanups from Jiri Olsa.
* Allow specifying B/K/M/G unit to the --mmap-pages arguments, from Jiri Olsa.
* Separate the GTK support in a separate libperf-gtk.so DSO, that is
only loaded when --gtk is specified, from Namhyung Kim.
* Fixes for some memory leaks, from Namhyumg Kim.
* Fix srcline sort key behavior, from Namhyung Kim.
* Fix failing assertions in numa bench, from Petr Holasek.
* perf bash completion fixes and improvements from Ramkumar Ramachandra.
* Improve error messages in 'trace', providing hints about system configuration
steps needed for using it, from Ramkumar Ramachandra.
* Remove bogus info when using 'perf stat' -e cycles/instructions, from
Ramkumar Ramachandra.
* Support for Openembedded/Yocto -dbg packages, from Ricardo Ribalda Delgado.
* Implement addr2line directly using libbfd, from Roberto Vitillo.
* Add new option --ignore-vmlinux for perf top, from Willy Tarreau.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
@@ -134,14 +134,14 @@ ifeq ($(VERBOSE),1)
|
||||
print_install =
|
||||
else
|
||||
Q = @
|
||||
print_compile = echo ' CC '$(OBJ);
|
||||
print_app_build = echo ' BUILD '$(OBJ);
|
||||
print_fpic_compile = echo ' CC FPIC '$(OBJ);
|
||||
print_shared_lib_compile = echo ' BUILD SHARED LIB '$(OBJ);
|
||||
print_plugin_obj_compile = echo ' CC PLUGIN OBJ '$(OBJ);
|
||||
print_plugin_build = echo ' CC PLUGI '$(OBJ);
|
||||
print_static_lib_build = echo ' BUILD STATIC LIB '$(OBJ);
|
||||
print_install = echo ' INSTALL '$1' to $(DESTDIR_SQ)$2';
|
||||
print_compile = echo ' CC '$(OBJ);
|
||||
print_app_build = echo ' BUILD '$(OBJ);
|
||||
print_fpic_compile = echo ' CC FPIC '$(OBJ);
|
||||
print_shared_lib_compile = echo ' BUILD SHARED LIB '$(OBJ);
|
||||
print_plugin_obj_compile = echo ' BUILD PLUGIN OBJ '$(OBJ);
|
||||
print_plugin_build = echo ' BUILD PLUGIN '$(OBJ);
|
||||
print_static_lib_build = echo ' BUILD STATIC LIB '$(OBJ);
|
||||
print_install = echo ' INSTALL '$1' to $(DESTDIR_SQ)$2';
|
||||
endif
|
||||
|
||||
do_fpic_compile = \
|
||||
@@ -268,7 +268,7 @@ TRACK_CFLAGS = $(subst ','\'',$(CFLAGS)):$(ARCH):$(CROSS_COMPILE)
|
||||
TRACEEVENT-CFLAGS: force
|
||||
@FLAGS='$(TRACK_CFLAGS)'; \
|
||||
if test x"$$FLAGS" != x"`cat TRACEEVENT-CFLAGS 2>/dev/null`" ; then \
|
||||
echo 1>&2 " * new build flags or cross compiler"; \
|
||||
echo 1>&2 " FLAGS: * new build flags or cross compiler"; \
|
||||
echo "$$FLAGS" >TRACEEVENT-CFLAGS; \
|
||||
fi
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ perf*.html
|
||||
common-cmds.h
|
||||
perf.data
|
||||
perf.data.old
|
||||
output.svg
|
||||
perf-archive
|
||||
tags
|
||||
TAGS
|
||||
|
||||
@@ -145,16 +145,17 @@ endif
|
||||
|
||||
ifneq ($(findstring $(MAKEFLAGS),s),s)
|
||||
ifneq ($(V),1)
|
||||
QUIET_ASCIIDOC = @echo ' ' ASCIIDOC $@;
|
||||
QUIET_XMLTO = @echo ' ' XMLTO $@;
|
||||
QUIET_DB2TEXI = @echo ' ' DB2TEXI $@;
|
||||
QUIET_MAKEINFO = @echo ' ' MAKEINFO $@;
|
||||
QUIET_DBLATEX = @echo ' ' DBLATEX $@;
|
||||
QUIET_XSLTPROC = @echo ' ' XSLTPROC $@;
|
||||
QUIET_GEN = @echo ' ' GEN $@;
|
||||
QUIET_ASCIIDOC = @echo ' ASCIIDOC '$@;
|
||||
QUIET_XMLTO = @echo ' XMLTO '$@;
|
||||
QUIET_DB2TEXI = @echo ' DB2TEXI '$@;
|
||||
QUIET_MAKEINFO = @echo ' MAKEINFO '$@;
|
||||
QUIET_DBLATEX = @echo ' DBLATEX '$@;
|
||||
QUIET_XSLTPROC = @echo ' XSLTPROC '$@;
|
||||
QUIET_GEN = @echo ' GEN '$@;
|
||||
QUIET_STDERR = 2> /dev/null
|
||||
QUIET_SUBDIR0 = +@subdir=
|
||||
QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
|
||||
QUIET_SUBDIR1 = ;$(NO_SUBDIR) \
|
||||
echo ' SUBDIR ' $$subdir; \
|
||||
$(MAKE) $(PRINT_DIR) -C $$subdir
|
||||
export V
|
||||
endif
|
||||
@@ -183,47 +184,43 @@ ifdef missing_tools
|
||||
endif
|
||||
|
||||
do-install-man: man
|
||||
$(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
|
||||
# $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir)
|
||||
# $(INSTALL) -d -m 755 $(DESTDIR)$(man7dir)
|
||||
$(INSTALL) -m 644 $(DOC_MAN1) $(DESTDIR)$(man1dir)
|
||||
# $(INSTALL) -m 644 $(DOC_MAN5) $(DESTDIR)$(man5dir)
|
||||
# $(INSTALL) -m 644 $(DOC_MAN7) $(DESTDIR)$(man7dir)
|
||||
$(call QUIET_INSTALL, Documentation-man) \
|
||||
$(INSTALL) -d -m 755 $(DESTDIR)$(man1dir); \
|
||||
# $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir); \
|
||||
# $(INSTALL) -d -m 755 $(DESTDIR)$(man7dir); \
|
||||
$(INSTALL) -m 644 $(DOC_MAN1) $(DESTDIR)$(man1dir); \
|
||||
# $(INSTALL) -m 644 $(DOC_MAN5) $(DESTDIR)$(man5dir); \
|
||||
# $(INSTALL) -m 644 $(DOC_MAN7) $(DESTDIR)$(man7dir)
|
||||
|
||||
install-man: check-man-tools man
|
||||
|
||||
try-install-man:
|
||||
ifdef missing_tools
|
||||
$(warning Please install $(missing_tools) to have the man pages installed)
|
||||
DO_INSTALL_MAN = $(warning Please install $(missing_tools) to have the man pages installed)
|
||||
else
|
||||
$(MAKE) do-install-man
|
||||
DO_INSTALL_MAN = do-install-man
|
||||
endif
|
||||
|
||||
try-install-man: $(DO_INSTALL_MAN)
|
||||
|
||||
install-info: info
|
||||
$(INSTALL) -d -m 755 $(DESTDIR)$(infodir)
|
||||
$(INSTALL) -m 644 $(OUTPUT)perf.info $(OUTPUT)perfman.info $(DESTDIR)$(infodir)
|
||||
$(call QUIET_INSTALL, Documentation-info) \
|
||||
$(INSTALL) -d -m 755 $(DESTDIR)$(infodir); \
|
||||
$(INSTALL) -m 644 $(OUTPUT)perf.info $(OUTPUT)perfman.info $(DESTDIR)$(infodir); \
|
||||
if test -r $(DESTDIR)$(infodir)/dir; then \
|
||||
$(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) perf.info ;\
|
||||
$(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) perfman.info ;\
|
||||
$(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) perf.info ;\
|
||||
$(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) perfman.info ;\
|
||||
else \
|
||||
echo "No directory found in $(DESTDIR)$(infodir)" >&2 ; \
|
||||
fi
|
||||
|
||||
install-pdf: pdf
|
||||
$(INSTALL) -d -m 755 $(DESTDIR)$(pdfdir)
|
||||
$(INSTALL) -m 644 $(OUTPUT)user-manual.pdf $(DESTDIR)$(pdfdir)
|
||||
$(call QUIET_INSTALL, Documentation-pdf) \
|
||||
$(INSTALL) -d -m 755 $(DESTDIR)$(pdfdir); \
|
||||
$(INSTALL) -m 644 $(OUTPUT)user-manual.pdf $(DESTDIR)$(pdfdir)
|
||||
|
||||
#install-html: html
|
||||
# '$(SHELL_PATH_SQ)' ./install-webdoc.sh $(DESTDIR)$(htmldir)
|
||||
|
||||
ifneq ($(MAKECMDGOALS),clean)
|
||||
ifneq ($(MAKECMDGOALS),tags)
|
||||
$(OUTPUT)PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE
|
||||
$(QUIET_SUBDIR0)../ $(QUIET_SUBDIR1) $(OUTPUT)PERF-VERSION-FILE
|
||||
|
||||
-include $(OUTPUT)PERF-VERSION-FILE
|
||||
endif
|
||||
endif
|
||||
|
||||
#
|
||||
# Determine "include::" file references in asciidoc files.
|
||||
@@ -253,15 +250,17 @@ $(OUTPUT)cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT)
|
||||
$(PERL_PATH) ./cmd-list.perl ../command-list.txt $(QUIET_STDERR) && \
|
||||
date >$@
|
||||
|
||||
CLEAN_FILES = \
|
||||
$(MAN_XML) $(addsuffix +,$(MAN_XML)) \
|
||||
$(MAN_HTML) $(addsuffix +,$(MAN_HTML)) \
|
||||
$(DOC_HTML) $(DOC_MAN1) $(DOC_MAN5) $(DOC_MAN7) \
|
||||
$(OUTPUT)*.texi $(OUTPUT)*.texi+ $(OUTPUT)*.texi++ \
|
||||
$(OUTPUT)perf.info $(OUTPUT)perfman.info \
|
||||
$(OUTPUT)howto-index.txt $(OUTPUT)howto/*.html $(OUTPUT)doc.dep \
|
||||
$(OUTPUT)technical/api-*.html $(OUTPUT)technical/api-index.txt \
|
||||
$(cmds_txt) $(OUTPUT)*.made
|
||||
clean:
|
||||
$(RM) $(MAN_XML) $(addsuffix +,$(MAN_XML))
|
||||
$(RM) $(MAN_HTML) $(addsuffix +,$(MAN_HTML))
|
||||
$(RM) $(DOC_HTML) $(DOC_MAN1) $(DOC_MAN5) $(DOC_MAN7)
|
||||
$(RM) $(OUTPUT)*.texi $(OUTPUT)*.texi+ $(OUTPUT)*.texi++
|
||||
$(RM) $(OUTPUT)perf.info $(OUTPUT)perfman.info
|
||||
$(RM) $(OUTPUT)howto-index.txt $(OUTPUT)howto/*.html $(OUTPUT)doc.dep
|
||||
$(RM) $(OUTPUT)technical/api-*.html $(OUTPUT)technical/api-index.txt
|
||||
$(RM) $(cmds_txt) $(OUTPUT)*.made
|
||||
$(call QUIET_CLEAN, Documentation) $(RM) $(CLEAN_FILES)
|
||||
|
||||
$(MAN_HTML): $(OUTPUT)%.html : %.txt
|
||||
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
|
||||
@@ -342,5 +341,3 @@ $(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
|
||||
|
||||
#quick-install-html:
|
||||
# '$(SHELL_PATH_SQ)' ./install-doc-quick.sh $(HTML_REF) $(DESTDIR)$(htmldir)
|
||||
|
||||
.PHONY: .FORCE-PERF-VERSION-FILE
|
||||
|
||||
@@ -21,6 +21,19 @@ OPTIONS
|
||||
-a::
|
||||
--add=::
|
||||
Add specified file to the cache.
|
||||
-k::
|
||||
--kcore::
|
||||
Add specified kcore file to the cache. For the current host that is
|
||||
/proc/kcore which requires root permissions to read. Be aware that
|
||||
running 'perf buildid-cache' as root may update root's build-id cache
|
||||
not the user's. Use the -v option to see where the file is created.
|
||||
Note that the copied file contains only code sections not the whole core
|
||||
image. Note also that files "kallsyms" and "modules" must also be in the
|
||||
same directory and are also copied. All 3 files are created with read
|
||||
permissions for root only. kcore will not be added if there is already a
|
||||
kcore in the cache (with the same build-id) that has the same modules at
|
||||
the same addresses. Use the -v option to see if a copy of kcore is
|
||||
actually made.
|
||||
-r::
|
||||
--remove=::
|
||||
Remove specified file from the cache.
|
||||
|
||||
@@ -109,7 +109,9 @@ STAT LIVE OPTIONS
|
||||
|
||||
-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.
|
||||
|
||||
-a::
|
||||
--all-cpus::
|
||||
|
||||
@@ -48,7 +48,7 @@ REPORT OPTIONS
|
||||
-k::
|
||||
--key=<value>::
|
||||
Sorting key. Possible values: acquired (default), contended,
|
||||
wait_total, wait_max, wait_min.
|
||||
avg_wait, wait_total, wait_max, wait_min.
|
||||
|
||||
INFO OPTIONS
|
||||
------------
|
||||
|
||||
@@ -87,7 +87,9 @@ OPTIONS
|
||||
|
||||
-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::
|
||||
--call-graph::
|
||||
|
||||
@@ -8,7 +8,8 @@ perf-timechart - Tool to visualize total system behavior during a workload
|
||||
SYNOPSIS
|
||||
--------
|
||||
[verse]
|
||||
'perf timechart' {record}
|
||||
'perf timechart' record <command>
|
||||
'perf timechart' [<options>]
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
@@ -41,6 +42,18 @@ OPTIONS
|
||||
--symfs=<directory>::
|
||||
Look for files with symbols relative to this directory.
|
||||
|
||||
EXAMPLES
|
||||
--------
|
||||
|
||||
$ perf timechart record git pull
|
||||
|
||||
[ perf record: Woken up 13 times to write data ]
|
||||
[ perf record: Captured and wrote 4.253 MB perf.data (~185801 samples) ]
|
||||
|
||||
$ perf timechart
|
||||
|
||||
Written 10.2 seconds of trace to output.svg.
|
||||
|
||||
SEE ALSO
|
||||
--------
|
||||
linkperf:perf-record[1]
|
||||
|
||||
@@ -68,7 +68,9 @@ Default is to monitor all CPUS.
|
||||
|
||||
-m <pages>::
|
||||
--mmap-pages=<pages>::
|
||||
Number of mmapped data pages.
|
||||
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.
|
||||
|
||||
-p <pid>::
|
||||
--pid=<pid>::
|
||||
|
||||
@@ -9,6 +9,7 @@ SYNOPSIS
|
||||
--------
|
||||
[verse]
|
||||
'perf trace'
|
||||
'perf trace record'
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
@@ -16,9 +17,14 @@ This command will show the events associated with the target, initially
|
||||
syscalls, but other system events like pagefaults, task lifetime events,
|
||||
scheduling events, etc.
|
||||
|
||||
Initially this is a live mode only tool, but eventually will work with
|
||||
perf.data files like the other tools, allowing a detached 'record' from
|
||||
analysis phases.
|
||||
This is a live mode tool in addition to working with perf.data files like
|
||||
the other perf tools. Files can be generated using the 'perf record' command
|
||||
but the session needs to include the raw_syscalls events (-e 'raw_syscalls:*').
|
||||
Alernatively, the 'perf trace record' can be used as a shortcut to
|
||||
automatically include the raw_syscalls events when writing events to a file.
|
||||
|
||||
The following options apply to perf trace; options to perf trace record are
|
||||
found in the perf record man page.
|
||||
|
||||
OPTIONS
|
||||
-------
|
||||
@@ -59,7 +65,9 @@ OPTIONS
|
||||
|
||||
-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.
|
||||
|
||||
-C::
|
||||
--cpu::
|
||||
@@ -78,6 +86,17 @@ the thread executes on the designated CPUs. Default is to monitor all CPUs.
|
||||
--input
|
||||
Process events from a given perf data file.
|
||||
|
||||
-T
|
||||
--time
|
||||
Print full timestamp rather time relative to first sample.
|
||||
|
||||
--comm::
|
||||
Show process COMM right beside its ID, on by default, disable with --no-comm.
|
||||
|
||||
--summary::
|
||||
Show a summary of syscalls by thread with min, max, and average times (in
|
||||
msec) and relative stddev.
|
||||
|
||||
SEE ALSO
|
||||
--------
|
||||
linkperf:perf-record[1], linkperf:perf-script[1]
|
||||
|
||||
+60
-800
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -5,7 +5,7 @@
|
||||
#include "../../util/types.h"
|
||||
#include <asm/perf_regs.h>
|
||||
|
||||
#ifndef ARCH_X86_64
|
||||
#ifndef HAVE_ARCH_X86_64_SUPPORT
|
||||
#define PERF_REGS_MASK ((1ULL << PERF_REG_X86_32_MAX) - 1)
|
||||
#else
|
||||
#define REG_NOSUPPORT ((1ULL << PERF_REG_X86_DS) | \
|
||||
@@ -52,7 +52,7 @@ static inline const char *perf_reg_name(int id)
|
||||
return "FS";
|
||||
case PERF_REG_X86_GS:
|
||||
return "GS";
|
||||
#ifdef ARCH_X86_64
|
||||
#ifdef HAVE_ARCH_X86_64_SUPPORT
|
||||
case PERF_REG_X86_R8:
|
||||
return "R8";
|
||||
case PERF_REG_X86_R9:
|
||||
@@ -69,7 +69,7 @@ static inline const char *perf_reg_name(int id)
|
||||
return "R14";
|
||||
case PERF_REG_X86_R15:
|
||||
return "R15";
|
||||
#endif /* ARCH_X86_64 */
|
||||
#endif /* HAVE_ARCH_X86_64_SUPPORT */
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "perf_regs.h"
|
||||
#include "../../util/unwind.h"
|
||||
|
||||
#ifdef ARCH_X86_64
|
||||
#ifdef HAVE_ARCH_X86_64_SUPPORT
|
||||
int unwind__arch_reg_id(int regnum)
|
||||
{
|
||||
int id;
|
||||
@@ -108,4 +108,4 @@ int unwind__arch_reg_id(int regnum)
|
||||
|
||||
return id;
|
||||
}
|
||||
#endif /* ARCH_X86_64 */
|
||||
#endif /* HAVE_ARCH_X86_64_SUPPORT */
|
||||
|
||||
+85
-21
@@ -1,17 +1,87 @@
|
||||
# perf completion
|
||||
|
||||
function_exists()
|
||||
# Taken from git.git's completion script.
|
||||
__my_reassemble_comp_words_by_ref()
|
||||
{
|
||||
declare -F $1 > /dev/null
|
||||
return $?
|
||||
local exclude i j first
|
||||
# Which word separators to exclude?
|
||||
exclude="${1//[^$COMP_WORDBREAKS]}"
|
||||
cword_=$COMP_CWORD
|
||||
if [ -z "$exclude" ]; then
|
||||
words_=("${COMP_WORDS[@]}")
|
||||
return
|
||||
fi
|
||||
# List of word completion separators has shrunk;
|
||||
# re-assemble words to complete.
|
||||
for ((i=0, j=0; i < ${#COMP_WORDS[@]}; i++, j++)); do
|
||||
# Append each nonempty word consisting of just
|
||||
# word separator characters to the current word.
|
||||
first=t
|
||||
while
|
||||
[ $i -gt 0 ] &&
|
||||
[ -n "${COMP_WORDS[$i]}" ] &&
|
||||
# word consists of excluded word separators
|
||||
[ "${COMP_WORDS[$i]//[^$exclude]}" = "${COMP_WORDS[$i]}" ]
|
||||
do
|
||||
# Attach to the previous token,
|
||||
# unless the previous token is the command name.
|
||||
if [ $j -ge 2 ] && [ -n "$first" ]; then
|
||||
((j--))
|
||||
fi
|
||||
first=
|
||||
words_[$j]=${words_[j]}${COMP_WORDS[i]}
|
||||
if [ $i = $COMP_CWORD ]; then
|
||||
cword_=$j
|
||||
fi
|
||||
if (($i < ${#COMP_WORDS[@]} - 1)); then
|
||||
((i++))
|
||||
else
|
||||
# Done.
|
||||
return
|
||||
fi
|
||||
done
|
||||
words_[$j]=${words_[j]}${COMP_WORDS[i]}
|
||||
if [ $i = $COMP_CWORD ]; then
|
||||
cword_=$j
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
function_exists __ltrim_colon_completions ||
|
||||
type _get_comp_words_by_ref &>/dev/null ||
|
||||
_get_comp_words_by_ref()
|
||||
{
|
||||
local exclude cur_ words_ cword_
|
||||
if [ "$1" = "-n" ]; then
|
||||
exclude=$2
|
||||
shift 2
|
||||
fi
|
||||
__my_reassemble_comp_words_by_ref "$exclude"
|
||||
cur_=${words_[cword_]}
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
cur)
|
||||
cur=$cur_
|
||||
;;
|
||||
prev)
|
||||
prev=${words_[$cword_-1]}
|
||||
;;
|
||||
words)
|
||||
words=("${words_[@]}")
|
||||
;;
|
||||
cword)
|
||||
cword=$cword_
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
type __ltrim_colon_completions &>/dev/null ||
|
||||
__ltrim_colon_completions()
|
||||
{
|
||||
if [[ "$1" == *:* && "$COMP_WORDBREAKS" == *:* ]]; then
|
||||
# Remove colon-word prefix from COMPREPLY items
|
||||
local colon_word=${1%${1##*:}}
|
||||
local colon_word=${1%"${1##*:}"}
|
||||
local i=${#COMPREPLY[*]}
|
||||
while [[ $((--i)) -ge 0 ]]; do
|
||||
COMPREPLY[$i]=${COMPREPLY[$i]#"$colon_word"}
|
||||
@@ -19,23 +89,18 @@ __ltrim_colon_completions()
|
||||
fi
|
||||
}
|
||||
|
||||
have perf &&
|
||||
type perf &>/dev/null &&
|
||||
_perf()
|
||||
{
|
||||
local cur prev cmd
|
||||
local cur words cword prev cmd
|
||||
|
||||
COMPREPLY=()
|
||||
if function_exists _get_comp_words_by_ref; then
|
||||
_get_comp_words_by_ref -n : cur prev
|
||||
else
|
||||
cur=$(_get_cword :)
|
||||
prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||
fi
|
||||
_get_comp_words_by_ref -n =: cur words cword prev
|
||||
|
||||
cmd=${COMP_WORDS[0]}
|
||||
cmd=${words[0]}
|
||||
|
||||
# List perf subcommands or long options
|
||||
if [ $COMP_CWORD -eq 1 ]; then
|
||||
if [ $cword -eq 1 ]; then
|
||||
if [[ $cur == --* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--help --version \
|
||||
--exec-path --html-path --paginate --no-pager \
|
||||
@@ -45,18 +110,17 @@ _perf()
|
||||
COMPREPLY=( $( compgen -W '$cmds' -- "$cur" ) )
|
||||
fi
|
||||
# List possible events for -e option
|
||||
elif [[ $prev == "-e" && "${COMP_WORDS[1]}" == @(record|stat|top) ]]; then
|
||||
elif [[ $prev == "-e" && "${words[1]}" == @(record|stat|top) ]]; then
|
||||
evts=$($cmd list --raw-dump)
|
||||
COMPREPLY=( $( compgen -W '$evts' -- "$cur" ) )
|
||||
__ltrim_colon_completions $cur
|
||||
# List long option names
|
||||
elif [[ $cur == --* ]]; then
|
||||
subcmd=${COMP_WORDS[1]}
|
||||
subcmd=${words[1]}
|
||||
opts=$($cmd $subcmd --list-opts)
|
||||
COMPREPLY=( $( compgen -W '$opts' -- "$cur" ) )
|
||||
# Fall down to list regular files
|
||||
else
|
||||
_filedir
|
||||
fi
|
||||
} &&
|
||||
complete -F _perf perf
|
||||
|
||||
complete -o bashdefault -o default -o nospace -F _perf perf 2>/dev/null \
|
||||
|| complete -o default -o nospace -F _perf perf
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
#ifdef ARCH_X86_64
|
||||
#ifdef HAVE_ARCH_X86_64_SUPPORT
|
||||
|
||||
#define MEMCPY_FN(fn, name, desc) \
|
||||
extern void *fn(void *, const void *, size_t);
|
||||
|
||||
@@ -58,7 +58,7 @@ struct routine routines[] = {
|
||||
{ "default",
|
||||
"Default memcpy() provided by glibc",
|
||||
memcpy },
|
||||
#ifdef ARCH_X86_64
|
||||
#ifdef HAVE_ARCH_X86_64_SUPPORT
|
||||
|
||||
#define MEMCPY_FN(fn, name, desc) { name, desc, fn },
|
||||
#include "mem-memcpy-x86-64-asm-def.h"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
#ifdef ARCH_X86_64
|
||||
#ifdef HAVE_ARCH_X86_64_SUPPORT
|
||||
|
||||
#define MEMSET_FN(fn, name, desc) \
|
||||
extern void *fn(void *, int, size_t);
|
||||
|
||||
@@ -58,7 +58,7 @@ static const struct routine routines[] = {
|
||||
{ "default",
|
||||
"Default memset() provided by glibc",
|
||||
memset },
|
||||
#ifdef ARCH_X86_64
|
||||
#ifdef HAVE_ARCH_X86_64_SUPPORT
|
||||
|
||||
#define MEMSET_FN(fn, name, desc) { name, desc, fn },
|
||||
#include "mem-memset-x86-64-asm-def.h"
|
||||
|
||||
+21
-13
@@ -429,14 +429,14 @@ static int parse_cpu_list(const char *arg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void parse_setup_cpu_list(void)
|
||||
static int parse_setup_cpu_list(void)
|
||||
{
|
||||
struct thread_data *td;
|
||||
char *str0, *str;
|
||||
int t;
|
||||
|
||||
if (!g->p.cpu_list_str)
|
||||
return;
|
||||
return 0;
|
||||
|
||||
dprintf("g->p.nr_tasks: %d\n", g->p.nr_tasks);
|
||||
|
||||
@@ -500,8 +500,12 @@ static void parse_setup_cpu_list(void)
|
||||
|
||||
dprintf("CPUs: %d_%d-%d#%dx%d\n", bind_cpu_0, bind_len, bind_cpu_1, step, mul);
|
||||
|
||||
BUG_ON(bind_cpu_0 < 0 || bind_cpu_0 >= g->p.nr_cpus);
|
||||
BUG_ON(bind_cpu_1 < 0 || bind_cpu_1 >= g->p.nr_cpus);
|
||||
if (bind_cpu_0 >= g->p.nr_cpus || bind_cpu_1 >= g->p.nr_cpus) {
|
||||
printf("\nTest not applicable, system has only %d CPUs.\n", g->p.nr_cpus);
|
||||
return -1;
|
||||
}
|
||||
|
||||
BUG_ON(bind_cpu_0 < 0 || bind_cpu_1 < 0);
|
||||
BUG_ON(bind_cpu_0 > bind_cpu_1);
|
||||
|
||||
for (bind_cpu = bind_cpu_0; bind_cpu <= bind_cpu_1; bind_cpu += step) {
|
||||
@@ -541,6 +545,7 @@ out:
|
||||
printf("# NOTE: %d tasks bound, %d tasks unbound\n", t, g->p.nr_tasks - t);
|
||||
|
||||
free(str0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int parse_cpus_opt(const struct option *opt __maybe_unused,
|
||||
@@ -561,14 +566,14 @@ static int parse_node_list(const char *arg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void parse_setup_node_list(void)
|
||||
static int parse_setup_node_list(void)
|
||||
{
|
||||
struct thread_data *td;
|
||||
char *str0, *str;
|
||||
int t;
|
||||
|
||||
if (!g->p.node_list_str)
|
||||
return;
|
||||
return 0;
|
||||
|
||||
dprintf("g->p.nr_tasks: %d\n", g->p.nr_tasks);
|
||||
|
||||
@@ -619,8 +624,12 @@ static void parse_setup_node_list(void)
|
||||
|
||||
dprintf("NODEs: %d-%d #%d\n", bind_node_0, bind_node_1, step);
|
||||
|
||||
BUG_ON(bind_node_0 < 0 || bind_node_0 >= g->p.nr_nodes);
|
||||
BUG_ON(bind_node_1 < 0 || bind_node_1 >= g->p.nr_nodes);
|
||||
if (bind_node_0 >= g->p.nr_nodes || bind_node_1 >= g->p.nr_nodes) {
|
||||
printf("\nTest not applicable, system has only %d nodes.\n", g->p.nr_nodes);
|
||||
return -1;
|
||||
}
|
||||
|
||||
BUG_ON(bind_node_0 < 0 || bind_node_1 < 0);
|
||||
BUG_ON(bind_node_0 > bind_node_1);
|
||||
|
||||
for (bind_node = bind_node_0; bind_node <= bind_node_1; bind_node += step) {
|
||||
@@ -651,6 +660,7 @@ out:
|
||||
printf("# NOTE: %d tasks mem-bound, %d tasks unbound\n", t, g->p.nr_tasks - t);
|
||||
|
||||
free(str0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int parse_nodes_opt(const struct option *opt __maybe_unused,
|
||||
@@ -1356,8 +1366,8 @@ static int init(void)
|
||||
init_thread_data();
|
||||
|
||||
tprintf("#\n");
|
||||
parse_setup_cpu_list();
|
||||
parse_setup_node_list();
|
||||
if (parse_setup_cpu_list() || parse_setup_node_list())
|
||||
return -1;
|
||||
tprintf("#\n");
|
||||
|
||||
print_summary();
|
||||
@@ -1600,7 +1610,6 @@ static int run_bench_numa(const char *name, const char **argv)
|
||||
return 0;
|
||||
|
||||
err:
|
||||
usage_with_options(numa_usage, options);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1701,8 +1710,7 @@ static int bench_all(void)
|
||||
BUG_ON(ret < 0);
|
||||
|
||||
for (i = 0; i < nr; i++) {
|
||||
if (run_bench_numa(tests[i][0], tests[i] + 1))
|
||||
return -1;
|
||||
run_bench_numa(tests[i][0], tests[i] + 1);
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user