• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: | 推荐给好友 上一篇 | 下一篇

利用truss在Solaris下定位问题

发布: 2009-5-22 10:09 | 作者: 不详 | 来源: 测试时代采编 | 查看: 332次 | 进入软件测试论坛讨论

领测软件测试网

-a Show arguments passed to the exec system calls
-e Show environment variables passed to the exec system calls
-f Show forked processes
(they will have a different pid: in column 1)
-rall Show all read data (default is 32 bytes)
-wall Show all written data (default is 32 bytes)
-p Hook to an existing process (must be owner or root)

Specify a program to run

Truss examples

# truss -rall -wall -f -p
# truss -rall -wall lsnrctl start
# truss -aef lsnrctl dbsnmp_start

A Running Example (using the date command)

# truss -d date

Base time stamp: 1066157908.5731 [ Tue Oct 14 14:58:28 EDT 2003 ]
0.0000 execve(”/usr/bin/date”, 0xFFBEF29C, 0xFFBEF2A4) argc = 1
0.0449 mmap(0×00000000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC,MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFF3A0000
0.0453 resolvepath(”/usr/lib/ld.so.1″, “/usr/lib/ld.so.1″, 1023) = 16
0.0457 open(”/var/ld/ld.config”, O_RDONLY) Err#2 ENOENT
0.0460 open(”/usr/lib/libc.so.1″, O_RDONLY) = 3
0.0463 fstat(3, 0xFFBEE9C4) = 0
0.0464 mmap(0×00000000, 8192, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xFF390000
0.0466 mmap(0×00000000, 794624, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xFF280000
0.0470 mmap(0xFF33A000, 24652, PROT_READ|PROT_WRITE|PROT_EXEC,MAP_PRIVATE|MAP_FIXED, 3, 696320) = 0xFF33A000
0.0474 munmap(0xFF32A000, 65536) = 0
0.0479 memcntl(0xFF280000, 113332, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
0.0481 close(3) = 0
0.0483 open(”/usr/lib/libdl.so.1″, O_RDONLY) = 3
0.0485 fstat(3, 0xFFBEE9C4) = 0
0.0487 mmap(0xFF390000, 8192, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED,3, 0) = 0xFF390000
0.0490 close(3) = 0
0.0493 open(”/usr/platform/SUNW,Ultra-5_10/lib/libc_psr.so.1″, O_RDONLY) = 3
0.0496 fstat(3, 0xFFBEE854) = 0
0.0497 mmap(0×00000000, 8192, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xFF380000
0.0500 mmap(0×00000000, 16384, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xFF370000
0.0502 close(3) = 0
0.0514 munmap(0xFF380000, 8192) = 0
0.0521 brk(0×00022420) = 0
0.0523 brk(0×00024420) = 0
0.0526 time() = 1066157908
0.0531 open(”/usr/share/lib/zoneinfo/US/Eastern”, O_RDONLY) = 3
0.0533 read(3, ” T Z i f\0\0\0\0\0\0\0\0″.., 8192) = 1250
0.0536 close(3) = 0
0.0542 ioctl(1, TCGETA, 0xFFBEEFDC) = 0
Tue Oct 14 14:58:28 EDT 2003
0.0545 write(1, ” T u e O c t 1 4 1″.., 29) = 29
0.0547 llseek(0, 0, SEEK_CUR) = 1829
0.0549 _exit(0)

NOTE: The “truss” command works on SUN and Sequent. Use “strace” on Linux. If your operating system doesn’t support the truss and strace commands, call your system administrator to find the equivalent command on your system.

Monitor your Unix system:

Unix message files record all system problems like disk errors, swap errors, NFS problems, etc. Monitor the following files on your system to detect system problems:

# tail -f /var/adm/SYSLOG
# tail -f /var/adm/messages
# tail -f /var/log/syslog


文章来源于领测软件测试网 https://www.ltesting.net/

44/4<1234

关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备10010545号-5
技术支持和业务联系:info@testage.com.cn 电话:010-51297073

软件测试 | 领测国际ISTQBISTQB官网TMMiTMMi认证国际软件测试工程师认证领测软件测试网