diff options
author | Jiri Olsa <jolsa@kernel.org> | 2017-10-11 17:01:37 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-11-13 13:39:59 +0100 |
commit | c835e1914c4bcfdd41f43d270cafc6d8119d7782 (patch) | |
tree | 250f7eef4f1a04c99521de5df5459c5857b86bee /tools/perf/util/annotate.h | |
parent | perf annotate: Move rb_node to struct annotation_line (diff) | |
download | linux-c835e1914c4bcfdd41f43d270cafc6d8119d7782.tar.xz linux-c835e1914c4bcfdd41f43d270cafc6d8119d7782.zip |
perf annotate: Add annotation_line__(new|delete) functions
Changing the way the annotation lines are allocated and adding
annotation_line__(new|delete) functions to deal with this.
Before the allocation schema was as follows:
-----------------------------------------------------------
struct disasm_line | struct annotation_line | private space
-----------------------------------------------------------
Where the private space is used in TUI code to store computed
annotation data for events. The stdio code computes the data
on the fly.
The goal is to compute and store annotation line's data directly
in the struct annotation_line itself, so this patch changes the
line allocation schema as follows:
------------------------------------------------------------
privsize space | struct disasm_line | struct annotation_line
------------------------------------------------------------
Moving struct annotation_line to the end, because in following
changes we will move here the non-fixed length event's data.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20171011150158.11895-15-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/annotate.h')
-rw-r--r-- | tools/perf/util/annotate.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h index 6f01e6117936..2e7a08afb04f 100644 --- a/tools/perf/util/annotate.h +++ b/tools/perf/util/annotate.h @@ -67,14 +67,22 @@ struct annotation_line { int line_nr; float ipc; u64 cycles; + size_t privsize; }; struct disasm_line { - struct annotation_line al; struct ins ins; struct ins_operands ops; + + /* This needs to be at the end. */ + struct annotation_line al; }; +static inline struct disasm_line *disasm_line(struct annotation_line *al) +{ + return al ? container_of(al, struct disasm_line, al) : NULL; +} + static inline bool disasm_line__has_offset(const struct disasm_line *dl) { return dl->ops.target.offset_avail; |