+ unsigned int i;
+ bool lookup = flags & KDBG_VFS_LOOKUP_FLAG_LOOKUP;
+ bool noprocfilt = flags & KDBG_VFS_LOOKUP_FLAG_NOPROCFILT;
+
+ /*
+ * In the event that we collect multiple, consecutive pathname
+ * entries, we must mark the start of the path's string and the end.
+ */
+ if (lookup) {
+ code = VFS_LOOKUP | DBG_FUNC_START;
+ } else {
+ code = VFS_LOOKUP_DONE | DBG_FUNC_START;
+ }
+
+ if (dbg_namelen <= (int)(3 * sizeof(long)))
+ code |= DBG_FUNC_END;
+
+ if (noprocfilt) {
+ KDBG_RELEASE_NOPROCFILT(code, kdebug_vnode(dp), dbg_parms[0],
+ dbg_parms[1], dbg_parms[2]);
+ } else {
+ KDBG_RELEASE(code, kdebug_vnode(dp), dbg_parms[0], dbg_parms[1],
+ dbg_parms[2]);
+ }
+
+ code &= ~DBG_FUNC_START;
+
+ for (i=3, dbg_namelen -= (3 * sizeof(long)); dbg_namelen > 0; i+=4, dbg_namelen -= (4 * sizeof(long))) {
+ if (dbg_namelen <= (int)(4 * sizeof(long)))
+ code |= DBG_FUNC_END;
+
+ if (noprocfilt) {
+ KDBG_RELEASE_NOPROCFILT(code, dbg_parms[i], dbg_parms[i + 1],
+ dbg_parms[i + 2], dbg_parms[i + 3]);
+ } else {
+ KDBG_RELEASE(code, dbg_parms[i], dbg_parms[i + 1], dbg_parms[i + 2],
+ dbg_parms[i + 3]);
+ }
+ }
+}
+
+void
+kdebug_lookup_gen_events(long *dbg_parms, int dbg_namelen, void *dp,
+ boolean_t lookup)
+{
+ kdebug_vfs_lookup(dbg_parms, dbg_namelen, dp,
+ lookup ? KDBG_VFS_LOOKUP_FLAG_LOOKUP : 0);
+}
+
+void
+kdebug_lookup(vnode_t dp, struct componentname *cnp)
+{