- lck_grp_attr_setdefault(&lck_grp_attr);
- lck_grp_init(&kperf_lck_grp, "kperf", &lck_grp_attr);
-
- ncpus = machine_info.logical_cpu_max;
-
- /* create buffers to remember which threads don't need to be sampled by PET */
- kperf_tid_on_cpus = kalloc_tag(ncpus * sizeof(*kperf_tid_on_cpus),
- VM_KERN_MEMORY_DIAG);
- if (kperf_tid_on_cpus == NULL) {
- err = ENOMEM;
- goto error;
- }
- bzero(kperf_tid_on_cpus, ncpus * sizeof(*kperf_tid_on_cpus));
-
- /* create the interrupt buffers */
- intr_samplec = ncpus;
- intr_samplev = kalloc_tag(ncpus * sizeof(*intr_samplev),
- VM_KERN_MEMORY_DIAG);
- if (intr_samplev == NULL) {
- err = ENOMEM;
- goto error;
- }
- bzero(intr_samplev, ncpus * sizeof(*intr_samplev));