Skip to content

Commit

Permalink
Mark subroutines with appropriate ALLOCA and DPTR flags
Browse files Browse the repository at this point in the history
Clearly, alloca() should be marked ALLOCA.

We also return copyin() in scratch memory.

These and other subroutines return results in DTrace-managed storage.

Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
  • Loading branch information
euloh authored and kvanhees committed Feb 20, 2023
1 parent c530238 commit 35900cb
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions libdtrace/dt_open.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ static const dt_provimpl_t *dt_providers[] = {
* argument.
*/
static const dt_ident_t _dtrace_globals[] = {
{ "alloca", DT_IDENT_FUNC, DT_IDFLG_ALLOCA, DIF_SUBR_ALLOCA, DT_ATTR_STABCMN,
DT_VERS_1_0, &dt_idops_func, "void *(size_t)" },
{ "alloca", DT_IDENT_FUNC, DT_IDFLG_ALLOCA, DIF_SUBR_ALLOCA,
DT_ATTR_STABCMN, DT_VERS_1_0, &dt_idops_func, "void *(size_t)" },
{ "arg0", DT_IDENT_SCALAR, 0, DIF_VAR_ARG0, DT_ATTR_STABCMN, DT_VERS_1_0,
&dt_idops_type, "int64_t" },
{ "arg1", DT_IDENT_SCALAR, 0, DIF_VAR_ARG1, DT_ATTR_STABCMN, DT_VERS_1_0,
Expand All @@ -112,7 +112,7 @@ static const dt_ident_t _dtrace_globals[] = {
&dt_idops_args, NULL },
{ "avg", DT_IDENT_AGGFUNC, 0, DT_AGG_AVG, DT_ATTR_STABCMN, DT_VERS_1_0,
&dt_idops_func, "void(@)" },
{ "basename", DT_IDENT_FUNC, 0, DIF_SUBR_BASENAME, DT_ATTR_STABCMN, DT_VERS_1_0,
{ "basename", DT_IDENT_FUNC, DT_IDFLG_DPTR, DIF_SUBR_BASENAME, DT_ATTR_STABCMN, DT_VERS_1_0,
&dt_idops_func, "string(const char *)" },
{ "bcopy", DT_IDENT_FUNC, 0, DIF_SUBR_BCOPY, DT_ATTR_STABCMN, DT_VERS_1_0,
&dt_idops_func, "void(void *, void *, size_t)" },
Expand All @@ -123,13 +123,13 @@ static const dt_ident_t _dtrace_globals[] = {
&dt_idops_type, "uintptr_t" },
{ "chill", DT_IDENT_ACTFUNC, 0, DT_ACT_CHILL, DT_ATTR_STABCMN, DT_VERS_1_0,
&dt_idops_func, "void(int)" },
{ "cleanpath", DT_IDENT_FUNC, 0, DIF_SUBR_CLEANPATH, DT_ATTR_STABCMN,
{ "cleanpath", DT_IDENT_FUNC, DT_IDFLG_DPTR, DIF_SUBR_CLEANPATH, DT_ATTR_STABCMN,
DT_VERS_1_0, &dt_idops_func, "string(const char *)" },
{ "clear", DT_IDENT_ACTFUNC, 0, DT_ACT_CLEAR, DT_ATTR_STABCMN, DT_VERS_1_0,
&dt_idops_func, "void(@)" },
{ "commit", DT_IDENT_ACTFUNC, 0, DT_ACT_COMMIT, DT_ATTR_STABCMN, DT_VERS_1_0,
&dt_idops_func, "void(int)" },
{ "copyin", DT_IDENT_FUNC, 0, DIF_SUBR_COPYIN, DT_ATTR_STABCMN, DT_VERS_1_0,
{ "copyin", DT_IDENT_FUNC, DT_IDFLG_ALLOCA, DIF_SUBR_COPYIN, DT_ATTR_STABCMN, DT_VERS_1_0,
&dt_idops_func, "void *(uintptr_t, size_t)" },
{ "copyinstr", DT_IDENT_FUNC, DT_IDFLG_DPTR, DIF_SUBR_COPYINSTR,
DT_ATTR_STABCMN, DT_VERS_1_0,
Expand All @@ -149,14 +149,14 @@ static const dt_ident_t _dtrace_globals[] = {
{ DTRACE_STABILITY_STABLE, DTRACE_STABILITY_PRIVATE,
DTRACE_CLASS_COMMON }, DT_VERS_1_0,
&dt_idops_type, "vmlinux`struct task_struct *" },
{ "d_path", DT_IDENT_FUNC, 0, DIF_SUBR_D_PATH, DT_ATTR_EVOLCMN,
{ "d_path", DT_IDENT_FUNC, DT_IDFLG_DPTR, DIF_SUBR_D_PATH, DT_ATTR_EVOLCMN,
DT_VERS_1_0, &dt_idops_func, "string(struct path *)" },
{ "ddi_pathname", DT_IDENT_FUNC, 0, DIF_SUBR_DDI_PATHNAME,
DT_ATTR_EVOLCMN, DT_VERS_1_0,
&dt_idops_func, "string(void *, int64_t)" },
{ "denormalize", DT_IDENT_ACTFUNC, 0, DT_ACT_DENORMALIZE, DT_ATTR_STABCMN,
DT_VERS_1_0, &dt_idops_func, "void(@)" },
{ "dirname", DT_IDENT_FUNC, 0, DIF_SUBR_DIRNAME, DT_ATTR_STABCMN, DT_VERS_1_0,
{ "dirname", DT_IDENT_FUNC, DT_IDFLG_DPTR, DIF_SUBR_DIRNAME, DT_ATTR_STABCMN, DT_VERS_1_0,
&dt_idops_func, "string(const char *)" },
{ "discard", DT_IDENT_ACTFUNC, 0, DT_ACT_DISCARD, DT_ATTR_STABCMN, DT_VERS_1_0,
&dt_idops_func, "void(int)" },
Expand Down Expand Up @@ -192,11 +192,11 @@ static const dt_ident_t _dtrace_globals[] = {
&dt_idops_type, "uint_t" },
{ "index", DT_IDENT_FUNC, 0, DIF_SUBR_INDEX, DT_ATTR_STABCMN, DT_VERS_1_1,
&dt_idops_func, "int(const char *, const char *, [int])" },
{ "inet_ntoa", DT_IDENT_FUNC, 0, DIF_SUBR_INET_NTOA, DT_ATTR_STABCMN,
{ "inet_ntoa", DT_IDENT_FUNC, DT_IDFLG_DPTR, DIF_SUBR_INET_NTOA, DT_ATTR_STABCMN,
DT_VERS_1_5, &dt_idops_func, "string(void *)" }, /* FIXME should be ipaddr_t* */
{ "inet_ntoa6", DT_IDENT_FUNC, 0, DIF_SUBR_INET_NTOA6, DT_ATTR_STABCMN,
{ "inet_ntoa6", DT_IDENT_FUNC, DT_IDFLG_DPTR, DIF_SUBR_INET_NTOA6, DT_ATTR_STABCMN,
DT_VERS_1_5, &dt_idops_func, "string(struct in6_addr *)" },
{ "inet_ntop", DT_IDENT_FUNC, 0, DIF_SUBR_INET_NTOP, DT_ATTR_STABCMN,
{ "inet_ntop", DT_IDENT_FUNC, DT_IDFLG_DPTR, DIF_SUBR_INET_NTOP, DT_ATTR_STABCMN,
DT_VERS_1_5, &dt_idops_func, "string(int, void *)" },
{ "ipl", DT_IDENT_SCALAR, 0, DIF_VAR_IPL, DT_ATTR_STABCMN, DT_VERS_1_0,
&dt_idops_type, "uint_t" },
Expand All @@ -207,7 +207,7 @@ static const dt_ident_t _dtrace_globals[] = {
{ "llquantize", DT_IDENT_AGGFUNC, 0, DT_AGG_LLQUANTIZE,
DT_ATTR_STABCMN, DT_VERS_1_6_4,
&dt_idops_func, "void(@, int32_t, int32_t, int32_t, int32_t, ...)" },
{ "lltostr", DT_IDENT_FUNC, 0, DIF_SUBR_LLTOSTR, DT_ATTR_STABCMN, DT_VERS_1_0,
{ "lltostr", DT_IDENT_FUNC, DT_IDFLG_DPTR, DIF_SUBR_LLTOSTR, DT_ATTR_STABCMN, DT_VERS_1_0,
&dt_idops_func, "string(int64_t)" },
{ "lquantize", DT_IDENT_AGGFUNC, 0, DT_AGG_LQUANTIZE,
DT_ATTR_STABCMN, DT_VERS_1_0,
Expand Down Expand Up @@ -304,19 +304,19 @@ static const dt_ident_t _dtrace_globals[] = {
DT_VERS_1_6, &dt_idops_func, "void(@)" },
{ "stop", DT_IDENT_ACTFUNC, 0, DT_ACT_STOP, DT_ATTR_STABCMN, DT_VERS_1_0,
&dt_idops_func, "void()" },
{ "strchr", DT_IDENT_FUNC, 0, DIF_SUBR_STRCHR, DT_ATTR_STABCMN, DT_VERS_1_1,
{ "strchr", DT_IDENT_FUNC, DT_IDFLG_DPTR, DIF_SUBR_STRCHR, DT_ATTR_STABCMN, DT_VERS_1_1,
&dt_idops_func, "string(const char *, char)" },
{ "strlen", DT_IDENT_FUNC, 0, DIF_SUBR_STRLEN, DT_ATTR_STABCMN, DT_VERS_1_0,
&dt_idops_func, "size_t(const char *)" },
{ "strjoin", DT_IDENT_FUNC, 0, DIF_SUBR_STRJOIN, DT_ATTR_STABCMN, DT_VERS_1_0,
{ "strjoin", DT_IDENT_FUNC, DT_IDFLG_DPTR, DIF_SUBR_STRJOIN, DT_ATTR_STABCMN, DT_VERS_1_0,
&dt_idops_func, "string(const char *, const char *)" },
{ "strrchr", DT_IDENT_FUNC, 0, DIF_SUBR_STRRCHR, DT_ATTR_STABCMN, DT_VERS_1_1,
{ "strrchr", DT_IDENT_FUNC, DT_IDFLG_DPTR, DIF_SUBR_STRRCHR, DT_ATTR_STABCMN, DT_VERS_1_1,
&dt_idops_func, "string(const char *, char)" },
{ "strstr", DT_IDENT_FUNC, 0, DIF_SUBR_STRSTR, DT_ATTR_STABCMN, DT_VERS_1_1,
{ "strstr", DT_IDENT_FUNC, DT_IDFLG_DPTR, DIF_SUBR_STRSTR, DT_ATTR_STABCMN, DT_VERS_1_1,
&dt_idops_func, "string(const char *, const char *)" },
{ "strtok", DT_IDENT_FUNC, 0, DIF_SUBR_STRTOK, DT_ATTR_STABCMN, DT_VERS_1_1,
{ "strtok", DT_IDENT_FUNC, DT_IDFLG_DPTR, DIF_SUBR_STRTOK, DT_ATTR_STABCMN, DT_VERS_1_1,
&dt_idops_func, "string(const char *, const char *)" },
{ "substr", DT_IDENT_FUNC, 0, DIF_SUBR_SUBSTR, DT_ATTR_STABCMN, DT_VERS_1_1,
{ "substr", DT_IDENT_FUNC, DT_IDFLG_DPTR, DIF_SUBR_SUBSTR, DT_ATTR_STABCMN, DT_VERS_1_1,
&dt_idops_func, "string(const char *, int, [int])" },
{ "sum", DT_IDENT_AGGFUNC, 0, DT_AGG_SUM, DT_ATTR_STABCMN, DT_VERS_1_0,
&dt_idops_func, "void(@)" },
Expand Down

0 comments on commit 35900cb

Please sign in to comment.