diff options
author | attilio <attilio@FreeBSD.org> | 2012-09-13 22:26:22 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2012-09-13 22:26:22 +0000 |
commit | d63ec4c4ce1de03b00bdd4813aeee11ee77907ea (patch) | |
tree | 98cf642eabc284875d15c5dcbebba86797df11e9 /sys/dev/hwpmc | |
parent | 5bb226a48fff4750ea9116c30966dec033b67f4c (diff) | |
download | FreeBSD-src-d63ec4c4ce1de03b00bdd4813aeee11ee77907ea.zip FreeBSD-src-d63ec4c4ce1de03b00bdd4813aeee11ee77907ea.tar.gz |
Remove all the checks on curthread != NULL with the exception of some MD
trap checks (eg. printtrap()).
Generally this check is not needed anymore, as there is not a legitimate
case where curthread != NULL, after pcpu 0 area has been properly
initialized.
Reviewed by: bde, jhb
MFC after: 1 week
Diffstat (limited to 'sys/dev/hwpmc')
-rw-r--r-- | sys/dev/hwpmc/hwpmc_arm.c | 8 | ||||
-rw-r--r-- | sys/dev/hwpmc/hwpmc_x86.c | 4 |
2 files changed, 3 insertions, 9 deletions
diff --git a/sys/dev/hwpmc/hwpmc_arm.c b/sys/dev/hwpmc/hwpmc_arm.c index c2c24c2..654b949 100644 --- a/sys/dev/hwpmc/hwpmc_arm.c +++ b/sys/dev/hwpmc/hwpmc_arm.c @@ -75,12 +75,10 @@ pmc_save_kernel_callchain(uintptr_t *cc, int maxsamples, KASSERT(TRAPF_USERMODE(tf) == 0,("[arm,%d] not a kernel backtrace", __LINE__)); + td = curthread; pc = PMC_TRAPFRAME_TO_PC(tf); *cc++ = pc; - if ((td = curthread) == NULL) - return (1); - if (maxsamples <= 1) return (1); @@ -126,12 +124,10 @@ pmc_save_user_callchain(uintptr_t *cc, int maxsamples, KASSERT(TRAPF_USERMODE(tf), ("[x86,%d] Not a user trap frame tf=%p", __LINE__, (void *) tf)); + td = curthread; pc = PMC_TRAPFRAME_TO_PC(tf); *cc++ = pc; - if ((td = curthread) == NULL) - return (1); - if (maxsamples <= 1) return (1); diff --git a/sys/dev/hwpmc/hwpmc_x86.c b/sys/dev/hwpmc/hwpmc_x86.c index e7485a4..f4c6c94 100644 --- a/sys/dev/hwpmc/hwpmc_x86.c +++ b/sys/dev/hwpmc/hwpmc_x86.c @@ -161,6 +161,7 @@ pmc_save_kernel_callchain(uintptr_t *cc, int nframes, struct trapframe *tf) KASSERT(TRAPF_USERMODE(tf) == 0,("[x86,%d] not a kernel backtrace", __LINE__)); + td = curthread; pc = PMC_TRAPFRAME_TO_PC(tf); fp = PMC_TRAPFRAME_TO_FP(tf); sp = PMC_TRAPFRAME_TO_KERNEL_SP(tf); @@ -168,9 +169,6 @@ pmc_save_kernel_callchain(uintptr_t *cc, int nframes, struct trapframe *tf) *cc++ = pc; r = fp + sizeof(uintptr_t); /* points to return address */ - if ((td = curthread) == NULL) - return (1); - if (nframes <= 1) return (1); |