Home  >  Article  >  Backend Development  >  How to use Strace debugging tool_PHP tutorial

How to use Strace debugging tool_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:09:251071browse

strace is a program debugging tool in the Linux environment, used to monitor the system calls used by an application and the system information it receives.
strace is a useful little tool that lets you know what a program is doing in the background by tracing system calls. Strace is a basic debugging tool that is installed by default on most Linux systems; but it is an excellent piece of software even when you are not tracking a problem. It can tell you a lot about how a Linux program works.

Let's start with a simple UNIX command, pwd, and then dig deeper into what the command does in accomplishing its task. Start xterm to create a controlled environment in which to experiment, and enter the following command:

$ pwd

The pwd command displays the current working directory. On my computer, the output was:

/home/bill/

Such a simple function belies the underlying complexity of the command (BTW (For a moment, all computer programs are like this). To really understand the complexity, run the pwd command again using the strace tool:

$ strace pwd

With this command, you can see that, in the display and In the process of enumerating the current working directory, the UNIX computer performs quite a few operations.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/327287.htmlTechArticlestrace is a program debugging tool in the Linux environment, used to monitor the system calls and The system information it receives. strace is a useful little tool, it...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn