mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-18 15:30:21 +00:00
hwpmc: mostly clean up cc --analyze
Sponsored by: Rubicon Communications, LLC ("Netgate")
This commit is contained in:
parent
b9296725cf
commit
aee6e7dc0c
@ -669,7 +669,7 @@ amd_release_pmc(int cpu, int ri, struct pmc *pmc)
|
||||
#ifdef HWPMC_DEBUG
|
||||
const struct amd_descr *pd;
|
||||
#endif
|
||||
struct pmc_hw *phw;
|
||||
struct pmc_hw *phw __diagused;
|
||||
|
||||
(void) pmc;
|
||||
|
||||
|
@ -741,7 +741,6 @@ static int
|
||||
iap_allocate_pmc(int cpu, int ri, struct pmc *pm,
|
||||
const struct pmc_op_pmcallocate *a)
|
||||
{
|
||||
enum pmc_event map;
|
||||
uint8_t ev;
|
||||
uint32_t caps;
|
||||
const struct pmc_md_iap_op_pmcallocate *iap;
|
||||
@ -755,7 +754,6 @@ iap_allocate_pmc(int cpu, int ri, struct pmc *pm,
|
||||
caps = a->pm_caps;
|
||||
if ((IAP_PMC_CAPS & caps) != caps)
|
||||
return (EPERM);
|
||||
map = 0; /* XXX: silent GCC warning */
|
||||
iap = &a->pm_md.pm_iap;
|
||||
ev = IAP_EVSEL_GET(iap->pm_iap_config);
|
||||
|
||||
@ -961,7 +959,7 @@ iap_start_pmc(int cpu, int ri)
|
||||
static int
|
||||
iap_stop_pmc(int cpu, int ri)
|
||||
{
|
||||
struct pmc *pm;
|
||||
struct pmc *pm __diagused;
|
||||
struct core_cpu *cc;
|
||||
uint64_t msr;
|
||||
|
||||
@ -985,7 +983,6 @@ iap_stop_pmc(int cpu, int ri)
|
||||
if (core_cputype == PMC_CPU_INTEL_CORE)
|
||||
return (0);
|
||||
|
||||
msr = 0;
|
||||
do {
|
||||
cc->pc_resync = 0;
|
||||
cc->pc_globalctrl &= ~(1ULL << ri);
|
||||
|
@ -550,7 +550,7 @@ pmclog_release(struct pmc_owner *po)
|
||||
static uint32_t *
|
||||
pmclog_reserve(struct pmc_owner *po, int length)
|
||||
{
|
||||
uintptr_t newptr, oldptr;
|
||||
uintptr_t newptr, oldptr __diagused;
|
||||
struct pmclog_buffer *plb, **pplb;
|
||||
|
||||
PMCDBG2(LOG,ALL,1, "po=%p len=%d", po, length);
|
||||
@ -693,7 +693,6 @@ pmclog_configure_log(struct pmc_mdep *md, struct pmc_owner *po, int logfd)
|
||||
{
|
||||
struct proc *p;
|
||||
struct timespec ts;
|
||||
uint64_t tsc;
|
||||
int error;
|
||||
|
||||
sx_assert(&pmc_sx, SA_XLOCKED);
|
||||
@ -722,7 +721,6 @@ pmclog_configure_log(struct pmc_mdep *md, struct pmc_owner *po, int logfd)
|
||||
p->p_flag |= P_HWPMC;
|
||||
PROC_UNLOCK(p);
|
||||
nanotime(&ts);
|
||||
tsc = pmc_rdtsc();
|
||||
/* create a log initialization entry */
|
||||
PMCLOG_RESERVE_WITH_ERROR(po, INITIALIZE,
|
||||
sizeof(struct pmclog_initialize));
|
||||
|
@ -1351,7 +1351,7 @@ pmc_process_csw_in(struct thread *td)
|
||||
struct pmc *pm;
|
||||
struct proc *p;
|
||||
struct pmc_cpu *pc;
|
||||
struct pmc_hw *phw;
|
||||
struct pmc_hw *phw __diagused;
|
||||
pmc_value_t newvalue;
|
||||
struct pmc_process *pp;
|
||||
struct pmc_thread *pt;
|
||||
@ -2769,7 +2769,7 @@ static void
|
||||
pmc_release_pmc_descriptor(struct pmc *pm)
|
||||
{
|
||||
enum pmc_mode mode;
|
||||
struct pmc_hw *phw;
|
||||
struct pmc_hw *phw __diagused;
|
||||
u_int adjri, ri, cpu;
|
||||
struct pmc_owner *po;
|
||||
struct pmc_binding pb;
|
||||
@ -4336,7 +4336,6 @@ pmc_syscall_handler(struct thread *td, void *syscall_args)
|
||||
if ((error = copyin(arg, &prw, sizeof(prw))) != 0)
|
||||
break;
|
||||
|
||||
ri = 0;
|
||||
PMCDBG2(PMC,OPS,1, "rw id=%d flags=0x%x", prw.pm_pmcid,
|
||||
prw.pm_flags);
|
||||
|
||||
@ -4920,7 +4919,7 @@ pmc_process_samples(int cpu, ring_type_t ring)
|
||||
struct pmc_sample *ps;
|
||||
struct pmc_classdep *pcd;
|
||||
struct pmc_samplebuffer *psb;
|
||||
uint64_t delta;
|
||||
uint64_t delta __diagused;
|
||||
|
||||
KASSERT(PCPU_GET(cpuid) == cpu,
|
||||
("[pmc,%d] not on the correct CPU pcpu=%d cpu=%d", __LINE__,
|
||||
|
@ -264,7 +264,7 @@ soft_pcpu_init(struct pmc_mdep *md, int cpu)
|
||||
static int
|
||||
soft_read_pmc(int cpu, int ri, pmc_value_t *v)
|
||||
{
|
||||
struct pmc *pm;
|
||||
struct pmc *pm __diagused;
|
||||
const struct pmc_hw *phw;
|
||||
|
||||
KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
|
||||
@ -288,8 +288,7 @@ soft_read_pmc(int cpu, int ri, pmc_value_t *v)
|
||||
static int
|
||||
soft_write_pmc(int cpu, int ri, pmc_value_t v)
|
||||
{
|
||||
struct pmc *pm;
|
||||
const struct soft_descr *pd;
|
||||
struct pmc *pm __diagused;
|
||||
|
||||
KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
|
||||
("[soft,%d] illegal cpu value %d", __LINE__, cpu));
|
||||
@ -297,7 +296,6 @@ soft_write_pmc(int cpu, int ri, pmc_value_t v)
|
||||
("[soft,%d] illegal row-index %d", __LINE__, ri));
|
||||
|
||||
pm = soft_pcpu[cpu]->soft_hw[ri].phw_pmc;
|
||||
pd = &soft_pmcdesc[ri];
|
||||
|
||||
KASSERT(pm,
|
||||
("[soft,%d] cpu %d ri %d pmc not configured", __LINE__, cpu, ri));
|
||||
@ -312,7 +310,7 @@ soft_write_pmc(int cpu, int ri, pmc_value_t v)
|
||||
static int
|
||||
soft_release_pmc(int cpu, int ri, struct pmc *pmc)
|
||||
{
|
||||
struct pmc_hw *phw;
|
||||
struct pmc_hw *phw __diagused;
|
||||
enum pmc_event ev;
|
||||
struct pmc_soft *ps;
|
||||
|
||||
|
@ -237,7 +237,7 @@ static int
|
||||
tsc_read_pmc(int cpu, int ri, pmc_value_t *v)
|
||||
{
|
||||
struct pmc *pm;
|
||||
enum pmc_mode mode;
|
||||
enum pmc_mode mode __diagused;
|
||||
const struct pmc_hw *phw;
|
||||
|
||||
KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
|
||||
@ -265,7 +265,7 @@ tsc_read_pmc(int cpu, int ri, pmc_value_t *v)
|
||||
static int
|
||||
tsc_release_pmc(int cpu, int ri, struct pmc *pmc)
|
||||
{
|
||||
struct pmc_hw *phw;
|
||||
struct pmc_hw *phw __diagused;
|
||||
|
||||
(void) pmc;
|
||||
|
||||
|
@ -189,7 +189,6 @@ static int
|
||||
ucf_allocate_pmc(int cpu, int ri, struct pmc *pm,
|
||||
const struct pmc_op_pmcallocate *a)
|
||||
{
|
||||
enum pmc_event ev;
|
||||
uint32_t caps, flags;
|
||||
|
||||
KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
|
||||
@ -206,7 +205,6 @@ ucf_allocate_pmc(int cpu, int ri, struct pmc *pm,
|
||||
(caps & UCF_PMC_CAPS) != caps)
|
||||
return (EINVAL);
|
||||
|
||||
ev = pm->pm_event;
|
||||
flags = UCF_EN;
|
||||
|
||||
pm->pm_md.pm_ucf.pm_ucf_ctrl = (flags << (ri * 4));
|
||||
@ -718,7 +716,7 @@ ucp_start_pmc(int cpu, int ri)
|
||||
static int
|
||||
ucp_stop_pmc(int cpu, int ri)
|
||||
{
|
||||
struct pmc *pm;
|
||||
struct pmc *pm __diagused;
|
||||
struct uncore_cpu *cc;
|
||||
|
||||
KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
|
||||
|
Loading…
Reference in New Issue
Block a user