此内容没有您所选择的语言版本。
1.4. Sample SystemTap scripts
Following are some example scripts that illustrate the basic operation of SystemTap. For more examples, see the examples/small_demos/ directory in the source directory, the SystemTap wiki at http://sourceware.org/systemtap/wiki/HomePage, or the SystemTap War Stories at http://sourceware.org/systemtap/wiki/WarStories page.
1.4.1. Basic SystemTap syntax and control structures 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
The following code examples demonstrate SystemTap syntax and control structures.
This prints:
Note that all variable types are inferred, and that all locals and globals are initialized.
1.4.2. Primes between 0 and 49 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
This prints:
1.4.3. Recursive functions 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
This prints:
11th fibonacci number: 118
11th fibonacci number: 118
Any larger number input to the function may exceed the MAXACTION or MAXNESTING limits, which will be caught at run time and result in an error. For more about limits see Section Section 1.6, “Safety and security”.