10 align1 = addr1 & ~(size - 1);
11 align2 = addr2 & ~(size - 1);
13 return (align1 != align2) ? true :
false;
17 #define AREA_2M (2 * 1024 * 1024) 22 if (flags->
type == PERF_BR_UNKNOWN || from == 0)
27 if (flags->
type == PERF_BR_COND) {
42 const char *branch_names[PERF_BR_MAX] = {
56 if (type >= 0 && type < PERF_BR_MAX)
57 return branch_names[type];
67 for (i = 0; i < PERF_BR_MAX; i++)
74 fprintf(fp,
"\n# Branch Statistics:");
78 fprintf(fp,
"\n%8s: %5.1f%%",
80 100.0 * (
double)st->
cond_fwd / (
double)total);
84 fprintf(fp,
"\n%8s: %5.1f%%",
86 100.0 * (
double)st->
cond_bwd / (
double)total);
90 fprintf(fp,
"\n%8s: %5.1f%%",
92 100.0 * (
double)st->
cross_4k / (
double)total);
96 fprintf(fp,
"\n%8s: %5.1f%%",
98 100.0 * (
double)st->
cross_2m / (
double)total);
101 for (i = 0; i < PERF_BR_MAX; i++) {
103 fprintf(fp,
"\n%8s: %5.1f%%",
106 (
double)st->
counts[i] / (
double)total);
112 return scnprintf(bf, size,
"%s%s", (idx) ?
" " :
" (", str);
117 int i, j = 0, printed = 0;
120 for (i = 0; i < PERF_BR_MAX; i++)
132 for (i = 0; i < PERF_BR_MAX; i++) {
133 if (i == PERF_BR_COND)
int branch_type_str(struct branch_type_stat *st, char *bf, int size)
static bool cross_area(u64 addr1, u64 addr2, int size)
const char * branch_type_name(int type)
static int str(yyscan_t scanner, int token)
void branch_type_stat_display(FILE *fp, struct branch_type_stat *st)
void branch_type_count(struct branch_type_stat *st, struct branch_flags *flags, u64 from, u64 to)
static int count_str_scnprintf(int idx, const char *str, char *bf, int size)