Lines Matching refs:rr
593 static int __mon_event_count(u32 closid, u32 rmid, struct rmid_read *rr) in __mon_event_count() argument
601 if (rr->first) { in __mon_event_count()
602 resctrl_arch_reset_rmid(rr->r, rr->d, closid, rmid, rr->evtid); in __mon_event_count()
603 m = get_mbm_state(rr->d, closid, rmid, rr->evtid); in __mon_event_count()
609 if (rr->d) { in __mon_event_count()
611 if (!cpumask_test_cpu(cpu, &rr->d->hdr.cpu_mask)) in __mon_event_count()
613 rr->err = resctrl_arch_rmid_read(rr->r, rr->d, closid, rmid, in __mon_event_count()
614 rr->evtid, &tval, rr->arch_mon_ctx); in __mon_event_count()
615 if (rr->err) in __mon_event_count()
616 return rr->err; in __mon_event_count()
618 rr->val += tval; in __mon_event_count()
624 if (!cpumask_test_cpu(cpu, &rr->ci->shared_cpu_map)) in __mon_event_count()
635 list_for_each_entry(d, &rr->r->mon_domains, hdr.list) { in __mon_event_count()
636 if (d->ci->id != rr->ci->id) in __mon_event_count()
638 err = resctrl_arch_rmid_read(rr->r, d, closid, rmid, in __mon_event_count()
639 rr->evtid, &tval, rr->arch_mon_ctx); in __mon_event_count()
641 rr->val += tval; in __mon_event_count()
647 rr->err = ret; in __mon_event_count()
664 static void mbm_bw_count(u32 closid, u32 rmid, struct rmid_read *rr) in mbm_bw_count() argument
667 struct mbm_state *m = &rr->d->mbm_local[idx]; in mbm_bw_count()
670 cur_bytes = rr->val; in mbm_bw_count()
686 struct rmid_read *rr = info; in mon_event_count() local
690 rdtgrp = rr->rgrp; in mon_event_count()
692 ret = __mon_event_count(rdtgrp->closid, rdtgrp->mon.rmid, rr); in mon_event_count()
704 rr) == 0) in mon_event_count()
715 rr->err = 0; in mon_event_count()
819 struct rmid_read rr = {0}; in mbm_update() local
821 rr.r = r; in mbm_update()
822 rr.d = d; in mbm_update()
829 rr.evtid = QOS_L3_MBM_TOTAL_EVENT_ID; in mbm_update()
830 rr.val = 0; in mbm_update()
831 rr.arch_mon_ctx = resctrl_arch_mon_ctx_alloc(rr.r, rr.evtid); in mbm_update()
832 if (IS_ERR(rr.arch_mon_ctx)) { in mbm_update()
834 PTR_ERR(rr.arch_mon_ctx)); in mbm_update()
838 __mon_event_count(closid, rmid, &rr); in mbm_update()
840 resctrl_arch_mon_ctx_free(rr.r, rr.evtid, rr.arch_mon_ctx); in mbm_update()
843 rr.evtid = QOS_L3_MBM_LOCAL_EVENT_ID; in mbm_update()
844 rr.val = 0; in mbm_update()
845 rr.arch_mon_ctx = resctrl_arch_mon_ctx_alloc(rr.r, rr.evtid); in mbm_update()
846 if (IS_ERR(rr.arch_mon_ctx)) { in mbm_update()
848 PTR_ERR(rr.arch_mon_ctx)); in mbm_update()
852 __mon_event_count(closid, rmid, &rr); in mbm_update()
860 mbm_bw_count(closid, rmid, &rr); in mbm_update()
862 resctrl_arch_mon_ctx_free(rr.r, rr.evtid, rr.arch_mon_ctx); in mbm_update()