diff options
author | jhb <jhb@FreeBSD.org> | 2015-05-08 15:57:23 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2015-05-08 15:57:23 +0000 |
commit | 7df2fac8671c925c4f9d667ca49d164ca67dce6f (patch) | |
tree | a6b29a45028b4be962c62644916065605a2d94d6 /sys/dev/hwpmc | |
parent | d9a8b7337bd9eac9574477b682f8bba0af827223 (diff) | |
download | FreeBSD-src-7df2fac8671c925c4f9d667ca49d164ca67dce6f.zip FreeBSD-src-7df2fac8671c925c4f9d667ca49d164ca67dce6f.tar.gz |
Move hwpmc(4) debugging code under a new HWPMC_DEBUG option instead of
the broader DEBUG option.
Reviewed by: emaste
MFC after: 2 weeks
Sponsored by: Norse Corp, Inc.
Diffstat (limited to 'sys/dev/hwpmc')
-rw-r--r-- | sys/dev/hwpmc/hwpmc_amd.c | 14 | ||||
-rw-r--r-- | sys/dev/hwpmc/hwpmc_logging.c | 2 | ||||
-rw-r--r-- | sys/dev/hwpmc/hwpmc_mod.c | 26 |
3 files changed, 21 insertions, 21 deletions
diff --git a/sys/dev/hwpmc/hwpmc_amd.c b/sys/dev/hwpmc/hwpmc_amd.c index 1a8398c..7bab68e 100644 --- a/sys/dev/hwpmc/hwpmc_amd.c +++ b/sys/dev/hwpmc/hwpmc_amd.c @@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$"); #include <machine/md_var.h> #include <machine/specialreg.h> -#ifdef DEBUG +#ifdef HWPMC_DEBUG enum pmc_class amd_pmc_class; #endif @@ -284,7 +284,7 @@ amd_read_pmc(int cpu, int ri, pmc_value_t *v) PMCDBG(MDP,REA,1,"amd-read id=%d class=%d", ri, pd->pm_descr.pd_class); -#ifdef DEBUG +#ifdef HWPMC_DEBUG KASSERT(pd->pm_descr.pd_class == amd_pmc_class, ("[amd,%d] unknown PMC class (%d)", __LINE__, pd->pm_descr.pd_class)); @@ -329,7 +329,7 @@ amd_write_pmc(int cpu, int ri, pmc_value_t v) mode = PMC_TO_MODE(pm); -#ifdef DEBUG +#ifdef HWPMC_DEBUG KASSERT(pd->pm_descr.pd_class == amd_pmc_class, ("[amd,%d] unknown PMC class (%d)", __LINE__, pd->pm_descr.pd_class)); @@ -515,7 +515,7 @@ amd_allocate_pmc(int cpu, int ri, struct pmc *pm, static int amd_release_pmc(int cpu, int ri, struct pmc *pmc) { -#ifdef DEBUG +#ifdef HWPMC_DEBUG const struct amd_descr *pd; #endif struct pmc_hw *phw; @@ -532,7 +532,7 @@ amd_release_pmc(int cpu, int ri, struct pmc *pmc) KASSERT(phw->phw_pmc == NULL, ("[amd,%d] PHW pmc %p non-NULL", __LINE__, phw->phw_pmc)); -#ifdef DEBUG +#ifdef HWPMC_DEBUG pd = &amd_pmcdesc[ri]; if (pd->pm_descr.pd_class == amd_pmc_class) KASSERT(AMD_PMC_IS_STOPPED(pd->pm_evsel), @@ -835,7 +835,7 @@ amd_pcpu_fini(struct pmc_mdep *md, int cpu) amd_pcpu[cpu] = NULL; -#ifdef DEBUG +#ifdef HWPMC_DEBUG for (i = 0; i < AMD_NPMCS; i++) { KASSERT(pac->pc_amdpmcs[i].phw_pmc == NULL, ("[amd,%d] CPU%d/PMC%d in use", __LINE__, cpu, i)); @@ -912,7 +912,7 @@ pmc_amd_initialize(void) return NULL; } -#ifdef DEBUG +#ifdef HWPMC_DEBUG amd_pmc_class = class; #endif diff --git a/sys/dev/hwpmc/hwpmc_logging.c b/sys/dev/hwpmc/hwpmc_logging.c index 4d14011..c694acc 100644 --- a/sys/dev/hwpmc/hwpmc_logging.c +++ b/sys/dev/hwpmc/hwpmc_logging.c @@ -213,7 +213,7 @@ pmclog_get_buffer(struct pmc_owner *po) PMCDBG(LOG,GTB,1, "po=%p plb=%p", po, plb); -#ifdef DEBUG +#ifdef HWPMC_DEBUG if (plb) KASSERT(plb->plb_ptr == plb->plb_base && plb->plb_base < plb->plb_fence, diff --git a/sys/dev/hwpmc/hwpmc_mod.c b/sys/dev/hwpmc/hwpmc_mod.c index cb8ed37..1a19c4b 100644 --- a/sys/dev/hwpmc/hwpmc_mod.c +++ b/sys/dev/hwpmc/hwpmc_mod.c @@ -173,7 +173,7 @@ static struct pmc_classdep **pmc_rowindex_to_classdep; * Prototypes */ -#ifdef DEBUG +#ifdef HWPMC_DEBUG static int pmc_debugflags_sysctl_handler(SYSCTL_HANDLER_ARGS); static int pmc_debugflags_parse(char *newstr, char *fence); #endif @@ -238,7 +238,7 @@ static int pmc_callchaindepth = PMC_CALLCHAIN_DEPTH; SYSCTL_INT(_kern_hwpmc, OID_AUTO, callchaindepth, CTLFLAG_RDTUN, &pmc_callchaindepth, 0, "depth of call chain records"); -#ifdef DEBUG +#ifdef HWPMC_DEBUG struct pmc_debugflags pmc_debugflags = PMC_DEBUG_DEFAULT_FLAGS; char pmc_debugstr[PMC_DEBUG_STRSIZE]; TUNABLE_STR(PMC_SYSCTL_NAME_PREFIX "debugflags", pmc_debugstr, @@ -337,7 +337,7 @@ static moduledata_t pmc_mod = { DECLARE_MODULE(pmc, pmc_mod, SI_SUB_SMP, SI_ORDER_ANY); MODULE_VERSION(pmc, PMC_VERSION); -#ifdef DEBUG +#ifdef HWPMC_DEBUG enum pmc_dbgparse_state { PMCDS_WS, /* in whitespace */ PMCDS_MAJOR, /* seen a major keyword */ @@ -816,7 +816,7 @@ pmc_link_target_process(struct pmc *pm, struct pmc_process *pp) PMCDBG(PRC,TLK,1, "link-target pmc=%p ri=%d pmc-process=%p", pm, ri, pp); -#ifdef DEBUG +#ifdef HWPMC_DEBUG LIST_FOREACH(pt, &pm->pm_targets, pt_next) if (pt->pt_process == pp) KASSERT(0, ("[pmc,%d] pp %p already in pmc %p targets", @@ -1784,7 +1784,7 @@ pmc_log_all_process_mappings(struct pmc_owner *po) */ -#ifdef DEBUG +#ifdef HWPMC_DEBUG const char *pmc_hooknames[] = { /* these strings correspond to PMC_FN_* in <sys/pmckern.h> */ "", @@ -2002,7 +2002,7 @@ pmc_hook_handler(struct thread *td, int function, void *arg) break; default: -#ifdef DEBUG +#ifdef HWPMC_DEBUG KASSERT(0, ("[pmc,%d] unknown hook %d\n", __LINE__, function)); #endif break; @@ -2185,7 +2185,7 @@ pmc_destroy_pmc_descriptor(struct pmc *pm) static void pmc_wait_for_pmc_idle(struct pmc *pm) { -#ifdef DEBUG +#ifdef HWPMC_DEBUG volatile int maxloop; maxloop = 100 * pmc_cpu_max(); @@ -2195,7 +2195,7 @@ pmc_wait_for_pmc_idle(struct pmc *pm) * comes down to zero. */ while (atomic_load_acq_32(&pm->pm_runcount) > 0) { -#ifdef DEBUG +#ifdef HWPMC_DEBUG maxloop--; KASSERT(maxloop > 0, ("[pmc,%d] (ri%d, rc%d) waiting too long for " @@ -2759,7 +2759,7 @@ pmc_stop(struct pmc *pm) } -#ifdef DEBUG +#ifdef HWPMC_DEBUG static const char *pmc_op_to_name[] = { #undef __PMC_OP #define __PMC_OP(N, D) #N , @@ -3798,7 +3798,7 @@ pmc_syscall_handler(struct thread *td, void *syscall_args) pprw = (struct pmc_op_pmcrw *) arg; -#ifdef DEBUG +#ifdef HWPMC_DEBUG if (prw.pm_flags & PMC_F_NEWVALUE) PMCDBG(PMC,OPS,2, "rw id=%d new %jx -> old %jx", ri, prw.pm_value, oldvalue); @@ -4712,7 +4712,7 @@ pmc_initialize(void) md = NULL; error = 0; -#ifdef DEBUG +#ifdef HWPMC_DEBUG /* parse debug flags first */ if (TUNABLE_STR_FETCH(PMC_SYSCTL_NAME_PREFIX "debugflags", pmc_debugstr, sizeof(pmc_debugstr))) @@ -4933,7 +4933,7 @@ pmc_cleanup(void) struct pmc_ownerhash *ph; struct pmc_owner *po, *tmp; struct pmc_binding pb; -#ifdef DEBUG +#ifdef HWPMC_DEBUG struct pmc_processhash *prh; #endif @@ -4985,7 +4985,7 @@ pmc_cleanup(void) mtx_destroy(&pmc_processhash_mtx); if (pmc_processhash) { -#ifdef DEBUG +#ifdef HWPMC_DEBUG struct pmc_process *pp; PMCDBG(MOD,INI,3, "%s", "destroy process hash"); |