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;
1510 assert(reservation->config);
1566 assert(reservation->config);
1573 ret = load_pmc->methods.set_config(load_pmc_obj, reservation->config->object);
1714 assert(reservation->config);
1715 assert(reservation->config->method);
1722 (void)reservation->config->method(reservation, refCon);
1728 reservation->config->method, (end - start));
2008 kern_return_t pmc_create_config(pmc_t pmc, pmc_config_t *config) {
2011 if(!pmc || !config) {
2037 *config = tmp;
2047 void pmc_free_config(pmc_t pmc, pmc_config_t config) {
2049 assert(config);
2053 pmc_config_free(pmc, config);
2064 kern_return_t pmc_config_set_value(pmc_t pmc, pmc_config_t config,
2069 if(!pmc || !config) {
2075 ret = pmc->methods.config_set_value(config->object, id, value);
2083 * pmc_config_set_interrupt_threshold modifies a config object, instructing
2095 kern_return_t pmc_config_set_interrupt_threshold(pmc_t pmc, pmc_config_t config,
2099 if(!config || !pmc) {
2103 assert(config);
2111 * the config to never change once a reservation has been taken out with
2115 * pmc_reservation_t before setting it up in the config object.
2122 config->interrupt_after_value = threshold;
2123 config->method = method;
2124 config->refCon = refCon;
2316 static boolean_t pmc_reservation_setup_pmi(pmc_reservation_t resv, pmc_config_t config) {
2319 assert(config);
2320 assert(config->object);
2323 if(config->interrupt_after_value && config->method) {
2326 kern_return_t ret = resv->pmc->methods.config_set_threshold(config->object,
2327 config->interrupt_after_value);
2338 if(KERN_SUCCESS != resv->pmc->methods.config_set_handler(config->object,
2339 (void *)resv, &pmc_reservation_interrupt, config->refCon)) {
2356 * must free the config object via pmc_free_config().
2360 kern_return_t pmc_reserve(pmc_t pmc, pmc_config_t config,
2363 if(!pmc || !config || !reservation) {
2375 resv->config = config;
2378 resv->config = NULL;
2383 if(!pmc_internal_reservation_add(resv) || !pmc_reservation_setup_pmi(resv, config)) {
2384 /* Prevent free of config object */
2385 resv->config = NULL;
2407 * must free the config object via pmc_free_config().
2412 kern_return_t pmc_reserve_task(pmc_t pmc, pmc_config_t config,
2415 if(!pmc || !config || !reservation || !task) {
2434 resv->config = config;
2437 resv->config = NULL;
2442 if(!pmc_internal_reservation_add(resv) || !pmc_reservation_setup_pmi(resv, config)) {
2443 /* Prevent free of config object */
2444 resv->config = NULL;
2466 * must free the config object via pmc_free_config().
2471 kern_return_t pmc_reserve_thread(pmc_t pmc, pmc_config_t config,
2473 if(!pmc || !config || !reservation || !thread) {
2492 resv->config = config;
2495 resv->config = NULL;
2500 if(!pmc_internal_reservation_add(resv) || !pmc_reservation_setup_pmi(resv, config)) {
2501 /* Prevent free of config object */
2502 resv->config = NULL;
2875 pmc_config_t *config __unused) {
2879 void pmc_free_config(pmc_t pmc __unused, pmc_config_t config __unused) {
2883 pmc_config_t config __unused, uint8_t id __unused,
2889 pmc_config_t config __unused, uint64_t threshold __unused,
2916 pmc_config_t config __unused, pmc_reservation_t *reservation __unused) {
2921 pmc_config_t config __unused, task_t task __unused,
2927 pmc_config_t config __unused, thread_t thread __unused,