Author: markj
Date: Thu Sep 22 04:49:31 2016
New Revision: 306157
URL: https://svnweb.freebsd.org/changeset/base/306157

Log:
  Annotate syscall provider pointer arguments with the "userland" keyword.
  
  This causes dtrace to automatically copyin arguments from userland, so
  one no longer has to explicitly use the copyin() action to do so. Moreover,
  copyin() on userland addresses is a no-op, so existing scripts should be
  unaffected by this change.
  
  Discussed with:       rstone
  MFC after:    2 weeks

Modified:
  head/sys/kern/makesyscalls.sh

Modified: head/sys/kern/makesyscalls.sh
==============================================================================
--- head/sys/kern/makesyscalls.sh       Thu Sep 22 03:35:02 2016        
(r306156)
+++ head/sys/kern/makesyscalls.sh       Thu Sep 22 04:49:31 2016        
(r306157)
@@ -418,7 +418,10 @@ s/\$//g
                        for (i = 1; i <= argc; i++) {
                                arg = argtype[i]
                                sub("__restrict$", "", arg)
-                               printf("\t\tcase %d:\n\t\t\tp = 
\"%s\";\n\t\t\tbreak;\n", i - 1, arg) > systracetmp
+                               if (index(arg, "*") > 0)
+                                       printf("\t\tcase %d:\n\t\t\tp = 
\"userland %s\";\n\t\t\tbreak;\n", i - 1, arg) > systracetmp
+                               else
+                                       printf("\t\tcase %d:\n\t\t\tp = 
\"%s\";\n\t\t\tbreak;\n", i - 1, arg) > systracetmp
                                if (index(arg, "*") > 0 || arg == "caddr_t")
                                        printf("\t\tuarg[%d] = (intptr_t) 
p->%s; /* %s */\n", \
                                             i - 1, \
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to