Author: manu
Date: Thu Jul 19 11:41:53 2018
New Revision: 336479
URL: https://svnweb.freebsd.org/changeset/base/336479

Log:
  fdt_pinctrl: Add some TSLOG annotations
  
  While we see the time spent in the pin controller attach via the hooks in
  DEVICE_ATTACH, it is useful to see the time spent configuring the pins.

Modified:
  head/sys/dev/fdt/fdt_pinctrl.c
  head/sys/dev/fdt/fdt_pinctrl_if.m

Modified: head/sys/dev/fdt/fdt_pinctrl.c
==============================================================================
--- head/sys/dev/fdt/fdt_pinctrl.c      Thu Jul 19 11:31:49 2018        
(r336478)
+++ head/sys/dev/fdt/fdt_pinctrl.c      Thu Jul 19 11:41:53 2018        
(r336479)
@@ -106,10 +106,15 @@ int
 fdt_pinctrl_register(device_t pinctrl, const char *pinprop)
 {
        phandle_t node;
+       int ret;
 
+       TSENTER();
        node = ofw_bus_get_node(pinctrl);
        OF_device_register_xref(OF_xref_from_node(node), pinctrl);
-       return (pinctrl_register_children(pinctrl, node, pinprop));
+       ret = pinctrl_register_children(pinctrl, node, pinprop);
+       TSEXIT();
+
+       return (ret);
 }
 
 static int
@@ -118,6 +123,8 @@ pinctrl_configure_children(device_t pinctrl, phandle_t
        phandle_t node, *configs;
        int i, nconfigs;
 
+       TSENTER();
+
        for (node = OF_child(parent); node != 0; node = OF_peer(node)) {
                if (!ofw_bus_node_status_okay(node))
                        continue;
@@ -138,6 +145,7 @@ pinctrl_configure_children(device_t pinctrl, phandle_t
                }
                OF_prop_free(configs);
        }
+       TSEXIT();
        return (0);
 }
 

Modified: head/sys/dev/fdt/fdt_pinctrl_if.m
==============================================================================
--- head/sys/dev/fdt/fdt_pinctrl_if.m   Thu Jul 19 11:31:49 2018        
(r336478)
+++ head/sys/dev/fdt/fdt_pinctrl_if.m   Thu Jul 19 11:41:53 2018        
(r336479)
@@ -27,6 +27,7 @@
 #
 
 #include <sys/types.h>
+#include <sys/bus.h>
 #include <dev/ofw/openfirm.h>
 
 #
@@ -35,11 +36,22 @@
 
 INTERFACE fdt_pinctrl;
 
+# Needed for timestamping device probe/attach calls
+HEADER {
+       #include <sys/tslog.h>
+}
+
 #
 # Set pins to the specified configuration.  The cfgxref arg is an xref phandle
 # to a descendent node (child, grandchild, ...) of the pinctrl device node.
 # Returns 0 on success or a standard errno value.
 #
+PROLOG {
+       TSENTER2(device_get_name(pinctrl));
+}
+EPILOG {
+       TSEXIT2(device_get_name(pinctrl));
+}
 METHOD int configure {
        device_t        pinctrl;
        phandle_t       cfgxref;
_______________________________________________
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