Lines Matching defs:config

623 static void pmc_config_free(pmc_t pmc, pmc_config_t config) {
625 assert(config);
627 if(config->object) {
628 pmc->methods.free_config(pmc->object, config->object);
629 config->object = NULL;
632 zfree(perf_small_zone, config);
666 * given pmc_reservation_t. This includes freeing the config used to create the
671 /* Free config */
672 if(resv->config) {
675 pmc_free_config(resv->pmc, resv->config);
677 resv->config = NULL;
694 resv->config = NULL;
1508 assert(reservation->config);
1564 assert(reservation->config);
1571 ret = load_pmc->methods.set_config(load_pmc_obj, reservation->config->object);
1712 assert(reservation->config);
1713 assert(reservation->config->method);
1720 (void)reservation->config->method(reservation, refCon);
1726 reservation->config->method, (end - start));
2006 kern_return_t pmc_create_config(pmc_t pmc, pmc_config_t *config) {
2009 if(!pmc || !config) {
2035 *config = tmp;
2045 void pmc_free_config(pmc_t pmc, pmc_config_t config) {
2047 assert(config);
2051 pmc_config_free(pmc, config);
2062 kern_return_t pmc_config_set_value(pmc_t pmc, pmc_config_t config,
2067 if(!pmc || !config) {
2073 ret = pmc->methods.config_set_value(config->object, id, value);
2081 * pmc_config_set_interrupt_threshold modifies a config object, instructing
2093 kern_return_t pmc_config_set_interrupt_threshold(pmc_t pmc, pmc_config_t config,
2097 if(!config || !pmc) {
2101 assert(config);
2109 * the config to never change once a reservation has been taken out with
2113 * pmc_reservation_t before setting it up in the config object.
2120 config->interrupt_after_value = threshold;
2121 config->method = method;
2122 config->refCon = refCon;
2314 static boolean_t pmc_reservation_setup_pmi(pmc_reservation_t resv, pmc_config_t config) {
2317 assert(config);
2318 assert(config->object);
2321 if(config->interrupt_after_value && config->method) {
2324 kern_return_t ret = resv->pmc->methods.config_set_threshold(config->object,
2325 config->interrupt_after_value);
2336 if(KERN_SUCCESS != resv->pmc->methods.config_set_handler(config->object,
2337 (void *)resv, &pmc_reservation_interrupt, config->refCon)) {
2354 * must free the config object via pmc_free_config().
2358 kern_return_t pmc_reserve(pmc_t pmc, pmc_config_t config,
2361 if(!pmc || !config || !reservation) {
2373 resv->config = config;
2376 resv->config = NULL;
2381 if(!pmc_internal_reservation_add(resv) || !pmc_reservation_setup_pmi(resv, config)) {
2382 /* Prevent free of config object */
2383 resv->config = NULL;
2405 * must free the config object via pmc_free_config().
2410 kern_return_t pmc_reserve_task(pmc_t pmc, pmc_config_t config,
2413 if(!pmc || !config || !reservation || !task) {
2432 resv->config = config;
2435 resv->config = NULL;
2440 if(!pmc_internal_reservation_add(resv) || !pmc_reservation_setup_pmi(resv, config)) {
2441 /* Prevent free of config object */
2442 resv->config = NULL;
2464 * must free the config object via pmc_free_config().
2469 kern_return_t pmc_reserve_thread(pmc_t pmc, pmc_config_t config,
2471 if(!pmc || !config || !reservation || !thread) {
2490 resv->config = config;
2493 resv->config = NULL;
2498 if(!pmc_internal_reservation_add(resv) || !pmc_reservation_setup_pmi(resv, config)) {
2499 /* Prevent free of config object */
2500 resv->config = NULL;
2873 pmc_config_t *config __unused) {
2877 void pmc_free_config(pmc_t pmc __unused, pmc_config_t config __unused) {
2881 pmc_config_t config __unused, uint8_t id __unused,
2887 pmc_config_t config __unused, uint64_t threshold __unused,
2914 pmc_config_t config __unused, pmc_reservation_t *reservation __unused) {
2919 pmc_config_t config __unused, task_t task __unused,
2925 pmc_config_t config __unused, thread_t thread __unused,