Lines Matching refs:cnt_num

1105 static int mlxbf_pmc_program_l3_counter(unsigned int blk_num, u32 cnt_num, u32 evt)  in mlxbf_pmc_program_l3_counter()  argument
1116 switch (cnt_num) { in mlxbf_pmc_program_l3_counter()
1135 switch (cnt_num) { in mlxbf_pmc_program_l3_counter()
1169 static int mlxbf_pmc_program_crspace_counter(unsigned int blk_num, u32 cnt_num, u32 evt) in mlxbf_pmc_program_crspace_counter() argument
1176 ((cnt_num / 2) * MLXBF_PMC_CRSPACE_PERFSEL_SZ); in mlxbf_pmc_program_crspace_counter()
1181 if (cnt_num % 2) { in mlxbf_pmc_program_crspace_counter()
1193 static int mlxbf_pmc_clear_crspace_counter(unsigned int blk_num, u32 cnt_num) in mlxbf_pmc_clear_crspace_counter() argument
1199 (cnt_num * 4); in mlxbf_pmc_clear_crspace_counter()
1205 static int mlxbf_pmc_program_counter(unsigned int blk_num, u32 cnt_num, u32 evt, bool is_l3) in mlxbf_pmc_program_counter() argument
1209 if (cnt_num >= pmc->block[blk_num].counters) in mlxbf_pmc_program_counter()
1213 return mlxbf_pmc_program_l3_counter(blk_num, cnt_num, evt); in mlxbf_pmc_program_counter()
1216 return mlxbf_pmc_program_crspace_counter(blk_num, cnt_num, in mlxbf_pmc_program_counter()
1235 cnt_num * MLXBF_PMC_REG_SIZE, in mlxbf_pmc_program_counter()
1249 cnt_num * MLXBF_PMC_REG_SIZE, in mlxbf_pmc_program_counter()
1260 cnt_num * MLXBF_PMC_REG_SIZE, in mlxbf_pmc_program_counter()
1268 static int mlxbf_pmc_read_l3_counter(unsigned int blk_num, u32 cnt_num, u64 *result) in mlxbf_pmc_read_l3_counter() argument
1276 cnt_num * MLXBF_PMC_L3C_REG_SIZE, in mlxbf_pmc_read_l3_counter()
1284 cnt_num * MLXBF_PMC_L3C_REG_SIZE, in mlxbf_pmc_read_l3_counter()
1299 static int mlxbf_pmc_read_crspace_counter(unsigned int blk_num, u32 cnt_num, u64 *result) in mlxbf_pmc_read_crspace_counter() argument
1306 (cnt_num * 4), &value); in mlxbf_pmc_read_crspace_counter()
1316 static int mlxbf_pmc_read_counter(unsigned int blk_num, u32 cnt_num, bool is_l3, u64 *result) in mlxbf_pmc_read_counter() argument
1322 if (cnt_num >= pmc->block[blk_num].counters) in mlxbf_pmc_read_counter()
1326 return mlxbf_pmc_read_l3_counter(blk_num, cnt_num, result); in mlxbf_pmc_read_counter()
1329 return mlxbf_pmc_read_crspace_counter(blk_num, cnt_num, result); in mlxbf_pmc_read_counter()
1331 perfcfg_offset = cnt_num * MLXBF_PMC_REG_SIZE; in mlxbf_pmc_read_counter()
1353 static int mlxbf_pmc_read_l3_event(unsigned int blk_num, u32 cnt_num, u64 *result) in mlxbf_pmc_read_l3_event() argument
1360 switch (cnt_num) { in mlxbf_pmc_read_l3_event()
1379 switch (cnt_num) { in mlxbf_pmc_read_l3_event()
1405 static int mlxbf_pmc_read_crspace_event(unsigned int blk_num, u32 cnt_num, u64 *result) in mlxbf_pmc_read_crspace_event() argument
1412 ((cnt_num / 2) * MLXBF_PMC_CRSPACE_PERFSEL_SZ); in mlxbf_pmc_read_crspace_event()
1417 if (cnt_num % 2) in mlxbf_pmc_read_crspace_event()
1428 static int mlxbf_pmc_read_event(unsigned int blk_num, u32 cnt_num, bool is_l3, u64 *result) in mlxbf_pmc_read_event() argument
1433 if (cnt_num >= pmc->block[blk_num].counters) in mlxbf_pmc_read_event()
1437 return mlxbf_pmc_read_l3_event(blk_num, cnt_num, result); in mlxbf_pmc_read_event()
1440 return mlxbf_pmc_read_crspace_event(blk_num, cnt_num, result); in mlxbf_pmc_read_event()
1442 perfcfg_offset = cnt_num * MLXBF_PMC_REG_SIZE; in mlxbf_pmc_read_event()
1508 unsigned int blk_num, cnt_num; in mlxbf_pmc_counter_show() local
1514 cnt_num = attr_counter->index; in mlxbf_pmc_counter_show()
1521 if (mlxbf_pmc_read_counter(blk_num, cnt_num, is_l3, &value)) in mlxbf_pmc_counter_show()
1543 unsigned int blk_num, cnt_num, data; in mlxbf_pmc_counter_store() local
1550 cnt_num = attr_counter->index; in mlxbf_pmc_counter_store()
1565 err = mlxbf_pmc_read_event(blk_num, cnt_num, is_l3, &evt_num); in mlxbf_pmc_counter_store()
1568 err = mlxbf_pmc_program_counter(blk_num, cnt_num, evt_num, in mlxbf_pmc_counter_store()
1581 if (sscanf(attr->attr.name, "counter%u", &cnt_num) != 1) in mlxbf_pmc_counter_store()
1583 err = mlxbf_pmc_clear_crspace_counter(blk_num, cnt_num); in mlxbf_pmc_counter_store()
1596 unsigned int blk_num, cnt_num; in mlxbf_pmc_event_show() local
1603 cnt_num = attr_event->index; in mlxbf_pmc_event_show()
1608 err = mlxbf_pmc_read_event(blk_num, cnt_num, is_l3, &evt_num); in mlxbf_pmc_event_show()
1626 unsigned int blk_num, cnt_num; in mlxbf_pmc_event_store() local
1632 cnt_num = attr_event->index; in mlxbf_pmc_event_store()
1648 err = mlxbf_pmc_program_counter(blk_num, cnt_num, evt_num, is_l3); in mlxbf_pmc_event_store()