Messages in this thread | | | Subject | Re: [PATCH 6/9] perf: Generic pci uncore device support | From | Peter Zijlstra <> | Date | Thu, 03 May 2012 23:37:28 +0200 |
| |
On Wed, 2012-05-02 at 10:07 +0800, Yan, Zheng wrote: > + if (box->pci_dev) { > + hwc->config_base = uncore_pci_event_ctl(box, > hwc->idx); > + hwc->event_base = uncore_pci_perf_ctr(box, hwc->idx); > + } else { > + hwc->config_base = uncore_msr_event_ctl(box, > hwc->idx); > + hwc->event_base = uncore_msr_perf_ctr(box, hwc->idx); > + }
Since box is already an argument to uncore_*_event_ct[lr]() it could include this conditional. Is GCC smart enough to pull it out and not evaluate the condition twice in that case?
| |