PERFORCE change 144348 for review
John Birrell
jb at FreeBSD.org
Mon Jun 30 07:03:20 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=144348
Change 144348 by jb at freebsd3 on 2008/06/30 07:02:38
Add the hooks for the child calback function after forking and before execing.
Affected files ...
.. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c#6 edit
.. //depot/projects/dtrace/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c#6 edit
.. //depot/projects/dtrace/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.h#6 edit
.. //depot/projects/dtrace/src/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h#6 edit
Differences ...
==== //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c#6 (text) ====
@@ -1576,7 +1576,7 @@
if ((v = make_argv(optarg)) == NULL)
fatal("failed to allocate memory");
- P = dtrace_proc_create(g_dtp, v[0], v);
+ P = dtrace_proc_create(g_dtp, v[0], v, NULL, NULL);
if (P == NULL)
dfatal(NULL); /* dtrace_errmsg() only */
==== //depot/projects/dtrace/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c#6 (text) ====
@@ -955,7 +955,8 @@
}
struct ps_prochandle *
-dt_proc_create(dtrace_hdl_t *dtp, const char *file, char *const *argv)
+dt_proc_create(dtrace_hdl_t *dtp, const char *file, char *const *argv,
+ proc_child_func *pcf, void *child_arg)
{
dt_proc_hash_t *dph = dtp->dt_procs;
dt_proc_t *dpr;
@@ -981,7 +982,7 @@
#else
(void) proc_clearflags(dpr->dpr_proc, PR_RLC);
(void) proc_setflags(dpr->dpr_proc, PR_KLC);
- if ((err = proc_create(file, argv, &dpr->dpr_proc)) != 0)
+ if ((err = proc_create(file, argv, pcf, child_arg, &dpr->dpr_proc)) != 0)
return (dt_proc_error(dtp, dpr,
"failed to execute %s: %s\n", file, strerror(err)));
dpr->dpr_hdl = dtp;
@@ -1183,10 +1184,11 @@
}
struct ps_prochandle *
-dtrace_proc_create(dtrace_hdl_t *dtp, const char *file, char *const *argv)
+dtrace_proc_create(dtrace_hdl_t *dtp, const char *file, char *const *argv,
+ proc_child_func *pcf, void *child_arg)
{
dt_ident_t *idp = dt_idhash_lookup(dtp->dt_macros, "target");
- struct ps_prochandle *P = dt_proc_create(dtp, file, argv);
+ struct ps_prochandle *P = dt_proc_create(dtp, file, argv, pcf, child_arg);
if (P != NULL && idp != NULL && idp->di_id == 0)
#if defined(sun)
==== //depot/projects/dtrace/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.h#6 (text) ====
@@ -99,7 +99,7 @@
} dt_proc_hash_t;
extern struct ps_prochandle *dt_proc_create(dtrace_hdl_t *,
- const char *, char *const *);
+ const char *, char *const *, proc_child_func *, void *);
extern struct ps_prochandle *dt_proc_grab(dtrace_hdl_t *, pid_t, int, int);
extern void dt_proc_release(dtrace_hdl_t *, struct ps_prochandle *);
==== //depot/projects/dtrace/src/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h#6 (text) ====
@@ -33,6 +33,7 @@
#include <stdarg.h>
#include <stdio.h>
#include <gelf.h>
+#include <libproc.h>
#ifdef __cplusplus
extern "C" {
@@ -413,7 +414,7 @@
*/
extern struct ps_prochandle *dtrace_proc_create(dtrace_hdl_t *,
- const char *, char *const *);
+ const char *, char *const *, proc_child_func *, void *);
extern struct ps_prochandle *dtrace_proc_grab(dtrace_hdl_t *, pid_t, int);
extern void dtrace_proc_release(dtrace_hdl_t *, struct ps_prochandle *);
More information about the p4-projects
mailing list