branch_sample_type
u64 (*bhrb_filter_map)(u64 branch_sample_type);
event->attr.branch_sample_type);
if (hweight64(event->attr.branch_sample_type & ~PERF_SAMPLE_BRANCH_PLM_ALL) > 1) {
event->attr.branch_sample_type);
static u64 power10_bhrb_filter_map(u64 branch_sample_type)
if (branch_sample_type & PERF_SAMPLE_BRANCH_ANY)
if (branch_sample_type & PERF_SAMPLE_BRANCH_ANY_RETURN)
if (branch_sample_type & PERF_SAMPLE_BRANCH_IND_CALL) {
if (branch_sample_type & PERF_SAMPLE_BRANCH_COND) {
if (branch_sample_type & PERF_SAMPLE_BRANCH_CALL)
if (branch_sample_type & PERF_SAMPLE_BRANCH_ANY_CALL) {
static u64 power8_bhrb_filter_map(u64 branch_sample_type)
if (branch_sample_type & PERF_SAMPLE_BRANCH_ANY)
if (branch_sample_type & PERF_SAMPLE_BRANCH_ANY_RETURN)
if (branch_sample_type & PERF_SAMPLE_BRANCH_IND_CALL)
if (branch_sample_type & PERF_SAMPLE_BRANCH_CALL)
if (branch_sample_type & PERF_SAMPLE_BRANCH_ANY_CALL) {
static u64 power9_bhrb_filter_map(u64 branch_sample_type)
if (branch_sample_type & PERF_SAMPLE_BRANCH_ANY)
if (branch_sample_type & PERF_SAMPLE_BRANCH_ANY_RETURN)
if (branch_sample_type & PERF_SAMPLE_BRANCH_IND_CALL)
if (branch_sample_type & PERF_SAMPLE_BRANCH_CALL)
if (branch_sample_type & PERF_SAMPLE_BRANCH_ANY_CALL) {
int type = event->attr.branch_sample_type;
u64 type = event->attr.branch_sample_type;
u64 br_type = event->attr.branch_sample_type;
u64 m = event->attr.branch_sample_type;
u64 *br_type = &event->attr.branch_sample_type;
if (0 == (event->attr.branch_sample_type &
u64 br_type = event->attr.branch_sample_type;
u64 br_type = event->attr.branch_sample_type;
.branch_sample_type = PERF_SAMPLE_BRANCH_CALL_STACK |
u64 branch_type = event->attr.branch_sample_type;
event->hw.branch_reg.config = branch_type_to_brbfcr(event->attr.branch_sample_type);
event->hw.extra_reg.config = branch_type_to_brbcr(event->attr.branch_sample_type);
static bool filter_branch_privilege(struct perf_branch_entry *entry, u64 branch_sample_type)
bool exclude_kernel = !((branch_sample_type & PERF_SAMPLE_BRANCH_KERNEL) ||
(is_kernel_in_hyp_mode() && (branch_sample_type & PERF_SAMPLE_BRANCH_HV)));
(branch_sample_type & PERF_SAMPLE_BRANCH_USER));
if (!(branch_sample_type & PERF_SAMPLE_BRANCH_USER)) {
u64 branch_sample_type = event->attr.branch_sample_type;
prepare_event_branch_type_mask(branch_sample_type, event_type_mask);
if (!filter_branch_record(pbe, branch_sample_type, event_type_mask))
return event->attr.branch_sample_type & PERF_SAMPLE_BRANCH_NO_FLAGS;
return event->attr.branch_sample_type & PERF_SAMPLE_BRANCH_NO_CYCLES;
return event->attr.branch_sample_type & PERF_SAMPLE_BRANCH_TYPE_SAVE;
return event->attr.branch_sample_type & PERF_SAMPLE_BRANCH_HW_INDEX;
return event->attr.branch_sample_type & PERF_SAMPLE_BRANCH_PRIV_SAVE;
return event->attr.branch_sample_type & PERF_SAMPLE_BRANCH_COUNTERS;
return event->attr.branch_sample_type & PERF_SAMPLE_BRANCH_CALL_STACK;
return event->attr.branch_sample_type != 0;
__u64 branch_sample_type; /* enum perf_branch_sample_type */
event->attr.branch_sample_type = 0;
u64 mask = attr->branch_sample_type;
attr->branch_sample_type = mask;
__u64 branch_sample_type; /* enum perf_branch_sample_type */
if (!(pos->core.attr.branch_sample_type & PERF_SAMPLE_BRANCH_COUNTERS))
if ((attr->branch_sample_type == 0 || attr->branch_sample_type & PERF_SAMPLE_BRANCH_ANY)
evsel.core.attr.branch_sample_type |= PERF_SAMPLE_BRANCH_HW_INDEX;
if (!(pos->core.attr.branch_sample_type & PERF_SAMPLE_BRANCH_COUNTERS))
if ((pos->core.attr.branch_sample_type & PERF_SAMPLE_BRANCH_COUNTERS) &&
if ((pos->core.attr.branch_sample_type & PERF_SAMPLE_BRANCH_COUNTERS) &&
attr.branch_sample_type |= PERF_SAMPLE_BRANCH_HW_INDEX;
attr.branch_sample_type |= PERF_SAMPLE_BRANCH_HW_INDEX;
branch_type |= evsel->core.attr.branch_sample_type;
if ((pos->core.attr.branch_sample_type & PERF_SAMPLE_BRANCH_COUNTERS) &&
if (evsel->core.attr.branch_sample_type & PERF_SAMPLE_BRANCH_COUNTERS) {
attr->branch_sample_type = PERF_SAMPLE_BRANCH_USER |
attr->branch_sample_type &= ~(PERF_SAMPLE_BRANCH_USER |
&attr->branch_sample_type);
attr->branch_sample_type = opts->branch_stack;
WRITE_ASS(branch_sample_type, "llu");
evsel->core.attr.branch_sample_type &= ~PERF_SAMPLE_BRANCH_COUNTERS;
evsel->core.attr.branch_sample_type &= ~(PERF_SAMPLE_BRANCH_NO_FLAGS |
evsel->core.attr.branch_sample_type &= ~PERF_SAMPLE_BRANCH_HW_INDEX;
attr.branch_sample_type = PERF_SAMPLE_BRANCH_COUNTERS;
attr.branch_sample_type = PERF_SAMPLE_BRANCH_HW_INDEX;
attr.branch_sample_type = PERF_SAMPLE_BRANCH_NO_CYCLES | PERF_SAMPLE_BRANCH_NO_FLAGS;
if ((evsel->core.attr.branch_sample_type & PERF_SAMPLE_BRANCH_COUNTERS) &&
if ((evsel->core.attr.branch_sample_type & (PERF_SAMPLE_BRANCH_NO_FLAGS |
if ((evsel->core.attr.branch_sample_type & PERF_SAMPLE_BRANCH_HW_INDEX) &&
return evsel->core.attr.branch_sample_type & PERF_SAMPLE_BRANCH_CALL_STACK;
return evsel->core.attr.branch_sample_type & PERF_SAMPLE_BRANCH_HW_INDEX;
(attr->branch_sample_type & ~(PERF_SAMPLE_BRANCH_MAX-1))) {
attr->branch_sample_type);
attr.branch_sample_type |= PERF_SAMPLE_BRANCH_HW_INDEX;
&attr->branch_sample_type)) {
PRINT_ATTRf(branch_sample_type, p_branch_sample_type);
bswap_field_64(branch_sample_type);
attr.branch_sample_type = PERF_SAMPLE_BRANCH_KERNEL |
.branch_sample_type = PERF_SAMPLE_BRANCH_USER |
attr.branch_sample_type = PERF_SAMPLE_BRANCH_USER | PERF_SAMPLE_BRANCH_ANY;
.branch_sample_type = PERF_SAMPLE_BRANCH_USER |
event.attr.branch_sample_type = PERF_SAMPLE_BRANCH_ANY | PERF_SAMPLE_BRANCH_ANY_CALL;
event.attr.branch_sample_type = 1U << i;
event.attr.branch_sample_type = bhrb_filter_map_valid_common[i];
event.attr.branch_sample_type = bhrb_filter_map_valid_p10[i];
event.attr.branch_sample_type = bhrb_filter_map_valid_p10[i];
event.attr.branch_sample_type = PERF_SAMPLE_BRANCH_ANY;
event.attr.branch_sample_type = PERF_SAMPLE_BRANCH_COND;
event.attr.branch_sample_type = PERF_SAMPLE_BRANCH_ANY;
event.attr.branch_sample_type = PERF_SAMPLE_BRANCH_IND_CALL;