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

  • Go Systems Programming
  • Mihalis Tsoukalos
  • 157字
  • 2021-07-02 18:08:03

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.

主站蜘蛛池模板: 灵璧县| 沐川县| 高雄市| 神农架林区| 阳曲县| 方正县| 泰顺县| 景东| 蕲春县| 和林格尔县| 泽库县| 凤阳县| 吉木乃县| 南溪县| 逊克县| 揭阳市| 尚志市| 黄骅市| 高阳县| 苍溪县| 简阳市| 甘孜| 板桥市| 万宁市| 陆河县| 商南县| 东辽县| 舒城县| 温宿县| 灵石县| 洞头县| 京山县| 长沙县| 周至县| 康保县| 丰城市| 筠连县| 龙游县| 布尔津县| 武平县| 吕梁市|