summaryrefslogtreecommitdiffstats
path: root/sys/dev/hwpmc
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2005-12-05 11:58:35 +0000
committerru <ru@FreeBSD.org>2005-12-05 11:58:35 +0000
commit9b19d72862ec030327b619472a0fdd12ace7a4c0 (patch)
tree10fbb6249e1553ff873a2885f2937b146e545698 /sys/dev/hwpmc
parent6bc69ac5efced12523ecf09740467f0e992166c5 (diff)
downloadFreeBSD-src-9b19d72862ec030327b619472a0fdd12ace7a4c0.zip
FreeBSD-src-9b19d72862ec030327b619472a0fdd12ace7a4c0.tar.gz
Fix -Wundef warnings found when compiling i386 LINT, GENERIC and
custom kernels.
Diffstat (limited to 'sys/dev/hwpmc')
-rw-r--r--sys/dev/hwpmc/hwpmc_amd.c20
-rw-r--r--sys/dev/hwpmc/hwpmc_logging.c2
-rw-r--r--sys/dev/hwpmc/hwpmc_mod.c28
-rw-r--r--sys/dev/hwpmc/hwpmc_piv.c4
4 files changed, 27 insertions, 27 deletions
diff --git a/sys/dev/hwpmc/hwpmc_amd.c b/sys/dev/hwpmc/hwpmc_amd.c
index 3d92829..b7cdee8 100644
--- a/sys/dev/hwpmc/hwpmc_amd.c
+++ b/sys/dev/hwpmc/hwpmc_amd.c
@@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$");
#include <machine/pmc_mdep.h>
#include <machine/specialreg.h>
-#if DEBUG
+#ifdef DEBUG
enum pmc_class amd_pmc_class;
#endif
@@ -291,7 +291,7 @@ amd_read_pmc(int cpu, int ri, pmc_value_t *v)
return 0;
}
-#if DEBUG
+#ifdef DEBUG
KASSERT(pd->pm_descr.pd_class == amd_pmc_class,
("[amd,%d] unknown PMC class (%d)", __LINE__,
pd->pm_descr.pd_class));
@@ -338,7 +338,7 @@ amd_write_pmc(int cpu, int ri, pmc_value_t v)
if (pd->pm_descr.pd_class == PMC_CLASS_TSC)
return 0;
-#if DEBUG
+#ifdef DEBUG
KASSERT(pd->pm_descr.pd_class == amd_pmc_class,
("[amd,%d] unknown PMC class (%d)", __LINE__,
pd->pm_descr.pd_class));
@@ -474,7 +474,7 @@ amd_allocate_pmc(int cpu, int ri, struct pmc *pm,
return 0;
}
-#if DEBUG
+#ifdef DEBUG
KASSERT(pd->pd_class == amd_pmc_class,
("[amd,%d] Unknown PMC class (%d)", __LINE__, pd->pd_class));
#endif
@@ -536,7 +536,7 @@ amd_allocate_pmc(int cpu, int ri, struct pmc *pm,
static int
amd_release_pmc(int cpu, int ri, struct pmc *pmc)
{
-#if DEBUG
+#ifdef DEBUG
const struct amd_descr *pd;
#endif
struct pmc_hw *phw;
@@ -553,7 +553,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));
-#if DEBUG
+#ifdef DEBUG
pd = &amd_pmcdesc[ri];
if (pd->pm_descr.pd_class == amd_pmc_class)
KASSERT(AMD_PMC_IS_STOPPED(pd->pm_evsel),
@@ -593,7 +593,7 @@ amd_start_pmc(int cpu, int ri)
if (pd->pm_descr.pd_class == PMC_CLASS_TSC)
return 0; /* TSCs are always running */
-#if DEBUG
+#ifdef DEBUG
KASSERT(pd->pm_descr.pd_class == amd_pmc_class,
("[amd,%d] unknown PMC class (%d)", __LINE__,
pd->pm_descr.pd_class));
@@ -641,7 +641,7 @@ amd_stop_pmc(int cpu, int ri)
if (pd->pm_descr.pd_class == PMC_CLASS_TSC)
return 0;
-#if DEBUG
+#ifdef DEBUG
KASSERT(pd->pm_descr.pd_class == amd_pmc_class,
("[amd,%d] unknown PMC class (%d)", __LINE__,
pd->pm_descr.pd_class));
@@ -890,7 +890,7 @@ amd_cleanup(int cpu)
if ((pcs = pmc_pcpu[cpu]) == NULL)
return 0;
-#if DEBUG
+#ifdef DEBUG
/* check the TSC */
KASSERT(pcs->pc_hwpmcs[0]->phw_pmc == NULL,
("[amd,%d] CPU%d,PMC0 still in use", __LINE__, cpu));
@@ -948,7 +948,7 @@ pmc_amd_initialize(void)
return NULL;
}
-#if DEBUG
+#ifdef DEBUG
amd_pmc_class = class;
#endif
diff --git a/sys/dev/hwpmc/hwpmc_logging.c b/sys/dev/hwpmc/hwpmc_logging.c
index 8b6f376..ff6298e 100644
--- a/sys/dev/hwpmc/hwpmc_logging.c
+++ b/sys/dev/hwpmc/hwpmc_logging.c
@@ -203,7 +203,7 @@ pmclog_get_buffer(struct pmc_owner *po)
PMCDBG(LOG,GTB,1, "po=%p plb=%p", po, plb);
-#if DEBUG
+#ifdef 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 ecd83d2..85b5fa0 100644
--- a/sys/dev/hwpmc/hwpmc_mod.c
+++ b/sys/dev/hwpmc/hwpmc_mod.c
@@ -150,7 +150,7 @@ static LIST_HEAD(, pmc_owner) pmc_ss_owners;
* Prototypes
*/
-#if DEBUG
+#ifdef DEBUG
static int pmc_debugflags_sysctl_handler(SYSCTL_HANDLER_ARGS);
static int pmc_debugflags_parse(char *newstr, char *fence);
#endif
@@ -202,7 +202,7 @@ static void pmc_unlink_target_process(struct pmc *pmc,
SYSCTL_NODE(_kern, OID_AUTO, hwpmc, CTLFLAG_RW, 0, "HWPMC parameters");
-#if DEBUG
+#ifdef 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,
@@ -301,7 +301,7 @@ static moduledata_t pmc_mod = {
DECLARE_MODULE(pmc, pmc_mod, SI_SUB_SMP, SI_ORDER_ANY);
MODULE_VERSION(pmc, PMC_VERSION);
-#if DEBUG
+#ifdef DEBUG
enum pmc_dbgparse_state {
PMCDS_WS, /* in whitespace */
PMCDS_MAJOR, /* seen a major keyword */
@@ -757,7 +757,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);
-#if DEBUG
+#ifdef 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",
@@ -1415,7 +1415,7 @@ pmc_process_csw_out(struct thread *td)
*/
-#if DEBUG
+#ifdef DEBUG
const char *pmc_hooknames[] = {
"",
"EXIT",
@@ -1584,7 +1584,7 @@ pmc_hook_handler(struct thread *td, int function, void *arg)
break;
default:
-#if DEBUG
+#ifdef DEBUG
KASSERT(0, ("[pmc,%d] unknown hook %d\n", __LINE__, function));
#endif
break;
@@ -1766,7 +1766,7 @@ pmc_destroy_pmc_descriptor(struct pmc *pm)
{
(void) pm;
-#if DEBUG
+#ifdef DEBUG
KASSERT(pm->pm_state == PMC_STATE_DELETED ||
pm->pm_state == PMC_STATE_FREE,
("[pmc,%d] destroying non-deleted PMC", __LINE__));
@@ -1783,7 +1783,7 @@ pmc_destroy_pmc_descriptor(struct pmc *pm)
static void
pmc_wait_for_pmc_idle(struct pmc *pm)
{
-#if DEBUG
+#ifdef DEBUG
volatile int maxloop;
maxloop = 100 * mp_ncpus;
@@ -1794,7 +1794,7 @@ pmc_wait_for_pmc_idle(struct pmc *pm)
* comes down to zero.
*/
while (atomic_load_acq_32(&pm->pm_runcount) > 0) {
-#if DEBUG
+#ifdef DEBUG
maxloop--;
KASSERT(maxloop > 0,
("[pmc,%d] (ri%d, rc%d) waiting too long for "
@@ -2344,7 +2344,7 @@ pmc_stop(struct pmc *pm)
}
-#if DEBUG
+#ifdef DEBUG
static const char *pmc_op_to_name[] = {
#undef __PMC_OP
#define __PMC_OP(N, D) #N ,
@@ -3282,7 +3282,7 @@ pmc_syscall_handler(struct thread *td, void *syscall_args)
pprw = (struct pmc_op_pmcrw *) arg;
-#if DEBUG
+#ifdef DEBUG
if (prw.pm_flags & PMC_F_NEWVALUE)
PMCDBG(PMC,OPS,2, "rw id=%d new %jx -> old %jx",
ri, prw.pm_value, oldvalue);
@@ -3921,7 +3921,7 @@ pmc_initialize(void)
md = NULL;
error = 0;
-#if DEBUG
+#ifdef DEBUG
/* parse debug flags first */
if (TUNABLE_STR_FETCH(PMC_SYSCTL_NAME_PREFIX "debugflags",
pmc_debugstr, sizeof(pmc_debugstr)))
@@ -4071,7 +4071,7 @@ pmc_cleanup(void)
struct pmc_ownerhash *ph;
struct pmc_owner *po, *tmp;
struct pmc_binding pb;
-#if DEBUG
+#ifdef DEBUG
struct pmc_processhash *prh;
#endif
@@ -4121,7 +4121,7 @@ pmc_cleanup(void)
mtx_destroy(&pmc_processhash_mtx);
if (pmc_processhash) {
-#if DEBUG
+#ifdef DEBUG
struct pmc_process *pp;
PMCDBG(MOD,INI,3, "%s", "destroy process hash");
diff --git a/sys/dev/hwpmc/hwpmc_piv.c b/sys/dev/hwpmc/hwpmc_piv.c
index 586fecd..d0c1af8 100644
--- a/sys/dev/hwpmc/hwpmc_piv.c
+++ b/sys/dev/hwpmc/hwpmc_piv.c
@@ -757,7 +757,7 @@ p4_read_pmc(int cpu, int ri, pmc_value_t *v)
if (ri == 0) { /* TSC */
-#if DEBUG
+#ifdef DEBUG
pc = (struct p4_cpu *) pmc_pcpu[cpu];
phw = pc->pc_hwpmcs[ri];
pm = phw->phw_pmc;
@@ -840,7 +840,7 @@ p4_write_pmc(int cpu, int ri, pmc_value_t v)
* timekeeping and other system functions.
*/
if (ri == 0) {
-#if DEBUG
+#ifdef DEBUG
pc = (struct p4_cpu *) pmc_pcpu[cpu];
phw = pc->pc_hwpmcs[ri];
pm = phw->phw_pmc;
OpenPOWER on IntegriCloud