PERFORCE change 97118 for review
John Birrell
jb at FreeBSD.org
Sun May 14 00:52:12 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=97118
Change 97118 by jb at jb_freebsd2 on 2006/05/14 00:51:10
Use the curthread in places to make the code look more like Sun's.
Affected files ...
.. //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_dif.c#8 edit
Differences ...
==== //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_dif.c#8 (text+ko) ====
@@ -71,8 +71,10 @@
}
case DIF_VAR_CURTHREAD:
+#if defined(sun)
if (!dtrace_priv_kernel(state))
return (0);
+#endif
return ((uint64_t)(uintptr_t)curthread);
case DIF_VAR_TIMESTAMP:
@@ -94,8 +96,10 @@
return (mstate->dtms_walltimestamp);
case DIF_VAR_IPL:
+#if defined(sun)
if (!dtrace_priv_kernel(state))
return (0);
+#endif
if (!(mstate->dtms_present & DTRACE_MSTATE_IPL)) {
mstate->dtms_ipl = dtrace_getipl();
mstate->dtms_present |= DTRACE_MSTATE_IPL;
@@ -111,8 +115,10 @@
return (mstate->dtms_probe->dtpr_id);
case DIF_VAR_STACKDEPTH:
+#if defined(sun)
if (!dtrace_priv_kernel(state))
return (0);
+#endif
if (!(mstate->dtms_present & DTRACE_MSTATE_STACKDEPTH)) {
int aframes = mstate->dtms_probe->dtpr_aframes + 2;
@@ -122,10 +128,10 @@
return (mstate->dtms_stackdepth);
case DIF_VAR_USTACKDEPTH:
-printf("%s:%s(%d): DIF_VAR_USTACKDEPTH\n",__FUNCTION__,__FILE__,__LINE__);
-#ifdef DOODAD
+#if defined(sun)
if (!dtrace_priv_proc(state))
return (0);
+#endif
if (!(mstate->dtms_present & DTRACE_MSTATE_USTACKDEPTH)) {
/*
* See comment in DIF_VAR_PID.
@@ -142,13 +148,12 @@
mstate->dtms_present |= DTRACE_MSTATE_USTACKDEPTH;
}
return (mstate->dtms_ustackdepth);
-#else
-return 0;
-#endif
case DIF_VAR_CALLER:
+#if defined(sun)
if (!dtrace_priv_kernel(state))
return (0);
+#endif
if (!(mstate->dtms_present & DTRACE_MSTATE_CALLER)) {
int aframes = mstate->dtms_probe->dtpr_aframes + 2;
@@ -246,17 +251,17 @@
*/
return ((uint64_t)curthread->t_procp->p_pidp->pid_id);
#else
- return ((uint64_t)curproc->p_pid);
+ return ((uint64_t)curthread->td_proc->p_pid);
#endif
case DIF_VAR_TID:
-#if defined(sun)
/*
* See comment in DIF_VAR_PID.
*/
if (DTRACE_ANCHORED(mstate->dtms_probe) && CPU_ON_INTR(CPU))
return (0);
+#if defined(sun)
return ((uint64_t)curthread->t_tid);
#else
return ((uint64_t)curthread->td_tid);
@@ -282,7 +287,7 @@
return ((uint64_t)(uintptr_t)
curthread->t_procp->p_user.u_comm);
#else
- return ((uint64_t)(uintptr_t) curproc->p_comm);
+ return ((uint64_t)(uintptr_t) curthread->td_proc->p_comm);
#endif
case DIF_VAR_ZONENAME:
@@ -580,7 +585,7 @@
}
}
#else
- for (p = curproc; p != NULL; p = p->p_pptr) {
+ for (p = curthread->td_proc; p != NULL; p = p->p_pptr) {
if (p->p_pid == pid) {
rval = 1;
break;
More information about the p4-projects
mailing list