| /xnu-11215/osfmk/x86_64/ |
| H A D | kpc_x86.c | 83 IA32_PMCx(uint32_t ctr) in IA32_PMCx() argument 86 return rdpmc64(ctr); in IA32_PMCx() 203 kpc_reload_fixed(int ctr) in kpc_reload_fixed() argument 206 wrIA32_FIXED_CTRx(ctr, FIXED_RELOAD(ctr)); in kpc_reload_fixed() 219 wrIA32_PMCx(ctr, CONFIGURABLE_RELOAD(ctr)); in kpc_reload_configurable() 656 uint32_t ctr; in kpc_pmi_handler() local 664 for (ctr = 0; ctr < kpc_fixed_count(); ctr++) { in kpc_pmi_handler() 668 FIXED_SHADOW(ctr) in kpc_pmi_handler() 672 BUF_INFO(PERF_KPC_FCOUNTER, ctr, FIXED_SHADOW(ctr), extra, actionid); in kpc_pmi_handler() 675 kpc_sample_kperf_x86(ctr, actionid, FIXED_SHADOW(ctr) + extra, 0); in kpc_pmi_handler() [all …]
|
| H A D | monotonic_x86_64.c | 82 mt_core_snap(unsigned int ctr) in mt_core_snap() argument 84 if (!mt_core_supported || ctr >= kpc_fixed_count()) { in mt_core_snap() 88 switch (ctr) { in mt_core_snap() 98 panic("monotonic: invalid core counter read: %u", ctr); in mt_core_snap() 104 mt_core_set_snap(unsigned int ctr, uint64_t count) in mt_core_set_snap() argument 106 if (!mt_core_supported || ctr >= kpc_fixed_count()) { in mt_core_set_snap() 110 switch (ctr) { in mt_core_set_snap() 124 panic("monotonic: invalid core counter write: %u", ctr); in mt_core_set_snap()
|
| /xnu-11215/osfmk/arm64/ |
| H A D | monotonic_arm64.c | 217 switch (ctr) { in mt_core_snap() 230 switch (ctr) { in mt_core_set_snap() 647 , ctr, in uncmon_update_locked() 661 mon->um_counts[ctr] += snap - mon->um_snaps[ctr]; in uncmon_update_locked() 865 for (unsigned int ctr = 0; ctr < UNCORE_NCTRS; ctr++) { in uncmon_read_all_counters() local 870 counts[ctr] = mon->um_counts[ctr]; in uncmon_read_all_counters() 956 for (unsigned int ctr = 0; ctr < UNCORE_NCTRS; ctr++) { in uncore_add() local 1028 for (int ctr = 0; ctr < UNCORE_NCTRS; ctr++) { in uncore_reset() local 1175 for (unsigned int ctr = 0; ctr < UNCORE_NCTRS; ctr++) { in uncore_fiq() local 1217 for (unsigned int ctr = 0; ctr < UNCORE_NCTRS; ctr++) { in uncore_save() local [all …]
|
| H A D | kpc.c | 693 uint64_t ctr = 0ULL; in kpc_get_configurable_counters() local 701 ctr = read_counter(i + offset); in kpc_get_configurable_counters() 704 ctr = CONFIGURABLE_SHADOW(i) + in kpc_get_configurable_counters() 708 ctr = CONFIGURABLE_SHADOW(i) + in kpc_get_configurable_counters() 712 *counterv++ = ctr; in kpc_get_configurable_counters() 752 kpc_reload_counter(uint32_t ctr) in kpc_reload_counter() argument 759 write_counter(ctr, FIXED_RELOAD(ctr)); in kpc_reload_counter() 829 if (FIXED_ACTIONID(ctr) && PMC_SUPPORTS_PC_CAPTURE(ctr)) { in kpc_pmi_handler() 840 FIXED_SHADOW(ctr) += (kpc_fixed_max() - FIXED_RELOAD(ctr) + 1 /* Wrap */) + extra; in kpc_pmi_handler() 842 if (FIXED_ACTIONID(ctr)) { in kpc_pmi_handler() [all …]
|
| /xnu-11215/osfmk/kern/ |
| H A D | kpc.h | 61 #define FIXED_ACTIONID(ctr) (kpc_actionid[(ctr)]) argument 62 #define CONFIGURABLE_ACTIONID(ctr) (kpc_actionid[(ctr) + kpc_fixed_count()]) argument 65 #define FIXED_RELOAD(ctr) (current_cpu_datap()->cpu_kpc_reload[(ctr)]) argument 66 #define FIXED_RELOAD_CPU(cpu, ctr) (cpu_datap(cpu)->cpu_kpc_reload[(ctr)]) argument 67 #define CONFIGURABLE_RELOAD(ctr) (current_cpu_datap()->cpu_kpc_reload[(ctr) + kpc_fi… argument 68 #define CONFIGURABLE_RELOAD_CPU(cpu, ctr) (cpu_datap(cpu)->cpu_kpc_reload[(ctr) + kpc_fixed_c… argument 71 #define FIXED_SHADOW(ctr) (current_cpu_datap()->cpu_kpc_shadow[(ctr)]) argument 72 #define FIXED_SHADOW_CPU(cpu, ctr) (cpu_datap(cpu)->cpu_kpc_shadow[(ctr)]) argument 73 #define CONFIGURABLE_SHADOW(ctr) (current_cpu_datap()->cpu_kpc_shadow[(ctr) + kpc_fi… argument 74 #define CONFIGURABLE_SHADOW_CPU(cpu, ctr) (cpu_datap(cpu)->cpu_kpc_shadow[(ctr) + kpc_fixed_c… argument [all …]
|
| H A D | kern_monotonic.c | 49 mt_mtc_update_count(struct mt_cpu *mtc, unsigned int ctr) in mt_mtc_update_count() argument 51 uint64_t snap = mt_core_snap(ctr); in mt_mtc_update_count() 52 if (snap < mtc->mtc_snaps[ctr]) { in mt_mtc_update_count() 57 mtc->mtc_snaps[ctr]); in mt_mtc_update_count() 61 mtc->mtc_snaps[ctr] = snap; in mt_mtc_update_count() 65 uint64_t count = snap - mtc->mtc_snaps[ctr]; in mt_mtc_update_count() 66 mtc->mtc_snaps[ctr] = snap; in mt_mtc_update_count() 72 mt_cpu_update_count(cpu_data_t *cpu, unsigned int ctr) in mt_cpu_update_count() argument 74 return mt_mtc_update_count(&cpu->cpu_monotonic, ctr); in mt_cpu_update_count() 282 assert(ctr < MT_CORE_NFIXED); in mt_microstackshot_start() [all …]
|
| H A D | monotonic.h | 111 uint64_t mt_cpu_update_count(cpu_data_t *cpu, unsigned int ctr); 122 int mt_microstackshot_start(unsigned int ctr, uint64_t period, mt_pmi_fn fn,
|
| H A D | kpc_common.c | 246 kpc_controls_counter(uint32_t ctr) in kpc_controls_counter() argument 250 assert(ctr < (kpc_fixed_count() + kpc_configurable_count())); in kpc_controls_counter() 252 if (ctr < kpc_fixed_count()) { in kpc_controls_counter() 262 pmc_mask = (1ULL << (ctr - kpc_fixed_count())); in kpc_controls_counter()
|
| H A D | telemetry.c | 339 unsigned int ctr = 0; in telemetry_pmi_setup() local 364 ctr = MT_CORE_INSTRS; in telemetry_pmi_setup() 370 ctr = MT_CORE_CYCLES; in telemetry_pmi_setup() 382 error = mt_microstackshot_start(ctr, period, telemetry_pmi_handler, NULL); in telemetry_pmi_setup()
|
| /xnu-11215/osfmk/machine/ |
| H A D | monotonic.h | 61 uint64_t mt_mtc_update_count(struct mt_cpu *mtc, unsigned int ctr); 62 uint64_t mt_core_snap(unsigned int ctr); 63 void mt_core_set_snap(unsigned int ctr, uint64_t snap); 64 void mt_mtc_set_snap(struct mt_cpu *mtc, unsigned int ctr, uint64_t snap);
|
| /xnu-11215/tests/ |
| H A D | monotonic_uncore.c | 142 uint32_t ctr; in uncore_add() local 161 ctr = add_ctl.out.ctr; in uncore_add() 162 T_QUIET; T_ASSERT_LT(ctr, (uint32_t)CTRS_MAX, "counter returned should be sane"); in uncore_add() 163 return ctr; in uncore_add() 171 uint32_t ctr; variable 175 ctr = uncore_add(fd, REF_TIMEBASE_EVENT, UINT64_MAX, 0); 176 T_LOG("added event to uncore counter %d\n", ctr); 178 (void)uncore_add(fd, REF_TIMEBASE_EVENT, UINT64_C(1) << ctr, ENOSPC);
|
| /xnu-11215/tests/cpu_counters/ |
| H A D | kpc_tests.c | 245 unsigned int ctr = i * nctrs + j; in check_counters() local 246 struct tally *tly = &tallies[ctr]; in check_counters() 247 uint64_t count = counts[ctr]; in check_counters() 249 if (counts[ctr] == 0) { in check_counters() 277 unsigned int ctr = i * nctrs + j; in check_tally() local 278 struct tally *tly = &tallies[ctr]; in check_tally() 630 unsigned int ctr = i * (mch.nfixed + mch.nconfig) + mch.nfixed; 631 uint64_t delta = tly[ctr].lastvalue - tly[ctr].firstvalue;
|
| /xnu-11215/EXTERNAL_HEADERS/corecrypto/ |
| H A D | ccmode_impl.h | 111 …int (*CC_SPTR(ccmode_ctr, setctr))(const struct ccmode_ctr *mode, ccctr_ctx *ctx, const void *ctr); 112 int (*CC_SPTR(ccmode_ctr, ctr))(ccctr_ctx *ctx, size_t nbytes, const void *in, void *out); 257 const struct ccmode_ctr *ctr; member 283 const struct ccmode_ctr *ctr; member
|
| H A D | ccrng_fortuna.h | 121 uint8_t ctr[16]; member
|
| H A D | ccmode_factory.h | 69 void ccmode_factory_ctr_crypt(struct ccmode_ctr *ctr,
|
| /xnu-11215/bsd/dev/ |
| H A D | monotonic.c | 188 uint32_t ctr; in mt_ctl_add() local 198 error = dev->mtd_add(&ctl.in.config, &ctr); in mt_ctl_add() 203 ctl.out.ctr = ctr; in mt_ctl_add()
|
| /xnu-11215/osfmk/corecrypto/ |
| H A D | ccmode_internal.h | 245 int ccmode_ctr_init(const struct ccmode_ctr *ctr, ccctr_ctx *ctx, 247 int ccmode_ctr_setctr(const struct ccmode_ctr *mode, ccctr_ctx *ctx, const void *ctr); 258 .ctr = ccmode_ctr_crypt, \ 284 ccctr_setctr(const struct ccmode_ctr *mode, ccctr_ctx *ctx, const void *ctr) in ccctr_setctr() argument 286 return mode->setctr(mode, ctx, ctr); in ccctr_setctr()
|
| /xnu-11215/bsd/sys/ |
| H A D | monotonic.h | 71 uint32_t ctr; member
|
| /xnu-11215/bsd/security/audit/ |
| H A D | audit_bsm.c | 616 int ctr; in kaudit_to_bsm() local 1816 for (ctr = 0; ctr < (int)ar->ar_arg_len; ctr++) { in kaudit_to_bsm() 1818 ar->ar_arg_ctlname[ctr]); in kaudit_to_bsm()
|
| H A D | audit_bsm_token.c | 1180 int ctr; in au_to_exec_strings() local 1187 ctr = count; in au_to_exec_strings() 1189 while (ctr-- > 0) { in au_to_exec_strings()
|