Lines Matching refs:aux

1347 #define AUX_SDB_INDEX(aux, i) ((i) % aux->sfb.num_sdb)  argument
1348 #define AUX_SDB_NUM(aux, start, end) (end >= start ? end - start + 1 : 0) argument
1349 #define AUX_SDB_NUM_ALERT(aux) AUX_SDB_NUM(aux, aux->head, aux->alert_mark) argument
1350 #define AUX_SDB_NUM_EMPTY(aux) AUX_SDB_NUM(aux, aux->head, aux->empty_mark) argument
1355 static struct hws_trailer_entry *aux_sdb_trailer(struct aux_buffer *aux, in aux_sdb_trailer() argument
1360 index = AUX_SDB_INDEX(aux, index); in aux_sdb_trailer()
1361 sdb = aux->sdb_index[index]; in aux_sdb_trailer()
1377 struct aux_buffer *aux; in aux_output_end() local
1380 aux = perf_get_aux(handle); in aux_output_end()
1381 if (!aux) in aux_output_end()
1384 range_scan = AUX_SDB_NUM_ALERT(aux); in aux_output_end()
1385 for (i = 0, idx = aux->head; i < range_scan; i++, idx++) { in aux_output_end()
1386 te = aux_sdb_trailer(aux, idx); in aux_output_end()
1394 te = aux_sdb_trailer(aux, aux->alert_mark); in aux_output_end()
1398 __func__, i, range_scan, aux->head); in aux_output_end()
1411 struct aux_buffer *aux, in aux_output_begin() argument
1422 aux->head = handle->head >> PAGE_SHIFT; in aux_output_begin()
1433 __func__, range, aux->head, aux->alert_mark, in aux_output_begin()
1434 aux->empty_mark); in aux_output_begin()
1435 if (range > AUX_SDB_NUM_EMPTY(aux)) { in aux_output_begin()
1436 range_scan = range - AUX_SDB_NUM_EMPTY(aux); in aux_output_begin()
1437 idx = aux->empty_mark + 1; in aux_output_begin()
1439 te = aux_sdb_trailer(aux, idx); in aux_output_begin()
1445 aux->empty_mark = aux->head + range - 1; in aux_output_begin()
1449 aux->alert_mark = aux->head + range/2 - 1; in aux_output_begin()
1450 te = aux_sdb_trailer(aux, aux->alert_mark); in aux_output_begin()
1454 head = AUX_SDB_INDEX(aux, aux->head); in aux_output_begin()
1455 base = aux->sdbt_index[head / CPUM_SF_SDB_PER_TABLE]; in aux_output_begin()
1458 cpuhw->lsctl.dear = aux->sdb_index[head]; in aux_output_begin()
1462 aux->head, aux->alert_mark, aux->empty_mark, in aux_output_begin()
1475 static bool aux_set_alert(struct aux_buffer *aux, unsigned long alert_index, in aux_set_alert() argument
1481 te = aux_sdb_trailer(aux, alert_index); in aux_set_alert()
1522 static bool aux_reset_buffer(struct aux_buffer *aux, unsigned long range, in aux_reset_buffer() argument
1530 "empty %ld\n", __func__, range, aux->head, in aux_reset_buffer()
1531 aux->alert_mark, aux->empty_mark); in aux_reset_buffer()
1532 if (range <= AUX_SDB_NUM_EMPTY(aux)) in aux_reset_buffer()
1538 return aux_set_alert(aux, aux->alert_mark, overflow); in aux_reset_buffer()
1540 if (aux->alert_mark <= aux->empty_mark) in aux_reset_buffer()
1545 if (!aux_set_alert(aux, aux->alert_mark, overflow)) in aux_reset_buffer()
1553 range_scan = range - AUX_SDB_NUM_EMPTY(aux); in aux_reset_buffer()
1554 idx_old = idx = aux->empty_mark + 1; in aux_reset_buffer()
1556 te = aux_sdb_trailer(aux, idx); in aux_reset_buffer()
1561 if (idx == aux->alert_mark) in aux_reset_buffer()
1572 aux->empty_mark = aux->head + range - 1; in aux_reset_buffer()
1576 idx - 1, aux->empty_mark); in aux_reset_buffer()
1585 struct aux_buffer *aux; in hw_collect_aux() local
1592 aux = perf_get_aux(handle); in hw_collect_aux()
1593 if (WARN_ON_ONCE(!aux)) in hw_collect_aux()
1597 size = AUX_SDB_NUM_ALERT(aux) << PAGE_SHIFT; in hw_collect_aux()
1602 num_sdb = aux->sfb.num_sdb; in hw_collect_aux()
1605 aux = perf_aux_output_begin(handle, cpuhw->event); in hw_collect_aux()
1615 if (WARN_ON_ONCE(!aux)) in hw_collect_aux()
1619 aux->head = handle->head >> PAGE_SHIFT; in hw_collect_aux()
1622 aux->alert_mark = aux->head; in hw_collect_aux()
1624 aux->alert_mark = aux->head + range/2 - 1; in hw_collect_aux()
1626 if (aux_reset_buffer(aux, range, &overflow)) { in hw_collect_aux()
1634 "pages to overflow\n", aux->sfb.num_sdb); in hw_collect_aux()
1637 aux->head, range, overflow); in hw_collect_aux()
1639 size = AUX_SDB_NUM_ALERT(aux) << PAGE_SHIFT; in hw_collect_aux()
1644 aux->head, aux->alert_mark); in hw_collect_aux()
1650 "empty %ld\n", __func__, aux->head, in hw_collect_aux()
1651 aux->alert_mark, aux->empty_mark); in hw_collect_aux()
1659 struct aux_buffer *aux = data; in aux_buffer_free() local
1662 if (!aux) in aux_buffer_free()
1666 num_sdbt = aux->sfb.num_sdbt; in aux_buffer_free()
1668 free_page(aux->sdbt_index[i]); in aux_buffer_free()
1670 kfree(aux->sdbt_index); in aux_buffer_free()
1671 kfree(aux->sdb_index); in aux_buffer_free()
1672 kfree(aux); in aux_buffer_free()
1706 struct aux_buffer *aux; in aux_buffer_setup() local
1726 aux = kzalloc(sizeof(struct aux_buffer), GFP_KERNEL); in aux_buffer_setup()
1727 if (!aux) in aux_buffer_setup()
1729 sfb = &aux->sfb; in aux_buffer_setup()
1733 aux->sdbt_index = kmalloc_array(n_sdbt, sizeof(void *), GFP_KERNEL); in aux_buffer_setup()
1734 if (!aux->sdbt_index) in aux_buffer_setup()
1738 aux->sdb_index = kmalloc_array(nr_pages, sizeof(void *), GFP_KERNEL); in aux_buffer_setup()
1739 if (!aux->sdb_index) in aux_buffer_setup()
1747 aux->sdbt_index[sfb->num_sdbt++] = (unsigned long)sfb->sdbt; in aux_buffer_setup()
1759 aux->sdbt_index[sfb->num_sdbt++] = (unsigned long)new; in aux_buffer_setup()
1766 aux->sdb_index[i] = (unsigned long)pages[i]; in aux_buffer_setup()
1780 aux->empty_mark = sfb->num_sdb - 1; in aux_buffer_setup()
1785 return aux; in aux_buffer_setup()
1790 free_page(aux->sdbt_index[i]); in aux_buffer_setup()
1791 kfree(aux->sdb_index); in aux_buffer_setup()
1793 kfree(aux->sdbt_index); in aux_buffer_setup()
1795 kfree(aux); in aux_buffer_setup()
1889 struct aux_buffer *aux; in cpumsf_pmu_add() local
1924 aux = perf_aux_output_begin(&cpuhw->handle, event); in cpumsf_pmu_add()
1925 if (!aux) { in cpumsf_pmu_add()
1929 err = aux_output_begin(&cpuhw->handle, aux, cpuhw); in cpumsf_pmu_add()