diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-04-05 11:53:45 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-04-08 10:34:26 -0400 |
commit | eed05fe70f96b04ebeb218b07ae8898e605f9b23 (patch) | |
tree | b6cfaaca79ac4dbceaf9efbd3ae5549be033182d /tools/perf/util | |
parent | c0ed55d2e4f600335193612725c0d7c8211a7a4a (diff) |
perf tools: Reorganize some structs to save space
Using 'pahole --packable' I found some structs that could be reorganized
to eliminate alignment holes, in some cases getting them to be cacheline
multiples.
[acme@doppio linux-2.6-tip]$ codiff perf.old ~/bin/perf
builtin-annotate.c:
struct perf_session | -8
struct perf_header | -8
2 structs changed
builtin-diff.c:
struct sample_data | -8
1 struct changed
diff__process_sample_event | -8
1 function changed, 8 bytes removed, diff: -8
builtin-sched.c:
struct sched_atom | -8
1 struct changed
builtin-timechart.c:
struct per_pid | -8
1 struct changed
cmd_timechart | -16
1 function changed, 16 bytes removed, diff: -16
builtin-probe.c:
struct perf_probe_point | -8
struct perf_probe_event | -8
2 structs changed
opt_add_probe_event | -3
1 function changed, 3 bytes removed, diff: -3
util/probe-finder.c:
struct probe_finder | -8
1 struct changed
find_kprobe_trace_events | -16
1 function changed, 16 bytes removed, diff: -16
/home/acme/bin/perf:
4 functions changed, 43 bytes removed, diff: -43
[acme@doppio linux-2.6-tip]$
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util')
-rw-r--r-- | tools/perf/util/event.h | 4 | ||||
-rw-r--r-- | tools/perf/util/header.h | 2 | ||||
-rw-r--r-- | tools/perf/util/probe-event.h | 2 | ||||
-rw-r--r-- | tools/perf/util/probe-finder.h | 4 |
4 files changed, 6 insertions, 6 deletions
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h index a33b94952e34..7f7cf8539cfe 100644 --- a/tools/perf/util/event.h +++ b/tools/perf/util/event.h | |||
@@ -68,11 +68,11 @@ struct sample_data { | |||
68 | u64 addr; | 68 | u64 addr; |
69 | u64 id; | 69 | u64 id; |
70 | u64 stream_id; | 70 | u64 stream_id; |
71 | u32 cpu; | ||
72 | u64 period; | 71 | u64 period; |
73 | struct ip_callchain *callchain; | 72 | u32 cpu; |
74 | u32 raw_size; | 73 | u32 raw_size; |
75 | void *raw_data; | 74 | void *raw_data; |
75 | struct ip_callchain *callchain; | ||
76 | }; | 76 | }; |
77 | 77 | ||
78 | #define BUILD_ID_SIZE 20 | 78 | #define BUILD_ID_SIZE 20 |
diff --git a/tools/perf/util/header.h b/tools/perf/util/header.h index 82a6af72d4cc..c059f08cf877 100644 --- a/tools/perf/util/header.h +++ b/tools/perf/util/header.h | |||
@@ -47,13 +47,13 @@ int perf_file_header__read(struct perf_file_header *self, | |||
47 | struct perf_header { | 47 | struct perf_header { |
48 | int frozen; | 48 | int frozen; |
49 | int attrs, size; | 49 | int attrs, size; |
50 | bool needs_swap; | ||
50 | struct perf_header_attr **attr; | 51 | struct perf_header_attr **attr; |
51 | s64 attr_offset; | 52 | s64 attr_offset; |
52 | u64 data_offset; | 53 | u64 data_offset; |
53 | u64 data_size; | 54 | u64 data_size; |
54 | u64 event_offset; | 55 | u64 event_offset; |
55 | u64 event_size; | 56 | u64 event_size; |
56 | bool needs_swap; | ||
57 | DECLARE_BITMAP(adds_features, HEADER_FEAT_BITS); | 57 | DECLARE_BITMAP(adds_features, HEADER_FEAT_BITS); |
58 | }; | 58 | }; |
59 | 59 | ||
diff --git a/tools/perf/util/probe-event.h b/tools/perf/util/probe-event.h index cd308b0a4d96..9d99fc24c4fc 100644 --- a/tools/perf/util/probe-event.h +++ b/tools/perf/util/probe-event.h | |||
@@ -40,9 +40,9 @@ struct perf_probe_point { | |||
40 | char *file; /* File path */ | 40 | char *file; /* File path */ |
41 | char *function; /* Function name */ | 41 | char *function; /* Function name */ |
42 | int line; /* Line number */ | 42 | int line; /* Line number */ |
43 | bool retprobe; /* Return probe flag */ | ||
43 | char *lazy_line; /* Lazy matching pattern */ | 44 | char *lazy_line; /* Lazy matching pattern */ |
44 | unsigned long offset; /* Offset from function entry */ | 45 | unsigned long offset; /* Offset from function entry */ |
45 | bool retprobe; /* Return probe flag */ | ||
46 | }; | 46 | }; |
47 | 47 | ||
48 | /* Perf probe probing argument field chain */ | 48 | /* Perf probe probing argument field chain */ |
diff --git a/tools/perf/util/probe-finder.h b/tools/perf/util/probe-finder.h index 3564f22954f1..2a271321944f 100644 --- a/tools/perf/util/probe-finder.h +++ b/tools/perf/util/probe-finder.h | |||
@@ -31,13 +31,13 @@ extern int find_line_range(int fd, struct line_range *lr); | |||
31 | 31 | ||
32 | struct probe_finder { | 32 | struct probe_finder { |
33 | struct perf_probe_event *pev; /* Target probe event */ | 33 | struct perf_probe_event *pev; /* Target probe event */ |
34 | int ntevs; /* number of trace events */ | ||
35 | struct kprobe_trace_event *tevs; /* Result trace events */ | 34 | struct kprobe_trace_event *tevs; /* Result trace events */ |
35 | int ntevs; /* number of trace events */ | ||
36 | 36 | ||
37 | /* For function searching */ | 37 | /* For function searching */ |
38 | int lno; /* Line number */ | ||
38 | Dwarf_Addr addr; /* Address */ | 39 | Dwarf_Addr addr; /* Address */ |
39 | const char *fname; /* Real file name */ | 40 | const char *fname; /* Real file name */ |
40 | int lno; /* Line number */ | ||
41 | Dwarf_Die cu_die; /* Current CU */ | 41 | Dwarf_Die cu_die; /* Current CU */ |
42 | struct list_head lcache; /* Line cache for lazy match */ | 42 | struct list_head lcache; /* Line cache for lazy match */ |
43 | 43 | ||