FreeBSD/sys/dev/hwpmc/hwpmc_mod.c
/*
 * Log mapping information about the kernel.
 */
Log mapping information about the kernel.
Log mapping information about the kernel .
static void
pmc_log_kernel_mappings(struct pmc *pm)
{
	struct pmc_owner *po;
	struct pmckern_map_in *km, *kmbase;
	sx_assert(&pmc_sx, SX_LOCKED);
	KASSERT(PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm)),
	    ("[pmc,%d] non-sampling PMC (%p) desires mapping information",
		__LINE__, (void *) pm));
	po = pm->pm_owner;
	if (po->po_flags & PMC_PO_INITIAL_MAPPINGS_DONE)
		return;
	kmbase = linker_hwpmc_list_objects();
	for (km = kmbase; km->pm_file != NULL; km++) {
		PMCDBG2(LOG,REG,1,"%s %p", (char *) km->pm_file,
		    (void *) km->pm_address);
		pmclog_process_map_in(po, (pid_t) -1, km->pm_address,
		    km->pm_file);
	}
	free(kmbase, M_LINKER);
	po->po_flags |= PMC_PO_INITIAL_MAPPINGS_DONE;
}
static void pmc_log_kernel_mappings ( struct pmc * pm ) { struct pmc_owner * po ; struct pmckern_map_in * km , * kmbase ; sx_assert ( & pmc_sx , SX_LOCKED ) ; KASSERT ( PMC_IS_SAMPLING_MODE ( PMC_TO_MODE ( pm ) ) , ( " " , __LINE__ , ( void * ) pm ) ) ; po = pm -> pm_owner ; if ( po -> po_flags & PMC_PO_INITIAL_MAPPINGS_DONE ) return ; kmbase = linker_hwpmc_list_objects ( ) ; for ( km = kmbase ; km -> pm_file != NULL ; km ++ ) { PMCDBG2 ( LOG , REG , 1 , " " , ( char * ) km -> pm_file , ( void * ) km -> pm_address ) ; pmclog_process_map_in ( po , ( pid_t ) - 1 , km -> pm_address , km -> pm_file ) ; } free ( kmbase , M_LINKER ) ; po -> po_flags |= PMC_PO_INITIAL_MAPPINGS_DONE ; }
Log mapping information about the kernel.
Log mapping information about the kernel .
/*
	 * Log the current set of kernel modules.
	 */