home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / hp / 13173 < prev    next >
Encoding:
Text File  |  1992-11-19  |  5.2 KB  |  128 lines

  1. Newsgroups: comp.sys.hp
  2. Path: sparky!uunet!mcsun!sunic!ugle.unit.no!Steinar.Haug
  3. From: Steinar.Haug@delab.sintef.no (Steinar Haug)
  4. Subject: Re: Sun-like trace(1) for 7xx's running 8.07?
  5. In-Reply-To: tml@tik.vtt.fi's message of 19 Nov 92 00:06:06
  6. Message-ID: <STEINAR.HAUG.92Nov20095915@delab.sintef.no>
  7. Sender: news@ugle.unit.no (NetNews Administrator)
  8. Organization: SINTEF DELAB, Trondheim, Norway.
  9. References: <Nov.18.14.23.17.1992.21700@klinzhai.rutgers.edu>
  10.     <TML.92Nov19000606@hemuli.tik.vtt.fi>
  11. Date: 20 Nov 92 09:59:15
  12. Lines: 114
  13.  
  14. tml@tik.vtt.fi (Tor Lillqvist) writes:
  15. > In article <Nov.18.14.23.17.1992.21700@klinzhai.rutgers.edu> juo@klinzhai.rutgers.edu (John Oleynick) writes:
  16. >  Has anyone created/ported a utility like Sun's trace(1) (creates or attaches
  17. >  to a process and prints the system calls it makes) to the HP 7xx's running 
  18. >  8.07?
  19. >
  20. >I once started writing a tool like this in 7.0, but then came 8.0 and
  21. >shared libraries and I lost interest... My program worked like this:
  22.  
  23. I have wanted a trace utility for HP myself many times. It is *extremely*
  24. useful to have this functionality.
  25.  
  26. Anyone wanting to write this on HP (I'd like to myself but don't have time)
  27. should take a careful look at Paul Kranenburg's 'strace' package, which is
  28. a freely available replacement for trace(1) on Suns. Available via anon FTP
  29. from kaa.cs.few.eur.nl, file pub/strace.tar.Z. I have included the README
  30. file from this below.
  31.  
  32. >I am sure HP uses system call tracing and other kernel instrumentation
  33. >when testing their software, why can't these features be left in when
  34. >the kernel is compiled for the customers...?
  35.  
  36. Couldn't agree more!
  37.  
  38. Steinar Haug, system/networks administrator
  39. SINTEF DELAB, University of Trondheim, NORWAY
  40. Email: Steinar.Haug@delab.sintef.no, 
  41.     sthaug@idt.unit.no, steinar@tosca.er.sintef.no
  42. ----------------------------------------------------------------------
  43. /*
  44.  * @(#)README    2.5 92/04/15
  45.  *
  46.  * Copyright (C) 1991 Paul Kranenburg.
  47.  *
  48.  * Please send comments, enhancements or any other useful ideas to
  49.  * the address at the end of this file.
  50.  *
  51.  */
  52.  
  53. strace(1) is a system call tracer for Sun(tm) systems much like the
  54. Sun supplied program trace(1). strace(1) is a useful utility to sort
  55. of debug programs for which no source is available which unfortunately
  56. includes almost all of the Sun supplied system software.
  57.  
  58. Like trace(1), strace displays each system call and its arguments as it
  59. is invoked by the traced process, but tries to do a better job of
  60. decoding the arguments, displaying them in symbolic format whenever
  61. possible. Passed structures/character arrays are read from the process'
  62. address space and displayed in an appropriate format.
  63.  
  64. It is also possible to instruct strace to trace child processes as
  65. they are created by the fork(2) system call. However, this is slightly
  66. involved for two reasons: 1) the trace flag is cleared in the child
  67. process by the fork system call, so we must make a special effort to
  68. gain control of the child (see NOTES below), 2) our tracing manipulations
  69. of the child may interfere with a possible wait(2) system call executed
  70. by the (also traced) parent process. In this case we don't allow the parent
  71. to continue until one of its children enters a state that may cause the
  72. parent's wait(2) call to return.
  73.  
  74. A version for BSD4.3-and-a-half can be compiled if the ptrace(2) system
  75. call is extended to support syscall tracing (a la Sun). Another extension
  76. PT_INHERIT can be used to trace child processes in a cleaner fashion than is
  77. now possible on SunOS.
  78. A sample set of diffs can be found on `ftp.cs.few.eur.nl' via Anon-FTP.
  79.  
  80.  
  81. NOTES.
  82.  
  83. o    Not all system calls have been implemented yet as described
  84.     above (see dummy.h for a list), these calls only have their args
  85.     displayed as hex numbers.
  86.  
  87. o    The program draws heavily on Sun's extensions to the ptrace(2)
  88.     system call.
  89.  
  90. o    This release is based upon SunOS 4.1.1. The syscall list (syscall.h)
  91.     and ioctl's (ioctlent.m4) are probably most critically dependant
  92.     on the OS version (see also /sys/os/init_sysent.c).
  93.     You may have to edit `ioctlsort.c' and/or `ioctlent.m4' to get
  94.     `ioctlsort.c' to compile with your suite of system header files.
  95.  
  96. o    The way in which child processes are caught and attached to after
  97.     the fork() call is Sparc-specific (in fact it has the looks of a
  98.     terrible hack). Also, this trick won't work with vfork(2).
  99.     Enhancements are sollicited for.
  100.  
  101. o    Dynamically linked executables can be convinced to use the fork(2)
  102.     system call in stead of vfork(2) by modifying their (internal)
  103.     symbol table immediately after such a program is exec'ed. Be
  104.     warned that programs which depend on vfork's peculiar semantics
  105.     may not run as expected. Enable by the `-F' switch.
  106.  
  107.  
  108. INSTALLATION.
  109.  
  110.     Edit the paths in the Makefile to suit your local system.
  111.     Enter the usual make commands (`make debug' to enable the
  112.     compiler `-g' flag).
  113.  
  114.     Not all sites have a complete set of include files, depending
  115.     on the selected software categories at OS install time. The
  116.     makefile tries to detect the presence of the Sunview category,
  117.     if other files are missing you may have to edit `ioctlent.h'.
  118.  
  119.  
  120. COMMENTS TO:
  121.  
  122.     P. Kranenburg
  123.     Department of Computer Science
  124.     Erasmus University Rotterdam
  125.     P.O. Box 1738
  126.     NL-3000 DR Rotterdam
  127.     e-mail: pk@cs.few.eur.nl
  128.