From owner-freebsd-current@FreeBSD.ORG Fri Apr 4 16:17:19 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7B2F637B401 for ; Fri, 4 Apr 2003 16:17:19 -0800 (PST) Received: from sccrmhc02.attbi.com (sccrmhc02.attbi.com [204.127.202.62]) by mx1.FreeBSD.org (Postfix) with ESMTP id B45E643FBD for ; Fri, 4 Apr 2003 16:17:18 -0800 (PST) (envelope-from julian@elischer.org) Received: from interjet.elischer.org (12-232-168-4.client.attbi.com[12.232.168.4]) by sccrmhc02.attbi.com (sccrmhc02) with ESMTP id <20030405001717002004ki1qe>; Sat, 5 Apr 2003 00:17:17 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id QAA38485; Fri, 4 Apr 2003 16:17:16 -0800 (PST) Date: Fri, 4 Apr 2003 16:17:14 -0800 (PST) From: Julian Elischer To: Glenn Johnson In-Reply-To: <20030405000712.GA9839@node1.cluster.srrc.usda.gov> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: current@freebsd.org Subject: Re: kp_proc and kp_eproc X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2003 00:17:19 -0000 On Fri, 4 Apr 2003, Glenn Johnson wrote: > On Fri, Apr 04, 2003 at 03:54:05PM -0800, Julian Elischer wrote: > > > yes.. > > > > The entire process structure and it's surrounding enviroment has been > > through a blender. > > > > What do you wnat to do? > > I would like to learn what I need to do to get the software to compile > on FreeBSD-5. I guess the question is, what information do I need to > provide? The software in question is OpenPBS (http://www.openpbs.org), > so it nothing proprietary. There were a whole bunch of dependency > problems that I worked through manually and finally got to the point > of the kp_proc failure. Here is a snippet of code that produces the > failure: > > ~~~~~~~~~~ you need to start from proc.h. the proc structure has been exploded into 4 parts but the kinfo_proc structure still exists. you may need to look at what 'ps' does to make sense of it.. some fields have become subfields and some may require following some links. > static unsigned long cput_sum(pjob) > job *pjob; > { > static char id[] = "cput_sum"; > int i; > u_long cputime; > int nps = 0; > > cputime = 0; > for (i=0; i struct kinfo_proc *pp = &proc_tbl[i]; > > if (!injob(pjob, sess_tbl[i])) > continue; > > nps++; > cputime += tvk(pp->kp_proc.p_rtime); > > if (pp->kp_proc.p_ru == NULL) { > struct pstats ps; > > DBPRT(("%s: p_stats 0x%lx\n", id, > (u_long)pp->kp_proc.p_stats)) > if (pp->kp_proc.p_stats == NULL) > continue; > > if (kvm_read(kd, (u_long)pp->kp_proc.p_stats, &ps, > sizeof(ps)) != sizeof(ps)) { > log_err(errno, id, "kvm_read(pstats)"); > continue; > } > cputime += tv(ps.p_ru.ru_utime) + > tv(ps.p_ru.ru_stime) + > tv(ps.p_cru.ru_utime) + > tv(ps.p_cru.ru_stime); > } > else { > struct rusage ru; > > DBPRT(("%s: p_ru 0x%lx\n", id, > (u_long)pp->kp_proc.p_ru)) > if (kvm_read(kd, (u_long)pp->kp_proc.p_ru, &ru, > sizeof(ru)) != sizeof(ru)) { > log_err(errno, id, "kvm_read(session)"); > continue; > } > cputime += tv(ru.ru_utime) + tv(ru.ru_stime); > } > DBPRT(("%s: ses %d pid %d cputime %d\n", id, > sess_tbl[i], pp->kp_proc.p_pid, cputime)) > } > > if (nps == 0) > pjob->ji_flags |= MOM_NO_PROC; > > return ((unsigned long)((double)cputime * cputfactor)); > } > > ~~~~~~~~~~ > > > On Fri, 4 Apr 2003, Glenn Johnson wrote: > > > > > I have some software that compiled fine on FreeBSD-4 but is not > > > compiling on FreeBSD-5. It is looking for kp_proc and kp_eproc. > > > The error I get is: > > > > > > structure has no member named `kp_proc' > > > structure has no member named `kp_eproc' > > > > > > Have those changed from FreeBSD-4? > > > > > > Thanks. > > -- > Glenn Johnson > USDA, ARS, SRRC Phone: (504) 286-4252 > New Orleans, LA 70124 e-mail: gjohnson@srrc.ars.usda.gov > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" >