diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2009-11-11 04:51:07 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-11-11 07:30:19 +0100 |
commit | 9e827dd00a94136b944a538bede67c944d0b740a (patch) | |
tree | 216a995921b8741461667bfdce8acc595a99685f /tools/perf/util/include | |
parent | perf tools: Use perf_header__set/has_feat whenever possible (diff) | |
download | linux-9e827dd00a94136b944a538bede67c944d0b740a.tar.xz linux-9e827dd00a94136b944a538bede67c944d0b740a.zip |
perf tools: Bring linear set of section headers for features
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 ] v
There 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 <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
LKML-Reference: <1257911467-28276-6-git-send-email-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/include')
-rw-r--r-- | tools/perf/util/include/linux/bitmap.h | 1 | ||||
-rw-r--r-- | tools/perf/util/include/linux/ctype.h | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/tools/perf/util/include/linux/bitmap.h b/tools/perf/util/include/linux/bitmap.h index 821c1033bccf..94507639a8c4 100644 --- a/tools/perf/util/include/linux/bitmap.h +++ b/tools/perf/util/include/linux/bitmap.h @@ -1,2 +1,3 @@ #include "../../../../include/linux/bitmap.h" #include "../../../../include/asm-generic/bitops/find.h" +#include <linux/errno.h> diff --git a/tools/perf/util/include/linux/ctype.h b/tools/perf/util/include/linux/ctype.h index bae5783282ef..a53d4ee1e0b7 100644 --- a/tools/perf/util/include/linux/ctype.h +++ b/tools/perf/util/include/linux/ctype.h @@ -1 +1 @@ -#include "../../../../include/linux/ctype.h" +#include "../util.h" |