diff options
author | Yan, Zheng <zheng.z.yan@intel.com> | 2014-11-04 21:55:57 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-02-18 11:16:01 -0500 |
commit | 27ac905b8f88d28779b0661809286b5ba2817d37 (patch) | |
tree | fba88a53448a59d56df83895a087ebff5d032620 /include | |
parent | c796b205b88c775fd220c1a63390bac6a8cdda3f (diff) |
perf/x86/intel: Reduce lbr_sel_map[] size
The index of lbr_sel_map is bit value of perf branch_sample_type.
PERF_SAMPLE_BRANCH_MAX is 1024 at present, so each lbr_sel_map uses
4096 bytes. By using bit shift as index, we can reduce lbr_sel_map
size to 40 bytes. This patch defines 'bit shift' for branch types,
and use 'bit shift' to define lbr_sel_maps.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Signed-off-by: Kan Liang <kan.liang@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Stephane Eranian <eranian@google.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: jolsa@redhat.com
Cc: linux-api@vger.kernel.org
Link: http://lkml.kernel.org/r/1415156173-10035-2-git-send-email-kan.liang@intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/uapi/linux/perf_event.h | 49 |
1 files changed, 35 insertions, 14 deletions
diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h index 9b79abbd1ab8..e46b93279e3d 100644 --- a/include/uapi/linux/perf_event.h +++ b/include/uapi/linux/perf_event.h | |||
@@ -152,21 +152,42 @@ enum perf_event_sample_format { | |||
152 | * The branch types can be combined, however BRANCH_ANY covers all types | 152 | * The branch types can be combined, however BRANCH_ANY covers all types |
153 | * of branches and therefore it supersedes all the other types. | 153 | * of branches and therefore it supersedes all the other types. |
154 | */ | 154 | */ |
155 | enum perf_branch_sample_type_shift { | ||
156 | PERF_SAMPLE_BRANCH_USER_SHIFT = 0, /* user branches */ | ||
157 | PERF_SAMPLE_BRANCH_KERNEL_SHIFT = 1, /* kernel branches */ | ||
158 | PERF_SAMPLE_BRANCH_HV_SHIFT = 2, /* hypervisor branches */ | ||
159 | |||
160 | PERF_SAMPLE_BRANCH_ANY_SHIFT = 3, /* any branch types */ | ||
161 | PERF_SAMPLE_BRANCH_ANY_CALL_SHIFT = 4, /* any call branch */ | ||
162 | PERF_SAMPLE_BRANCH_ANY_RETURN_SHIFT = 5, /* any return branch */ | ||
163 | PERF_SAMPLE_BRANCH_IND_CALL_SHIFT = 6, /* indirect calls */ | ||
164 | PERF_SAMPLE_BRANCH_ABORT_TX_SHIFT = 7, /* transaction aborts */ | ||
165 | PERF_SAMPLE_BRANCH_IN_TX_SHIFT = 8, /* in transaction */ | ||
166 | PERF_SAMPLE_BRANCH_NO_TX_SHIFT = 9, /* not in transaction */ | ||
167 | PERF_SAMPLE_BRANCH_COND_SHIFT = 10, /* conditional branches */ | ||
168 | |||
169 | PERF_SAMPLE_BRANCH_MAX_SHIFT /* non-ABI */ | ||
170 | }; | ||
171 | |||
155 | enum perf_branch_sample_type { | 172 | enum perf_branch_sample_type { |
156 | PERF_SAMPLE_BRANCH_USER = 1U << 0, /* user branches */ | 173 | PERF_SAMPLE_BRANCH_USER = 1U << PERF_SAMPLE_BRANCH_USER_SHIFT, |
157 | PERF_SAMPLE_BRANCH_KERNEL = 1U << 1, /* kernel branches */ | 174 | PERF_SAMPLE_BRANCH_KERNEL = 1U << PERF_SAMPLE_BRANCH_KERNEL_SHIFT, |
158 | PERF_SAMPLE_BRANCH_HV = 1U << 2, /* hypervisor branches */ | 175 | PERF_SAMPLE_BRANCH_HV = 1U << PERF_SAMPLE_BRANCH_HV_SHIFT, |
159 | 176 | ||
160 | PERF_SAMPLE_BRANCH_ANY = 1U << 3, /* any branch types */ | 177 | PERF_SAMPLE_BRANCH_ANY = 1U << PERF_SAMPLE_BRANCH_ANY_SHIFT, |
161 | PERF_SAMPLE_BRANCH_ANY_CALL = 1U << 4, /* any call branch */ | 178 | PERF_SAMPLE_BRANCH_ANY_CALL = |
162 | PERF_SAMPLE_BRANCH_ANY_RETURN = 1U << 5, /* any return branch */ | 179 | 1U << PERF_SAMPLE_BRANCH_ANY_CALL_SHIFT, |
163 | PERF_SAMPLE_BRANCH_IND_CALL = 1U << 6, /* indirect calls */ | 180 | PERF_SAMPLE_BRANCH_ANY_RETURN = |
164 | PERF_SAMPLE_BRANCH_ABORT_TX = 1U << 7, /* transaction aborts */ | 181 | 1U << PERF_SAMPLE_BRANCH_ANY_RETURN_SHIFT, |
165 | PERF_SAMPLE_BRANCH_IN_TX = 1U << 8, /* in transaction */ | 182 | PERF_SAMPLE_BRANCH_IND_CALL = |
166 | PERF_SAMPLE_BRANCH_NO_TX = 1U << 9, /* not in transaction */ | 183 | 1U << PERF_SAMPLE_BRANCH_IND_CALL_SHIFT, |
167 | PERF_SAMPLE_BRANCH_COND = 1U << 10, /* conditional branches */ | 184 | PERF_SAMPLE_BRANCH_ABORT_TX = |
168 | 185 | 1U << PERF_SAMPLE_BRANCH_ABORT_TX_SHIFT, | |
169 | PERF_SAMPLE_BRANCH_MAX = 1U << 11, /* non-ABI */ | 186 | PERF_SAMPLE_BRANCH_IN_TX = 1U << PERF_SAMPLE_BRANCH_IN_TX_SHIFT, |
187 | PERF_SAMPLE_BRANCH_NO_TX = 1U << PERF_SAMPLE_BRANCH_NO_TX_SHIFT, | ||
188 | PERF_SAMPLE_BRANCH_COND = 1U << PERF_SAMPLE_BRANCH_COND_SHIFT, | ||
189 | |||
190 | PERF_SAMPLE_BRANCH_MAX = 1U << PERF_SAMPLE_BRANCH_MAX_SHIFT, | ||
170 | }; | 191 | }; |
171 | 192 | ||
172 | #define PERF_SAMPLE_BRANCH_PLM_ALL \ | 193 | #define PERF_SAMPLE_BRANCH_PLM_ALL \ |