Add another field to the SDT_PROBE_DEFINE macro, so our DTrace probes

can named the same as those on other platforms.

For example, proc:::exec-success, not proc:::exec_success.

Implementation follows the same basic principle as FreeBSD's; add
another field to the SDT_PROBE_DEFINE macro which is the name
as exposed to userland.
This commit is contained in:
riz 2013-06-09 01:13:47 +00:00
parent b27a9f36f3
commit c02fb3c915
6 changed files with 28 additions and 27 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_exec.c,v 1.360 2013/04/20 22:28:58 christos Exp $ */
/* $NetBSD: kern_exec.c,v 1.361 2013/06/09 01:13:47 riz Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@ -59,7 +59,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.360 2013/04/20 22:28:58 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.361 2013/06/09 01:13:47 riz Exp $");
#include "opt_exec.h"
#include "opt_execfmt.h"
@ -126,15 +126,15 @@ static int exec_sigcode_map(struct proc *, const struct emul *);
/*
* DTrace SDT provider definitions
*/
SDT_PROBE_DEFINE(proc,,,exec,
SDT_PROBE_DEFINE(proc,,,exec,exec,
"char *", NULL,
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL);
SDT_PROBE_DEFINE(proc,,,exec_success,
SDT_PROBE_DEFINE(proc,,,exec_success,exec-success,
"char *", NULL,
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL);
SDT_PROBE_DEFINE(proc,,,exec_failure,
SDT_PROBE_DEFINE(proc,,,exec_failure,exec-failure,
"int", NULL,
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL);

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_exit.c,v 1.242 2012/09/27 20:43:15 rmind Exp $ */
/* $NetBSD: kern_exit.c,v 1.243 2013/06/09 01:13:47 riz Exp $ */
/*-
* Copyright (c) 1998, 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.242 2012/09/27 20:43:15 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.243 2013/06/09 01:13:47 riz Exp $");
#include "opt_ktrace.h"
#include "opt_perfctrs.h"
@ -123,7 +123,7 @@ static void proc_free(struct proc *, struct rusage *);
/*
* DTrace SDT provider definitions
*/
SDT_PROBE_DEFINE(proc,,,exit,
SDT_PROBE_DEFINE(proc,,,exit,exit,
"int", NULL, /* reason */
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL);

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_fork.c,v 1.191 2012/07/27 20:52:49 christos Exp $ */
/* $NetBSD: kern_fork.c,v 1.192 2013/06/09 01:13:47 riz Exp $ */
/*-
* Copyright (c) 1999, 2001, 2004, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_fork.c,v 1.191 2012/07/27 20:52:49 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_fork.c,v 1.192 2013/06/09 01:13:47 riz Exp $");
#include "opt_ktrace.h"
@ -98,7 +98,7 @@ __KERNEL_RCSID(0, "$NetBSD: kern_fork.c,v 1.191 2012/07/27 20:52:49 christos Exp
/*
* DTrace SDT provider definitions
*/
SDT_PROBE_DEFINE(proc,,,create,
SDT_PROBE_DEFINE(proc,,,create,create,
"struct proc *", NULL, /* new process */
"struct proc *", NULL, /* parent process */
"int", NULL, /* flags */

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_lwp.c,v 1.174 2012/12/16 22:21:03 dsl Exp $ */
/* $NetBSD: kern_lwp.c,v 1.175 2013/06/09 01:13:47 riz Exp $ */
/*-
* Copyright (c) 2001, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@ -211,7 +211,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.174 2012/12/16 22:21:03 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.175 2013/06/09 01:13:47 riz Exp $");
#include "opt_ddb.h"
#include "opt_lockdebug.h"
@ -251,15 +251,15 @@ struct lwplist alllwp __cacheline_aligned;
static void lwp_dtor(void *, void *);
/* DTrace proc provider probes */
SDT_PROBE_DEFINE(proc,,,lwp_create,
SDT_PROBE_DEFINE(proc,,,lwp_create,lwp-create,
"struct lwp *", NULL,
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL);
SDT_PROBE_DEFINE(proc,,,lwp_start,
SDT_PROBE_DEFINE(proc,,,lwp_start,lwp-start,
"struct lwp *", NULL,
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL);
SDT_PROBE_DEFINE(proc,,,lwp_exit,
SDT_PROBE_DEFINE(proc,,,lwp_exit,lwp-exit,
"struct lwp *", NULL,
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL);

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_sig.c,v 1.317 2012/02/19 21:06:53 rmind Exp $ */
/* $NetBSD: kern_sig.c,v 1.318 2013/06/09 01:13:47 riz Exp $ */
/*-
* Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@ -70,7 +70,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.317 2012/02/19 21:06:53 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.318 2013/06/09 01:13:47 riz Exp $");
#include "opt_ptrace.h"
#include "opt_compat_sunos.h"
@ -131,21 +131,21 @@ int (*coredump_vec)(struct lwp *, const char *) =
/*
* DTrace SDT provider definitions
*/
SDT_PROBE_DEFINE(proc,,,signal_send,
SDT_PROBE_DEFINE(proc,,,signal_send,signal-send,
"struct lwp *", NULL, /* target thread */
"struct proc *", NULL, /* target process */
"int", NULL, /* signal */
NULL, NULL, NULL, NULL);
SDT_PROBE_DEFINE(proc,,,signal_discard,
SDT_PROBE_DEFINE(proc,,,signal_discard,signal-discard,
"struct lwp *", NULL, /* target thread */
"struct proc *", NULL, /* target process */
"int", NULL, /* signal */
NULL, NULL, NULL, NULL);
SDT_PROBE_DEFINE(proc,,,signal_clear,
SDT_PROBE_DEFINE(proc,,,signal_clear,signal-clear,
"int", NULL, /* signal */
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL);
SDT_PROBE_DEFINE(proc,,,signal_handle,
SDT_PROBE_DEFINE(proc,,,signal_handle,signal-handle,
"int", NULL, /* signal */
"ksiginfo_t *", NULL,
"void (*)(void)", NULL, /* handler address */

View File

@ -1,4 +1,4 @@
/* $NetBSD: sdt.h,v 1.2 2011/12/08 22:27:36 dholland Exp $ */
/* $NetBSD: sdt.h,v 1.3 2013/06/09 01:13:47 riz Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@ -78,7 +78,7 @@ extern sdt_probe_func_t sdt_probe_func;
#ifdef KDTRACE_HOOKS
/*
* SDT_PROBE_DEFINE(prov, mod, func, name,
* SDT_PROBE_DEFINE(prov, mod, func, name, sname,
* arg0, argx0, arg1, argx1,
* arg2, argx2, arg3, argx3, arg4, argx4)
*
@ -86,6 +86,7 @@ extern sdt_probe_func_t sdt_probe_func;
* mod - module name
* func - function name
* name - probe name
* sname - probe name as exposed to userland
* arg0 - arg4, argument types as strings, or NULL.
* argx0 - argx4, translation types for arg0 - arg4
*
@ -97,11 +98,11 @@ extern sdt_probe_func_t sdt_probe_func;
* This is used in the target module to define probes to be used.
* The translation type should be set to NULL if not used.
*/
#define SDT_PROBE_DEFINE(prov, mod, func, name, \
#define SDT_PROBE_DEFINE(prov, mod, func, name, sname, \
arg0, argx0, arg1, argx1, arg2, argx2, \
arg3, argx3, arg4, argx4) \
sdt_probe_t SDT_NAME(prov, mod, func, name) = { \
0, 0, 0, #prov, #mod, #func, #name, \
0, 0, 0, #prov, #mod, #func, #sname, \
{ arg0, arg1, arg2, arg3, arg4 }, \
{ NULL, NULL, NULL, NULL, NULL } \
}
@ -118,7 +119,7 @@ extern sdt_probe_func_t sdt_probe_func;
(uintptr_t)(arg3), (uintptr_t)(arg4)); \
}
#else
#define SDT_PROBE_DEFINE(prov, mod, func, name, \
#define SDT_PROBE_DEFINE(prov, mod, func, name, sname, \
arg0, argx0, arg1, argx1, arg2, argx2, \
arg3, argx3, arg4, argx4)
#define SDT_PROBE_DECLARE(prov, mod, func, name)