summaryrefslogtreecommitdiffstats
path: root/usr.sbin/procmap
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2013-03-26 08:58:00 +0000
committertedu <tedu@openbsd.org>2013-03-26 08:58:00 +0000
commit16db1b702e0db4cf026a02294f0983b6c96c9d99 (patch)
treee885179ef7931cb241836311172ae858bde352f5 /usr.sbin/procmap
parentPGSHIFT and PGOFSET are now contained inside the kernel namespace. (diff)
downloadwireguard-openbsd-16db1b702e0db4cf026a02294f0983b6c96c9d99.tar.xz
wireguard-openbsd-16db1b702e0db4cf026a02294f0983b6c96c9d99.zip
for the sake of argument, let's pretend this #if 0 code isn't wanted
Diffstat (limited to 'usr.sbin/procmap')
-rw-r--r--usr.sbin/procmap/procmap.c80
1 files changed, 1 insertions, 79 deletions
diff --git a/usr.sbin/procmap/procmap.c b/usr.sbin/procmap/procmap.c
index cbfae94dc79..9094ee8b71e 100644
--- a/usr.sbin/procmap/procmap.c
+++ b/usr.sbin/procmap/procmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: procmap.c,v 1.45 2013/03/23 10:46:04 tedu Exp $ */
+/* $OpenBSD: procmap.c,v 1.46 2013/03/26 08:58:00 tedu Exp $ */
/* $NetBSD: pmap.c,v 1.1 2002/09/01 20:32:44 atatat Exp $ */
/*
@@ -177,10 +177,6 @@ size_t dump_vm_map_entry(kvm_t *, struct kbit *, struct vm_map_entry *,
char *findname(kvm_t *, struct kbit *, struct vm_map_entry *, struct kbit *,
struct kbit *, struct kbit *);
int search_cache(kvm_t *, struct kbit *, char **, char *, size_t);
-#if 0
-void load_name_cache(kvm_t *);
-void cache_enter(struct namecache *);
-#endif
static void __dead usage(void);
static pid_t strtopid(const char *);
void print_sum(struct sum *, struct sum *);
@@ -911,11 +907,6 @@ search_cache(kvm_t *kd, struct kbit *vp, char **name, char *buf, size_t blen)
char *o, *e;
u_long cid;
-#if 0
- if (nchashtbl == NULL)
- load_name_cache(kd);
-#endif
-
P(&svp) = P(vp);
S(&svp) = sizeof(struct vnode);
cid = D(vp, vnode)->v_id;
@@ -948,75 +939,6 @@ search_cache(kvm_t *kd, struct kbit *vp, char **name, char *buf, size_t blen)
return (D(&svp, vnode)->v_flag & VROOT);
}
-#if 0
-void
-load_name_cache(kvm_t *kd)
-{
- struct namecache _ncp, *ncp, *oncp;
- struct nchashhead _ncpp, *ncpp;
- u_long nchash;
- int i;
-
- LIST_INIT(&lcache);
-
- _KDEREF(kd, nchash_addr, &nchash, sizeof(nchash));
- nchashtbl = calloc(sizeof(nchashtbl), (int)nchash);
- if (nchashtbl == NULL)
- err(1, "load_name_cache");
- _KDEREF(kd, nchashtbl_addr, nchashtbl,
- sizeof(nchashtbl) * (int)nchash);
-
- ncpp = &_ncpp;
-
- for (i = 0; i < nchash; i++) {
- ncpp = &nchashtbl[i];
- oncp = NULL;
- LIST_FOREACH(ncp, ncpp, nc_hash) {
- if (ncp == oncp ||
- ncp == (void*)0xdeadbeef)
- break;
- oncp = ncp;
- _KDEREF(kd, (u_long)ncp, &_ncp, sizeof(*ncp));
- ncp = &_ncp;
- if (ncp->nc_nlen > 0) {
- if (ncp->nc_nlen > 2 ||
- ncp->nc_name[0] != '.' ||
- (ncp->nc_name[1] != '.' &&
- ncp->nc_nlen != 1))
- cache_enter(ncp);
- }
- }
- }
-}
-
-void
-cache_enter(struct namecache *ncp)
-{
- struct cache_entry *ce;
-
- if (debug & DUMP_NAMEI_CACHE)
- printf("ncp->nc_vp %10p, ncp->nc_dvp %10p, ncp->nc_nlen "
- "%3d [%.*s] (nc_dvpid=%lu, nc_vpid=%lu)\n",
- ncp->nc_vp, ncp->nc_dvp,
- ncp->nc_nlen, ncp->nc_nlen, ncp->nc_name,
- ncp->nc_dvpid, ncp->nc_vpid);
-
- ce = malloc(sizeof(struct cache_entry));
- if (ce == NULL)
- err(1, "cache_enter");
-
- ce->ce_vp = ncp->nc_vp;
- ce->ce_pvp = ncp->nc_dvp;
- ce->ce_cid = ncp->nc_vpid;
- ce->ce_pcid = ncp->nc_dvpid;
- /* safe since nc_nlen is maximum NCHNAMLEN */
- ce->ce_nlen = (unsigned int)ncp->nc_nlen;
- strlcpy(ce->ce_name, ncp->nc_name, sizeof(ce->ce_name));
-
- LIST_INSERT_HEAD(&lcache, ce, ce_next);
-}
-#endif
-
static void __dead
usage(void)
{