31 Jan, 2012
1 commit
-
When building on my Debian/mips system, util/util.c fails to build
because commit 1aed2671738785e8f5aea663a6fda91aa7ef59b5 (perf kvm: Do
guest-only counting by default) indirectly includes stdio.h before the
feature selection in util.h is done. This prevents _GNU_SOURCE in
util.h from enabling the declaration of getline(), from now second
inclusion of stdio.h, and the build is broken.There is another breakage in util/evsel.c caused by include ordering,
but I didn't fully track down the commit that caused it.The root cause of all this is an inconsistent definition of _GNU_SOURCE,
so I move the definition into the Makefile so that it is passed to all
invocations of the compiler and used uniformly for all system header
files. All other #define and #undef of _GNU_SOURCE are removed as they
cause conflicts with the definition passed to the compiler.All the features.h definitions (_LARGEFILE64_SOURCE _FILE_OFFSET_BITS=64
and _GNU_SOURCE) are needed by the python glue code too, so they are
moved to BASIC_CFLAGS, and the misleading comments about BASIC_CFLAGS
are removed.This gives me a clean build on x86_64 (fc12) and mips (Debian).
Cc: David Daney
Cc: Ingo Molnar
Cc: Joerg Roedel
Cc: Namhyung Kim
Cc: Paul Mackerras
Cc: Peter Zijlstra
Link: http://lkml.kernel.org/r/1326836461-11952-1-git-send-email-ddaney.cavm@gmail.com
Signed-off-by: David Daney
Signed-off-by: Arnaldo Carvalho de Melo
07 Jan, 2012
1 commit
-
Make use of exclude_guest and exlude_host in perf-kvm to do only
guest-only counting by default.Cc: Gleb Natapov
Cc: Ingo Molnar
Cc: Joerg Roedel
Cc: Peter Zijlstra
Signed-off-by: Gleb Natapov
Signed-off-by: Joerg Roedel
[ committer note: Moved perf_{guest,host} & event_attr_init to util.c ]
[ so as not to drag more stuff to the python binding]
Signed-off-by: Arnaldo Carvalho de Melo
24 Dec, 2011
1 commit
-
Now that we automatically point users at it, let's provide them some
guidance so that they hopefully don't just get mysterious EINVAL's
from the kernel.Cc: Ingo Molnar
Cc: Paul Mackerras
Cc: Peter Zijlstra
Link: http://lkml.kernel.org/r/1324301972-22740-4-git-send-email-nelhage@nelhage.com
Signed-off-by: Nelson Elhage
[ committer note: Made it work after 50a682c ]
Signed-off-by: Arnaldo Carvalho de Melo
16 Jul, 2011
1 commit
-
Since strtailcmp() is enough generic, it should be defined in string.c.
Signed-off-by: Masami Hiramatsu
Cc: Peter Zijlstra
Cc: Frederic Weisbecker
Cc: Paul Mackerras
Cc: Ingo Molnar
Cc: Arnaldo Carvalho de Melo
Link: http://lkml.kernel.org/r/20110627072715.6528.10677.stgit@fedora15
Signed-off-by: Steven Rostedt
18 Feb, 2011
1 commit
-
While it makes sense that this tool could be used on
other platforms at least to parse data, there doesn't
appear to be any real support for such usage.This commit squashes several commits that remove:
SNPRINTF_RETURNS_BOGUS
FREAD_READS_DIRECTORIES
NO_D_{INO,TYPE}_IN_DIRENT
NO_STRCASESTR
NO_MEMMEM
NO_STRTOUMAX and NO_STRTOULL
NO_SETENV
NO_UNSETENV
NO_MKDTEMP
NEEDS_LIBICONV
NEEDS_SOCKET
NO_MMAP
NO_PTHREADS
NO_PREAD
NO_TRUSTABLE_FILEMODE
NO_IPV6 and NO_SOCKADDR_STORAGE
NO_ICONV and OLD_ICONV
NO_NSEC, USE_NSEC, and USE_ST_TIMESPEC
NO_ST_BLOCKS_IN_STRUCT_STAT
NO_FINK and NO_DARWIN_PORTS
NO_SYS_SELECT_H
NO_HSTRERROR
DIR_HAS_BSD_GROUP_SEMANTICS and FORCE_DIR_SET_GID
NEEDS_NSL, NO_UINTMAX_T, NO_INET_{N,P}TON
COMPAT_{CFLAGS,OBJS}
Executable extension `X'Signed-off-by: Michael Witten
LKML-Reference:
Signed-off-by: Arnaldo Carvalho de Melo
04 Jan, 2011
1 commit
-
Not really something to be exported from session.c. Rename it to
'readn' as others did in the past.Cc: Frederic Weisbecker
Cc: Ingo Molnar
Cc: Mike Galbraith
Cc: Paul Mackerras
Cc: Peter Zijlstra
Cc: Stephane Eranian
Cc: Tom Zanussi
LKML-Reference:
Signed-off-by: Arnaldo Carvalho de Melo
20 Aug, 2010
1 commit
-
Make all browsers return the exit key uniformly and remove the
newtExitStruct parameter, removing one more newt specific thing from the
ui API.Cc: Frederic Weisbecker
Cc: Mike Galbraith
Cc: Peter Zijlstra
Cc: Stephane Eranian
LKML-Reference:
Signed-off-by: Arnaldo Carvalho de Melo
17 Jun, 2010
1 commit
-
There are situations where there is enough information in the perf.data
to process the samples. Updating the buildid cache may add unecessary
overhead in terms of disk space and time (copying large elf images).A persistent option to do this already exists via the perfconfig file,
simply do:[buildid]
dir = /dev/nullThis patch provides a way to suppress builid cache updates on a per-run
basis. It addds a new option, -N, to perf record. Buildids are still
generated in the perf.data file.Cc: David S. Miller
Cc: Frédéric Weisbecker
Cc: Ingo Molnar
Cc: Paul Mackerras
Cc: Peter Zijlstra
LKML-Reference:
Signed-off-by: Stephane Eranian
Signed-off-by: Arnaldo Carvalho de Melo
05 Jun, 2010
1 commit
-
This patch adds the ability to specify an alternate directory to store the
buildid cache (buildids, copy of binaries). By default, it is hardcoded to
$HOME/.debug. This directory contains immutable data. The layout of the
directory is such that no conflicts in filenames are possible. A modification
in a file, yields a different buildid and thus a different location in the
subdir hierarchy.You may want to put the buildid cache elsewhere because of disk space
limitation or simply to share the cache between users. It is also useful for
remote collect vs. local analysis of profiles.This patch adds a new config option to the perfconfig file. Under the tag
'buildid', there is a dir option. For instance, if you have:$ cat /etc/perfconfig
[buildid]
dir = /var/cache/perf-buildidAll buildids and binaries are be saved in the directory specified. The perf
record, buildid-list, buildid-cache, report, annotate, and archive commands
will it to pull information out.The option can be set in the system-wide perfconfig file or in the
$HOME/.perfconfig file.Cc: David S. Miller
Cc: Frédéric Weisbecker
Cc: Ingo Molnar
Cc: Paul Mackerras
Cc: Peter Zijlstra
Cc: Stephane Eranian
Cc: Tom Zanussi
LKML-Reference:
Signed-off-by: Stephane Eranian
Signed-off-by: Arnaldo Carvalho de Melo
22 May, 2010
1 commit
-
When annotating multiple entries, for instance, when running simply as:
$ perf annotate
the right and left keys, as well as TAB can be used to cycle thru the
multiple symbols being annotated.If one doesn't like TUI annotate, disable it by editing ~/.perfconfig
and adding:[tui]
annotate = off
Just like it is possible for report.
Cc: Frédéric Weisbecker
Cc: Mike Galbraith
Cc: Paul Mackerras
Cc: Peter Zijlstra
Cc: Stephane Eranian
Cc: Tom Zanussi
LKML-Reference:
Signed-off-by: Arnaldo Carvalho de Melo
19 May, 2010
2 commits
-
All the functions that call this can handle the equivalent, non
panic'ing wrapped routines.Cc: Frédéric Weisbecker
Cc: Mike Galbraith
Cc: Paul Mackerras
Cc: Peter Zijlstra
Cc: Tom Zanussi
LKML-Reference:
Signed-off-by: Arnaldo Carvalho de Melo -
Without the bloated cplus_demangle from binutils, i.e building with:
$ make NO_DEMANGLE=1 O=~acme/git/build/perf -j3 -C tools/perf/ install
Before:
text data bss dec hex filename
471851 29280 4025056 4526187 45106b /home/acme/bin/perfAfter:
[acme@doppio linux-2.6-tip]$ size ~/bin/perf
text data bss dec hex filename
446886 29232 4008576 4484694 446e56 /home/acme/bin/perfSo its a 5.3% size reduction in code, but the interesting part is in the git
diff --stat output:19 files changed, 20 insertions(+), 1909 deletions(-)
If we ever need some of the things we got from git but weren't using, we just
have to go to the git repo and get fresh, uptodate source code bits.Cc: Frédéric Weisbecker
Cc: Mike Galbraith
Cc: Paul Mackerras
Cc: Peter Zijlstra
Cc: Tom Zanussi
LKML-Reference:
Signed-off-by: Arnaldo Carvalho de Melo
15 May, 2010
1 commit
-
Number of samples is meaningless after we switched to auto-freq, so
report the number of events, i.e. not the sum of the different periods,
but the number PERF_RECORD_SAMPLE emitted by the kernel.While doing this I noticed that naming "count" to the sum of all the
event periods can be confusing, so rename it to .period, just like in
struct sample.data, so that we become more consistent.This helps with the next step, that was to record in struct hist_entry
the number of sample events for each instance, we need that because we
use it to generate the number of events when applying filters to the
tree of hist entries like it is being done in the TUI report browser.Suggested-by: Ingo Molnar
Cc: Frédéric Weisbecker
Cc: Mike Galbraith
Cc: Paul Mackerras
Cc: Peter Zijlstra
Cc: Tom Zanussi
LKML-Reference:
Signed-off-by: Arnaldo Carvalho de Melo
03 Apr, 2010
1 commit
-
So that we avoid conflict with libc's string.h header.
Reviewed-by: KOSAKI Motohiro
Suggested-by: KOSAKI Motohiro
Cc: KOSAKI Motohiro
Cc: Frédéric Weisbecker
Cc: Mike Galbraith
Cc: Peter Zijlstra
Cc: Paul Mackerras
Signed-off-by: Arnaldo Carvalho de Melo
17 Mar, 2010
1 commit
-
Introducing xzalloc() which wrapping zalloc() for detecting out
of memory conditions.Signed-off-by: Masami Hiramatsu
Cc: systemtap
Cc: DLE
Cc: Frederic Weisbecker
Cc: Arnaldo Carvalho de Melo
Cc: Paul Mackerras
Cc: Mike Galbraith
Cc: Peter Zijlstra
LKML-Reference:
[ -v2: small cleanups in surrounding code ]
Signed-off-by: Ingo Molnar
28 Dec, 2009
1 commit
-
Now a cache will be created in a ~/.debug debuginfo like
hierarchy, so that at the end of a 'perf record' session all the
binaries (with build-ids) involved get collected and indexed by
their build-ids, so that perf report can find them.This is interesting when developing software where you want to
do a 'perf diff' with the previous build and opens avenues for
lots more interesting tools, like a 'perf diff --graph' that
takes more than two binaries into account.Tunables for collecting just the symtabs can be added if one
doesn't want to have the full binary, but having the full binary
allows things like 'perf rerecord' or other tools that can
re-run the tests by having access to the exact binary in some
perf.data file, so it may well be interesting to keep the full
binary there.Space consumption is minimised by trying to use hard links, a
'perf cache' tool to manage the space used, a la ccache is
required to purge older entries.With this in place it will be possible also to introduce new
commands, 'perf archive' and 'perf restore' (or some more
suitable and future proof names) to create a cpio/tar file with
the perf data and the files in the cache that _had_ perf hits of
interest.There are more aspects to polish, like finding the right vmlinux
file to cache, etc, but this is enough for a first step.Signed-off-by: Arnaldo Carvalho de Melo
Cc: Frédéric Weisbecker
Cc: Mike Galbraith
Cc: Peter Zijlstra
Cc: Paul Mackerras
LKML-Reference:
Signed-off-by: Ingo Molnar
24 Nov, 2009
3 commits
-
And also make xrealloc and xmalloc weak symbols so that we don't
have this problem:/usr/lib/gcc/x86_64-redhat-linux/4.4.1/../../../../lib64/libiberty.a(xmalloc.o):
In function `xrealloc':
(.text+0xc0): multiple definition of `xrealloc'
libperf.a(wrapper.o):/home/acme_unencrypted/git/linux-2.6-tip/tools/perf/util/wrapper.c:67:
first defined here
collect2: ld returned 1 exit statusSigned-off-by: Arnaldo Carvalho de Melo
Cc: Frédéric Weisbecker
Cc: Mike Galbraith
Cc: Peter Zijlstra
Cc: Paul Mackerras
LKML-Reference:
Signed-off-by: Ingo Molnar -
This way we type less characters and it looks more like the
kzalloc kernel counterpart.Signed-off-by: Arnaldo Carvalho de Melo
Cc: Frédéric Weisbecker
Cc: Mike Galbraith
Cc: Peter Zijlstra
Cc: Paul Mackerras
LKML-Reference:
Signed-off-by: Ingo Molnar -
So that they can be used in other tools.
Signed-off-by: Arnaldo Carvalho de Melo
Cc: Frédéric Weisbecker
Cc: Mike Galbraith
Cc: Peter Zijlstra
Cc: Paul Mackerras
LKML-Reference:
Signed-off-by: Ingo Molnar
17 Nov, 2009
1 commit
-
Resolved merge conflict in tools/perf/Makefile
Merge reason: we want to queue up a dependent patch.
Signed-off-by: Ingo Molnar
11 Nov, 2009
1 commit
-
Build a set of section headers for features right after the
datas. Each implemented feature will have one of such section
header that provides the offset and the size of the data
manipulated by the feature.The trace informations have moved after the data and are
recorded on exit time.The new layout is as follows:
-----------------------
___
[ magic ] |
[ header size ] |
[ attr size ] |
[ attr content offset ] |
[ attr content size ] |
[ data offset ] File Headers
[ data size ] |
[ event_types offset ] |
[ event_types size ] |
[ feature bitmap ] v[ attr section ]
[ events section ]___
[ X ] |
[ X ] |
[ X ] Datas
[ X ] |
[ X ] v___
[ Feature 1 offset ] |
[ Feature 1 size ] Features headers
[ Feature 2 offset ] |
[ Feature 2 size ] v[ Feature 1 content ]
[ Feature 2 content ]
-----------------------We have as many feature's section headers as we have features in
use for the current file.Say Feat 1 and Feat 3 are used by the file, but not Feat 2. Then
the feature headers will be like follows:[ Feature 1 offset ] |
[ Feature 1 size ] Features headers
[ Feature 3 offset ] |
[ Feature 3 size ] vThere is no hole to cover Feature 2 that is not in use here. We
only need to cover the needed headers in order, from the lowest
feature bit to the highest.Currently we have two features: HEADER_TRACE_INFO and
HEADER_BUILD_ID. Both have their contents that follow the
feature headers. Putting the contents right after the feature
headers is not mandatory though. While we keep the feature
headers right after the data and in order, their offsets can
point everywhere. We have just put the two above feature
contents in the end of the file for convenience.The purpose of this layout change is to have a file format that
scales while keeping it simple: having such linear feature
headers is less error prone wrt forward/backward compatibility
as the content of a feature can be put anywhere, its location
can even change by the time, it's fine because its headers will
tell where it is. And we know how to find these headers,
following the above rules.Signed-off-by: Frederic Weisbecker
Cc: Peter Zijlstra
Cc: Arnaldo Carvalho de Melo
Cc: Mike Galbraith
Cc: Paul Mackerras
Cc: Hitoshi Mitake
LKML-Reference:
Signed-off-by: Ingo Molnar
17 Oct, 2009
1 commit
-
Add DIE_IF() macro and replace ERR_IF() with it, and use
linux/stringify.h.Signed-off-by: Masami Hiramatsu
Cc: Frederic Weisbecker
Cc: Arnaldo Carvalho de Melo
Cc: Steven Rostedt
Cc: Paul Mackerras
Cc: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar
31 Aug, 2009
1 commit
-
Merge reason: this topic is ready now to merge into the main
development branch for .32, with functional
perf trace output.Signed-off-by: Ingo Molnar
18 Aug, 2009
1 commit
-
The _XOPEN_SOURCE* defines are not really needed on Linux and
it's not like we'll port this to AIX ;-)The define also broke the build with gcc 4.4.1:
CC util/trace-event-parse.o
In file included from util/trace-event-parse.c:32:
util/util.h:43:1: error: "_XOPEN_SOURCE" redefinedSo remove them.
Cc: Peter Zijlstra
Cc: Mike Galbraith
Cc: Paul Mackerras
Cc: Arnaldo Carvalho de Melo
Cc: Frederic Weisbecker
LKML-Reference:
Signed-off-by: Ingo Molnar
17 Aug, 2009
1 commit
-
This adds perf trace into the set of perf tools.
It is written to fetch the tracepoint samples from perf events
and display them, according to the events information given by
the debugfs files through the util/trace* tools.It is a rough first shot and doesn't yet handle the cpu,
timestamps fields and some other things.Example:
perf record -f -e workqueue:workqueue_execution:record -F 1 -a
perf tracekblockd/0-236 [000] 0.000000: workqueue_execution: thread=:236 func=cfq_kick_queue+0x0
kondemand/0-360 [000] 0.000000: workqueue_execution: thread=:360 func=do_dbs_timer+0x0
kondemand/0-360 [000] 0.000000: workqueue_execution: thread=:360 func=do_dbs_timer+0x0
kondemand/1-361 [000] 0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
kondemand/1-361 [000] 0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
kondemand/1-361 [000] 0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
kondemand/1-361 [000] 0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
kondemand/1-361 [000] 0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
kondemand/1-361 [000] 0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
kondemand/1-361 [000] 0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
kondemand/1-361 [000] 0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
kondemand/1-361 [000] 0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
kondemand/1-361 [000] 0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
kondemand/1-361 [000] 0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
kondemand/1-361 [000] 0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
kondemand/1-361 [000] 0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0Todo:
- A lot of things!
Signed-off-by: Frederic Weisbecker
Cc: Peter Zijlstra
Cc: Arnaldo Carvalho de Melo
Cc: Mike Galbraith
Cc: "Luis Claudio R. Goncalves"
Cc: Clark Williams
Cc: Jon Masters
Cc: Mathieu Desnoyers
Cc: Christoph Hellwig
Cc: Xiao Guangrong
Cc: Zhaolei
Cc: Li Zefan
Cc: Lai Jiangshan
Cc: Masami Hiramatsu
Cc: Tom Zanussi
Cc: "Frank Ch. Eigler"
Cc: Roland McGrath
Cc: Jason Baron
Cc: Paul Mackerras
Cc: Jiaying Zhang
Cc: Anton Blanchard
LKML-Reference:
Signed-off-by: Ingo Molnar
12 Aug, 2009
2 commits
-
Factorize the dso mapping helpers into a single purpose common file
"util/map.c"Signed-off-by: Frederic Weisbecker
Cc: Arnaldo Carvalho de Melo
Cc: Peter Zijlstra
Cc: Mike Galbraith
Cc: Brice Goglin -
Factorize the multiple definition of the events structures into a
single util/event.h file.Signed-off-by: Frederic Weisbecker
Cc: Arnaldo Carvalho de Melo
Cc: Peter Zijlstra
Cc: Mike Galbraith
Cc: Brice Goglin
23 Jul, 2009
1 commit
-
Add support to 'perf list' and 'perf stat' for kernel tracepoints. The
implementation creates a 'for_each_subsystem' and 'for_each_event' for
easy iteration over the tracepoints.Signed-off-by: Jason Baron
Signed-off-by: Peter Zijlstra
LKML-Reference:
27 Jun, 2009
1 commit
-
Vince Weaver reported that there's a handful of #ifdef __MINGW32__
sections in the code.Remove them as they are in essence dead code - as unlike upstream
Git, the perf tool is unlikely to be ported to Windows.Reported-by: Vince Weaver
Cc: Peter Zijlstra
Cc: Mike Galbraith
Cc: Paul Mackerras
Cc: Arnaldo Carvalho de Melo
LKML-Reference:
Signed-off-by: Ingo Molnar
18 Jun, 2009
2 commits
-
Introduce isprint() to print out raw event dumps to ASCII, etc.
(This is an extension to upstream Git's ctype.c.)
Signed-off-by: Peter Zijlstra
Cc: Mike Galbraith
Cc: Paul Mackerras
Cc: Arnaldo Carvalho de Melo
LKML-Reference:
[ removed openssl.h inclusion from util.h - it leaked ctype.h ]
Signed-off-by: Ingo Molnar -
The Git utils came with a ctype replacement that doesn't provide
isprint(). Add a replacement.Solves a build bug on certain distros.
Signed-off-by: Peter Zijlstra
Cc: Peter Zijlstra
Cc: Mike Galbraith
Cc: Paul Mackerras
Cc: Arnaldo Carvalho de Melo
LKML-Reference:
Signed-off-by: Ingo Molnar
07 Jun, 2009
1 commit
-
Several people have suggested that 'perf' has become a full-fledged
tool that should be moved out of Documentation/. Move it to the
(new) tools/ directory.Cc: Peter Zijlstra
Cc: Mike Galbraith
Cc: Paul Mackerras
Cc: Arnaldo Carvalho de Melo
LKML-Reference:
Signed-off-by: Ingo Molnar