[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[],[],null,["# Tracing system calls\n\nThis page describes using system call tracing to diagnose container sandbox\nlimitations, and assumes that you have some familiarity with system call tracing,\nusing tools such as [`strace`](https://en.wikipedia.org/wiki/Strace) or\n`dtruss`. If you are not familiar with system call tracing, you should proceed\nonly after you contact Google Cloud support with the details of your problem\nand have been invited to trace the system calls by the Google Cloud support team.\n\nThe container sandbox does not support all of the system calls that are\nsupported in Linux. You can use system call tracing tools such as `strace`\n(Linux) or `dtruss` (macOS) to examine the syscalls made by your application, to\nhelp determine the syscalls that are not supported by the sandbox.\n\nUsing `strace` (Linux)\n----------------------\n\nIf you're running your code on Linux, install and enable `strace`: \n\n```bash\nsudo apt-get install strace\n```\n\nRun your application with strace by prefacing your usual invocation with\n`strace -f` where `-f` means to trace all child threads. For example, if you\nnormally invoke your application with `./main`, you can run it with strace by\ninvoking `/usr/bin/strace -f ./main`.\n\n### Viewing the logs returned by strace\n\nThe system logs from strace look like this:\n\nUsing `dtruss` (macOS)\n----------------------\n\nIf you're running your code on macOS, use `dtrusss` by prefacing your usual\ninvocation with `dtruss -a` from the command line, for example: \n\n```bash\nsudo dtruss -a ./main\n```\n\nFor documentation, use the command `man dtruss`, or visit one of the\n[`dtrace/drusss` websites](http://www.brendangregg.com/DTrace/dtruss_example.txt)."]]