官术网_书友最值得收藏!

Analysing software

There are times that a program fails for some unknown reason or does not perform well, and you want to find out why without having to rewrite your code and add a plethora of debugging statements. So, this section will talk about strace(1) and dtrace(1) , which allow you to see what is going on behind the scenes when you execute a program on a Unix machine. Although both tools can work with the go run command, you will get less unrelated output if you first create an executable file using go build and use this file. This mainly occurs because go run makes temporary files before actually running your Go code, and you want to debug the actual program, not the compiler used to build the program.

Remember that although dtrace(1) is more powerful than strace(1) and has its own programming language, strace(1) is more versatile for watching the system calls a program makes.

主站蜘蛛池模板: 江北区| 涞源县| 临高县| 涡阳县| 湟源县| 新昌县| 南汇区| 明光市| 平谷区| 当阳市| 双城市| 杂多县| 廉江市| 苏州市| 深水埗区| 乌兰县| 郸城县| 汪清县| 鹿泉市| 莲花县| 江陵县| 子长县| 浮山县| 宁远县| 香河县| 丽水市| 峨眉山市| 阳原县| 江山市| 汝南县| 新蔡县| 湘阴县| 沽源县| 罗山县| 嘉禾县| 义马市| 普宁市| 汉源县| 托里县| 潞西市| 东乡县|