struct pmu_caps {
        int             nr_caps;
        unsigned int    max_branches;
+       unsigned int    br_cntr_nr;
+       unsigned int    br_cntr_width;
+
        char            **caps;
        char            *pmu_name;
 };
        unsigned long long      total_mem;
        unsigned int            msr_pmu_type;
        unsigned int            max_branches;
+       unsigned int            br_cntr_nr;
+       unsigned int            br_cntr_width;
        int                     kernel_is_64_bit;
 
        int                     nr_cmdline;
 
 }
 
 static int __process_pmu_caps(struct feat_fd *ff, int *nr_caps,
-                             char ***caps, unsigned int *max_branches)
+                             char ***caps, unsigned int *max_branches,
+                             unsigned int *br_cntr_nr,
+                             unsigned int *br_cntr_width)
 {
        char *name, *value, *ptr;
        u32 nr_pmu_caps, i;
                if (!strcmp(name, "branches"))
                        *max_branches = atoi(value);
 
+               if (!strcmp(name, "branch_counter_nr"))
+                       *br_cntr_nr = atoi(value);
+
+               if (!strcmp(name, "branch_counter_width"))
+                       *br_cntr_width = atoi(value);
+
                free(value);
                free(name);
        }
 {
        int ret = __process_pmu_caps(ff, &ff->ph->env.nr_cpu_pmu_caps,
                                     &ff->ph->env.cpu_pmu_caps,
-                                    &ff->ph->env.max_branches);
+                                    &ff->ph->env.max_branches,
+                                    &ff->ph->env.br_cntr_nr,
+                                    &ff->ph->env.br_cntr_width);
 
        if (!ret && !ff->ph->env.cpu_pmu_caps)
                pr_debug("cpu pmu capabilities not available\n");
        for (i = 0; i < nr_pmu; i++) {
                ret = __process_pmu_caps(ff, &pmu_caps[i].nr_caps,
                                         &pmu_caps[i].caps,
-                                        &pmu_caps[i].max_branches);
+                                        &pmu_caps[i].max_branches,
+                                        &pmu_caps[i].br_cntr_nr,
+                                        &pmu_caps[i].br_cntr_width);
                if (ret)
                        goto err;