Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 alpha 4/15/85; site lzwi.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!ihnp4!lzwi!psc From: psc@lzwi.UUCP (Paul S. R. Chisholm) Newsgroups: net.unix Subject: Profiling child processes (SysVr2) Message-ID: <175@lzwi.UUCP> Date: Wed, 12-Jun-85 13:26:44 EDT Article-I.D.: lzwi.175 Posted: Wed Jun 12 13:26:44 1985 Date-Received: Thu, 13-Jun-85 02:52:23 EDT Distribution: net Organization: AT&T-IS Enhanced Network Services Lines: 31 Keywords: profiling child < Smokey the Bar says, "Help stamp out software pirates" [squish!] > AT&T System V Release 2.0 Unix claims to be able to profile programs that fork(2) off child processes. I read that somewhere in the release notes, and prof(1) implies it: The name of the file created by a profiled program is controlled by the environment variable PROFDIR. If PROFDIR does not exit, "mon.out" is produced in the directory current when the program terminates. If PROFDIR = string, "string/pid.progname" is produced, where progname consists of argv[0] with any path prefix removed, and pid is the program's process id. If PROFDIR = nothing, no profiling output is produced. Indeed, setting PROFDIR does create such a file for the parent process. Alas, if the parent forks off a child, there doesn't seem to be any monitor file. Answers to obvious questions: Yes, the parent waits on the child. Yes, the child calls exit(2). No, the child doesn't do a chdir(2). Possible work around: I could have three separate programs, and have the children of one exec(2) the other two. I really don't want to do this. (This is an AT&T product running on a 3B/2; I don't care if Berkeley Unix handles this right.) Any thoughts? -- -Paul S. R. Chisholm The above opinions are my own, {pegasus,vax135}!lzwi!psc not necessarily those of any {mtgzz,ihnp4}!lznv!psc telecommunications company.