summaryrefslogtreecommitdiffstats
path: root/SystemTap_Beginners_Guide
diff options
authorjistone <jistone>2014-08-08 23:22:55 +0000
committerjistone <jistone>2014-08-08 23:22:55 +0000
commitee0f63498a58a80413f9edf3dab13ba7049ee37e (patch)
treef63e372afe75a6718c077be48afbcf8899492b5f /SystemTap_Beginners_Guide
parentadded new man pages (diff)
update SystemTap_Beginners_Guide
Diffstat (limited to 'SystemTap_Beginners_Guide')
-rw-r--r--SystemTap_Beginners_Guide/Common_Content/css/brand.css14
-rw-r--r--SystemTap_Beginners_Guide/Common_Content/css/common.css98
-rw-r--r--SystemTap_Beginners_Guide/Common_Content/css/epub.css115
-rw-r--r--SystemTap_Beginners_Guide/Common_Content/css/lang.css2
-rw-r--r--SystemTap_Beginners_Guide/Common_Content/css/overrides.css51
-rw-r--r--SystemTap_Beginners_Guide/Common_Content/images/bkgrnd_greydots.pngbin157 -> 0 bytes
-rw-r--r--SystemTap_Beginners_Guide/Common_Content/images/bullet_arrowblue.pngbin177 -> 0 bytes
-rw-r--r--SystemTap_Beginners_Guide/Common_Content/images/documentation.pngbin623 -> 0 bytes
-rw-r--r--SystemTap_Beginners_Guide/Common_Content/images/logo.pngbin1114 -> 0 bytes
-rw-r--r--SystemTap_Beginners_Guide/Common_Content/images/shade.pngbin101 -> 0 bytes
-rw-r--r--SystemTap_Beginners_Guide/SystemTap_Beginners_Guide-Preface.html23
-rw-r--r--SystemTap_Beginners_Guide/appe-Publican-Revision_History.html3
-rw-r--r--SystemTap_Beginners_Guide/arrayoperators.html13
-rw-r--r--SystemTap_Beginners_Guide/arrayops-aggregates.html31
-rw-r--r--SystemTap_Beginners_Guide/arrayops-conditionals.html17
-rw-r--r--SystemTap_Beginners_Guide/arrayops-deleting.html12
-rw-r--r--SystemTap_Beginners_Guide/arrayops-foreach.html14
-rw-r--r--SystemTap_Beginners_Guide/arrayops-increment.html12
-rw-r--r--SystemTap_Beginners_Guide/arrayops-readvalues.html12
-rw-r--r--SystemTap_Beginners_Guide/associativearrays.html14
-rw-r--r--SystemTap_Beginners_Guide/commandlineargssect.html12
-rw-r--r--SystemTap_Beginners_Guide/cross-compiling.html24
-rw-r--r--SystemTap_Beginners_Guide/errors.html55
-rw-r--r--SystemTap_Beginners_Guide/futexcontentionsect.html14
-rw-r--r--SystemTap_Beginners_Guide/handlerconditionalstatements.html40
-rw-r--r--SystemTap_Beginners_Guide/index.html6
-rw-r--r--SystemTap_Beginners_Guide/inodewatch2sect.html12
-rw-r--r--SystemTap_Beginners_Guide/inodewatchsect.html20
-rw-r--r--SystemTap_Beginners_Guide/intro-systemtap-limitations.html7
-rw-r--r--SystemTap_Beginners_Guide/intro-systemtap-vs-others.html3
-rw-r--r--SystemTap_Beginners_Guide/introduction.html6
-rw-r--r--SystemTap_Beginners_Guide/ioblktimesect.html10
-rw-r--r--SystemTap_Beginners_Guide/iotimesect.html12
-rw-r--r--SystemTap_Beginners_Guide/ix01.html3
-rw-r--r--SystemTap_Beginners_Guide/mainsect-disk.html17
-rw-r--r--SystemTap_Beginners_Guide/mainsect-profiling.html17
-rw-r--r--SystemTap_Beginners_Guide/paracallgraph.html16
-rw-r--r--SystemTap_Beginners_Guide/pr01s02.html3
-rw-r--r--SystemTap_Beginners_Guide/references.html3
-rw-r--r--SystemTap_Beginners_Guide/runtimeerror.html31
-rw-r--r--SystemTap_Beginners_Guide/scriptconstructions.html13
-rw-r--r--SystemTap_Beginners_Guide/scripts.html83
-rw-r--r--SystemTap_Beginners_Guide/syscallsbyprocpidsect.html16
-rw-r--r--SystemTap_Beginners_Guide/systemtapscript-handler.html65
-rw-r--r--SystemTap_Beginners_Guide/targetavailable.html8
-rw-r--r--SystemTap_Beginners_Guide/targetvariables.html34
-rw-r--r--SystemTap_Beginners_Guide/threadtimessect.html12
-rw-r--r--SystemTap_Beginners_Guide/timeoutssect.html10
-rw-r--r--SystemTap_Beginners_Guide/topsyssect.html10
-rw-r--r--SystemTap_Beginners_Guide/traceio2sect.html18
-rw-r--r--SystemTap_Beginners_Guide/traceiosect.html12
-rw-r--r--SystemTap_Beginners_Guide/typecasting.html8
-rw-r--r--SystemTap_Beginners_Guide/understanding-how-systemtap-works.html13
-rw-r--r--SystemTap_Beginners_Guide/understanding-tapsets.html3
-rw-r--r--SystemTap_Beginners_Guide/useful-systemtap-scripts.html54
-rw-r--r--SystemTap_Beginners_Guide/userspace-probing.html18
-rw-r--r--SystemTap_Beginners_Guide/using-systemtap.html25
-rw-r--r--SystemTap_Beginners_Guide/using-usage.html42
-rw-r--r--SystemTap_Beginners_Guide/ustack.html5
-rw-r--r--SystemTap_Beginners_Guide/utargetvariable.html27
60 files changed, 731 insertions, 487 deletions
diff --git a/SystemTap_Beginners_Guide/Common_Content/css/brand.css b/SystemTap_Beginners_Guide/Common_Content/css/brand.css
new file mode 100644
index 00000000..d86cba93
--- /dev/null
+++ b/SystemTap_Beginners_Guide/Common_Content/css/brand.css
@@ -0,0 +1,14 @@
1/*headings*/
2h1, h2, h3, h4, h5, h6,
3div.producttitle,
4div.subtitle,
5div.author div.author,
6div.translator div.translator,
7div.othercredit div.othercredit,
8div.editor div.editor,
9div.contrib div.contrib,
10.title,
11.titlepage .edition,
12.titlepage .releaseinfo {
13 color: #336699;
14}
diff --git a/SystemTap_Beginners_Guide/Common_Content/css/common.css b/SystemTap_Beginners_Guide/Common_Content/css/common.css
index 5af9649c..434c5b87 100644
--- a/SystemTap_Beginners_Guide/Common_Content/css/common.css
+++ b/SystemTap_Beginners_Guide/Common_Content/css/common.css
@@ -107,7 +107,7 @@ div.section {
107 107
108p, div.para { 108p, div.para {
109 padding-top: 0px; 109 padding-top: 0px;
110 margin-top: 0.3em; 110 margin-top: 1em;
111 padding-bottom: 0px; 111 padding-bottom: 0px;
112 margin-bottom: 1em; 112 margin-bottom: 1em;
113} 113}
@@ -294,6 +294,9 @@ h6 {
294 294
295.section > div > div > div > h2.title { 295.section > div > div > div > h2.title {
296 font-size: 21px; 296 font-size: 21px;
297 page-break-inside: avoid;
298 page-break-before: avoid;
299 page-break-after: avoid;
297} 300}
298 301
299.section > div > div > div > h3.title { 302.section > div > div > div > h3.title {
@@ -639,42 +642,33 @@ div.authorgroup.contrib {
639 642
640/*Lists*/ 643/*Lists*/
641ul { 644ul {
642 padding-left:1.6em; 645 list-style-image: url("../images/dot.png");
643 list-style-image:url(../images/dot.png); 646 list-style-type: circle;
644 list-style-type: circle; 647 padding-left: 1.6em;
645} 648}
646 649
647ul ul { 650ul ul {
648 list-style-image:url(../images/dot2.png); 651 list-style-image: url("../images/dot2.png");
649 list-style-type: circle; 652 list-style-type: circle;
650} 653}
651 654
652ol { 655ol.1 {
653 list-style-image:none;
654 list-style-type: decimal; 656 list-style-type: decimal;
655} 657}
656 658
659ol.a,
657ol ol { 660ol ol {
658 list-style-type: lower-alpha; 661 list-style-type: lower-alpha;
659} 662}
660 663
661ol.arabic { 664ol.i {
662 list-style-type: decimal;
663}
664
665ol.loweralpha {
666 list-style-type: lower-alpha;
667}
668
669ol.lowerroman {
670 list-style-type: lower-roman; 665 list-style-type: lower-roman;
671} 666}
672 667ol.A {
673ol.upperalpha {
674 list-style-type: upper-alpha; 668 list-style-type: upper-alpha;
675} 669}
676 670
677ol.upperroman { 671ol.I {
678 list-style-type: upper-roman; 672 list-style-type: upper-roman;
679} 673}
680 674
@@ -688,7 +682,6 @@ dd {
688 margin:0px; 682 margin:0px;
689 margin-left:2em; 683 margin-left:2em;
690 padding-top:0px; 684 padding-top:0px;
691 padding-bottom: 1em;
692} 685}
693 686
694li { 687li {
@@ -698,13 +691,6 @@ li {
698/* margin-bottom: 16px; */ 691/* margin-bottom: 16px; */
699} 692}
700 693
701li p, li div.para {
702 padding-top:0px;
703 margin-top:0px;
704 padding-bottom:0px;
705 margin-bottom:0.3em;
706}
707
708/*images*/ 694/*images*/
709img { 695img {
710 display:block; 696 display:block;
@@ -720,15 +706,19 @@ img {
720 overflow: hidden; 706 overflow: hidden;
721} 707}
722 708
709.figure {
710 margin-top: 1em;
711 width: 100%;
712}
713
723.figure img, 714.figure img,
724.mediaobject img { 715.mediaobject img {
725 display:block; 716 display:block;
726 margin:0; 717 margin: 0em;
727 page-break-inside: avoid; 718 page-break-inside: avoid;
728} 719}
729 720
730.figure .title { 721.figure .title {
731 margin:0px;
732 margin-bottom:2em; 722 margin-bottom:2em;
733 padding:0px; 723 padding:0px;
734} 724}
@@ -809,7 +799,6 @@ div.title {
809} 799}
810 800
811.replaceable { 801.replaceable {
812 font-family:"liberation mono", "bitstream vera mono", "dejavu mono", monospace;
813 font-style: italic; 802 font-style: italic;
814} 803}
815 804
@@ -932,6 +921,7 @@ div.admonition_header p {
932} 921}
933 922
934div.admonition_header { 923div.admonition_header {
924 background-origin:content-box;
935 clear: both; 925 clear: both;
936 margin: 0px; 926 margin: 0px;
937 padding: 0px; 927 padding: 0px;
@@ -944,21 +934,30 @@ div.admonition_header {
944div.warning div.admonition_header { 934div.warning div.admonition_header {
945 background: url(../images/red.png) top left repeat-x; 935 background: url(../images/red.png) top left repeat-x;
946 background-color: #590000; 936 background-color: #590000;
937 background: -webkit-linear-gradient(#a40000,#590000);
938 background: linear-gradient(#a40000,#590000);
947} 939}
948 940
949div.note div.admonition_header { 941div.note div.admonition_header {
950 background: url(../images/green.png) top right repeat-x; 942 background: url(../images/green.png) top right repeat-x;
951 background-color: #597800; 943 background-color: #597800;
944 background: -webkit-linear-gradient(#769f00,#597800);
945 background: linear-gradient(#769f00,#597800);
952} 946}
953 947
954div.important div.admonition_header { 948div.important div.admonition_header {
955 background: url(../images/yellow.png) top right repeat-x; 949 background: url(../images/yellow.png) top right repeat-x;
956 background-color: #a6710f; 950 background-color: #a6710f;
951 background: -webkit-linear-gradient(#d08e13,#a6710f);
952 background: linear-gradient(#d08e13,#a6710f);
957} 953}
958 954
959div.warning p, div.warning div.para, 955div.warning p:first-child,
960div.note p, div.note div.para, 956div.warning div.para:first-child,
961div.important p, div.important div.para { 957div.note p:first-child,
958div.note div.para:first-child,
959div.important p:first-child,
960div.important div.para:first-child {
962 padding: 0px; 961 padding: 0px;
963 margin: 0px; 962 margin: 0px;
964} 963}
@@ -1012,7 +1011,7 @@ div.admonition {
1012 1011
1013/*Table*/ 1012/*Table*/
1014div.table { 1013div.table {
1015 page-break-inside: avoid; 1014/* page-break-inside: avoid; */
1016} 1015}
1017 1016
1018table { 1017table {
@@ -1319,7 +1318,7 @@ div.chapter {
1319} 1318}
1320 1319
1321 1320
1322div.titlepage { 1321div.titlepage, div.titlepage > div, div.titlepage > div > div {
1323 page-break-inside: avoid; 1322 page-break-inside: avoid;
1324 page-break-after: avoid; 1323 page-break-after: avoid;
1325} 1324}
@@ -1639,7 +1638,7 @@ pre {
1639 -moz-border-radius:11px; 1638 -moz-border-radius:11px;
1640 -webkit-border-radius:11px; 1639 -webkit-border-radius:11px;
1641 border-radius: 11px; 1640 border-radius: 11px;
1642 page-break-inside: avoid; 1641/* page-break-inside: avoid; */
1643} 1642}
1644 1643
1645.example { 1644.example {
@@ -1649,11 +1648,18 @@ pre {
1649 page-break-inside: avoid; 1648 page-break-inside: avoid;
1650} 1649}
1651 1650
1651/* move these invisible fields out of the flow */
1652.example > a:first-child,
1653.table > a:first-child {
1654 float: left;
1655}
1656
1652.package, .citetitle { 1657.package, .citetitle {
1653 font-style: italic; 1658 font-style: italic;
1654} 1659}
1655 1660
1656.titlepage .edition { 1661.titlepage .edition,
1662.titlepage .releaseinfo {
1657 color: #336699; 1663 color: #336699;
1658 background-color: transparent; 1664 background-color: transparent;
1659 margin-top: 1em; 1665 margin-top: 1em;
@@ -1679,6 +1685,8 @@ span.remark {
1679 1685
1680dt { 1686dt {
1681 clear:both; 1687 clear:both;
1688 page-break-inside: avoid;
1689 page-break-after: avoid;
1682} 1690}
1683 1691
1684dt img { 1692dt img {
@@ -1747,3 +1755,17 @@ li.step > a:first-child {
1747} 1755}
1748 1756
1749 1757
1758.added {
1759 background-color: #99ff99;
1760}
1761
1762.changed {
1763 background-color: #ffff77;
1764}
1765
1766.deleted {
1767 background-color: #ff4455;
1768 text-decoration: line-through;
1769}
1770
1771
diff --git a/SystemTap_Beginners_Guide/Common_Content/css/epub.css b/SystemTap_Beginners_Guide/Common_Content/css/epub.css
new file mode 100644
index 00000000..b0ffd43c
--- /dev/null
+++ b/SystemTap_Beginners_Guide/Common_Content/css/epub.css
@@ -0,0 +1,115 @@
1/*headings*/
2h1, h2, h3, h4, h5, h6,
3div.producttitle,
4div.subtitle,
5div.author div.author,
6div.translator div.translator,
7div.othercredit div.othercredit,
8div.editor div.editor,
9div.contrib div.contrib,
10.title,
11.titlepage .edition {
12}
13
14div.para {
15 margin-top: 1em;
16}
17/* inline syntax highlighting */
18.perl_Alert {
19 color: #0000ff;
20}
21
22.perl_BaseN {
23 color: #007f00;
24}
25
26.perl_BString {
27 color: #5C3566;
28}
29
30.perl_Char {
31 color: #ff00ff;
32}
33
34.perl_Comment {
35 color: #888888;
36}
37
38
39.perl_DataType {
40 color: #0000ff;
41}
42
43
44.perl_DecVal {
45 color: #00007f;
46}
47
48
49.perl_Error {
50 color: #ff0000;
51}
52
53
54.perl_Float {
55 color: #00007f;
56}
57
58
59.perl_Function {
60 color: #007f00;
61}
62
63
64.perl_IString {
65 color: #5C3566;
66}
67
68
69.perl_Keyword {
70 color: #002F5D;
71}
72
73
74.perl_Operator {
75 color: #ffa500;
76}
77
78
79.perl_Others {
80 color: #b03060;
81}
82
83
84.perl_RegionMarker {
85 color: #96b9ff;
86}
87
88
89.perl_Reserved {
90 color: #9b30ff;
91}
92
93
94.perl_String {
95 color: #5C3566;
96}
97
98
99.perl_Variable {
100 color: #0000ff;
101}
102
103
104.perl_Warning {
105 color: #0000ff;
106}
107
108b, strong {
109 font-weight: bolder;
110}
111
112code.command {
113 font-family: monospace;
114 font-weight: bolder;
115}
diff --git a/SystemTap_Beginners_Guide/Common_Content/css/lang.css b/SystemTap_Beginners_Guide/Common_Content/css/lang.css
deleted file mode 100644
index 81c31156..00000000
--- a/SystemTap_Beginners_Guide/Common_Content/css/lang.css
+++ /dev/null
@@ -1,2 +0,0 @@
1/* place holder */
2
diff --git a/SystemTap_Beginners_Guide/Common_Content/css/overrides.css b/SystemTap_Beginners_Guide/Common_Content/css/overrides.css
deleted file mode 100644
index 057be297..00000000
--- a/SystemTap_Beginners_Guide/Common_Content/css/overrides.css
+++ /dev/null
@@ -1,51 +0,0 @@
1a:link {
2 color:#0066cc;
3}
4
5a:hover, a:active {
6 color:#003366;
7}
8
9a:visited {
10 color:#6699cc;
11}
12
13
14h1 {
15 color:#3c6eb4
16}
17
18.producttitle {
19 background: #3c6eb4 url(../images/h1-bg.png) top left repeat;
20}
21
22.section h1.title {
23 color:#3c6eb4;
24}
25
26
27h2,h3,h4,h5,h6 {
28 color:#3c6eb4;
29}
30
31table {
32 border:1px solid #3c6eb4;
33}
34
35table th {
36 background-color:#3c6eb4;
37}
38
39
40table tr.even td {
41 background-color:#f5f5f5;
42}
43
44.revhistory table th {
45 color:#3c6eb4;
46}
47
48.titlepage .edition {
49 color: #3c6eb4;
50}
51
diff --git a/SystemTap_Beginners_Guide/Common_Content/images/bkgrnd_greydots.png b/SystemTap_Beginners_Guide/Common_Content/images/bkgrnd_greydots.png
deleted file mode 100644
index 2333a6db..00000000
--- a/SystemTap_Beginners_Guide/Common_Content/images/bkgrnd_greydots.png
+++ /dev/null
Binary files differ
diff --git a/SystemTap_Beginners_Guide/Common_Content/images/bullet_arrowblue.png b/SystemTap_Beginners_Guide/Common_Content/images/bullet_arrowblue.png
deleted file mode 100644
index c2355345..00000000
--- a/SystemTap_Beginners_Guide/Common_Content/images/bullet_arrowblue.png
+++ /dev/null
Binary files differ
diff --git a/SystemTap_Beginners_Guide/Common_Content/images/documentation.png b/SystemTap_Beginners_Guide/Common_Content/images/documentation.png
deleted file mode 100644
index 79d0a804..00000000
--- a/SystemTap_Beginners_Guide/Common_Content/images/documentation.png
+++ /dev/null
Binary files differ
diff --git a/SystemTap_Beginners_Guide/Common_Content/images/logo.png b/SystemTap_Beginners_Guide/Common_Content/images/logo.png
deleted file mode 100644
index 66a3104e..00000000
--- a/SystemTap_Beginners_Guide/Common_Content/images/logo.png
+++ /dev/null
Binary files differ
diff --git a/SystemTap_Beginners_Guide/Common_Content/images/shade.png b/SystemTap_Beginners_Guide/Common_Content/images/shade.png
deleted file mode 100644
index a73afdf6..00000000
--- a/SystemTap_Beginners_Guide/Common_Content/images/shade.png
+++ /dev/null
Binary files differ
diff --git a/SystemTap_Beginners_Guide/SystemTap_Beginners_Guide-Preface.html b/SystemTap_Beginners_Guide/SystemTap_Beginners_Guide-Preface.html
index c16c71d3..65d4623e 100644
--- a/SystemTap_Beginners_Guide/SystemTap_Beginners_Guide-Preface.html
+++ b/SystemTap_Beginners_Guide/SystemTap_Beginners_Guide-Preface.html
@@ -1,11 +1,14 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">Preface</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="index.html" title="SystemTap Beginners Guide" /><link rel="prev" href="index.html" title="SystemTap Beginners Guide" /><link rel="next" href="pr01s02.html" title="2. We Need Feedback!" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="index.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="pr01s02.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="preface" lang="en-US"><div class="titlepage"><div><div><h1 class="title"><a id="SystemTap_Beginners_Guide-Preface"></a>Preface</h1></div></div></div><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">Preface</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="index.html" title="SystemTap Beginners Guide" /><link rel="prev" href="index.html" title="SystemTap Beginners Guide" /><link rel="next" href="pr01s02.html" title="2. We Need Feedback!" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="index.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="pr01s02.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="preface" lang="en-US"><div class="titlepage"><div><div><h1 class="title"><a id="SystemTap_Beginners_Guide-Preface">
3 ⁠</a>Preface</h1></div></div></div><div class="para">
3 4
4 </div><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h2 class="title"><a id="idm47951421478384"></a>1. Document Conventions</h2></div></div></div><div class="para"> 5 </div><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h2 class="title"><a id="idm214012261552">
6 ⁠</a>1. Document Conventions</h2></div></div></div><div class="para">
5 This manual uses several conventions to highlight certain words and phrases and draw attention to specific pieces of information. 7 This manual uses several conventions to highlight certain words and phrases and draw attention to specific pieces of information.
6 </div><div class="para"> 8 </div><div class="para">
7 In PDF and paper editions, this manual uses typefaces drawn from the <a href="https://fedorahosted.org/liberation-fonts/">Liberation Fonts</a> set. The Liberation Fonts set is also used in HTML editions if the set is installed on your system. If not, alternative but equivalent typefaces are displayed. Note: Red Hat Enterprise Linux 5 and later include the Liberation Fonts set by default. 9 In PDF and paper editions, this manual uses typefaces drawn from the <a href="https://fedorahosted.org/liberation-fonts/">Liberation Fonts</a> set. The Liberation Fonts set is also used in HTML editions if the set is installed on your system. If not, alternative but equivalent typefaces are displayed. Note: Red Hat Enterprise Linux 5 and later include the Liberation Fonts set by default.
8 </div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="idm47951421509056"></a>1.1. Typographic Conventions</h3></div></div></div><div class="para"> 10 </div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="idm213971251520">
11 ⁠</a>1.1. Typographic Conventions</h3></div></div></div><div class="para">
9 Four typographic conventions are used to call attention to specific words and phrases. These conventions, and the circumstances they apply to, are as follows. 12 Four typographic conventions are used to call attention to specific words and phrases. These conventions, and the circumstances they apply to, are as follows.
10 </div><div class="para"> 13 </div><div class="para">
11 <code class="literal">Mono-spaced Bold</code> 14 <code class="literal">Mono-spaced Bold</code>
@@ -38,22 +41,23 @@
38 </div></blockquote></div><div class="para"> 41 </div></blockquote></div><div class="para">
39 The above text includes application names; system-wide menu names and items; application-specific menu names; and buttons and text found within a GUI interface, all presented in proportional bold and all distinguishable by context. 42 The above text includes application names; system-wide menu names and items; application-specific menu names; and buttons and text found within a GUI interface, all presented in proportional bold and all distinguishable by context.
40 </div><div class="para"> 43 </div><div class="para">
41 <code class="command"><em class="replaceable"><code>Mono-spaced Bold Italic</code></em></code> or <span class="application"><strong><em class="replaceable"><code>Proportional Bold Italic</code></em></strong></span> 44 <code class="command"><em class="replaceable">Mono-spaced Bold Italic</em></code> or <span class="application"><strong><em class="replaceable">Proportional Bold Italic</em></strong></span>
42 </div><div class="para"> 45 </div><div class="para">
43 Whether mono-spaced bold or proportional bold, the addition of italics indicates replaceable or variable text. Italics denotes text you do not input literally or displayed text that changes depending on circumstance. For example: 46 Whether mono-spaced bold or proportional bold, the addition of italics indicates replaceable or variable text. Italics denotes text you do not input literally or displayed text that changes depending on circumstance. For example:
44 </div><div class="blockquote"><blockquote class="blockquote"><div class="para"> 47 </div><div class="blockquote"><blockquote class="blockquote"><div class="para">
45 To connect to a remote machine using ssh, type <code class="command">ssh <em class="replaceable"><code>username</code></em>@<em class="replaceable"><code>domain.name</code></em></code> at a shell prompt. If the remote machine is <code class="filename">example.com</code> and your username on that machine is john, type <code class="command">ssh john@example.com</code>. 48 To connect to a remote machine using ssh, type <code class="command">ssh <em class="replaceable">username</em>@<em class="replaceable">domain.name</em></code> at a shell prompt. If the remote machine is <code class="filename">example.com</code> and your username on that machine is john, type <code class="command">ssh john@example.com</code>.
46 </div><div class="para"> 49 </div><div class="para">
47 The <code class="command">mount -o remount <em class="replaceable"><code>file-system</code></em></code> command remounts the named file system. For example, to remount the <code class="filename">/home</code> file system, the command is <code class="command">mount -o remount /home</code>. 50 The <code class="command">mount -o remount <em class="replaceable">file-system</em></code> command remounts the named file system. For example, to remount the <code class="filename">/home</code> file system, the command is <code class="command">mount -o remount /home</code>.
48 </div><div class="para"> 51 </div><div class="para">
49 To see the version of a currently installed package, use the <code class="command">rpm -q <em class="replaceable"><code>package</code></em></code> command. It will return a result as follows: <code class="command"><em class="replaceable"><code>package-version-release</code></em></code>. 52 To see the version of a currently installed package, use the <code class="command">rpm -q <em class="replaceable">package</em></code> command. It will return a result as follows: <code class="command"><em class="replaceable">package-version-release</em></code>.
50 </div></blockquote></div><div class="para"> 53 </div></blockquote></div><div class="para">
51 Note the words in bold italics above: username, domain.name, file-system, package, version and release. Each word is a placeholder, either for text you enter when issuing a command or for text displayed by the system. 54 Note the words in bold italics above: username, domain.name, file-system, package, version and release. Each word is a placeholder, either for text you enter when issuing a command or for text displayed by the system.
52 </div><div class="para"> 55 </div><div class="para">
53 Aside from standard usage for presenting the title of a work, italics denotes the first use of a new and important term. For example: 56 Aside from standard usage for presenting the title of a work, italics denotes the first use of a new and important term. For example:
54 </div><div class="blockquote"><blockquote class="blockquote"><div class="para"> 57 </div><div class="blockquote"><blockquote class="blockquote"><div class="para">
55 Publican is a <em class="firstterm">DocBook</em> publishing system. 58 Publican is a <em class="firstterm">DocBook</em> publishing system.
56 </div></blockquote></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="idm47951476167024"></a>1.2. Pull-quote Conventions</h3></div></div></div><div class="para"> 59 </div></blockquote></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="idm214026482192">
60 ⁠</a>1.2. Pull-quote Conventions</h3></div></div></div><div class="para">
57 Terminal output and source code listings are set off visually from the surrounding text. 61 Terminal output and source code listings are set off visually from the surrounding text.
58 </div><div class="para"> 62 </div><div class="para">
59 Output sent to a terminal is set in <code class="computeroutput">mono-spaced roman</code> and presented thus: 63 Output sent to a terminal is set in <code class="computeroutput">mono-spaced roman</code> and presented thus:
@@ -78,7 +82,8 @@ books_tests Desktop1 downloads images notes scripts svgs</pre><div cla
78 82
79 System.<span class="perl_Function">out</span>.<span class="perl_Function">println</span>(<span class="perl_String">"Echo.echo('Hello') = "</span> + echo.<span class="perl_Function">echo</span>(<span class="perl_String">"Hello"</span>)); 83 System.<span class="perl_Function">out</span>.<span class="perl_Function">println</span>(<span class="perl_String">"Echo.echo('Hello') = "</span> + echo.<span class="perl_Function">echo</span>(<span class="perl_String">"Hello"</span>));
80 } 84 }
81}</pre></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="idm47951418913856"></a>1.3. Notes and Warnings</h3></div></div></div><div class="para"> 85}</pre></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="idm213975281520">
86 ⁠</a>1.3. Notes and Warnings</h3></div></div></div><div class="para">
82 Finally, we use three visual styles to draw attention to information that might otherwise be overlooked. 87 Finally, we use three visual styles to draw attention to information that might otherwise be overlooked.
83 </div><div xmlns:d="http://docbook.org/ns/docbook" class="note"><div class="admonition_header"><p><strong>Note</strong></p></div><div class="admonition"><div class="para"> 88 </div><div xmlns:d="http://docbook.org/ns/docbook" class="note"><div class="admonition_header"><p><strong>Note</strong></p></div><div class="admonition"><div class="para">
84 Notes are tips, shortcuts or alternative approaches to the task at hand. Ignoring a note should have no negative consequences, but you might miss out on a trick that makes your life easier. 89 Notes are tips, shortcuts or alternative approaches to the task at hand. Ignoring a note should have no negative consequences, but you might miss out on a trick that makes your life easier.
diff --git a/SystemTap_Beginners_Guide/appe-Publican-Revision_History.html b/SystemTap_Beginners_Guide/appe-Publican-Revision_History.html
index 11f69e2a..095645ad 100644
--- a/SystemTap_Beginners_Guide/appe-Publican-Revision_History.html
+++ b/SystemTap_Beginners_Guide/appe-Publican-Revision_History.html
@@ -1,5 +1,6 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">Appendix A. Revision History</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="index.html" title="SystemTap Beginners Guide" /><link rel="prev" href="references.html" title="Chapter 7. References" /><link rel="next" href="ix01.html" title="Index" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="references.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="ix01.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="appendix" lang="en-US"><div class="titlepage"><div><div><h1 class="title"><a id="appe-Publican-Revision_History"></a>Appendix A. Revision History</h1></div></div></div><div xmlns:d="http://docbook.org/ns/docbook" class="para"><p></p> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">Appendix A. Revision History</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="index.html" title="SystemTap Beginners Guide" /><link rel="prev" href="references.html" title="Chapter 7. References" /><link rel="next" href="ix01.html" title="Index" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="references.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="ix01.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="appendix" lang="en-US"><div class="titlepage"><div><div><h1 class="title"><a id="appe-Publican-Revision_History">
3 ⁠</a>Appendix A. Revision History</h1></div></div></div><div xmlns:d="http://docbook.org/ns/docbook" class="para"><p></p>
3 <div class="revhistory"><table summary="Revision History"><tr><th align="left" valign="top" colspan="3"><strong>Revision History</strong></th></tr><tr><td align="left">Revision 2.0-1</td><td align="left">Mon Jul 20 2009</td><td align="left"><span class="author"><span class="firstname">Don</span> <span class="surname">Domingo</span></span></td></tr><tr><td align="left" colspan="3"> 4 <div class="revhistory"><table summary="Revision History"><tr><th align="left" valign="top" colspan="3"><strong>Revision History</strong></th></tr><tr><td align="left">Revision 2.0-1</td><td align="left">Mon Jul 20 2009</td><td align="left"><span class="author"><span class="firstname">Don</span> <span class="surname">Domingo</span></span></td></tr><tr><td align="left" colspan="3">
4 <table border="0" summary="Simple list" class="simplelist"><tr><td>includes 5.4 minor updates and additional script "dropwatch.stp"</td></tr></table> 5 <table border="0" summary="Simple list" class="simplelist"><tr><td>includes 5.4 minor updates and additional script "dropwatch.stp"</td></tr></table>
5 6
diff --git a/SystemTap_Beginners_Guide/arrayoperators.html b/SystemTap_Beginners_Guide/arrayoperators.html
index e4ce6351..1f44174f 100644
--- a/SystemTap_Beginners_Guide/arrayoperators.html
+++ b/SystemTap_Beginners_Guide/arrayoperators.html
@@ -1,11 +1,14 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.5. Array Operations in SystemTap</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="understanding-how-systemtap-works.html" title="Chapter 3. Understanding How SystemTap Works" /><link rel="prev" href="associativearrays.html" title="3.4. Associative Arrays" /><link rel="next" href="arrayops-readvalues.html" title="3.5.2. Reading Values From Arrays" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="associativearrays.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="arrayops-readvalues.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h2 class="title"><a id="arrayoperators"></a>3.5. Array Operations in SystemTap</h2></div></div></div><a id="idm47951457442400" class="indexterm"></a><a id="idm47951457440816" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.5. Array Operations in SystemTap</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="understanding-how-systemtap-works.html" title="Chapter 3. Understanding How SystemTap Works" /><link rel="prev" href="associativearrays.html" title="3.4. Associative Arrays" /><link rel="next" href="arrayops-readvalues.html" title="3.5.2. Reading Values From Arrays" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="associativearrays.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="arrayops-readvalues.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h2 class="title"><a id="arrayoperators">
3 ⁠</a>3.5. Array Operations in SystemTap</h2></div></div></div><a id="idm214015222512" class="indexterm"></a><a id="idm213967472832" class="indexterm"></a><div class="para">
3 This section enumerates some of the most commonly used array operations in SystemTap. 4 This section enumerates some of the most commonly used array operations in SystemTap.
4 </div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="arrayops-assignvalue"></a>3.5.1. Assigning an Associated Value</h3></div></div></div><a id="idm47951460808816" class="indexterm"></a><a id="idm47951457819296" class="indexterm"></a><a id="idm47951457817744" class="indexterm"></a><div class="para"> 5 </div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="arrayops-assignvalue">
6 ⁠</a>3.5.1. Assigning an Associated Value</h3></div></div></div><a id="idm214022245552" class="indexterm"></a><a id="idm214017561440" class="indexterm"></a><a id="idm213967710848" class="indexterm"></a><div class="para">
5 Use <code class="command">=</code> to set an associated value to indexed unique pairs, as in: 7 Use <code class="command">=</code> to set an associated value to indexed unique pairs, as in:
6 </div><pre class="screen"><em class="replaceable"><code>array_name</code></em>[<em class="replaceable"><code>index_expression</code></em>] = <em class="replaceable"><code>value</code></em></pre><div class="para"> 8 </div><pre class="screen"><em class="replaceable">array_name</em>[<em class="replaceable">index_expression</em>] = <em class="replaceable">value</em></pre><div class="para">
7 <a class="xref" href="associativearrays.html#arraysimplestexample">Example 3.13, “Basic Array Statements”</a> shows a very basic example of how to set an explicit associated value to a unique key. You can also use a handler function as both your <code class="command"><em class="replaceable"><code>index_expression</code></em></code> and <code class="command"><em class="replaceable"><code>value</code></em></code>. For example, you can use arrays to set a timestamp as the associated value to a process name (which you wish to use as your unique key), as in: 9 <a class="xref" href="associativearrays.html#arraysimplestexample">Example 3.13, “Basic Array Statements”</a> shows a very basic example of how to set an explicit associated value to a unique key. You can also use a handler function as both your <code class="command"><em class="replaceable">index_expression</em></code> and <code class="command"><em class="replaceable">value</em></code>. For example, you can use arrays to set a timestamp as the associated value to a process name (which you wish to use as your unique key), as in:
8 </div><a id="idm47951466573600" class="indexterm"></a><a id="idm47951460626544" class="indexterm"></a><a id="idm47951466535136" class="indexterm"></a><a id="idm47951466533088" class="indexterm"></a><a id="idm47951422666160" class="indexterm"></a><a id="idm47951421068960" class="indexterm"></a><div class="example"><a id="arrays-timestampprocessname"></a><p class="title"><strong>Example 3.14. Associating Timestamps to Process Names</strong></p><div class="example-contents"><pre class="programlisting">foo[tid()] = gettimeofday_s()</pre></div></div><br class="example-break" /><div class="para"> 10 </div><a id="idm213974750096" class="indexterm"></a><a id="idm214007419616" class="indexterm"></a><a id="idm213972681872" class="indexterm"></a><a id="idm214026634592" class="indexterm"></a><a id="idm214018860096" class="indexterm"></a><a id="idm214007078240" class="indexterm"></a><div class="example"><a id="arrays-timestampprocessname">
11 ⁠</a><p class="title"><strong>Example 3.14. Associating Timestamps to Process Names</strong></p><div class="example-contents"><pre class="programlisting">foo[tid()] = gettimeofday_s()</pre></div></div><div class="para">
9 Whenever an event invokes the statement in <a class="xref" href="arrayoperators.html#arrays-timestampprocessname">Example 3.14, “Associating Timestamps to Process Names”</a>, SystemTap returns the appropriate <code class="command">tid()</code> value (that is, the ID of a thread, which is then used as the unique key). At the same time, SystemTap also uses the function <code class="command">gettimeofday_s()</code> to set the corresponding timestamp as the associated value to the unique key defined by the function <code class="command">tid()</code>. This creates an array composed of key pairs containing thread IDs and timestamps. 12 Whenever an event invokes the statement in <a class="xref" href="arrayoperators.html#arrays-timestampprocessname">Example 3.14, “Associating Timestamps to Process Names”</a>, SystemTap returns the appropriate <code class="command">tid()</code> value (that is, the ID of a thread, which is then used as the unique key). At the same time, SystemTap also uses the function <code class="command">gettimeofday_s()</code> to set the corresponding timestamp as the associated value to the unique key defined by the function <code class="command">tid()</code>. This creates an array composed of key pairs containing thread IDs and timestamps.
10 </div><div class="para"> 13 </div><div class="para">
11 In this same example, if <code class="command">tid()</code> returns a value that is already defined in the array <code class="command">foo</code>, the operator will discard the original associated value to it, and replace it with the current timestamp from <code class="command">gettimeofday_s()</code>. 14 In this same example, if <code class="command">tid()</code> returns a value that is already defined in the array <code class="command">foo</code>, the operator will discard the original associated value to it, and replace it with the current timestamp from <code class="command">gettimeofday_s()</code>.
diff --git a/SystemTap_Beginners_Guide/arrayops-aggregates.html b/SystemTap_Beginners_Guide/arrayops-aggregates.html
index 5b33af39..71ea3e31 100644
--- a/SystemTap_Beginners_Guide/arrayops-aggregates.html
+++ b/SystemTap_Beginners_Guide/arrayops-aggregates.html
@@ -1,31 +1,34 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.5.7. Computing for Statistical Aggregates</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="arrayoperators.html" title="3.5. Array Operations in SystemTap" /><link rel="prev" href="arrayops-conditionals.html" title="3.5.6. Using Arrays in Conditional Statements" /><link rel="next" href="understanding-tapsets.html" title="3.6. Tapsets" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="arrayops-conditionals.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="understanding-tapsets.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="arrayops-aggregates"></a>3.5.7. Computing for Statistical Aggregates</h3></div></div></div><a id="idm47951475136176" class="indexterm"></a><a id="idm47951475134592" class="indexterm"></a><a id="idm47951454929264" class="indexterm"></a><a id="idm47951454927712" class="indexterm"></a><a id="idm47951454926160" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.5.7. Computing for Statistical Aggregates</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="arrayoperators.html" title="3.5. Array Operations in SystemTap" /><link rel="prev" href="arrayops-conditionals.html" title="3.5.6. Using Arrays in Conditional Statements" /><link rel="next" href="understanding-tapsets.html" title="3.6. Tapsets" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="arrayops-conditionals.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="understanding-tapsets.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="arrayops-aggregates">
3 ⁠</a>3.5.7. Computing for Statistical Aggregates</h3></div></div></div><a id="idm214018347504" class="indexterm"></a><a id="idm214018346064" class="indexterm"></a><a id="idm213973123504" class="indexterm"></a><a id="idm213973122096" class="indexterm"></a><a id="idm214020970944" class="indexterm"></a><div class="para">
3 Statistical aggregates are used to collect statistics on numerical values where it is important to accumulate new data quickly and in large volume (that is, storing only aggregated stream statistics). Statistical aggregates can be used in global variables or as elements in an array. 4 Statistical aggregates are used to collect statistics on numerical values where it is important to accumulate new data quickly and in large volume (that is, storing only aggregated stream statistics). Statistical aggregates can be used in global variables or as elements in an array.
4 </div><a id="idm47951459865936" class="indexterm"></a><a id="idm47951455904128" class="indexterm"></a><a id="idm47951455902080" class="indexterm"></a><a id="idm47951427877488" class="indexterm"></a><div class="para"> 5 </div><a id="idm214015343184" class="indexterm"></a><a id="idm214015341328" class="indexterm"></a><a id="idm214012427120" class="indexterm"></a><a id="idm214020852176" class="indexterm"></a><div class="para">
5 To add value to a statistical aggregate, use the operator <code class="command">&lt;&lt;&lt; <em class="replaceable"><code>value</code></em></code>. 6 To add value to a statistical aggregate, use the operator <code class="command">&lt;&lt;&lt; <em class="replaceable">value</em></code>.
6 </div><div class="example"><a id="simpleaggregates"></a><p class="title"><strong>Example 3.21. stat-aggregates.stp</strong></p><div class="example-contents"><pre class="programlisting">global reads 7 </div><div class="example"><a id="simpleaggregates">
8 ⁠</a><p class="title"><strong>Example 3.21. stat-aggregates.stp</strong></p><div class="example-contents"><pre class="programlisting">global reads
7probe vfs.read 9probe vfs.read
8{ 10{
9 reads[execname()] &lt;&lt;&lt; $count 11 reads[execname()] &lt;&lt;&lt; $count
10}</pre></div></div><br class="example-break" /><a id="idm47951457323632" class="indexterm"></a><a id="idm47951416232192" class="indexterm"></a><a id="idm47951416230112" class="indexterm"></a><a id="idm47951475892224" class="indexterm"></a><div class="para"> 12}</pre></div></div><a id="idm214017457808" class="indexterm"></a><a id="idm214017455920" class="indexterm"></a><a id="idm214022146624" class="indexterm"></a><a id="idm214021100112" class="indexterm"></a><div class="para">
11 In <a class="xref" href="arrayops-aggregates.html#simpleaggregates">Example 3.21, “stat-aggregates.stp”</a>, the operator <code class="command">&lt;&lt;&lt; $count</code> <span class="emphasis"><em>stores</em></span> the amount returned by <code class="literal">$count</code> to the associated value of the corresponding <code class="command">execname()</code> in the <code class="literal">reads</code> array. Remember, these values are <span class="emphasis"><em>stored</em></span>; they are not added to the associated values of each unique key, nor are they used to replace the current associated values. In a manner of speaking, think of it as having each unique key (<code class="command">execname()</code>) having multiple associated values, accumulating with each probe handler run. 13 In <a class="xref" href="arrayops-aggregates.html#simpleaggregates">Example 3.21, “stat-aggregates.stp”</a>, the operator <code class="command">&lt;&lt;&lt; $count</code> <span class="emphasis"><em>stores</em></span> the amount returned by <code class="literal">$count</code> to the associated value of the corresponding <code class="command">execname()</code> in the <code class="literal">reads</code> array. Remember, these values are <span class="emphasis"><em>stored</em></span>; they are not added to the associated values of each unique key, nor are they used to replace the current associated values. In a manner of speaking, think of it as having each unique key (<code class="command">execname()</code>) having multiple associated values, accumulating with each probe handler run.
12 </div><div xmlns:d="http://docbook.org/ns/docbook" class="note"><div class="admonition_header"><p><strong>Note</strong></p></div><div class="admonition"><div class="para"> 14 </div><div xmlns:d="http://docbook.org/ns/docbook" class="note"><div class="admonition_header"><p><strong>Note</strong></p></div><div class="admonition"><div class="para">
13 In the context of <a class="xref" href="arrayops-aggregates.html#simpleaggregates">Example 3.21, “stat-aggregates.stp”</a>, <code class="literal">count</code> returns the amount of data read by the returned <code class="command">execname()</code> to the virtual file system. 15 In the context of <a class="xref" href="arrayops-aggregates.html#simpleaggregates">Example 3.21, “stat-aggregates.stp”</a>, <code class="literal">count</code> returns the amount of data read by the returned <code class="command">execname()</code> to the virtual file system.
14 </div></div></div><a id="idm47951457699712" class="indexterm"></a><a id="idm47951415557408" class="indexterm"></a><a id="idm47951415555360" class="indexterm"></a><a id="idm47951460648480" class="indexterm"></a><a id="idm47951460646432" class="indexterm"></a><div class="para"> 16 </div></div></div><a id="idm213972109328" class="indexterm"></a><a id="idm214021103056" class="indexterm"></a><a id="idm214021101200" class="indexterm"></a><a id="idm214013277584" class="indexterm"></a><a id="idm213979372160" class="indexterm"></a><div class="para">
15 To extract data collected by statistical aggregates, use the syntax format <code class="command">@<em class="replaceable"><code>extractor</code></em>(<em class="replaceable"><code>variable/array index expression</code></em>)</code>. <code class="command"><em class="replaceable"><code>extractor</code></em></code> can be any of the following integer extractors: 17 To extract data collected by statistical aggregates, use the syntax format <code class="command">@<em class="replaceable">extractor</em>(<em class="replaceable">variable/array index expression</em>)</code>. <code class="command"><em class="replaceable">extractor</em></code> can be any of the following integer extractors:
16 </div><div class="variablelist"><dl class="variablelist"><dt><span class="term">count</span></dt><dd><a id="idm47951416450336" class="indexterm"></a><a id="idm47951416448288" class="indexterm"></a><a id="idm47951469518176" class="indexterm"></a><a id="idm47951469516128" class="indexterm"></a><div class="para"> 18 </div><div class="variablelist"><dl class="variablelist"><dt><span class="term">count</span></dt><dd><a id="idm214013859568" class="indexterm"></a><a id="idm214013858352" class="indexterm"></a><a id="idm214013857136" class="indexterm"></a><a id="idm214014508416" class="indexterm"></a><div class="para">
17 Returns the number of all values stored into the variable/array index expression. Given the sample probe in <a class="xref" href="arrayops-aggregates.html#simpleaggregates">Example 3.21, “stat-aggregates.stp”</a>, the expression <code class="command">@count(reads[execname()])</code> will return <span class="emphasis"><em>how many values are stored</em></span> in each unique key in array <code class="literal">reads</code>. 19 Returns the number of all values stored into the variable/array index expression. Given the sample probe in <a class="xref" href="arrayops-aggregates.html#simpleaggregates">Example 3.21, “stat-aggregates.stp”</a>, the expression <code class="command">@count(reads[execname()])</code> will return <span class="emphasis"><em>how many values are stored</em></span> in each unique key in array <code class="literal">reads</code>.
18 </div></dd><dt><span class="term">sum</span></dt><dd><a id="idm47951422422464" class="indexterm"></a><a id="idm47951422420416" class="indexterm"></a><a id="idm47951468985408" class="indexterm"></a><a id="idm47951468983360" class="indexterm"></a><div class="para"> 20 </div></dd><dt><span class="term">sum</span></dt><dd><a id="idm214009611040" class="indexterm"></a><a id="idm214009609824" class="indexterm"></a><a id="idm214026578944" class="indexterm"></a><a id="idm214026577728" class="indexterm"></a><div class="para">
19 Returns the sum of all values stored into the variable/array index expression. Again, given sample probe in <a class="xref" href="arrayops-aggregates.html#simpleaggregates">Example 3.21, “stat-aggregates.stp”</a>, the expression <code class="command">@sum(reads[execname()])</code> will return <span class="emphasis"><em>the total of all values stored</em></span> in each unique key in array <code class="literal">reads</code>. 21 Returns the sum of all values stored into the variable/array index expression. Again, given sample probe in <a class="xref" href="arrayops-aggregates.html#simpleaggregates">Example 3.21, “stat-aggregates.stp”</a>, the expression <code class="command">@sum(reads[execname()])</code> will return <span class="emphasis"><em>the total of all values stored</em></span> in each unique key in array <code class="literal">reads</code>.
20 </div></dd><dt><span class="term">min</span></dt><dd><a id="idm47951476110848" class="indexterm"></a><a id="idm47951476108800" class="indexterm"></a><a id="idm47951460579184" class="indexterm"></a><a id="idm47951460577136" class="indexterm"></a><div class="para"> 22 </div></dd><dt><span class="term">min</span></dt><dd><a id="idm213967554224" class="indexterm"></a><a id="idm213967553008" class="indexterm"></a><a id="idm214008322960" class="indexterm"></a><a id="idm214008321744" class="indexterm"></a><div class="para">
21 Returns the smallest among all the values stored in the variable/array index expression. 23 Returns the smallest among all the values stored in the variable/array index expression.
22 </div></dd><dt><span class="term">max</span></dt><dd><a id="idm47951461404624" class="indexterm"></a><a id="idm47951475042928" class="indexterm"></a><a id="idm47951475040880" class="indexterm"></a><a id="idm47951476465344" class="indexterm"></a><div class="para"> 24 </div></dd><dt><span class="term">max</span></dt><dd><a id="idm214011622160" class="indexterm"></a><a id="idm214012572384" class="indexterm"></a><a id="idm214012571168" class="indexterm"></a><a id="idm214018910240" class="indexterm"></a><div class="para">
23 Returns the largest among all the values stored in the variable/array index expression. 25 Returns the largest among all the values stored in the variable/array index expression.
24 </div></dd><dt><span class="term">avg</span></dt><dd><a id="idm47951466515520" class="indexterm"></a><a id="idm47951466513472" class="indexterm"></a><a id="idm47951427736624" class="indexterm"></a><a id="idm47951427734576" class="indexterm"></a><div class="para"> 26 </div></dd><dt><span class="term">avg</span></dt><dd><a id="idm214026224496" class="indexterm"></a><a id="idm214026223280" class="indexterm"></a><a id="idm214026644496" class="indexterm"></a><a id="idm214026643280" class="indexterm"></a><div class="para">
25 Returns the average of all values stored in the variable/array index expression. 27 Returns the average of all values stored in the variable/array index expression.
26 </div></dd></dl></div><div class="para"> 28 </div></dd></dl></div><div class="para">
27 When using statistical aggregates, you can also build array constructs that use multiple index expressions (to a maximum of 5). This is helpful in capturing additional contextual information during a probe. For example: 29 When using statistical aggregates, you can also build array constructs that use multiple index expressions (to a maximum of 5). This is helpful in capturing additional contextual information during a probe. For example:
28 </div><div class="example"><a id="multiplearrayindices"></a><p class="title"><strong>Example 3.22. Multiple Array Indexes</strong></p><div class="example-contents"><pre class="programlisting">global reads 30 </div><div class="example"><a id="multiplearrayindices">
31 ⁠</a><p class="title"><strong>Example 3.22. Multiple Array Indexes</strong></p><div class="example-contents"><pre class="programlisting">global reads
29probe vfs.read 32probe vfs.read
30{ 33{
31 reads[execname(),pid()] &lt;&lt;&lt; 1 34 reads[execname(),pid()] &lt;&lt;&lt; 1
@@ -34,7 +37,7 @@ probe timer.s(3)
34{ 37{
35 foreach([var1,var2] in reads) 38 foreach([var1,var2] in reads)
36 printf("%s (%d) : %d \n", var1, var2, @count(reads[var1,var2])) 39 printf("%s (%d) : %d \n", var1, var2, @count(reads[var1,var2]))
37}</pre></div></div><br class="example-break" /><div class="para"> 40}</pre></div></div><div class="para">
38 In <a class="xref" href="arrayops-aggregates.html#multiplearrayindices">Example 3.22, “Multiple Array Indexes”</a>, the first probe tracks how many times each process performs a VFS read. What makes this different from earlier examples is that this array associates a performed read to both a process name <span class="emphasis"><em>and</em></span> its corresponding process ID. 41 In <a class="xref" href="arrayops-aggregates.html#multiplearrayindices">Example 3.22, “Multiple Array Indexes”</a>, the first probe tracks how many times each process performs a VFS read. What makes this different from earlier examples is that this array associates a performed read to both a process name <span class="emphasis"><em>and</em></span> its corresponding process ID.
39 </div><div class="para"> 42 </div><div class="para">
40 The second probe in <a class="xref" href="arrayops-aggregates.html#multiplearrayindices">Example 3.22, “Multiple Array Indexes”</a> demonstrates how to process and print the information collected by the array <code class="literal">reads</code>. Note how the <code class="command">foreach</code> statement uses the same number of variables (that is, <code class="literal">var1</code> and <code class="literal">var2</code>) contained in the first instance of the array <code class="literal">reads</code> from the first probe. 43 The second probe in <a class="xref" href="arrayops-aggregates.html#multiplearrayindices">Example 3.22, “Multiple Array Indexes”</a> demonstrates how to process and print the information collected by the array <code class="literal">reads</code>. Note how the <code class="command">foreach</code> statement uses the same number of variables (that is, <code class="literal">var1</code> and <code class="literal">var2</code>) contained in the first instance of the array <code class="literal">reads</code> from the first probe.
diff --git a/SystemTap_Beginners_Guide/arrayops-conditionals.html b/SystemTap_Beginners_Guide/arrayops-conditionals.html
index 5efeddbb..33299cdb 100644
--- a/SystemTap_Beginners_Guide/arrayops-conditionals.html
+++ b/SystemTap_Beginners_Guide/arrayops-conditionals.html
@@ -1,7 +1,9 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.5.6. Using Arrays in Conditional Statements</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="arrayoperators.html" title="3.5. Array Operations in SystemTap" /><link rel="prev" href="arrayops-deleting.html" title="3.5.5. Clearing/Deleting Arrays and Array Elements" /><link rel="next" href="arrayops-aggregates.html" title="3.5.7. Computing for Statistical Aggregates" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="arrayops-deleting.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="arrayops-aggregates.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="arrayops-conditionals"></a>3.5.6. Using Arrays in Conditional Statements</h3></div></div></div><a id="idm47951427983728" class="indexterm"></a><a id="idm47951456316512" class="indexterm"></a><a id="idm47951456314960" class="indexterm"></a><a id="idm47951468259648" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.5.6. Using Arrays in Conditional Statements</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="arrayoperators.html" title="3.5. Array Operations in SystemTap" /><link rel="prev" href="arrayops-deleting.html" title="3.5.5. Clearing/Deleting Arrays and Array Elements" /><link rel="next" href="arrayops-aggregates.html" title="3.5.7. Computing for Statistical Aggregates" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="arrayops-deleting.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="arrayops-aggregates.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="arrayops-conditionals">
3 ⁠</a>3.5.6. Using Arrays in Conditional Statements</h3></div></div></div><a id="idm213968235952" class="indexterm"></a><a id="idm214008312560" class="indexterm"></a><a id="idm214008311152" class="indexterm"></a><a id="idm213972645712" class="indexterm"></a><div class="para">
3 You can also use associative arrays in <code class="command">if</code> statements. This is useful if you want to execute a subroutine once a value in the array matches a certain condition. Consider the following example: 4 You can also use associative arrays in <code class="command">if</code> statements. This is useful if you want to execute a subroutine once a value in the array matches a certain condition. Consider the following example:
4 </div><div class="example"><a id="simplevfsreadprintif"></a><p class="title"><strong>Example 3.19. vfsreads-print-if-1kb.stp</strong></p><div class="example-contents"><pre class="programlisting">global reads 5 </div><div class="example"><a id="simplevfsreadprintif">
6 ⁠</a><p class="title"><strong>Example 3.19. vfsreads-print-if-1kb.stp</strong></p><div class="example-contents"><pre class="programlisting">global reads
5probe vfs.read 7probe vfs.read
6{ 8{
7 reads[execname()] ++ 9 reads[execname()] ++
@@ -15,13 +17,14 @@ probe timer.s(3)
15 printf("%s : %dkB \n", count, reads[count]/1024) 17 printf("%s : %dkB \n", count, reads[count]/1024)
16 else 18 else
17 printf("%s : %dB \n", count, reads[count]) 19 printf("%s : %dB \n", count, reads[count])
18}</pre></div></div><br class="example-break" /><div class="para"> 20}</pre></div></div><div class="para">
19 Every three seconds, <a class="xref" href="arrayops-conditionals.html#simplevfsreadprintif">Example 3.19, “vfsreads-print-if-1kb.stp”</a> prints out a list of all processes, along with how many times each process performed a VFS read. If the associated value of a process name is equal or greater than 1024, the <code class="command">if</code> statement in the script converts and prints it out in <code class="command">kB</code>. 21 Every three seconds, <a class="xref" href="arrayops-conditionals.html#simplevfsreadprintif">Example 3.19, “vfsreads-print-if-1kb.stp”</a> prints out a list of all processes, along with how many times each process performed a VFS read. If the associated value of a process name is equal or greater than 1024, the <code class="command">if</code> statement in the script converts and prints it out in <code class="command">kB</code>.
20 </div><div class="formalpara"><div xmlns:d="http://docbook.org/ns/docbook" class="title">Testing for Membership</div><a id="idm47951463628656" class="indexterm"></a><a id="idm47951463626608" class="indexterm"></a><a id="idm47951457253152" class="indexterm"></a><a id="idm47951457251104" class="indexterm"></a><a id="idm47951464280192" class="indexterm"></a> 22 </div><div class="para"><div xmlns:d="http://docbook.org/ns/docbook" class="title">Testing for Membership</div><a id="idm214012613328" class="indexterm"></a><a id="idm213967776592" class="indexterm"></a><a id="idm213967775376" class="indexterm"></a><a id="idm213967774160" class="indexterm"></a><a id="idm213968229520" class="indexterm"></a>
21 You can also test whether a specific unique key is a member of an array. Further, membership in an array can be used in <code class="command">if</code> statements, as in: 23 You can also test whether a specific unique key is a member of an array. Further, membership in an array can be used in <code class="command">if</code> statements, as in:
22 </div><pre class="screen">if([<em class="replaceable"><code>index_expression</code></em>] in <em class="replaceable"><code>array_name</code></em>) <em class="replaceable"><code>statement</code></em></pre><div class="para"> 24 </div><pre class="screen">if([<em class="replaceable">index_expression</em>] in <em class="replaceable">array_name</em>) <em class="replaceable">statement</em></pre><div class="para">
23 To illustrate this, consider the following example: 25 To illustrate this, consider the following example:
24 </div><div class="example"><a id="simplesimplevfsreadprintifmember"></a><p class="title"><strong>Example 3.20. vfsreads-stop-on-stapio2.stp</strong></p><div class="example-contents"><pre class="programlisting">global reads 26 </div><div class="example"><a id="simplesimplevfsreadprintifmember">
27 ⁠</a><p class="title"><strong>Example 3.20. vfsreads-stop-on-stapio2.stp</strong></p><div class="example-contents"><pre class="programlisting">global reads
25 28
26probe vfs.read 29probe vfs.read
27{ 30{
@@ -37,6 +40,6 @@ probe timer.s(3)
37 printf("stapio read detected, exiting\n") 40 printf("stapio read detected, exiting\n")
38 exit() 41 exit()
39 } 42 }
40}</pre></div></div><br class="example-break" /><div class="para"> 43}</pre></div></div><div class="para">
41 The <code class="command">if(["stapio"] in reads)</code> statement instructs the script to print <code class="computeroutput">stapio read detected, exiting</code> once the unique key <code class="command">stapio</code> is added to the array <code class="command">reads</code>. 44 The <code class="command">if(["stapio"] in reads)</code> statement instructs the script to print <code class="computeroutput">stapio read detected, exiting</code> once the unique key <code class="command">stapio</code> is added to the array <code class="command">reads</code>.
42 </div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="arrayops-deleting.html"><strong>Prev</strong>3.5.5. Clearing/Deleting Arrays and Array Elements</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="arrayops-aggregates.html"><strong>Next</strong>3.5.7. Computing for Statistical Aggregates</a></li></ul></body></html> \ No newline at end of file 45 </div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="arrayops-deleting.html"><strong>Prev</strong>3.5.5. Clearing/Deleting Arrays and Array Elements</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="arrayops-aggregates.html"><strong>Next</strong>3.5.7. Computing for Statistical Aggregates</a></li></ul></body></html> \ No newline at end of file
diff --git a/SystemTap_Beginners_Guide/arrayops-deleting.html b/SystemTap_Beginners_Guide/arrayops-deleting.html
index 96039bc1..3fbc8b19 100644
--- a/SystemTap_Beginners_Guide/arrayops-deleting.html
+++ b/SystemTap_Beginners_Guide/arrayops-deleting.html
@@ -1,9 +1,11 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.5.5. Clearing/Deleting Arrays and Array Elements</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="arrayoperators.html" title="3.5. Array Operations in SystemTap" /><link rel="prev" href="arrayops-foreach.html" title="3.5.4. Processing Multiple Elements in an Array" /><link rel="next" href="arrayops-conditionals.html" title="3.5.6. Using Arrays in Conditional Statements" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="arrayops-foreach.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="arrayops-conditionals.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="arrayops-deleting"></a>3.5.5. Clearing/Deleting Arrays and Array Elements</h3></div></div></div><a id="idm47951420920944" class="indexterm"></a><a id="idm47951420919392" class="indexterm"></a><a id="idm47951463747840" class="indexterm"></a><a id="idm47951463746288" class="indexterm"></a><a id="idm47951463744736" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.5.5. Clearing/Deleting Arrays and Array Elements</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="arrayoperators.html" title="3.5. Array Operations in SystemTap" /><link rel="prev" href="arrayops-foreach.html" title="3.5.4. Processing Multiple Elements in an Array" /><link rel="next" href="arrayops-conditionals.html" title="3.5.6. Using Arrays in Conditional Statements" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="arrayops-foreach.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="arrayops-conditionals.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="arrayops-deleting">
3 ⁠</a>3.5.5. Clearing/Deleting Arrays and Array Elements</h3></div></div></div><a id="idm214026308800" class="indexterm"></a><a id="idm214026307392" class="indexterm"></a><a id="idm214017255632" class="indexterm"></a><a id="idm214017254224" class="indexterm"></a><a id="idm214014401008" class="indexterm"></a><div class="para">
3 Sometimes, you may need to clear the associated values in array elements, or reset an entire array for re-use in another probe. <a class="xref" href="arrayops-foreach.html#simplevfsreadprint">Example 3.17, “cumulative-vfsreads.stp”</a> in <a class="xref" href="arrayops-foreach.html">Section 3.5.4, “Processing Multiple Elements in an Array”</a> allows you to track how the number of VFS reads per process grows over time, but it does not show you the number of VFS reads each process makes per 3-second period. 4 Sometimes, you may need to clear the associated values in array elements, or reset an entire array for re-use in another probe. <a class="xref" href="arrayops-foreach.html#simplevfsreadprint">Example 3.17, “cumulative-vfsreads.stp”</a> in <a class="xref" href="arrayops-foreach.html">Section 3.5.4, “Processing Multiple Elements in an Array”</a> allows you to track how the number of VFS reads per process grows over time, but it does not show you the number of VFS reads each process makes per 3-second period.
4 </div><a id="idm47951476467456" class="indexterm"></a><a id="idm47951469392800" class="indexterm"></a><a id="idm47951469390720" class="indexterm"></a><a id="idm47951454964752" class="indexterm"></a><div class="para"> 5 </div><a id="idm214009653488" class="indexterm"></a><a id="idm214012513264" class="indexterm"></a><a id="idm214018151584" class="indexterm"></a><a id="idm214017539280" class="indexterm"></a><div class="para">
5 To do that, you will need to clear the values accumulated by the array. You can accomplish this using the <code class="command">delete</code> operator to delete elements in an array, or an entire array. Consider the following example: 6 To do that, you will need to clear the values accumulated by the array. You can accomplish this using the <code class="command">delete</code> operator to delete elements in an array, or an entire array. Consider the following example:
6 </div><a id="idm47951471321104" class="indexterm"></a><a id="idm47951471319056" class="indexterm"></a><a id="idm47951466571664" class="indexterm"></a><a id="idm47951466569616" class="indexterm"></a><div class="example"><a id="simplevfsreadprintnotcumulative"></a><p class="title"><strong>Example 3.18. noncumulative-vfsreads.stp</strong></p><div class="example-contents"><pre class="programlisting">global reads 7 </div><a id="idm214008624480" class="indexterm"></a><a id="idm214008622624" class="indexterm"></a><a id="idm214016957744" class="indexterm"></a><a id="idm213978536016" class="indexterm"></a><div class="example"><a id="simplevfsreadprintnotcumulative">
8 ⁠</a><p class="title"><strong>Example 3.18. noncumulative-vfsreads.stp</strong></p><div class="example-contents"><pre class="programlisting">global reads
7probe vfs.read 9probe vfs.read
8{ 10{
9 reads[execname()] ++ 11 reads[execname()] ++
@@ -13,9 +15,9 @@ probe timer.s(3)
13 foreach (count in reads) 15 foreach (count in reads)
14 printf("%s : %d \n", count, reads[count]) 16 printf("%s : %d \n", count, reads[count])
15 delete reads 17 delete reads
16}</pre></div></div><br class="example-break" /><div class="para"> 18}</pre></div></div><div class="para">
17 In <a class="xref" href="arrayops-deleting.html#simplevfsreadprintnotcumulative">Example 3.18, “noncumulative-vfsreads.stp”</a>, the second probe prints the number of VFS reads each process made <span class="emphasis"><em>within the probed 3-second period only</em></span>. The <code class="command">delete reads</code> statement clears the <code class="command">reads</code> array within the probe. 19 In <a class="xref" href="arrayops-deleting.html#simplevfsreadprintnotcumulative">Example 3.18, “noncumulative-vfsreads.stp”</a>, the second probe prints the number of VFS reads each process made <span class="emphasis"><em>within the probed 3-second period only</em></span>. The <code class="command">delete reads</code> statement clears the <code class="command">reads</code> array within the probe.
18 </div><div xmlns:d="http://docbook.org/ns/docbook" class="note"><div class="admonition_header"><p><strong>Note</strong></p></div><div class="admonition"><a id="idm47951468294096" class="indexterm"></a><a id="idm47951460943104" class="indexterm"></a><a id="idm47951460928160" class="indexterm"></a><a id="idm47951460926112" class="indexterm"></a><div class="para"> 20 </div><div xmlns:d="http://docbook.org/ns/docbook" class="note"><div class="admonition_header"><p><strong>Note</strong></p></div><div class="admonition"><a id="idm214026351648" class="indexterm"></a><a id="idm213978541264" class="indexterm"></a><a id="idm213978539408" class="indexterm"></a><a id="idm214012294112" class="indexterm"></a><div class="para">
19 You can have multiple array operations within the same probe. Using the examples from <a class="xref" href="arrayops-foreach.html">Section 3.5.4, “Processing Multiple Elements in an Array”</a> and <a class="xref" href="arrayops-deleting.html">Section 3.5.5, “Clearing/Deleting Arrays and Array Elements”</a> , you can track the number of VFS reads each process makes per 3-second period <span class="emphasis"><em>and</em></span> tally the cumulative VFS reads of those same processes. Consider the following example: 21 You can have multiple array operations within the same probe. Using the examples from <a class="xref" href="arrayops-foreach.html">Section 3.5.4, “Processing Multiple Elements in an Array”</a> and <a class="xref" href="arrayops-deleting.html">Section 3.5.5, “Clearing/Deleting Arrays and Array Elements”</a> , you can track the number of VFS reads each process makes per 3-second period <span class="emphasis"><em>and</em></span> tally the cumulative VFS reads of those same processes. Consider the following example:
20 </div><pre class="screen">global reads, totalreads 22 </div><pre class="screen">global reads, totalreads
21 23
diff --git a/SystemTap_Beginners_Guide/arrayops-foreach.html b/SystemTap_Beginners_Guide/arrayops-foreach.html
index 4f033003..45f114ad 100644
--- a/SystemTap_Beginners_Guide/arrayops-foreach.html
+++ b/SystemTap_Beginners_Guide/arrayops-foreach.html
@@ -1,9 +1,11 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.5.4. Processing Multiple Elements in an Array</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="arrayoperators.html" title="3.5. Array Operations in SystemTap" /><link rel="prev" href="arrayops-increment.html" title="3.5.3. Incrementing Associated Values" /><link rel="next" href="arrayops-deleting.html" title="3.5.5. Clearing/Deleting Arrays and Array Elements" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="arrayops-increment.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="arrayops-deleting.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="arrayops-foreach"></a>3.5.4. Processing Multiple Elements in an Array</h3></div></div></div><a id="idm47951457621024" class="indexterm"></a><a id="idm47951464475504" class="indexterm"></a><a id="idm47951464473952" class="indexterm"></a><a id="idm47951455929088" class="indexterm"></a><a id="idm47951455927536" class="indexterm"></a><a id="idm47951455925984" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.5.4. Processing Multiple Elements in an Array</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="arrayoperators.html" title="3.5. Array Operations in SystemTap" /><link rel="prev" href="arrayops-increment.html" title="3.5.3. Incrementing Associated Values" /><link rel="next" href="arrayops-deleting.html" title="3.5.5. Clearing/Deleting Arrays and Array Elements" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="arrayops-increment.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="arrayops-deleting.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="arrayops-foreach">
3 ⁠</a>3.5.4. Processing Multiple Elements in an Array</h3></div></div></div><a id="idm213970909872" class="indexterm"></a><a id="idm213967813024" class="indexterm"></a><a id="idm213970907152" class="indexterm"></a><a id="idm213970905744" class="indexterm"></a><a id="idm214008327856" class="indexterm"></a><a id="idm214008326448" class="indexterm"></a><div class="para">
3 Once you've collected enough information in an array, you will need to retrieve and process all elements in that array to make it useful. Consider <a class="xref" href="arrayops-increment.html#simplesimplevfsread">Example 3.16, “vfsreads.stp”</a>: the script collects information about how many VFS reads each process performs, but does not specify what to do with it. The obvious means for making <a class="xref" href="arrayops-increment.html#simplesimplevfsread">Example 3.16, “vfsreads.stp”</a> useful is to print the key pairs in the array <code class="command">reads</code>, but how? 4 Once you've collected enough information in an array, you will need to retrieve and process all elements in that array to make it useful. Consider <a class="xref" href="arrayops-increment.html#simplesimplevfsread">Example 3.16, “vfsreads.stp”</a>: the script collects information about how many VFS reads each process performs, but does not specify what to do with it. The obvious means for making <a class="xref" href="arrayops-increment.html#simplesimplevfsread">Example 3.16, “vfsreads.stp”</a> useful is to print the key pairs in the array <code class="command">reads</code>, but how?
4 </div><a id="idm47951427847440" class="indexterm"></a><a id="idm47951427845360" class="indexterm"></a><a id="idm47951455910048" class="indexterm"></a><a id="idm47951455907968" class="indexterm"></a><a id="idm47951457262736" class="indexterm"></a><a id="idm47951475991712" class="indexterm"></a><a id="idm47951475989664" class="indexterm"></a><div class="para"> 5 </div><a id="idm214008629440" class="indexterm"></a><a id="idm214017370864" class="indexterm"></a><a id="idm214021095360" class="indexterm"></a><a id="idm214013648800" class="indexterm"></a><a id="idm213967806032" class="indexterm"></a><a id="idm214007140240" class="indexterm"></a><a id="idm214017326096" class="indexterm"></a><div class="para">
5 The best way to process all key pairs in an array (as an iteration) is to use the <code class="command">foreach</code> statement. Consider the following example: 6 The best way to process all key pairs in an array (as an iteration) is to use the <code class="command">foreach</code> statement. Consider the following example:
6 </div><a id="idm47951415803248" class="indexterm"></a><a id="idm47951475559744" class="indexterm"></a><a id="idm47951475557696" class="indexterm"></a><a id="idm47951416255104" class="indexterm"></a><a id="idm47951454747184" class="indexterm"></a><div class="example"><a id="simplevfsreadprint"></a><p class="title"><strong>Example 3.17. cumulative-vfsreads.stp</strong></p><div class="example-contents"><pre class="programlisting">global reads 7 </div><a id="idm213975412272" class="indexterm"></a><a id="idm213972046272" class="indexterm"></a><a id="idm214018762944" class="indexterm"></a><a id="idm214014541424" class="indexterm"></a><a id="idm214014539568" class="indexterm"></a><div class="example"><a id="simplevfsreadprint">
8 ⁠</a><p class="title"><strong>Example 3.17. cumulative-vfsreads.stp</strong></p><div class="example-contents"><pre class="programlisting">global reads
7probe vfs.read 9probe vfs.read
8{ 10{
9 reads[execname()] ++ 11 reads[execname()] ++
@@ -12,12 +14,12 @@ probe timer.s(3)
12{ 14{
13 foreach (count in reads) 15 foreach (count in reads)
14 printf("%s : %d \n", count, reads[count]) 16 printf("%s : %d \n", count, reads[count])
15}</pre></div></div><br class="example-break" /><div class="para"> 17}</pre></div></div><div class="para">
16 In the second probe of <a class="xref" href="arrayops-foreach.html#simplevfsreadprint">Example 3.17, “cumulative-vfsreads.stp”</a>, the <code class="command">foreach</code> statement uses the variable <code class="command">count</code> to reference each iteration of a unique key in the array <code class="command">reads</code>. The <code class="command">reads[count]</code> array statement in the same probe retrieves the associated value of each unique key. 18 In the second probe of <a class="xref" href="arrayops-foreach.html#simplevfsreadprint">Example 3.17, “cumulative-vfsreads.stp”</a>, the <code class="command">foreach</code> statement uses the variable <code class="command">count</code> to reference each iteration of a unique key in the array <code class="command">reads</code>. The <code class="command">reads[count]</code> array statement in the same probe retrieves the associated value of each unique key.
17 </div><div class="para"> 19 </div><div class="para">
18 Given what we know about the first probe in <a class="xref" href="arrayops-foreach.html#simplevfsreadprint">Example 3.17, “cumulative-vfsreads.stp”</a>, the script prints VFS-read statistics every 3 seconds, displaying names of processes that performed a VFS-read along with a corresponding VFS-read count. 20 Given what we know about the first probe in <a class="xref" href="arrayops-foreach.html#simplevfsreadprint">Example 3.17, “cumulative-vfsreads.stp”</a>, the script prints VFS-read statistics every 3 seconds, displaying names of processes that performed a VFS-read along with a corresponding VFS-read count.
19 </div><a id="idm47951475816784" class="indexterm"></a><a id="idm47951475814736" class="indexterm"></a><a id="idm47951420904832" class="indexterm"></a><a id="idm47951420902784" class="indexterm"></a><a id="idm47951475478576" class="indexterm"></a><a id="idm47951457105984" class="indexterm"></a><a id="idm47951457103936" class="indexterm"></a><a id="idm47951475517824" class="indexterm"></a><div class="para"> 21 </div><a id="idm213972652592" class="indexterm"></a><a id="idm213972650736" class="indexterm"></a><a id="idm213967501840" class="indexterm"></a><a id="idm213973594944" class="indexterm"></a><a id="idm214013469264" class="indexterm"></a><a id="idm213973608768" class="indexterm"></a><a id="idm214008326240" class="indexterm"></a><a id="idm214008324384" class="indexterm"></a><div class="para">
20 Now, remember that the <code class="command">foreach</code> statement in <a class="xref" href="arrayops-foreach.html#simplevfsreadprint">Example 3.17, “cumulative-vfsreads.stp”</a> prints <span class="emphasis"><em>all</em></span> iterations of process names in the array, and in no particular order. You can instruct the script to process the iterations in a particular order by using <code class="command">+</code> (ascending) or <code class="command">-</code> (descending). In addition, you can also limit the number of iterations the script needs to process with the <code class="command">limit <em class="replaceable"><code>value</code></em></code> option. 22 Now, remember that the <code class="command">foreach</code> statement in <a class="xref" href="arrayops-foreach.html#simplevfsreadprint">Example 3.17, “cumulative-vfsreads.stp”</a> prints <span class="emphasis"><em>all</em></span> iterations of process names in the array, and in no particular order. You can instruct the script to process the iterations in a particular order by using <code class="command">+</code> (ascending) or <code class="command">-</code> (descending). In addition, you can also limit the number of iterations the script needs to process with the <code class="command">limit <em class="replaceable">value</em></code> option.
21 </div><div class="para"> 23 </div><div class="para">
22 For example, consider the following replacement probe: 24 For example, consider the following replacement probe:
23 </div><pre class="screen">probe timer.s(3) 25 </div><pre class="screen">probe timer.s(3)
diff --git a/SystemTap_Beginners_Guide/arrayops-increment.html b/SystemTap_Beginners_Guide/arrayops-increment.html
index 27a80dc4..24eebb69 100644
--- a/SystemTap_Beginners_Guide/arrayops-increment.html
+++ b/SystemTap_Beginners_Guide/arrayops-increment.html
@@ -1,11 +1,13 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.5.3. Incrementing Associated Values</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="arrayoperators.html" title="3.5. Array Operations in SystemTap" /><link rel="prev" href="arrayops-readvalues.html" title="3.5.2. Reading Values From Arrays" /><link rel="next" href="arrayops-foreach.html" title="3.5.4. Processing Multiple Elements in an Array" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="arrayops-readvalues.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="arrayops-foreach.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="arrayops-increment"></a>3.5.3. Incrementing Associated Values</h3></div></div></div><a id="idm47951455956224" class="indexterm"></a><a id="idm47951455954672" class="indexterm"></a><a id="idm47951455953120" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.5.3. Incrementing Associated Values</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="arrayoperators.html" title="3.5. Array Operations in SystemTap" /><link rel="prev" href="arrayops-readvalues.html" title="3.5.2. Reading Values From Arrays" /><link rel="next" href="arrayops-foreach.html" title="3.5.4. Processing Multiple Elements in an Array" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="arrayops-readvalues.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="arrayops-foreach.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="arrayops-increment">
3 ⁠</a>3.5.3. Incrementing Associated Values</h3></div></div></div><a id="idm214008390576" class="indexterm"></a><a id="idm214012070256" class="indexterm"></a><a id="idm213973597664" class="indexterm"></a><div class="para">
3 Use <code class="command">++</code> to increment the associated value of a unique key in an array, as in: 4 Use <code class="command">++</code> to increment the associated value of a unique key in an array, as in:
4 </div><pre class="screen"><em class="replaceable"><code>array_name</code></em>[<em class="replaceable"><code>index_expression</code></em>] ++</pre><div class="para"> 5 </div><pre class="screen"><em class="replaceable">array_name</em>[<em class="replaceable">index_expression</em>] ++</pre><div class="para">
5 Again, you can also use a handler function for your <code class="command"><em class="replaceable"><code>index_expression</code></em></code>. For example, if you wanted to tally how many times a specific process performed a read to the virtual file system (using the event <code class="command">vfs.read</code>), you can use the following probe: 6 Again, you can also use a handler function for your <code class="command"><em class="replaceable">index_expression</em></code>. For example, if you wanted to tally how many times a specific process performed a read to the virtual file system (using the event <code class="command">vfs.read</code>), you can use the following probe:
6 </div><a id="idm47951460559856" class="indexterm"></a><a id="idm47951455970192" class="indexterm"></a><a id="idm47951455968144" class="indexterm"></a><a id="idm47951415716928" class="indexterm"></a><a id="idm47951460749184" class="indexterm"></a><div class="example"><a id="simplesimplevfsread"></a><p class="title"><strong>Example 3.16. vfsreads.stp</strong></p><div class="example-contents"><pre class="programlisting">probe vfs.read 7 </div><a id="idm214012423392" class="indexterm"></a><a id="idm214015255312" class="indexterm"></a><a id="idm214026397152" class="indexterm"></a><a id="idm214015968768" class="indexterm"></a><a id="idm213970540176" class="indexterm"></a><div class="example"><a id="simplesimplevfsread">
8 ⁠</a><p class="title"><strong>Example 3.16. vfsreads.stp</strong></p><div class="example-contents"><pre class="programlisting">probe vfs.read
7{ 9{
8 reads[execname()] ++ 10 reads[execname()] ++
9}</pre></div></div><br class="example-break" /><div class="para"> 11}</pre></div></div><div class="para">
10 In <a class="xref" href="arrayops-increment.html#simplesimplevfsread">Example 3.16, “vfsreads.stp”</a>, the first time that the probe returns the process name <code class="command">gnome-terminal</code> (that is, the first time <code class="command">gnome-terminal</code> performs a VFS read), that process name is set as the unique key <code class="literal">gnome-terminal</code> with an associated value of 1. The next time that the probe returns the process name <code class="command">gnome-terminal</code>, SystemTap increments the associated value of <code class="literal">gnome-terminal</code> by 1. SystemTap performs this operation for <span class="emphasis"><em>all</em></span> process names as the probe returns them. 12 In <a class="xref" href="arrayops-increment.html#simplesimplevfsread">Example 3.16, “vfsreads.stp”</a>, the first time that the probe returns the process name <code class="command">gnome-terminal</code> (that is, the first time <code class="command">gnome-terminal</code> performs a VFS read), that process name is set as the unique key <code class="literal">gnome-terminal</code> with an associated value of 1. The next time that the probe returns the process name <code class="command">gnome-terminal</code>, SystemTap increments the associated value of <code class="literal">gnome-terminal</code> by 1. SystemTap performs this operation for <span class="emphasis"><em>all</em></span> process names as the probe returns them.
11 </div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="arrayops-readvalues.html"><strong>Prev</strong>3.5.2. Reading Values From Arrays</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="arrayops-foreach.html"><strong>Next</strong>3.5.4. Processing Multiple Elements in an Array</a></li></ul></body></html> \ No newline at end of file 13 </div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="arrayops-readvalues.html"><strong>Prev</strong>3.5.2. Reading Values From Arrays</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="arrayops-foreach.html"><strong>Next</strong>3.5.4. Processing Multiple Elements in an Array</a></li></ul></body></html> \ No newline at end of file
diff --git a/SystemTap_Beginners_Guide/arrayops-readvalues.html b/SystemTap_Beginners_Guide/arrayops-readvalues.html
index 95c952f5..72adba13 100644
--- a/SystemTap_Beginners_Guide/arrayops-readvalues.html
+++ b/SystemTap_Beginners_Guide/arrayops-readvalues.html
@@ -1,10 +1,12 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.5.2. Reading Values From Arrays</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="arrayoperators.html" title="3.5. Array Operations in SystemTap" /><link rel="prev" href="arrayoperators.html" title="3.5. Array Operations in SystemTap" /><link rel="next" href="arrayops-increment.html" title="3.5.3. Incrementing Associated Values" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="arrayoperators.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="arrayops-increment.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="arrayops-readvalues"></a>3.5.2. Reading Values From Arrays</h3></div></div></div><a id="idm47951464393840" class="indexterm"></a><a id="idm47951464392288" class="indexterm"></a><a id="idm47951420909568" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.5.2. Reading Values From Arrays</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="arrayoperators.html" title="3.5. Array Operations in SystemTap" /><link rel="prev" href="arrayoperators.html" title="3.5. Array Operations in SystemTap" /><link rel="next" href="arrayops-increment.html" title="3.5.3. Incrementing Associated Values" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="arrayoperators.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="arrayops-increment.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="arrayops-readvalues">
3 You can also read values from an array the same way you would read the value of a variable. To do so, include the <code class="command"><em class="replaceable"><code>array_name</code></em>[<em class="replaceable"><code>index_expression</code></em>]</code> statement as an element in a mathematical expression. For example: 3 ⁠</a>3.5.2. Reading Values From Arrays</h3></div></div></div><a id="idm214007122672" class="indexterm"></a><a id="idm214021151248" class="indexterm"></a><a id="idm214026354064" class="indexterm"></a><div class="para">
4 </div><a id="idm47951460683216" class="indexterm"></a><a id="idm47951460681168" class="indexterm"></a><a id="idm47951422432304" class="indexterm"></a><a id="idm47951468200736" class="indexterm"></a><a id="idm47951468198688" class="indexterm"></a><a id="idm47951476374816" class="indexterm"></a><a id="idm47951416197568" class="indexterm"></a><a id="idm47951416195520" class="indexterm"></a><a id="idm47951421019312" class="indexterm"></a><a id="idm47951421017264" class="indexterm"></a><div class="example"><a id="arrayreadingvaluesfrom"></a><p class="title"><strong>Example 3.15. Using Array Values in Simple Computations</strong></p><div class="example-contents"><pre class="screen">delta = gettimeofday_s() - foo[tid()]</pre></div></div><br class="example-break" /><div class="para"> 4 You can also read values from an array the same way you would read the value of a variable. To do so, include the <code class="command"><em class="replaceable">array_name</em>[<em class="replaceable">index_expression</em>]</code> statement as an element in a mathematical expression. For example:
5 </div><a id="idm214008389216" class="indexterm"></a><a id="idm214013738384" class="indexterm"></a><a id="idm213974826416" class="indexterm"></a><a id="idm213978768000" class="indexterm"></a><a id="idm214018085024" class="indexterm"></a><a id="idm214014325792" class="indexterm"></a><a id="idm214013762272" class="indexterm"></a><a id="idm213967858112" class="indexterm"></a><a id="idm214007079440" class="indexterm"></a><a id="idm214013748832" class="indexterm"></a><div class="example"><a id="arrayreadingvaluesfrom">
6 ⁠</a><p class="title"><strong>Example 3.15. Using Array Values in Simple Computations</strong></p><div class="example-contents"><pre class="screen">delta = gettimeofday_s() - foo[tid()]</pre></div></div><div class="para">
5 This example assumes that the array <code class="command">foo</code> was built using the construct in <a class="xref" href="arrayoperators.html#arrays-timestampprocessname">Example 3.14, “Associating Timestamps to Process Names”</a> (from <a class="xref" href="arrayoperators.html#arrayops-assignvalue">Section 3.5.1, “Assigning an Associated Value”</a>). This sets a timestamp that will serve as a <span class="emphasis"><em>reference point</em></span>, to be used in computing for <code class="literal">delta</code>. 7 This example assumes that the array <code class="command">foo</code> was built using the construct in <a class="xref" href="arrayoperators.html#arrays-timestampprocessname">Example 3.14, “Associating Timestamps to Process Names”</a> (from <a class="xref" href="arrayoperators.html#arrayops-assignvalue">Section 3.5.1, “Assigning an Associated Value”</a>). This sets a timestamp that will serve as a <span class="emphasis"><em>reference point</em></span>, to be used in computing for <code class="literal">delta</code>.
6 </div><div class="para"> 8 </div><div class="para">
7 The construct in <a class="xref" href="arrayops-readvalues.html#arrayreadingvaluesfrom">Example 3.15, “Using Array Values in Simple Computations”</a> computes a value for the variable <code class="literal">delta</code> by subtracting the associated value of the key <code class="literal">tid()</code> from the current <code class="command">gettimeofday_s()</code>. The construct does this by <span class="emphasis"><em>reading</em></span> the value of <code class="literal">tid()</code> from the array. This particular construct is useful for determining the time between two events, such as the start and completion of a read operation. 9 The construct in <a class="xref" href="arrayops-readvalues.html#arrayreadingvaluesfrom">Example 3.15, “Using Array Values in Simple Computations”</a> computes a value for the variable <code class="literal">delta</code> by subtracting the associated value of the key <code class="literal">tid()</code> from the current <code class="command">gettimeofday_s()</code>. The construct does this by <span class="emphasis"><em>reading</em></span> the value of <code class="literal">tid()</code> from the array. This particular construct is useful for determining the time between two events, such as the start and completion of a read operation.
8 </div><a id="idm47951457477648" class="indexterm"></a><a id="idm47951455598192" class="indexterm"></a><a id="idm47951455596112" class="indexterm"></a><a id="idm47951421037488" class="indexterm"></a><div xmlns:d="http://docbook.org/ns/docbook" class="note"><div class="admonition_header"><p><strong>Note</strong></p></div><div class="admonition"><div class="para"> 10 </div><a id="idm214013869552" class="indexterm"></a><a id="idm214012682608" class="indexterm"></a><a id="idm214012575008" class="indexterm"></a><a id="idm214014378656" class="indexterm"></a><div xmlns:d="http://docbook.org/ns/docbook" class="note"><div class="admonition_header"><p><strong>Note</strong></p></div><div class="admonition"><div class="para">
9 If the <code class="command"><em class="replaceable"><code>index_expression</code></em></code> cannot find the unique key, it returns a value of 0 (for numerical operations, such as <a class="xref" href="arrayops-readvalues.html#arrayreadingvaluesfrom">Example 3.15, “Using Array Values in Simple Computations”</a>) or a null/empty string value (for string operations) by default. 11 If the <code class="command"><em class="replaceable">index_expression</em></code> cannot find the unique key, it returns a value of 0 (for numerical operations, such as <a class="xref" href="arrayops-readvalues.html#arrayreadingvaluesfrom">Example 3.15, “Using Array Values in Simple Computations”</a>) or a null/empty string value (for string operations) by default.
10 </div></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="arrayoperators.html"><strong>Prev</strong>3.5. Array Operations in SystemTap</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="arrayops-increment.html"><strong>Next</strong>3.5.3. Incrementing Associated Values</a></li></ul></body></html> \ No newline at end of file 12 </div></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="arrayoperators.html"><strong>Prev</strong>3.5. Array Operations in SystemTap</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="arrayops-increment.html"><strong>Next</strong>3.5.3. Incrementing Associated Values</a></li></ul></body></html> \ No newline at end of file
diff --git a/SystemTap_Beginners_Guide/associativearrays.html b/SystemTap_Beginners_Guide/associativearrays.html
index 6e959de3..ef47630e 100644
--- a/SystemTap_Beginners_Guide/associativearrays.html
+++ b/SystemTap_Beginners_Guide/associativearrays.html
@@ -1,13 +1,15 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.4. Associative Arrays</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="understanding-how-systemtap-works.html" title="Chapter 3. Understanding How SystemTap Works" /><link rel="prev" href="commandlineargssect.html" title="3.3.4. Command-Line Arguments" /><link rel="next" href="arrayoperators.html" title="3.5. Array Operations in SystemTap" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="commandlineargssect.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="arrayoperators.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h2 class="title"><a id="associativearrays"></a>3.4. Associative Arrays</h2></div></div></div><a id="idm47951420873600" class="indexterm"></a><a id="idm47951429350848" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.4. Associative Arrays</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="understanding-how-systemtap-works.html" title="Chapter 3. Understanding How SystemTap Works" /><link rel="prev" href="commandlineargssect.html" title="3.3.4. Command-Line Arguments" /><link rel="next" href="arrayoperators.html" title="3.5. Array Operations in SystemTap" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="commandlineargssect.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="arrayoperators.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h2 class="title"><a id="associativearrays">
3 ⁠</a>3.4. Associative Arrays</h2></div></div></div><a id="idm214007233712" class="indexterm"></a><a id="idm214018905072" class="indexterm"></a><div class="para">
3 SystemTap also supports the use of associative arrays. While an ordinary variable represents a single value, associative arrays can represent a collection of values. Simply put, an associative array is a collection of unique keys; each key in the array has a value associated with it. 4 SystemTap also supports the use of associative arrays. While an ordinary variable represents a single value, associative arrays can represent a collection of values. Simply put, an associative array is a collection of unique keys; each key in the array has a value associated with it.
4 </div><a id="idm47951468330144" class="indexterm"></a><a id="idm47951456713952" class="indexterm"></a><a id="idm47951475551232" class="indexterm"></a><a id="idm47951457841888" class="indexterm"></a><a id="idm47951457839264" class="indexterm"></a><a id="idm47951427780864" class="indexterm"></a><a id="idm47951456296992" class="indexterm"></a><a id="idm47951429346912" class="indexterm"></a><div class="para"> 5 </div><a id="idm214018799152" class="indexterm"></a><a id="idm213979340784" class="indexterm"></a><a id="idm214007089824" class="indexterm"></a><a id="idm214017493712" class="indexterm"></a><a id="idm213969444112" class="indexterm"></a><a id="idm214016959840" class="indexterm"></a><a id="idm214026583152" class="indexterm"></a><a id="idm214009641888" class="indexterm"></a><div class="para">
5 Since associative arrays are normally processed in multiple probes (as we will demonstrate later), they should be declared as <code class="command">global</code> variables in the SystemTap script. The syntax for accessing an element in an associative array is similar to that of <code class="command">awk</code>, and is as follows: 6 Since associative arrays are normally processed in multiple probes (as we will demonstrate later), they should be declared as <code class="command">global</code> variables in the SystemTap script. The syntax for accessing an element in an associative array is similar to that of <code class="command">awk</code>, and is as follows:
6 </div><a id="idm47951468162656" class="indexterm"></a><a id="idm47951463622608" class="indexterm"></a><a id="idm47951463771856" class="indexterm"></a><pre class="screen"><em class="replaceable"><code>array_name</code></em>[<em class="replaceable"><code>index_expression</code></em>]</pre><div class="para"> 7 </div><a id="idm213975388304" class="indexterm"></a><a id="idm214021154928" class="indexterm"></a><a id="idm214026344944" class="indexterm"></a><pre class="screen"><em class="replaceable">array_name</em>[<em class="replaceable">index_expression</em>]</pre><div class="para">
7 Here, the <code class="command"><em class="replaceable"><code>array_name</code></em></code> is any arbitrary name the array uses. The <code class="command"><em class="replaceable"><code>index_expression</code></em></code> is used to refer to a specific unique key in the array. To illustrate, let us try to build an array named <code class="command">foo</code> that specifies the ages of three people <code class="command">tom</code>, <code class="command">dick</code>, and <code class="command">harry</code> (which are unique keys). To assign them the ages (associated values) of 23, 24, and 25 respectively, we'd use the following array statements: 8 Here, the <code class="command"><em class="replaceable">array_name</em></code> is any arbitrary name the array uses. The <code class="command"><em class="replaceable">index_expression</em></code> is used to refer to a specific unique key in the array. To illustrate, let us try to build an array named <code class="command">foo</code> that specifies the ages of three people <code class="command">tom</code>, <code class="command">dick</code>, and <code class="command">harry</code> (which are unique keys). To assign them the ages (associated values) of 23, 24, and 25 respectively, we'd use the following array statements:
8 </div><a id="idm47951457443712" class="indexterm"></a><a id="idm47951456157664" class="indexterm"></a><div class="example"><a id="arraysimplestexample"></a><p class="title"><strong>Example 3.13. Basic Array Statements</strong></p><div class="example-contents"><pre class="screen">foo["tom"] = 23 9 </div><a id="idm214012568416" class="indexterm"></a><a id="idm214010602368" class="indexterm"></a><div class="example"><a id="arraysimplestexample">
10 ⁠</a><p class="title"><strong>Example 3.13. Basic Array Statements</strong></p><div class="example-contents"><pre class="screen">foo["tom"] = 23
9foo["dick"] = 24 11foo["dick"] = 24
10foo["harry"] = 25</pre></div></div><br class="example-break" /><div class="para"> 12foo["harry"] = 25</pre></div></div><div class="para">
11 You can specify up to nine index expressions in an array statement, each one delimited by a comma (<code class="command">,</code>). This is useful if you wish to have a key that contains multiple pieces of information. The following line from <a class="xref" href="mainsect-disk.html#scriptdisktop">disktop.stp</a> uses 5 elements for the key: process ID, executable name, user ID, parent process ID, and string "W". It associates the value of <code class="command">devname</code> with that key. 13 You can specify up to nine index expressions in an array statement, each one delimited by a comma (<code class="command">,</code>). This is useful if you wish to have a key that contains multiple pieces of information. The following line from <a class="xref" href="mainsect-disk.html#scriptdisktop">disktop.stp</a> uses 5 elements for the key: process ID, executable name, user ID, parent process ID, and string "W". It associates the value of <code class="command">devname</code> with that key.
12 </div><pre class="screen">device[pid(),execname(),uid(),ppid(),"W"] = devname</pre><div xmlns:d="http://docbook.org/ns/docbook" class="important"><div class="admonition_header"><p><strong>Important</strong></p></div><div class="admonition"><div class="para"> 14 </div><pre class="screen">device[pid(),execname(),uid(),ppid(),"W"] = devname</pre><div xmlns:d="http://docbook.org/ns/docbook" class="important"><div class="admonition_header"><p><strong>Important</strong></p></div><div class="admonition"><div class="para">
13 All associate arrays must be declared as <code class="command">global</code>, regardless of whether the associate array is used in one or multiple probes. 15 All associate arrays must be declared as <code class="command">global</code>, regardless of whether the associate array is used in one or multiple probes.
diff --git a/SystemTap_Beginners_Guide/commandlineargssect.html b/SystemTap_Beginners_Guide/commandlineargssect.html
index 79025476..67d13d21 100644
--- a/SystemTap_Beginners_Guide/commandlineargssect.html
+++ b/SystemTap_Beginners_Guide/commandlineargssect.html
@@ -1,7 +1,9 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.3.4. Command-Line Arguments</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="scriptconstructions.html" title="3.3. Basic SystemTap Handler Constructs" /><link rel="prev" href="handlerconditionalstatements.html" title="3.3.3. Conditional Statements" /><link rel="next" href="associativearrays.html" title="3.4. Associative Arrays" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="handlerconditionalstatements.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="associativearrays.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="commandlineargssect"></a>3.3.4. Command-Line Arguments</h3></div></div></div><a id="idm47951466589664" class="indexterm"></a><a id="idm47951456300000" class="indexterm"></a><a id="idm47951459742944" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.3.4. Command-Line Arguments</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="scriptconstructions.html" title="3.3. Basic SystemTap Handler Constructs" /><link rel="prev" href="handlerconditionalstatements.html" title="3.3.3. Conditional Statements" /><link rel="next" href="associativearrays.html" title="3.4. Associative Arrays" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="handlerconditionalstatements.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="associativearrays.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="commandlineargssect">
3 ⁠</a>3.3.4. Command-Line Arguments</h3></div></div></div><a id="idm213967884160" class="indexterm"></a><a id="idm214018570432" class="indexterm"></a><a id="idm214018642432" class="indexterm"></a><div class="para">
3 A SystemTap script can also accept simple command-line arguments using a <code class="command">$</code> or <code class="command">@</code> immediately followed by the number of the argument on the command line. Use <code class="command">$</code> if you are expecting the user to enter an integer as a command-line argument, and <code class="command">@</code> if you are expecting a string. 4 A SystemTap script can also accept simple command-line arguments using a <code class="command">$</code> or <code class="command">@</code> immediately followed by the number of the argument on the command line. Use <code class="command">$</code> if you are expecting the user to enter an integer as a command-line argument, and <code class="command">@</code> if you are expecting a string.
4 </div><div class="example"><a id="commandlineargs"></a><p class="title"><strong>Example 3.12. commandlineargs.stp</strong></p><div class="example-contents"><pre class="programlisting">probe kernel.function(@1) { } 5 </div><div class="example"><a id="commandlineargs">
5probe kernel.function(@1).return { }</pre></div></div><br class="example-break" /><div class="para"> 6 ⁠</a><p class="title"><strong>Example 3.12. commandlineargs.stp</strong></p><div class="example-contents"><pre class="programlisting">probe kernel.function(@1) { }
6 <a class="xref" href="commandlineargssect.html#commandlineargs">Example 3.12, “commandlineargs.stp”</a> is similar to <a class="xref" href="scripts.html#wildcards">Example 3.1, “wildcards.stp”</a>, except that it allows you to pass the kernel function to be probed as a command-line argument (as in <code class="command">stap commandlineargs.stp <em class="replaceable"><code>kernel function</code></em></code>). You can also specify the script to accept multiple command-line arguments, noting them as <code class="command">@1</code>, <code class="command">@2</code>, and so on, in the order they are entered by the user. 7probe kernel.function(@1).return { }</pre></div></div><div class="para">
7 </div><a id="idm47951461492080" class="indexterm"></a><a id="idm47951461598432" class="indexterm"></a><a id="idm47951476264768" class="indexterm"></a></div><ul class="docnav"><li class="previous"><a accesskey="p" href="handlerconditionalstatements.html"><strong>Prev</strong>3.3.3. Conditional Statements</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="associativearrays.html"><strong>Next</strong>3.4. Associative Arrays</a></li></ul></body></html> \ No newline at end of file 8 <a class="xref" href="commandlineargssect.html#commandlineargs">Example 3.12, “commandlineargs.stp”</a> is similar to <a class="xref" href="scripts.html#wildcards">Example 3.1, “wildcards.stp”</a>, except that it allows you to pass the kernel function to be probed as a command-line argument (as in <code class="command">stap commandlineargs.stp <em class="replaceable">kernel function</em></code>). You can also specify the script to accept multiple command-line arguments, noting them as <code class="command">@1</code>, <code class="command">@2</code>, and so on, in the order they are entered by the user.
9 </div><a id="idm214018850480" class="indexterm"></a><a id="idm213972626800" class="indexterm"></a><a id="idm213971992432" class="indexterm"></a></div><ul class="docnav"><li class="previous"><a accesskey="p" href="handlerconditionalstatements.html"><strong>Prev</strong>3.3.3. Conditional Statements</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="associativearrays.html"><strong>Next</strong>3.4. Associative Arrays</a></li></ul></body></html> \ No newline at end of file
diff --git a/SystemTap_Beginners_Guide/cross-compiling.html b/SystemTap_Beginners_Guide/cross-compiling.html
index 6209b96f..233d220a 100644
--- a/SystemTap_Beginners_Guide/cross-compiling.html
+++ b/SystemTap_Beginners_Guide/cross-compiling.html
@@ -1,27 +1,29 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">2.2. Generating Instrumentation for Other Computers</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="using-systemtap.html" title="Chapter 2. Using SystemTap" /><link rel="prev" href="using-systemtap.html" title="Chapter 2. Using SystemTap" /><link rel="next" href="using-usage.html" title="2.3. Running SystemTap Scripts" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="using-systemtap.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="using-usage.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h2 class="title"><a id="cross-compiling"></a>2.2. Generating Instrumentation for Other Computers</h2></div></div></div><a id="idm47951466606512" class="indexterm"></a><a id="idm47951457694528" class="indexterm"></a><a id="idm47951462945440" class="indexterm"></a><a id="idm47951468141824" class="indexterm"></a><a id="idm47951469078592" class="indexterm"></a><a id="idm47951464609200" class="indexterm"></a><a id="idm47951460796288" class="indexterm"></a><a id="idm47951476318464" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">2.2. Generating Instrumentation for Other Computers</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="using-systemtap.html" title="Chapter 2. Using SystemTap" /><link rel="prev" href="using-systemtap.html" title="Chapter 2. Using SystemTap" /><link rel="next" href="using-usage.html" title="2.3. Running SystemTap Scripts" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="using-systemtap.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="using-usage.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h2 class="title"><a id="cross-compiling">
3 ⁠</a>2.2. Generating Instrumentation for Other Computers</h2></div></div></div><a id="idm213978436128" class="indexterm"></a><a id="idm213973987664" class="indexterm"></a><a id="idm214014021200" class="indexterm"></a><a id="idm213975700048" class="indexterm"></a><a id="idm214015541904" class="indexterm"></a><a id="idm213969565440" class="indexterm"></a><a id="idm214010451120" class="indexterm"></a><a id="idm214014059168" class="indexterm"></a><div class="para">
3 When users run a SystemTap script, SystemTap builds a kernel module out of that script. SystemTap then loads the module into the kernel, allowing it to extract the specified data directly from the kernel (refer to <a class="xref" href="understanding-how-systemtap-works.html#systemtapsession">Procedure 3.1, “SystemTap Session”</a> in <a class="xref" href="understanding-how-systemtap-works.html#understanding-architecture-tools">Section 3.1, “Architecture”</a> for more information). 4 When users run a SystemTap script, SystemTap builds a kernel module out of that script. SystemTap then loads the module into the kernel, allowing it to extract the specified data directly from the kernel (refer to <a class="xref" href="understanding-how-systemtap-works.html#systemtapsession">Procedure 3.1, “SystemTap Session”</a> in <a class="xref" href="understanding-how-systemtap-works.html#understanding-architecture-tools">Section 3.1, “Architecture”</a> for more information).
4 </div><div class="para"> 5 </div><div class="para">
5 Normally, however, SystemTap scripts can only be run on systems where SystemTap is deployed (as in <a class="xref" href="using-systemtap.html#using-setup">Section 2.1, “Installation and Setup”</a>). This could mean that if you want to run SystemTap on ten systems, you would need to deploy SystemTap on <span class="emphasis"><em>all</em></span> those systems. In some cases, this may be neither feasible nor desired. For instance, corporate policy may prohibit an administrator from installing RPM packages that provide compilers or debug information on specific machines, and thus prevent the deployment of SystemTap. To work around this problem, SystemTap allows you to use <em class="firstterm">cross-instrumentation</em>. 6 Normally, however, SystemTap scripts can only be run on systems where SystemTap is deployed (as in <a class="xref" href="using-systemtap.html#using-setup">Section 2.1, “Installation and Setup”</a>). This could mean that if you want to run SystemTap on ten systems, you would need to deploy SystemTap on <span class="emphasis"><em>all</em></span> those systems. In some cases, this may be neither feasible nor desired. For instance, corporate policy may prohibit an administrator from installing RPM packages that provide compilers or debug information on specific machines, and thus prevent the deployment of SystemTap. To work around this problem, SystemTap allows you to use <em class="firstterm">cross-instrumentation</em>.
6 </div><div class="para"> 7 </div><div class="para">
7 Cross-instrumentation is the process of generating SystemTap instrumentation module from a SystemTap script on one computer to be used on another computer. This process offers the following benefits: 8 Cross-instrumentation is the process of generating SystemTap instrumentation module from a SystemTap script on one computer to be used on another computer. This process offers the following benefits:
8 </div><a id="idm47951469099984" class="indexterm"></a><a id="idm47951461471792" class="indexterm"></a><div xmlns:d="http://docbook.org/ns/docbook" class="itemizedlist"><ul><li class="listitem"><div class="para"> 9 </div><a id="idm214007277376" class="indexterm"></a><a id="idm214007237696" class="indexterm"></a><div xmlns:d="http://docbook.org/ns/docbook" class="itemizedlist"><ul><li class="listitem"><div class="para">
9 The kernel information packages for various machines can be installed on a single <span class="emphasis"><em>host machine</em></span>. 10 The kernel information packages for various machines can be installed on a single <span class="emphasis"><em>host machine</em></span>.
10 </div></li><li class="listitem"><div class="para"> 11 </div></li><li class="listitem"><div class="para">
11 Each <span class="emphasis"><em>target machine</em></span> only needs one RPM package to be installed in order to use the generated SystemTap instrumentation module: the <span class="package">systemtap-runtime</span> package. 12 Each <span class="emphasis"><em>target machine</em></span> only needs one RPM package to be installed in order to use the generated SystemTap instrumentation module: the <span class="package">systemtap-runtime</span> package.
12 </div></li></ul></div><div class="para"> 13 </div></li></ul></div><div class="para">
13 For the sake of simplicity, the following terms are used throughout this section: 14 For the sake of simplicity, the following terms are used throughout this section:
14 </div><div xmlns:d="http://docbook.org/ns/docbook" class="itemizedlist"><ul><li class="listitem"><div class="para"> 15 </div><div xmlns:d="http://docbook.org/ns/docbook" class="itemizedlist"><ul><li class="listitem"><div class="para">
15 <a id="idm47951415797216" class="indexterm"></a> <a id="idm47951461387648" class="indexterm"></a> <span class="emphasis"><em>Instrumentation module</em></span> — the kernel module built from a SystemTap script. The <span class="emphasis"><em>SystemTap module</em></span> is built on the <span class="emphasis"><em>host system</em></span>, and will be loaded on the <span class="emphasis"><em>target kernel</em></span> of <span class="emphasis"><em>target system</em></span>. 16 <a id="idm213972682672" class="indexterm"></a> <a id="idm214012266752" class="indexterm"></a> <span class="emphasis"><em>Instrumentation module</em></span> — the kernel module built from a SystemTap script. The <span class="emphasis"><em>SystemTap module</em></span> is built on the <span class="emphasis"><em>host system</em></span>, and will be loaded on the <span class="emphasis"><em>target kernel</em></span> of <span class="emphasis"><em>target system</em></span>.
16 </div></li><li class="listitem"><div class="para"> 17 </div></li><li class="listitem"><div class="para">
17 <a id="idm47951461377568" class="indexterm"></a> <a id="idm47951463669056" class="indexterm"></a> <span class="emphasis"><em>Host system</em></span> — the system on which you compile the <span class="emphasis"><em>instrumentation modules</em></span> from SystemTap scripts in order to load them on <span class="emphasis"><em>target systems</em></span>. 18 <a id="idm214008631440" class="indexterm"></a> <a id="idm214018432416" class="indexterm"></a> <span class="emphasis"><em>Host system</em></span> — the system on which you compile the <span class="emphasis"><em>instrumentation modules</em></span> from SystemTap scripts in order to load them on <span class="emphasis"><em>target systems</em></span>.
18 </div></li><li class="listitem"><div class="para"> 19 </div></li><li class="listitem"><div class="para">
19 <a id="idm47951475665056" class="indexterm"></a> <a id="idm47951416182656" class="indexterm"></a> <span class="emphasis"><em>Target system</em></span> — the system for which you are building the <span class="emphasis"><em>instrumentation modules</em></span> from SystemTap scripts. 20 <a id="idm213970633024" class="indexterm"></a> <a id="idm213970632064" class="indexterm"></a> <span class="emphasis"><em>Target system</em></span> — the system for which you are building the <span class="emphasis"><em>instrumentation modules</em></span> from SystemTap scripts.
20 </div></li><li class="listitem"><div class="para"> 21 </div></li><li class="listitem"><div class="para">
21 <a id="idm47951428029136" class="indexterm"></a> <a id="idm47951464505904" class="indexterm"></a> <span class="emphasis"><em>Target kernel</em></span> — the kernel of the <span class="emphasis"><em>target system</em></span>. This is the kernel on which you intend to load or run the <span class="emphasis"><em>instrumentation module</em></span>. 22 <a id="idm214017439440" class="indexterm"></a> <a id="idm214013912832" class="indexterm"></a> <span class="emphasis"><em>Target kernel</em></span> — the kernel of the <span class="emphasis"><em>target system</em></span>. This is the kernel on which you intend to load or run the <span class="emphasis"><em>instrumentation module</em></span>.
22 </div></li></ul></div><div class="para"> 23 </div></li></ul></div><div class="para">
23 To configure a host system and target systems, complete the following steps: 24 To configure a host system and target systems, complete the following steps:
24 </div><div xmlns:d="http://docbook.org/ns/docbook" class="procedure"><a id="preppingxcompile"></a><a id="idm47951464565376" class="indexterm"></a><a id="idm47951464498976" class="indexterm"></a><a id="idm47951461367568" class="indexterm"></a><ol class="1"><li class="step"><div class="para"> 25 </div><div xmlns:d="http://docbook.org/ns/docbook" class="procedure"><a id="preppingxcompile">
26 ⁠</a><a id="idm214017323360" class="indexterm"></a><a id="idm214015248464" class="indexterm"></a><a id="idm214017102064" class="indexterm"></a><ol class="1"><li class="step"><div class="para">
25 Install the <span class="package">systemtap-runtime</span> package on each <span class="emphasis"><em>target system</em></span>. 27 Install the <span class="package">systemtap-runtime</span> package on each <span class="emphasis"><em>target system</em></span>.
26 </div></li><li class="step"><div class="para"> 28 </div></li><li class="step"><div class="para">
27 Determine the kernel running on each <span class="emphasis"><em>target system</em></span> by running the <code class="command">uname -r</code> command on each of these systems. 29 Determine the kernel running on each <span class="emphasis"><em>target system</em></span> by running the <code class="command">uname -r</code> command on each of these systems.
@@ -33,13 +35,13 @@
33 After completing these steps, you can now build the <span class="emphasis"><em>instrumentation module</em></span> (for any <span class="emphasis"><em>target system</em></span>) on the <span class="emphasis"><em>host system</em></span>. 35 After completing these steps, you can now build the <span class="emphasis"><em>instrumentation module</em></span> (for any <span class="emphasis"><em>target system</em></span>) on the <span class="emphasis"><em>host system</em></span>.
34 </div><div class="para"> 36 </div><div class="para">
35 To build the <span class="emphasis"><em>instrumentation module</em></span>, run the following command on the <span class="emphasis"><em>host system</em></span> (be sure to specify the appropriate values): 37 To build the <span class="emphasis"><em>instrumentation module</em></span>, run the following command on the <span class="emphasis"><em>host system</em></span> (be sure to specify the appropriate values):
36 </div><pre class="screen"><code class="command">stap -r <em class="replaceable"><code>kernel_version</code></em> <em class="replaceable"><code>script</code></em> -m <em class="replaceable"><code>module_name</code></em></code></pre><div class="para"> 38 </div><pre class="screen"><code class="command">stap -r <em class="replaceable">kernel_version</em> <em class="replaceable">script</em> -m <em class="replaceable">module_name</em></code></pre><div class="para">
37 Here, <em class="replaceable"><code>kernel_version</code></em> refers to the version of the <span class="emphasis"><em>target kernel</em></span> (the output of the <code class="command">uname -r</code> command on the target machine), <em class="replaceable"><code>script</code></em> refers to the script to be converted into the <span class="emphasis"><em>instrumentation module</em></span>, and <em class="replaceable"><code>module_name</code></em> is the desired name of the <span class="emphasis"><em>instrumentation module</em></span>. 39 Here, <em class="replaceable">kernel_version</em> refers to the version of the <span class="emphasis"><em>target kernel</em></span> (the output of the <code class="command">uname -r</code> command on the target machine), <em class="replaceable">script</em> refers to the script to be converted into the <span class="emphasis"><em>instrumentation module</em></span>, and <em class="replaceable">module_name</em> is the desired name of the <span class="emphasis"><em>instrumentation module</em></span>.
38 </div><div xmlns:d="http://docbook.org/ns/docbook" class="note"><div class="admonition_header"><p><strong>Note</strong></p></div><div class="admonition"><a id="idm47951427714880" class="indexterm"></a><a id="idm47951458643632" class="indexterm"></a><a id="idm47951458642608" class="indexterm"></a><div class="para"> 40 </div><div xmlns:d="http://docbook.org/ns/docbook" class="note"><div class="admonition_header"><p><strong>Note</strong></p></div><div class="admonition"><a id="idm214012739168" class="indexterm"></a><a id="idm214012738208" class="indexterm"></a><a id="idm214015375056" class="indexterm"></a><div class="para">
39 To determine the architecture notation of a running kernel, you can run the following command: 41 To determine the architecture notation of a running kernel, you can run the following command:
40 </div><pre class="screen"><code class="command">uname -m</code></pre></div></div><div class="para"> 42 </div><pre class="screen"><code class="command">uname -m</code></pre></div></div><div class="para">
41 Once the <span class="emphasis"><em>instrumentation module</em></span> is compiled, copy it to the <span class="emphasis"><em>target system</em></span> and then load it using: 43 Once the <span class="emphasis"><em>instrumentation module</em></span> is compiled, copy it to the <span class="emphasis"><em>target system</em></span> and then load it using:
42 </div><pre class="screen"><code class="command">staprun <em class="replaceable"><code>module_name</code></em>.ko</code></pre><div class="para"> 44 </div><pre class="screen"><code class="command">staprun <em class="replaceable">module_name</em>.ko</code></pre><div class="para">
43 For example, to create the <span class="emphasis"><em>instrumentation module</em></span> <code class="filename">simple.ko</code> from a SystemTap script named <code class="filename">simple.stp</code> for the <span class="emphasis"><em>target kernel</em></span> 2.6.18-92.1.10.el5 (on x86_64 architecture), use the following command: 45 For example, to create the <span class="emphasis"><em>instrumentation module</em></span> <code class="filename">simple.ko</code> from a SystemTap script named <code class="filename">simple.stp</code> for the <span class="emphasis"><em>target kernel</em></span> 2.6.18-92.1.10.el5 (on x86_64 architecture), use the following command:
44 </div><pre class="screen"><code class="command">stap -r 2.6.18-92.1.10.el5 -e 'probe vfs.read {exit()}' -m simple</code></pre><div class="para"> 46 </div><pre class="screen"><code class="command">stap -r 2.6.18-92.1.10.el5 -e 'probe vfs.read {exit()}' -m simple</code></pre><div class="para">
45 This creates a module named <code class="filename">simple.ko</code>. To use this <span class="emphasis"><em>instrumentation module</em></span>, copy it to the <span class="emphasis"><em>target system</em></span> and run the following command (on the <span class="emphasis"><em>target system</em></span>): 47 This creates a module named <code class="filename">simple.ko</code>. To use this <span class="emphasis"><em>instrumentation module</em></span>, copy it to the <span class="emphasis"><em>target system</em></span> and run the following command (on the <span class="emphasis"><em>target system</em></span>):
diff --git a/SystemTap_Beginners_Guide/errors.html b/SystemTap_Beginners_Guide/errors.html
index 6f2507c6..10e65305 100644
--- a/SystemTap_Beginners_Guide/errors.html
+++ b/SystemTap_Beginners_Guide/errors.html
@@ -1,9 +1,12 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">Chapter 6. Understanding SystemTap Errors</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="index.html" title="SystemTap Beginners Guide" /><link rel="prev" href="futexcontentionsect.html" title="5.4. Identifying Contended User-Space Locks" /><link rel="next" href="runtimeerror.html" title="6.2. Runtime Errors and Warnings" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="futexcontentionsect.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="runtimeerror.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="chapter" lang="en-US"><div class="titlepage"><div><div><h1 class="title"><a id="errors"></a>Chapter 6. Understanding SystemTap Errors</h1></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="errors.html#parsetype">6.1. Parse and Semantic Errors</a></span></dt><dt><span class="section"><a href="runtimeerror.html">6.2. Runtime Errors and Warnings</a></span></dt></dl></div><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">Chapter 6. Understanding SystemTap Errors</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="index.html" title="SystemTap Beginners Guide" /><link rel="prev" href="futexcontentionsect.html" title="5.4. Identifying Contended User-Space Locks" /><link rel="next" href="runtimeerror.html" title="6.2. Runtime Errors and Warnings" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="futexcontentionsect.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="runtimeerror.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="chapter" lang="en-US"><div class="titlepage"><div><div><h1 class="title"><a id="errors">
3 ⁠</a>Chapter 6. Understanding SystemTap Errors</h1></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="errors.html#parsetype">6.1. Parse and Semantic Errors</a></span></dt><dt><span class="section"><a href="runtimeerror.html">6.2. Runtime Errors and Warnings</a></span></dt></dl></div><div class="para">
3 This chapter explains the most common errors you may encounter while using SystemTap. 4 This chapter explains the most common errors you may encounter while using SystemTap.
4 </div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="parsetype"></a>6.1. Parse and Semantic Errors</h2></div></div></div><a id="idm47951416904288" class="indexterm"></a><a id="idm47951468205168" class="indexterm"></a><a id="idm47951418188384" class="indexterm"></a><div class="para"> 5 </div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="parsetype">
6 ⁠</a>6.1. Parse and Semantic Errors</h2></div></div></div><a id="idm214018066656" class="indexterm"></a><a id="idm214018728064" class="indexterm"></a><a id="idm213968388096" class="indexterm"></a><div class="para">
5 Parse and semantic errors occur while SystemTap attempts to parse and translate the script into C, before converting it into a kernel module. For example, type errors result from operations that assign invalid values to variables or arrays. 7 Parse and semantic errors occur while SystemTap attempts to parse and translate the script into C, before converting it into a kernel module. For example, type errors result from operations that assign invalid values to variables or arrays.
6 </div><h3><a id="idm47951415685200"></a>parse error: expected <em class="replaceable"><code>foo</code></em>, saw <em class="replaceable"><code>bar</code></em></h3><a id="idm47951417412080" class="indexterm"></a><a id="idm47951429234176" class="indexterm"></a><a id="idm47951420816688" class="indexterm"></a><a id="idm47951471219664" class="indexterm"></a><a id="idm47951471217296" class="indexterm"></a><a id="idm47951460953392" class="indexterm"></a><a id="idm47951460951312" class="indexterm"></a><a id="idm47951460949264" class="indexterm"></a><a id="idm47951457247760" class="indexterm"></a><div class="para"> 8 </div><h3><a id="idm213969753536">
9 ⁠</a>parse error: expected <em class="replaceable">foo</em>, saw <em class="replaceable">bar</em></h3><a id="idm213974386512" class="indexterm"></a><a id="idm213974173104" class="indexterm"></a><a id="idm214015217312" class="indexterm"></a><a id="idm214006639776" class="indexterm"></a><a id="idm214020489280" class="indexterm"></a><a id="idm213968114048" class="indexterm"></a><a id="idm214018621392" class="indexterm"></a><a id="idm214018619536" class="indexterm"></a><a id="idm213970547696" class="indexterm"></a><div class="para">
7 The script contains a grammatical or typographical error. SystemTap detected the type of the construct that is incorrect, given the context of the probe. 10 The script contains a grammatical or typographical error. SystemTap detected the type of the construct that is incorrect, given the context of the probe.
8 </div><div class="para"> 11 </div><div class="para">
9 For example, the following invalid SystemTap script is missing its probe handlers: 12 For example, the following invalid SystemTap script is missing its probe handlers:
@@ -19,34 +22,46 @@ probe vfs.write
19<pre class="programlisting">parse error: expected one of '. , ( ? ! { = +=' 22<pre class="programlisting">parse error: expected one of '. , ( ? ! { = +='
20 saw: keyword at perror.stp:2:1 23 saw: keyword at perror.stp:2:1
211 parse error(s).</pre> 241 parse error(s).</pre>
22 </div><h3><a id="idm47951466641648"></a>parse error: embedded code in unprivileged script</h3><a id="idm47951466640800" class="indexterm"></a><a id="idm47951466638752" class="indexterm"></a><a id="idm47951466636672" class="indexterm"></a><a id="idm47951466614192" class="indexterm"></a><a id="idm47951466612144" class="indexterm"></a><a id="idm47951466610096" class="indexterm"></a><div class="para"> 25 </div><h3><a id="idm214017381744">
26 ⁠</a>parse error: embedded code in unprivileged script</h3><a id="idm214017380976" class="indexterm"></a><a id="idm214017379120" class="indexterm"></a><a id="idm214017377232" class="indexterm"></a><a id="idm214017375376" class="indexterm"></a><a id="idm214007406160" class="indexterm"></a><a id="idm214007404304" class="indexterm"></a><div class="para">
23 The script contains unsafe embedded C code, that is, blocks of code surrounded by <code class="command">%{</code> and <code class="command">%}</code>. SystemTap allows you to embed C code in a script, which is useful if there are no tapsets to suit your purposes. However, embedded C constructs are not safe and SystemTap reports this error to warn you if such constructs appear in the script. 27 The script contains unsafe embedded C code, that is, blocks of code surrounded by <code class="command">%{</code> and <code class="command">%}</code>. SystemTap allows you to embed C code in a script, which is useful if there are no tapsets to suit your purposes. However, embedded C constructs are not safe and SystemTap reports this error to warn you if such constructs appear in the script.
24 </div><a id="idm47951441775184" class="indexterm"></a><a id="idm47951441773104" class="indexterm"></a><a id="idm47951441770992" class="indexterm"></a><a id="idm47951441768912" class="indexterm"></a><div class="para"> 28 </div><a id="idm214007400528" class="indexterm"></a><a id="idm214019019888" class="indexterm"></a><a id="idm214019017968" class="indexterm"></a><a id="idm214019016080" class="indexterm"></a><div class="para">
25 If you are sure that any similar constructs in the script are safe <span class="emphasis"><em>and</em></span> you are a member of the <code class="systemitem">stapdev</code> group (or have root privileges), run the script in "guru" mode by using the <code class="option">-g</code> option: 29 If you are sure that any similar constructs in the script are safe <span class="emphasis"><em>and</em></span> you are a member of the <code class="systemitem">stapdev</code> group (or have root privileges), run the script in "guru" mode by using the <code class="option">-g</code> option:
26 </div><pre class="screen"><code class="command">stap -g <em class="replaceable"><code>script</code></em></code></pre><h3><a id="idm47951475543648"></a>semantic error: type mismatch for identifier '<em class="replaceable"><code>foo</code></em>' ... string vs. long</h3><a id="idm47951475542272" class="indexterm"></a><a id="idm47951475540224" class="indexterm"></a><a id="idm47951455844192" class="indexterm"></a><a id="idm47951455842144" class="indexterm"></a><a id="idm47951455840096" class="indexterm"></a><div class="para"> 30 </div><pre class="screen"><code class="command">stap -g <em class="replaceable">script</em></code></pre><h3><a id="idm213973562864">
27 The function <em class="replaceable"><code>foo</code></em> in the script used the wrong type (such as <code class="literal">%s</code> or <code class="literal">%d</code>). In the following example, the format specifier should be <code class="literal">%s</code> and not <code class="literal">%d</code>, because the <code class="function">execname()</code> function returns a string: 31 ⁠</a>semantic error: type mismatch for identifier '<em class="replaceable">foo</em>' ... string vs. long</h3><a id="idm213973561616" class="indexterm"></a><a id="idm213973559760" class="indexterm"></a><a id="idm213973557872" class="indexterm"></a><a id="idm214014278160" class="indexterm"></a><a id="idm214014276304" class="indexterm"></a><div class="para">
32 The function <em class="replaceable">foo</em> in the script used the wrong type (such as <code class="literal">%s</code> or <code class="literal">%d</code>). In the following example, the format specifier should be <code class="literal">%s</code> and not <code class="literal">%d</code>, because the <code class="function">execname()</code> function returns a string:
28 </div><pre class="programlisting">probe syscall.open 33 </div><pre class="programlisting">probe syscall.open
29{ 34{
30 printf ("%d(%d) open\n", execname(), pid()) 35 printf ("%d(%d) open\n", execname(), pid())
31}</pre><h3><a id="idm47951501051216"></a>semantic error: unresolved type for identifier '<em class="replaceable"><code>foo</code></em>'</h3><a id="idm47951501049840" class="indexterm"></a><a id="idm47951501047792" class="indexterm"></a><a id="idm47951417001008" class="indexterm"></a><a id="idm47951416998960" class="indexterm"></a><div class="para"> 36}</pre><h3><a id="idm213970932240">
37 ⁠</a>semantic error: unresolved type for identifier '<em class="replaceable">foo</em>'</h3><a id="idm213970930992" class="indexterm"></a><a id="idm213970929136" class="indexterm"></a><a id="idm213970927248" class="indexterm"></a><a id="idm214021182224" class="indexterm"></a><div class="para">
32 The identifier (variable) was used, but no type (integer or string) could be determined. This occurs, for instance, if you use a variable in a <code class="command">printf</code> statement while the script never assigns a value to the variable. 38 The identifier (variable) was used, but no type (integer or string) could be determined. This occurs, for instance, if you use a variable in a <code class="command">printf</code> statement while the script never assigns a value to the variable.
33 </div><h3><a id="idm47951416995760"></a>semantic error: Expecting symbol or array index expression</h3><a id="idm47951416994912" class="indexterm"></a><a id="idm47951468564832" class="indexterm"></a><a id="idm47951468562752" class="indexterm"></a><a id="idm47951468560704" class="indexterm"></a><div class="para"> 39 </div><h3><a id="idm214021179312">
40 ⁠</a>semantic error: Expecting symbol or array index expression</h3><a id="idm214021178544" class="indexterm"></a><a id="idm214021176688" class="indexterm"></a><a id="idm214011392704" class="indexterm"></a><a id="idm214011390848" class="indexterm"></a><div class="para">
34 SystemTap could not assign a value to a variable or to a location in an array. The destination for the assignment is not a valid destination. The following example code would generate this error: 41 SystemTap could not assign a value to a variable or to a location in an array. The destination for the assignment is not a valid destination. The following example code would generate this error:
35 </div><pre class="programlisting">probe begin { printf("x") = 1 } 42 </div><pre class="programlisting">probe begin { printf("x") = 1 }
36</pre><h3><a id="idm47951462943120"></a>while searching for arity <em class="replaceable"><code>N</code></em> function, semantic error: unresolved function call</h3><a id="idm47951462941776" class="indexterm"></a><a id="idm47951462939728" class="indexterm"></a><a id="idm47951462937648" class="indexterm"></a><a id="idm47951456169040" class="indexterm"></a><a id="idm47951456166992" class="indexterm"></a><div class="para"> 43</pre><h3><a id="idm214011387520">
44 ⁠</a>while searching for arity <em class="replaceable">N</em> function, semantic error: unresolved function call</h3><a id="idm214011386304" class="indexterm"></a><a id="idm213972581824" class="indexterm"></a><a id="idm213972579936" class="indexterm"></a><a id="idm213972578080" class="indexterm"></a><a id="idm213972576224" class="indexterm"></a><div class="para">
37 A function call or array index expression in the script used an invalid number of arguments or parameters. In SystemTap, <em class="firstterm">arity</em> can either refer to the number of indices for an array, or the number of parameters to a function. 45 A function call or array index expression in the script used an invalid number of arguments or parameters. In SystemTap, <em class="firstterm">arity</em> can either refer to the number of indices for an array, or the number of parameters to a function.
38 </div><h3><a id="idm47951456163808"></a>semantic error: array locals not supported, missing global declaration?</h3><a id="idm47951456162784" class="indexterm"></a><a id="idm47951464460128" class="indexterm"></a><a id="idm47951464458048" class="indexterm"></a><a id="idm47951464455936" class="indexterm"></a><a id="idm47951464453856" class="indexterm"></a><div class="para"> 46 </div><h3><a id="idm214018075536">
47 ⁠</a>semantic error: array locals not supported, missing global declaration?</h3><a id="idm214018074608" class="indexterm"></a><a id="idm214018072752" class="indexterm"></a><a id="idm214018070864" class="indexterm"></a><a id="idm214010640208" class="indexterm"></a><a id="idm214010638320" class="indexterm"></a><div class="para">
39 The script used an array operation without declaring the array as a global variable (global variables can be declared after their use in SystemTap scripts). Similar messages appear if an array is used, but with inconsistent arities. 48 The script used an array operation without declaring the array as a global variable (global variables can be declared after their use in SystemTap scripts). Similar messages appear if an array is used, but with inconsistent arities.
40 </div><h3><a id="idm47951475511296"></a>semantic error: variable '<em class="replaceable"><code>foo</code></em>' modified during 'foreach' iteration</h3><a id="idm47951475509952" class="indexterm"></a><a id="idm47951475507904" class="indexterm"></a><a id="idm47951475505824" class="indexterm"></a><a id="idm47951416348176" class="indexterm"></a><div class="para"> 49 </div><h3><a id="idm214010635728">
41 The array <em class="replaceable"><code>foo</code></em> is being modified (being assigned to or deleted from) within an active <code class="command">foreach</code> loop. This error also displays if an operation within the script performs a function call within the <code class="command">foreach</code> loop. 50 ⁠</a>semantic error: variable '<em class="replaceable">foo</em>' modified during 'foreach' iteration</h3><a id="idm214010634512" class="indexterm"></a><a id="idm214011831328" class="indexterm"></a><a id="idm214011829440" class="indexterm"></a><a id="idm214011827584" class="indexterm"></a><div class="para">
42 </div><h3><a id="idm47951416344080"></a>semantic error: probe point mismatch at position <em class="replaceable"><code>N</code></em>, while resolving probe point <em class="replaceable"><code>foo</code></em></h3><a id="idm47951416342208" class="indexterm"></a><a id="idm47951415712976" class="indexterm"></a><a id="idm47951415710864" class="indexterm"></a><a id="idm47951415708784" class="indexterm"></a><div class="para"> 51 The array <em class="replaceable">foo</em> is being modified (being assigned to or deleted from) within an active <code class="command">foreach</code> loop. This error also displays if an operation within the script performs a function call within the <code class="command">foreach</code> loop.
43 SystemTap did not understand what the event or SystemTap function <em class="replaceable"><code>foo</code></em> refers to. This usually means that SystemTap could not find a match for <em class="replaceable"><code>foo</code></em> in the tapset library. <em class="replaceable"><code>N</code></em> refers to the line and column of the error. 52 </div><h3><a id="idm214011384608">
44 </div><h3><a id="idm47951460885568"></a>semantic error: no match for probe point, while resolving probe point <em class="replaceable"><code>foo</code></em></h3><a id="idm47951460884192" class="indexterm"></a><a id="idm47951460882144" class="indexterm"></a><a id="idm47951460880064" class="indexterm"></a><a id="idm47951424816640" class="indexterm"></a><a id="idm47951424814592" class="indexterm"></a><div class="para"> 53 ⁠</a>semantic error: probe point mismatch at position <em class="replaceable">N</em>, while resolving probe point <em class="replaceable">foo</em></h3><a id="idm214011382912" class="indexterm"></a><a id="idm214011381024" class="indexterm"></a><a id="idm214011379104" class="indexterm"></a><a id="idm214018616544" class="indexterm"></a><div class="para">
45 SystemTap could not resolve the events or handler function <em class="replaceable"><code>foo</code></em> for a variety of reasons. This error occurs when the script contains the event <code class="command">kernel.function("<em class="replaceable"><code>something</code></em>")</code>, and <em class="replaceable"><code>something</code></em> does not exist. In some cases, the error could also mean the script contains an invalid kernel file name or source line number. 54 SystemTap did not understand what the event or SystemTap function <em class="replaceable">foo</em> refers to. This usually means that SystemTap could not find a match for <em class="replaceable">foo</em> in the tapset library. <em class="replaceable">N</em> refers to the line and column of the error.
46 </div><h3><a id="idm47951476087232"></a>semantic error: unresolved target-symbol expression</h3><a id="idm47951476086384" class="indexterm"></a><a id="idm47951476084336" class="indexterm"></a><a id="idm47951476082256" class="indexterm"></a><a id="idm47951476080208" class="indexterm"></a><a id="idm47951441635744" class="indexterm"></a><div class="para"> 55 </div><h3><a id="idm214018612240">
56 ⁠</a>semantic error: no match for probe point, while resolving probe point <em class="replaceable">foo</em></h3><a id="idm214018610992" class="indexterm"></a><a id="idm214013866816" class="indexterm"></a><a id="idm214013864928" class="indexterm"></a><a id="idm214013863072" class="indexterm"></a><a id="idm214013861216" class="indexterm"></a><div class="para">
57 SystemTap could not resolve the events or handler function <em class="replaceable">foo</em> for a variety of reasons. This error occurs when the script contains the event <code class="command">kernel.function("<em class="replaceable">something</em>")</code>, and <em class="replaceable">something</em> does not exist. In some cases, the error could also mean the script contains an invalid kernel file name or source line number.
58 </div><h3><a id="idm213968361488">
59 ⁠</a>semantic error: unresolved target-symbol expression</h3><a id="idm213968360720" class="indexterm"></a><a id="idm213968358864" class="indexterm"></a><a id="idm213968356976" class="indexterm"></a><a id="idm214004714928" class="indexterm"></a><a id="idm214004713072" class="indexterm"></a><div class="para">
47 A handler in the script references a target variable, but the value of the variable could not be resolved. This error could also mean that a handler is referencing a target variable that is not valid in the context when it was referenced. This may be a result of compiler optimization of the generated code. 60 A handler in the script references a target variable, but the value of the variable could not be resolved. This error could also mean that a handler is referencing a target variable that is not valid in the context when it was referenced. This may be a result of compiler optimization of the generated code.
48 </div><h3><a id="idm47951441632864"></a>semantic error: libdwfl failure </h3><a id="idm47951441631840" class="indexterm"></a><a id="idm47951441629760" class="indexterm"></a><a id="idm47951468900880" class="indexterm"></a><a id="idm47951468898800" class="indexterm"></a><div class="para"> 61 </div><h3><a id="idm214004710432">
62 ⁠</a>semantic error: libdwfl failure </h3><a id="idm214004709504" class="indexterm"></a><a id="idm214018772288" class="indexterm"></a><a id="idm214018770368" class="indexterm"></a><a id="idm214018768480" class="indexterm"></a><div class="para">
49 There was a problem processing the debugging information. In most cases, this error results from the installation of a <span class="package">kernel-debuginfo</span> package whose version does not match the probed kernel exactly. The installed <span class="package">kernel-debuginfo</span> package itself may have some consistency or correctness problems. 63 There was a problem processing the debugging information. In most cases, this error results from the installation of a <span class="package">kernel-debuginfo</span> package whose version does not match the probed kernel exactly. The installed <span class="package">kernel-debuginfo</span> package itself may have some consistency or correctness problems.
50 </div><h3><a id="idm47951468895088"></a>semantic error: cannot find <em class="replaceable"><code>foo</code></em> debuginfo</h3><div class="para"> 64 </div><h3><a id="idm214020533568">
65 ⁠</a>semantic error: cannot find <em class="replaceable">foo</em> debuginfo</h3><div class="para">
51 SystemTap could not find a suitable <span class="package">kernel-debuginfo</span> package. 66 SystemTap could not find a suitable <span class="package">kernel-debuginfo</span> package.
52 </div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="futexcontentionsect.html"><strong>Prev</strong>5.4. Identifying Contended User-Space Locks</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="runtimeerror.html"><strong>Next</strong>6.2. Runtime Errors and Warnings</a></li></ul></body></html> \ No newline at end of file 67 </div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="futexcontentionsect.html"><strong>Prev</strong>5.4. Identifying Contended User-Space Locks</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="runtimeerror.html"><strong>Next</strong>6.2. Runtime Errors and Warnings</a></li></ul></body></html> \ No newline at end of file
diff --git a/SystemTap_Beginners_Guide/futexcontentionsect.html b/SystemTap_Beginners_Guide/futexcontentionsect.html
index ba1a9f8f..c616885b 100644
--- a/SystemTap_Beginners_Guide/futexcontentionsect.html
+++ b/SystemTap_Beginners_Guide/futexcontentionsect.html
@@ -1,11 +1,12 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">5.4. Identifying Contended User-Space Locks</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="useful-systemtap-scripts.html" title="Chapter 5. Useful SystemTap Scripts" /><link rel="prev" href="syscallsbyprocpidsect.html" title="5.3.6. Tracking System Call Volume Per Process" /><link rel="next" href="errors.html" title="Chapter 6. Understanding SystemTap Errors" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="syscallsbyprocpidsect.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="errors.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h2 class="title"><a id="futexcontentionsect"></a>5.4. Identifying Contended User-Space Locks</h2></div></div></div><a id="idm47951468567584" class="indexterm"></a><a id="idm47951415646096" class="indexterm"></a><a id="idm47951469025536" class="indexterm"></a><a id="idm47951457196304" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">5.4. Identifying Contended User-Space Locks</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="useful-systemtap-scripts.html" title="Chapter 5. Useful SystemTap Scripts" /><link rel="prev" href="syscallsbyprocpidsect.html" title="5.3.6. Tracking System Call Volume Per Process" /><link rel="next" href="errors.html" title="Chapter 6. Understanding SystemTap Errors" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="syscallsbyprocpidsect.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="errors.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h2 class="title"><a id="futexcontentionsect">
3 ⁠</a>5.4. Identifying Contended User-Space Locks</h2></div></div></div><a id="idm214007214768" class="indexterm"></a><a id="idm214026404128" class="indexterm"></a><a id="idm214011505328" class="indexterm"></a><a id="idm214018396784" class="indexterm"></a><div class="para">
3 This section describes how to identify contended user-space locks throughout the system within a specific time period. The ability to identify contended user-space locks can help you investigate poor program performance that you suspect may be caused by <code class="command">futex</code> contentions. 4 This section describes how to identify contended user-space locks throughout the system within a specific time period. The ability to identify contended user-space locks can help you investigate poor program performance that you suspect may be caused by <code class="command">futex</code> contentions.
4 </div><a id="idm47951474961760" class="indexterm"></a><a id="idm47951454811360" class="indexterm"></a><a id="idm47951454809840" class="indexterm"></a><a id="idm47951421049440" class="indexterm"></a><a id="idm47951454808160" class="indexterm"></a><div class="para"> 5 </div><a id="idm214012297008" class="indexterm"></a><a id="idm214014514080" class="indexterm"></a><a id="idm214022126960" class="indexterm"></a><a id="idm214011556576" class="indexterm"></a><a id="idm214011555200" class="indexterm"></a><div class="para">
5 Simply put, <code class="command">futex</code> contention occurs when multiple processes are trying to access the same lock variable at the same time. This can result in a poor performance because the lock serializes execution; one process obtains the lock while the other processes must wait for the lock variable to become available again. 6 Simply put, <code class="command">futex</code> contention occurs when multiple processes are trying to access the same lock variable at the same time. This can result in a poor performance because the lock serializes execution; one process obtains the lock while the other processes must wait for the lock variable to become available again.
6 </div><a id="idm47951454961712" class="indexterm"></a><a id="idm47951474986208" class="indexterm"></a><a id="idm47951469263072" class="indexterm"></a><div class="para"> 7 </div><a id="idm213975317296" class="indexterm"></a><a id="idm214020757968" class="indexterm"></a><a id="idm214026201328" class="indexterm"></a><div class="para">
7 The <a class="xref" href="futexcontentionsect.html#futexcontention">futexes.stp</a> script probes the <code class="command">futex</code> system call to show lock contention. 8 The <a class="xref" href="futexcontentionsect.html#futexcontention">futexes.stp</a> script probes the <code class="command">futex</code> system call to show lock contention.
8 </div><div class="formalpara"><div xmlns:d="http://docbook.org/ns/docbook" class="title">futexes.stp</div> 9 </div><div class="para"><div xmlns:d="http://docbook.org/ns/docbook" class="title">futexes.stp</div>
9 10
10<pre class="programlisting">#! /usr/bin/env stap 11<pre class="programlisting">#! /usr/bin/env stap
11 12
@@ -45,9 +46,10 @@ probe end {
45 Average time of contention throughout the probe 46 Average time of contention throughout the probe
46 </div></li></ul></div><div class="para"> 47 </div></li></ul></div><div class="para">
47 <a class="xref" href="futexcontentionsect.html#futexcontentionoutput">Example 5.19, “futexes.stp Sample Output”</a> contains an excerpt from the output of <a class="xref" href="futexcontentionsect.html#futexcontention">futexes.stp</a> upon exiting the script (after approximately 20 seconds). 48 <a class="xref" href="futexcontentionsect.html#futexcontentionoutput">Example 5.19, “futexes.stp Sample Output”</a> contains an excerpt from the output of <a class="xref" href="futexcontentionsect.html#futexcontention">futexes.stp</a> upon exiting the script (after approximately 20 seconds).
48 </div><div class="example"><a id="futexcontentionoutput"></a><p class="title"><strong>Example 5.19. <a class="xref" href="futexcontentionsect.html#futexcontention">futexes.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen">[...] 49 </div><div class="example"><a id="futexcontentionoutput">
50 ⁠</a><p class="title"><strong>Example 5.19. <a class="xref" href="futexcontentionsect.html#futexcontention">futexes.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen">[...]
49automount[2825] lock 0x00bc7784 contended 18 times, 999931 avg us 51automount[2825] lock 0x00bc7784 contended 18 times, 999931 avg us
50synergyc[3686] lock 0x0861e96c contended 192 times, 101991 avg us 52synergyc[3686] lock 0x0861e96c contended 192 times, 101991 avg us
51synergyc[3758] lock 0x08d98744 contended 192 times, 101990 avg us 53synergyc[3758] lock 0x08d98744 contended 192 times, 101990 avg us
52synergyc[3938] lock 0x0982a8b4 contended 192 times, 101997 avg us 54synergyc[3938] lock 0x0982a8b4 contended 192 times, 101997 avg us
53[...]</pre></div></div><br class="example-break" /></div><ul class="docnav"><li class="previous"><a accesskey="p" href="syscallsbyprocpidsect.html"><strong>Prev</strong>5.3.6. Tracking System Call Volume Per Process</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="errors.html"><strong>Next</strong>Chapter 6. Understanding SystemTap Errors</a></li></ul></body></html> \ No newline at end of file 55[...]</pre></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="syscallsbyprocpidsect.html"><strong>Prev</strong>5.3.6. Tracking System Call Volume Per Process</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="errors.html"><strong>Next</strong>Chapter 6. Understanding SystemTap Errors</a></li></ul></body></html> \ No newline at end of file
diff --git a/SystemTap_Beginners_Guide/handlerconditionalstatements.html b/SystemTap_Beginners_Guide/handlerconditionalstatements.html
index 7cedee8e..a663569e 100644
--- a/SystemTap_Beginners_Guide/handlerconditionalstatements.html
+++ b/SystemTap_Beginners_Guide/handlerconditionalstatements.html
@@ -1,16 +1,18 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.3.3. Conditional Statements</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="scriptconstructions.html" title="3.3. Basic SystemTap Handler Constructs" /><link rel="prev" href="targetavailable.html" title="3.3.2.3. Checking Target Variable Availability" /><link rel="next" href="commandlineargssect.html" title="3.3.4. Command-Line Arguments" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="targetavailable.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="commandlineargssect.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="handlerconditionalstatements"></a>3.3.3. Conditional Statements</h3></div></div></div><a id="idm47951455898096" class="indexterm"></a><a id="idm47951474937584" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.3.3. Conditional Statements</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="scriptconstructions.html" title="3.3. Basic SystemTap Handler Constructs" /><link rel="prev" href="targetavailable.html" title="3.3.2.3. Checking Target Variable Availability" /><link rel="next" href="commandlineargssect.html" title="3.3.4. Command-Line Arguments" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="targetavailable.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="commandlineargssect.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="handlerconditionalstatements">
3 ⁠</a>3.3.3. Conditional Statements</h3></div></div></div><a id="idm214011954080" class="indexterm"></a><a id="idm214007213072" class="indexterm"></a><div class="para">
3 In some cases, the output of a SystemTap script may be too large. To address this, you need to further refine the script's logic in order to delimit the output into something more relevant or useful to your probe. 4 In some cases, the output of a SystemTap script may be too large. To address this, you need to further refine the script's logic in order to delimit the output into something more relevant or useful to your probe.
4 </div><div class="para"> 5 </div><div class="para">
5 Do this by using <span class="emphasis"><em>conditionals</em></span> in handlers. SystemTap accepts the following types of conditional statements: 6 Do this by using <span class="emphasis"><em>conditionals</em></span> in handlers. SystemTap accepts the following types of conditional statements:
6 </div><div class="variablelist"><dl class="variablelist"><dt><span class="term">If/Else Statements</span></dt><dd><a id="idm47951471309152" class="indexterm"></a><a id="idm47951457668128" class="indexterm"></a><a id="idm47951416368192" class="indexterm"></a><div class="para"> 7 </div><div class="variablelist"><dl class="variablelist"><dt><span class="term">If/Else Statements</span></dt><dd><a id="idm213973606704" class="indexterm"></a><a id="idm214018132832" class="indexterm"></a><a id="idm213973137472" class="indexterm"></a><div class="para">
7 Format: 8 Format:
8 </div><pre class="programlisting">if (<em class="replaceable"><code>condition</code></em>) 9 </div><pre class="programlisting">if (<em class="replaceable">condition</em>)
9 <em class="replaceable"><code>statement1</code></em> 10 <em class="replaceable">statement1</em>
10else 11else
11 <em class="replaceable"><code>statement2</code></em></pre><div class="para"> 12 <em class="replaceable">statement2</em></pre><div class="para">
12 The <code class="command"><em class="replaceable"><code>statement1</code></em></code> is executed if the <code class="command"><em class="replaceable"><code>condition</code></em></code> expression is non-zero. The <code class="command"><em class="replaceable"><code>statement2</code></em></code> is executed if the <code class="command"><em class="replaceable"><code>condition</code></em></code> expression is zero. The <code class="command">else</code> clause (<code class="command">else</code> <em class="replaceable"><code>statement2</code></em>) is optional. Both <code class="command"><em class="replaceable"><code>statement1</code></em></code> and <code class="command"><em class="replaceable"><code>statement2</code></em></code> can be statement blocks. 13 The <code class="command"><em class="replaceable">statement1</em></code> is executed if the <code class="command"><em class="replaceable">condition</em></code> expression is non-zero. The <code class="command"><em class="replaceable">statement2</em></code> is executed if the <code class="command"><em class="replaceable">condition</em></code> expression is zero. The <code class="command">else</code> clause (<code class="command">else</code> <em class="replaceable">statement2</em>) is optional. Both <code class="command"><em class="replaceable">statement1</em></code> and <code class="command"><em class="replaceable">statement2</em></code> can be statement blocks.
13 </div><div class="example"><a id="simpleifelseexample"></a><p class="title"><strong>Example 3.11. ifelse.stp</strong></p><div class="example-contents"><pre class="programlisting">global countread, countnonread 14 </div><div class="example"><a id="simpleifelseexample">
15 ⁠</a><p class="title"><strong>Example 3.11. ifelse.stp</strong></p><div class="example-contents"><pre class="programlisting">global countread, countnonread
14probe kernel.function("vfs_read"),kernel.function("vfs_write") 16probe kernel.function("vfs_read"),kernel.function("vfs_write")
15{ 17{
16 if (probefunc()=="vfs_read") 18 if (probefunc()=="vfs_read")
@@ -22,22 +24,22 @@ probe timer.s(5) { exit() }
22probe end 24probe end
23{ 25{
24 printf("VFS reads total %d\n VFS writes total %d\n", countread, countnonread) 26 printf("VFS reads total %d\n VFS writes total %d\n", countread, countnonread)
25}</pre></div></div><br class="example-break" /><div class="para"> 27}</pre></div></div><div class="para">
26 <a class="xref" href="handlerconditionalstatements.html#simpleifelseexample">Example 3.11, “ifelse.stp”</a> is a script that counts how many virtual file system reads (<code class="command">vfs_read</code>) and writes (<code class="command">vfs_write</code>) the system performs within a 5-second span. When run, the script increments the value of the variable <code class="command">countread</code> by 1 if the name of the function it probed matches <code class="command">vfs_read</code> (as noted by the condition <code class="command">if (probefunc()=="vfs_read")</code>); otherwise, it increments <code class="command">countnonread</code> (<code class="command">else {countnonread ++}</code>). 28 <a class="xref" href="handlerconditionalstatements.html#simpleifelseexample">Example 3.11, “ifelse.stp”</a> is a script that counts how many virtual file system reads (<code class="command">vfs_read</code>) and writes (<code class="command">vfs_write</code>) the system performs within a 5-second span. When run, the script increments the value of the variable <code class="command">countread</code> by 1 if the name of the function it probed matches <code class="command">vfs_read</code> (as noted by the condition <code class="command">if (probefunc()=="vfs_read")</code>); otherwise, it increments <code class="command">countnonread</code> (<code class="command">else {countnonread ++}</code>).
27 </div></dd><dt><span class="term">While Loops</span></dt><dd><a id="idm47951463801456" class="indexterm"></a><a id="idm47951463799344" class="indexterm"></a><a id="idm47951474886544" class="indexterm"></a><div class="para"> 29 </div></dd><dt><span class="term">While Loops</span></dt><dd><a id="idm214017988768" class="indexterm"></a><a id="idm213970851600" class="indexterm"></a><a id="idm214018911600" class="indexterm"></a><div class="para">
28 Format: 30 Format:
29 </div><pre class="programlisting">while (<em class="replaceable"><code>condition</code></em>) 31 </div><pre class="programlisting">while (<em class="replaceable">condition</em>)
30 <em class="replaceable"><code>statement</code></em></pre><div class="para"> 32 <em class="replaceable">statement</em></pre><div class="para">
31 So long as <code class="command"><em class="replaceable"><code>condition</code></em></code> is non-zero the block of statements in <code class="command"><em class="replaceable"><code>statement</code></em></code> are executed. The <code class="command"><em class="replaceable"><code>statement</code></em></code> is often a statement block and it must change a value so <code class="command"><em class="replaceable"><code>condition</code></em></code> will eventually be zero. 33 So long as <code class="command"><em class="replaceable">condition</em></code> is non-zero the block of statements in <code class="command"><em class="replaceable">statement</em></code> are executed. The <code class="command"><em class="replaceable">statement</em></code> is often a statement block and it must change a value so <code class="command"><em class="replaceable">condition</em></code> will eventually be zero.
32 </div></dd><dt><span class="term">For Loops</span></dt><dd><a id="idm47951427819424" class="indexterm"></a><a id="idm47951415749280" class="indexterm"></a><a id="idm47951415747168" class="indexterm"></a><div class="para"> 34 </div></dd><dt><span class="term">For Loops</span></dt><dd><a id="idm213969747888" class="indexterm"></a><a id="idm214010565392" class="indexterm"></a><a id="idm213978689584" class="indexterm"></a><div class="para">
33 Format: 35 Format:
34 </div><pre class="programlisting">for (<em class="replaceable"><code>initialization</code></em>; <em class="replaceable"><code>conditional</code></em>; <em class="replaceable"><code>increment</code></em>) <em class="replaceable"><code>statement</code></em></pre><div class="para"> 36 </div><pre class="programlisting">for (<em class="replaceable">initialization</em>; <em class="replaceable">conditional</em>; <em class="replaceable">increment</em>) <em class="replaceable">statement</em></pre><div class="para">
35 The <code class="command">for</code> loop is shorthand for a while loop. The following is the equivalent <code class="command">while</code> loop: 37 The <code class="command">for</code> loop is shorthand for a while loop. The following is the equivalent <code class="command">while</code> loop:
36 </div><pre class="programlisting"><em class="replaceable"><code>initialization</code></em> 38 </div><pre class="programlisting"><em class="replaceable">initialization</em>
37while (<em class="replaceable"><code>conditional</code></em>) { 39while (<em class="replaceable">conditional</em>) {
38 <em class="replaceable"><code>statement</code></em> 40 <em class="replaceable">statement</em>
39 <em class="replaceable"><code>increment</code></em> 41 <em class="replaceable">increment</em>
40}</pre></dd></dl></div><div class="formalpara"><div xmlns:d="http://docbook.org/ns/docbook" class="title">Conditional Operators</div><a id="idm47951475738720" class="indexterm"></a><a id="idm47951475736608" class="indexterm"></a><a id="idm47951475841488" class="indexterm"></a> 42}</pre></dd></dl></div><div class="para"><div xmlns:d="http://docbook.org/ns/docbook" class="title">Conditional Operators</div><a id="idm214010496016" class="indexterm"></a><a id="idm214009622416" class="indexterm"></a><a id="idm213972701104" class="indexterm"></a>
41 Aside from <code class="command">==</code> ("is equal to"), following operators can also be used in conditional statements: 43 Aside from <code class="command">==</code> ("is equal to"), following operators can also be used in conditional statements:
42 </div><div class="variablelist"><dl class="variablelist"><dt><span class="term">&gt;=</span></dt><dd><div class="para"> 44 </div><div class="variablelist"><dl class="variablelist"><dt><span class="term">&gt;=</span></dt><dd><div class="para">
43 Greater than or equal to 45 Greater than or equal to
diff --git a/SystemTap_Beginners_Guide/index.html b/SystemTap_Beginners_Guide/index.html
index fb11b485..c4405d11 100644
--- a/SystemTap_Beginners_Guide/index.html
+++ b/SystemTap_Beginners_Guide/index.html
@@ -1,10 +1,10 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">SystemTap Beginners Guide</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><meta name="description" content="This guide provides basic instructions on how to use SystemTap to monitor different subsystems of a Linux system in finer detail." /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="next" href="SystemTap_Beginners_Guide-Preface.html" title="Preface" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="SystemTap_Beginners_Guide-Preface.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="book" lang="en-US"><div class="titlepage"><div><div class="producttitle"><span xmlns:d="http://docbook.org/ns/docbook" class="productname">SystemTap</span> <span xmlns:d="http://docbook.org/ns/docbook" class="productnumber">2.6</span></div><div><h1 class="title"><a id="idm47951426728368"></a>SystemTap Beginners Guide</h1></div><div><h2 class="subtitle">Introduction to SystemTap</h2></div><p xmlns:d="http://docbook.org/ns/docbook" class="edition">Edition 2.6</p><div><h3 class="corpauthor"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">SystemTap Beginners Guide</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><meta name="description" content="This guide provides basic instructions on how to use SystemTap to monitor different subsystems of a Linux system in finer detail." /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="next" href="SystemTap_Beginners_Guide-Preface.html" title="Preface" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="SystemTap_Beginners_Guide-Preface.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="book" lang="en-US"><div class="titlepage"><div><div class="producttitle"><span xmlns:d="http://docbook.org/ns/docbook" class="productname">SystemTap</span> <span xmlns:d="http://docbook.org/ns/docbook" class="productnumber">2.6</span></div><div><h1 class="title"><a id="idm213972794928"></a>SystemTap Beginners Guide</h1></div><div><h2 class="subtitle">Introduction to SystemTap</h2></div><p xmlns:d="http://docbook.org/ns/docbook" class="edition">Edition 2.6</p><div><h3 class="corpauthor">
3 <span class="inlinemediaobject"><object data="Common_Content/images/title_logo.svg" type="image/svg+xml"><img src="Common_Content/images/title_logo.png" alt="Logo" /></object></span> 3 <span class="inlinemediaobject"><object data="Common_Content/images/title_logo.svg" type="image/svg+xml"><img src="Common_Content/images/title_logo.png" alt="Logo" /></object></span>
4 4
5 </h3></div><div><div xml:lang="en-US" class="authorgroup" lang="en-US"><h3 class="corpauthor"> 5 </h3></div><div><div xml:lang="en-US" class="authorgroup" lang="en-US"><h3 class="corpauthor">
6 Red Hat, Inc. 6 Red Hat, Inc.
7 </h3><div class="author"><h3 class="author"><span class="firstname">Don</span> <span class="surname">Domingo </span></h3><div class="affiliation"><span xmlns:d="http://docbook.org/ns/docbook" class="orgname">Engineering Services and Operations</span> <span xmlns:d="http://docbook.org/ns/docbook" class="orgdiv">Content Services</span></div><code class="email"><a class="email" href="mailto:ddomingo@redhat.com">ddomingo@redhat.com</a></code></div><div class="author"><h3 class="author"><span class="firstname">William</span> <span class="surname">Cohen</span></h3><div class="affiliation"><span xmlns:d="http://docbook.org/ns/docbook" class="orgname">Engineering Services and Operations</span> <span xmlns:d="http://docbook.org/ns/docbook" class="orgdiv">Performance Tools</span></div><code class="email"><a class="email" href="mailto:wcohen@redhat.com">wcohen@redhat.com</a></code></div></div></div><div><p class="copyright">Copyright © 2013 Red Hat, Inc</p></div><div><div class="legalnotice"><a id="idm47951420759648"></a><h1 class="legalnotice">Legal Notice</h1><div class="para"> 7 </h3><div class="author"><h3 class="author"><span class="firstname">Don</span> <span class="surname">Domingo </span></h3><div class="affiliation"><span xmlns:d="http://docbook.org/ns/docbook" class="orgname">Engineering Services and Operations</span> <span xmlns:d="http://docbook.org/ns/docbook" class="orgdiv">Content Services</span></div><code class="email"><a class="email" href="mailto:ddomingo@redhat.com">ddomingo@redhat.com</a></code></div><div class="author"><h3 class="author"><span class="firstname">William</span> <span class="surname">Cohen</span></h3><div class="affiliation"><span xmlns:d="http://docbook.org/ns/docbook" class="orgname">Engineering Services and Operations</span> <span xmlns:d="http://docbook.org/ns/docbook" class="orgdiv">Performance Tools</span></div><code class="email"><a class="email" href="mailto:wcohen@redhat.com">wcohen@redhat.com</a></code></div></div></div><div><p class="copyright">Copyright © 2013 Red Hat, Inc</p></div><div><div class="legalnotice"><a id="idm213973105360"></a><h1 class="legalnotice">Legal Notice</h1><div class="para">
8 This documentation is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. 8 This documentation is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
9 </div><div class="para"> 9 </div><div class="para">
10 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 10 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
@@ -14,4 +14,4 @@
14 For more details see the file COPYING in the source distribution of Linux. 14 For more details see the file COPYING in the source distribution of Linux.
15 </div></div></div><div><div class="abstract"><p class="title"><strong>Abstract</strong></p><div class="para"> 15 </div></div></div><div><div class="abstract"><p class="title"><strong>Abstract</strong></p><div class="para">
16 This guide provides basic instructions on how to use SystemTap to monitor different subsystems of a Linux system in finer detail. 16 This guide provides basic instructions on how to use SystemTap to monitor different subsystems of a Linux system in finer detail.
17 </div></div></div></div></div><div class="toc"><dl class="toc"><dt><span class="preface"><a href="SystemTap_Beginners_Guide-Preface.html">Preface</a></span></dt><dd><dl><dt><span class="section"><a href="SystemTap_Beginners_Guide-Preface.html#idm47951421478384">1. Document Conventions</a></span></dt><dd><dl><dt><span class="section"><a href="SystemTap_Beginners_Guide-Preface.html#idm47951421509056">1.1. Typographic Conventions</a></span></dt><dt><span class="section"><a href="SystemTap_Beginners_Guide-Preface.html#idm47951476167024">1.2. Pull-quote Conventions</a></span></dt><dt><span class="section"><a href="SystemTap_Beginners_Guide-Preface.html#idm47951418913856">1.3. Notes and Warnings</a></span></dt></dl></dd><dt><span class="section"><a href="pr01s02.html">2. We Need Feedback!</a></span></dt></dl></dd><dt><span class="chapter"><a href="introduction.html">1. Introduction</a></span></dt><dd><dl><dt><span class="section"><a href="introduction.html#goals">1.1. Documentation Goals</a></span></dt><dt><span class="section"><a href="intro-systemtap-vs-others.html">1.2. SystemTap Capabilities</a></span></dt><dt><span class="section"><a href="intro-systemtap-limitations.html">1.3. Limitations of SystemTap</a></span></dt></dl></dd><dt><span class="chapter"><a href="using-systemtap.html">2. Using SystemTap</a></span></dt><dd><dl><dt><span class="section"><a href="using-systemtap.html#using-setup">2.1. Installation and Setup</a></span></dt><dd><dl><dt><span class="section"><a href="using-systemtap.html#installproper">2.1.1. Installing SystemTap</a></span></dt><dt><span class="section"><a href="using-systemtap.html#install-kinfo">2.1.2. Installing Required Kernel Information Packages Manually</a></span></dt><dt><span class="section"><a href="using-systemtap.html#testing">2.1.3. Initial Testing</a></span></dt></dl></dd><dt><span class="section"><a href="cross-compiling.html">2.2. Generating Instrumentation for Other Computers</a></span></dt><dt><span class="section"><a href="using-usage.html">2.3. Running SystemTap Scripts</a></span></dt><dd><dl><dt><span class="section"><a href="using-usage.html#flight-recorder">2.3.1. SystemTap Flight Recorder Mode</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="understanding-how-systemtap-works.html">3. Understanding How SystemTap Works</a></span></dt><dd><dl><dt><span class="section"><a href="understanding-how-systemtap-works.html#understanding-architecture-tools">3.1. Architecture</a></span></dt><dt><span class="section"><a href="scripts.html">3.2. SystemTap Scripts</a></span></dt><dd><dl><dt><span class="section"><a href="scripts.html#systemtapscript-events">3.2.1. Event</a></span></dt><dt><span class="section"><a href="systemtapscript-handler.html">3.2.2. SystemTap Handler/Body</a></span></dt></dl></dd><dt><span class="section"><a href="scriptconstructions.html">3.3. Basic SystemTap Handler Constructs</a></span></dt><dd><dl><dt><span class="section"><a href="scriptconstructions.html#variablesconstructs">3.3.1. Variables</a></span></dt><dt><span class="section"><a href="targetvariables.html">3.3.2. Target Variables</a></span></dt><dt><span class="section"><a href="handlerconditionalstatements.html">3.3.3. Conditional Statements</a></span></dt><dt><span class="section"><a href="commandlineargssect.html">3.3.4. Command-Line Arguments</a></span></dt></dl></dd><dt><span class="section"><a href="associativearrays.html">3.4. Associative Arrays</a></span></dt><dt><span class="section"><a href="arrayoperators.html">3.5. Array Operations in SystemTap</a></span></dt><dd><dl><dt><span class="section"><a href="arrayoperators.html#arrayops-assignvalue">3.5.1. Assigning an Associated Value</a></span></dt><dt><span class="section"><a href="arrayops-readvalues.html">3.5.2. Reading Values From Arrays</a></span></dt><dt><span class="section"><a href="arrayops-increment.html">3.5.3. Incrementing Associated Values</a></span></dt><dt><span class="section"><a href="arrayops-foreach.html">3.5.4. Processing Multiple Elements in an Array</a></span></dt><dt><span class="section"><a href="arrayops-deleting.html">3.5.5. Clearing/Deleting Arrays and Array Elements</a></span></dt><dt><span class="section"><a href="arrayops-conditionals.html">3.5.6. Using Arrays in Conditional Statements</a></span></dt><dt><span class="section"><a href="arrayops-aggregates.html">3.5.7. Computing for Statistical Aggregates</a></span></dt></dl></dd><dt><span class="section"><a href="understanding-tapsets.html">3.6. Tapsets</a></span></dt></dl></dd><dt><span class="chapter"><a href="userspace-probing.html">4. User-space Probing</a></span></dt><dd><dl><dt><span class="section"><a href="userspace-probing.html#uevents">4.1. User-Space Events</a></span></dt><dt><span class="section"><a href="utargetvariable.html">4.2. Accessing User-Space Target Variables</a></span></dt><dt><span class="section"><a href="ustack.html">4.3. User-Space Stack Backtraces</a></span></dt></dl></dd><dt><span class="chapter"><a href="useful-systemtap-scripts.html">5. Useful SystemTap Scripts</a></span></dt><dd><dl><dt><span class="section"><a href="useful-systemtap-scripts.html#mainsect-network">5.1. Network</a></span></dt><dd><dl><dt><span class="section"><a href="useful-systemtap-scripts.html#nettopsect">5.1.1. Network Profiling</a></span></dt><dt><span class="section"><a href="useful-systemtap-scripts.html#sockettracesect">5.1.2. Tracing Functions Called in Network Socket Code</a></span></dt><dt><span class="section"><a href="useful-systemtap-scripts.html#tcpconnectionssect">5.1.3. Monitoring Incoming TCP Connections</a></span></dt><dt><span class="section"><a href="useful-systemtap-scripts.html#tcpdumplikesect">5.1.4. Monitoring TCP Packets</a></span></dt><dt><span class="section"><a href="useful-systemtap-scripts.html#dropwatchsect">5.1.5. Monitoring Network Packets Drops in Kernel</a></span></dt></dl></dd><dt><span class="section"><a href="mainsect-disk.html">5.2. Disk</a></span></dt><dd><dl><dt><span class="section"><a href="mainsect-disk.html#disktop">5.2.1. Summarizing Disk Read/Write Traffic</a></span></dt><dt><span class="section"><a href="iotimesect.html">5.2.2. Tracking I/O Time For Each File Read or Write</a></span></dt><dt><span class="section"><a href="traceiosect.html">5.2.3. Track Cumulative IO</a></span></dt><dt><span class="section"><a href="traceio2sect.html">5.2.4. I/O Monitoring (By Device)</a></span></dt><dt><span class="section"><a href="inodewatchsect.html">5.2.5. Monitoring Reads and Writes to a File</a></span></dt><dt><span class="section"><a href="inodewatch2sect.html">5.2.6. Monitoring Changes to File Attributes</a></span></dt><dt><span class="section"><a href="ioblktimesect.html">5.2.7. Periodically Print I/O Block Time</a></span></dt></dl></dd><dt><span class="section"><a href="mainsect-profiling.html">5.3. Profiling</a></span></dt><dd><dl><dt><span class="section"><a href="mainsect-profiling.html#countcallssect">5.3.1. Counting Function Calls Made</a></span></dt><dt><span class="section"><a href="paracallgraph.html">5.3.2. Call Graph Tracing</a></span></dt><dt><span class="section"><a href="threadtimessect.html">5.3.3. Determining Time Spent in Kernel and User Space</a></span></dt><dt><span class="section"><a href="timeoutssect.html">5.3.4. Monitoring Polling Applications</a></span></dt><dt><span class="section"><a href="topsyssect.html">5.3.5. Tracking Most Frequently Used System Calls</a></span></dt><dt><span class="section"><a href="syscallsbyprocpidsect.html">5.3.6. Tracking System Call Volume Per Process</a></span></dt></dl></dd><dt><span class="section"><a href="futexcontentionsect.html">5.4. Identifying Contended User-Space Locks</a></span></dt></dl></dd><dt><span class="chapter"><a href="errors.html">6. Understanding SystemTap Errors</a></span></dt><dd><dl><dt><span class="section"><a href="errors.html#parsetype">6.1. Parse and Semantic Errors</a></span></dt><dt><span class="section"><a href="runtimeerror.html">6.2. Runtime Errors and Warnings</a></span></dt></dl></dd><dt><span class="chapter"><a href="references.html">7. References</a></span></dt><dt><span class="appendix"><a href="appe-Publican-Revision_History.html">A. Revision History</a></span></dt><dt><span class="index"><a href="ix01.html">Index</a></span></dt></dl></div></div><ul class="docnav"><li class="previous"></li><li class="next"><a accesskey="n" href="SystemTap_Beginners_Guide-Preface.html"><strong>Next</strong>Preface</a></li></ul></body></html> \ No newline at end of file 17 </div></div></div></div></div><div class="toc"><dl class="toc"><dt><span class="preface"><a href="SystemTap_Beginners_Guide-Preface.html">Preface</a></span></dt><dd><dl><dt><span class="section"><a href="SystemTap_Beginners_Guide-Preface.html#idm214012261552">1. Document Conventions</a></span></dt><dd><dl><dt><span class="section"><a href="SystemTap_Beginners_Guide-Preface.html#idm213971251520">1.1. Typographic Conventions</a></span></dt><dt><span class="section"><a href="SystemTap_Beginners_Guide-Preface.html#idm214026482192">1.2. Pull-quote Conventions</a></span></dt><dt><span class="section"><a href="SystemTap_Beginners_Guide-Preface.html#idm213975281520">1.3. Notes and Warnings</a></span></dt></dl></dd><dt><span class="section"><a href="pr01s02.html">2. We Need Feedback!</a></span></dt></dl></dd><dt><span class="chapter"><a href="introduction.html">1. Introduction</a></span></dt><dd><dl><dt><span class="section"><a href="introduction.html#goals">1.1. Documentation Goals</a></span></dt><dt><span class="section"><a href="intro-systemtap-vs-others.html">1.2. SystemTap Capabilities</a></span></dt><dt><span class="section"><a href="intro-systemtap-limitations.html">1.3. Limitations of SystemTap</a></span></dt></dl></dd><dt><span class="chapter"><a href="using-systemtap.html">2. Using SystemTap</a></span></dt><dd><dl><dt><span class="section"><a href="using-systemtap.html#using-setup">2.1. Installation and Setup</a></span></dt><dd><dl><dt><span class="section"><a href="using-systemtap.html#installproper">2.1.1. Installing SystemTap</a></span></dt><dt><span class="section"><a href="using-systemtap.html#install-kinfo">2.1.2. Installing Required Kernel Information Packages Manually</a></span></dt><dt><span class="section"><a href="using-systemtap.html#testing">2.1.3. Initial Testing</a></span></dt></dl></dd><dt><span class="section"><a href="cross-compiling.html">2.2. Generating Instrumentation for Other Computers</a></span></dt><dt><span class="section"><a href="using-usage.html">2.3. Running SystemTap Scripts</a></span></dt><dd><dl><dt><span class="section"><a href="using-usage.html#flight-recorder">2.3.1. SystemTap Flight Recorder Mode</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="understanding-how-systemtap-works.html">3. Understanding How SystemTap Works</a></span></dt><dd><dl><dt><span class="section"><a href="understanding-how-systemtap-works.html#understanding-architecture-tools">3.1. Architecture</a></span></dt><dt><span class="section"><a href="scripts.html">3.2. SystemTap Scripts</a></span></dt><dd><dl><dt><span class="section"><a href="scripts.html#systemtapscript-events">3.2.1. Event</a></span></dt><dt><span class="section"><a href="systemtapscript-handler.html">3.2.2. SystemTap Handler/Body</a></span></dt></dl></dd><dt><span class="section"><a href="scriptconstructions.html">3.3. Basic SystemTap Handler Constructs</a></span></dt><dd><dl><dt><span class="section"><a href="scriptconstructions.html#variablesconstructs">3.3.1. Variables</a></span></dt><dt><span class="section"><a href="targetvariables.html">3.3.2. Target Variables</a></span></dt><dt><span class="section"><a href="handlerconditionalstatements.html">3.3.3. Conditional Statements</a></span></dt><dt><span class="section"><a href="commandlineargssect.html">3.3.4. Command-Line Arguments</a></span></dt></dl></dd><dt><span class="section"><a href="associativearrays.html">3.4. Associative Arrays</a></span></dt><dt><span class="section"><a href="arrayoperators.html">3.5. Array Operations in SystemTap</a></span></dt><dd><dl><dt><span class="section"><a href="arrayoperators.html#arrayops-assignvalue">3.5.1. Assigning an Associated Value</a></span></dt><dt><span class="section"><a href="arrayops-readvalues.html">3.5.2. Reading Values From Arrays</a></span></dt><dt><span class="section"><a href="arrayops-increment.html">3.5.3. Incrementing Associated Values</a></span></dt><dt><span class="section"><a href="arrayops-foreach.html">3.5.4. Processing Multiple Elements in an Array</a></span></dt><dt><span class="section"><a href="arrayops-deleting.html">3.5.5. Clearing/Deleting Arrays and Array Elements</a></span></dt><dt><span class="section"><a href="arrayops-conditionals.html">3.5.6. Using Arrays in Conditional Statements</a></span></dt><dt><span class="section"><a href="arrayops-aggregates.html">3.5.7. Computing for Statistical Aggregates</a></span></dt></dl></dd><dt><span class="section"><a href="understanding-tapsets.html">3.6. Tapsets</a></span></dt></dl></dd><dt><span class="chapter"><a href="userspace-probing.html">4. User-space Probing</a></span></dt><dd><dl><dt><span class="section"><a href="userspace-probing.html#uevents">4.1. User-Space Events</a></span></dt><dt><span class="section"><a href="utargetvariable.html">4.2. Accessing User-Space Target Variables</a></span></dt><dt><span class="section"><a href="ustack.html">4.3. User-Space Stack Backtraces</a></span></dt></dl></dd><dt><span class="chapter"><a href="useful-systemtap-scripts.html">5. Useful SystemTap Scripts</a></span></dt><dd><dl><dt><span class="section"><a href="useful-systemtap-scripts.html#mainsect-network">5.1. Network</a></span></dt><dd><dl><dt><span class="section"><a href="useful-systemtap-scripts.html#nettopsect">5.1.1. Network Profiling</a></span></dt><dt><span class="section"><a href="useful-systemtap-scripts.html#sockettracesect">5.1.2. Tracing Functions Called in Network Socket Code</a></span></dt><dt><span class="section"><a href="useful-systemtap-scripts.html#tcpconnectionssect">5.1.3. Monitoring Incoming TCP Connections</a></span></dt><dt><span class="section"><a href="useful-systemtap-scripts.html#tcpdumplikesect">5.1.4. Monitoring TCP Packets</a></span></dt><dt><span class="section"><a href="useful-systemtap-scripts.html#dropwatchsect">5.1.5. Monitoring Network Packets Drops in Kernel</a></span></dt></dl></dd><dt><span class="section"><a href="mainsect-disk.html">5.2. Disk</a></span></dt><dd><dl><dt><span class="section"><a href="mainsect-disk.html#disktop">5.2.1. Summarizing Disk Read/Write Traffic</a></span></dt><dt><span class="section"><a href="iotimesect.html">5.2.2. Tracking I/O Time For Each File Read or Write</a></span></dt><dt><span class="section"><a href="traceiosect.html">5.2.3. Track Cumulative IO</a></span></dt><dt><span class="section"><a href="traceio2sect.html">5.2.4. I/O Monitoring (By Device)</a></span></dt><dt><span class="section"><a href="inodewatchsect.html">5.2.5. Monitoring Reads and Writes to a File</a></span></dt><dt><span class="section"><a href="inodewatch2sect.html">5.2.6. Monitoring Changes to File Attributes</a></span></dt><dt><span class="section"><a href="ioblktimesect.html">5.2.7. Periodically Print I/O Block Time</a></span></dt></dl></dd><dt><span class="section"><a href="mainsect-profiling.html">5.3. Profiling</a></span></dt><dd><dl><dt><span class="section"><a href="mainsect-profiling.html#countcallssect">5.3.1. Counting Function Calls Made</a></span></dt><dt><span class="section"><a href="paracallgraph.html">5.3.2. Call Graph Tracing</a></span></dt><dt><span class="section"><a href="threadtimessect.html">5.3.3. Determining Time Spent in Kernel and User Space</a></span></dt><dt><span class="section"><a href="timeoutssect.html">5.3.4. Monitoring Polling Applications</a></span></dt><dt><span class="section"><a href="topsyssect.html">5.3.5. Tracking Most Frequently Used System Calls</a></span></dt><dt><span class="section"><a href="syscallsbyprocpidsect.html">5.3.6. Tracking System Call Volume Per Process</a></span></dt></dl></dd><dt><span class="section"><a href="futexcontentionsect.html">5.4. Identifying Contended User-Space Locks</a></span></dt></dl></dd><dt><span class="chapter"><a href="errors.html">6. Understanding SystemTap Errors</a></span></dt><dd><dl><dt><span class="section"><a href="errors.html#parsetype">6.1. Parse and Semantic Errors</a></span></dt><dt><span class="section"><a href="runtimeerror.html">6.2. Runtime Errors and Warnings</a></span></dt></dl></dd><dt><span class="chapter"><a href="references.html">7. References</a></span></dt><dt><span class="appendix"><a href="appe-Publican-Revision_History.html">A. Revision History</a></span></dt><dt><span class="index"><a href="ix01.html">Index</a></span></dt></dl></div></div><ul class="docnav"><li class="previous"></li><li class="next"><a accesskey="n" href="SystemTap_Beginners_Guide-Preface.html"><strong>Next</strong>Preface</a></li></ul></body></html> \ No newline at end of file
diff --git a/SystemTap_Beginners_Guide/inodewatch2sect.html b/SystemTap_Beginners_Guide/inodewatch2sect.html
index 3ff909ab..4b1fa834 100644
--- a/SystemTap_Beginners_Guide/inodewatch2sect.html
+++ b/SystemTap_Beginners_Guide/inodewatch2sect.html
@@ -1,7 +1,8 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">5.2.6. Monitoring Changes to File Attributes</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="mainsect-disk.html" title="5.2. Disk" /><link rel="prev" href="inodewatchsect.html" title="5.2.5. Monitoring Reads and Writes to a File" /><link rel="next" href="ioblktimesect.html" title="5.2.7. Periodically Print I/O Block Time" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="inodewatchsect.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="ioblktimesect.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="inodewatch2sect"></a>5.2.6. Monitoring Changes to File Attributes</h3></div></div></div><a id="idm47951468299408" class="indexterm"></a><a id="idm47951458451184" class="indexterm"></a><a id="idm47951459409056" class="indexterm"></a><a id="idm47951424068624" class="indexterm"></a><a id="idm47951423763408" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">5.2.6. Monitoring Changes to File Attributes</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="mainsect-disk.html" title="5.2. Disk" /><link rel="prev" href="inodewatchsect.html" title="5.2.5. Monitoring Reads and Writes to a File" /><link rel="next" href="ioblktimesect.html" title="5.2.7. Periodically Print I/O Block Time" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="inodewatchsect.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="ioblktimesect.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="inodewatch2sect">
3 ⁠</a>5.2.6. Monitoring Changes to File Attributes</h3></div></div></div><a id="idm214012348416" class="indexterm"></a><a id="idm213972396208" class="indexterm"></a><a id="idm214013304720" class="indexterm"></a><a id="idm214013595296" class="indexterm"></a><a id="idm213978401440" class="indexterm"></a><div class="para">
3 This section describes how to monitor if any processes are changing the attributes of a targeted file, in real time. 4 This section describes how to monitor if any processes are changing the attributes of a targeted file, in real time.
4 </div><div class="formalpara"><div xmlns:d="http://docbook.org/ns/docbook" class="title">inodewatch2.stp</div> 5 </div><div class="para"><div xmlns:d="http://docbook.org/ns/docbook" class="title">inodewatch2.stp</div>
5 6
6<pre class="programlisting">#! /usr/bin/env stap 7<pre class="programlisting">#! /usr/bin/env stap
7 8
@@ -17,12 +18,13 @@ probe kernel.function("setattr_copy")!,
17 &amp;&amp; inode_nr == $3 18 &amp;&amp; inode_nr == $3
18 &amp;&amp; $attr-&gt;ia_valid &amp; ATTR_MODE) 19 &amp;&amp; $attr-&gt;ia_valid &amp; ATTR_MODE)
19 printf ("%s(%d) %s 0x%x/%u %o %d\n", 20 printf ("%s(%d) %s 0x%x/%u %o %d\n",
20 execname(), pid(), probefunc(), dev_nr, inode_nr, $attr-&gt;ia_mode, uid()) 21 execname(), pid(), ppfunc(), dev_nr, inode_nr, $attr-&gt;ia_mode, uid())
21} 22}
22</pre> 23</pre>
23 </div><div class="para"> 24 </div><div class="para">
24 Like <a class="xref" href="inodewatchsect.html#inodewatch">inodewatch.stp</a> from <a class="xref" href="inodewatchsect.html">Section 5.2.5, “Monitoring Reads and Writes to a File”</a>, <a class="xref" href="inodewatch2sect.html#inodewatch2">inodewatch2.stp</a> takes the targeted file's device number (in integer format) and <code class="command">inode</code> number as arguments. For more information on how to retrieve this information, refer to <a class="xref" href="inodewatchsect.html">Section 5.2.5, “Monitoring Reads and Writes to a File”</a>. 25 Like <a class="xref" href="inodewatchsect.html#inodewatch">inodewatch.stp</a> from <a class="xref" href="inodewatchsect.html">Section 5.2.5, “Monitoring Reads and Writes to a File”</a>, <a class="xref" href="inodewatch2sect.html#inodewatch2">inodewatch2.stp</a> takes the targeted file's device number (in integer format) and <code class="command">inode</code> number as arguments. For more information on how to retrieve this information, refer to <a class="xref" href="inodewatchsect.html">Section 5.2.5, “Monitoring Reads and Writes to a File”</a>.
25 </div><div class="para"> 26 </div><div class="para">
26 The output for <a class="xref" href="inodewatch2sect.html#inodewatch2">inodewatch2.stp</a> is similar to that of <a class="xref" href="inodewatchsect.html#inodewatch">inodewatch.stp</a>, except that <a class="xref" href="inodewatch2sect.html#inodewatch2">inodewatch2.stp</a> also contains the attribute changes to the monitored file, as well as the ID of the user responsible (<code class="command">uid()</code>). <a class="xref" href="inodewatch2sect.html#inodewatch2output">Example 5.11, “inodewatch2.stp Sample Output”</a> shows the output of <a class="xref" href="inodewatch2sect.html#inodewatch2">inodewatch2.stp</a> while monitoring <code class="filename">/home/joe/bigfile</code> when user <code class="computeroutput">joe</code> executes <code class="command">chmod 777 /home/joe/bigfile</code> and <code class="command">chmod 666 /home/joe/bigfile</code>. 27 The output for <a class="xref" href="inodewatch2sect.html#inodewatch2">inodewatch2.stp</a> is similar to that of <a class="xref" href="inodewatchsect.html#inodewatch">inodewatch.stp</a>, except that <a class="xref" href="inodewatch2sect.html#inodewatch2">inodewatch2.stp</a> also contains the attribute changes to the monitored file, as well as the ID of the user responsible (<code class="command">uid()</code>). <a class="xref" href="inodewatch2sect.html#inodewatch2output">Example 5.11, “inodewatch2.stp Sample Output”</a> shows the output of <a class="xref" href="inodewatch2sect.html#inodewatch2">inodewatch2.stp</a> while monitoring <code class="filename">/home/joe/bigfile</code> when user <code class="computeroutput">joe</code> executes <code class="command">chmod 777 /home/joe/bigfile</code> and <code class="command">chmod 666 /home/joe/bigfile</code>.
27 </div><div class="example"><a id="inodewatch2output"></a><p class="title"><strong>Example 5.11. <a class="xref" href="inodewatch2sect.html#inodewatch2">inodewatch2.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen">chmod(17448) inode_setattr 0x800005/6011835 100777 500 28 </div><div class="example"><a id="inodewatch2output">
28chmod(17449) inode_setattr 0x800005/6011835 100666 500</pre></div></div><br class="example-break" /></div><ul class="docnav"><li class="previous"><a accesskey="p" href="inodewatchsect.html"><strong>Prev</strong>5.2.5. Monitoring Reads and Writes to a File</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="ioblktimesect.html"><strong>Next</strong>5.2.7. Periodically Print I/O Block Time</a></li></ul></body></html> \ No newline at end of file 29 ⁠</a><p class="title"><strong>Example 5.11. <a class="xref" href="inodewatch2sect.html#inodewatch2">inodewatch2.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen">chmod(17448) inode_setattr 0x800005/6011835 100777 500
30chmod(17449) inode_setattr 0x800005/6011835 100666 500</pre></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="inodewatchsect.html"><strong>Prev</strong>5.2.5. Monitoring Reads and Writes to a File</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="ioblktimesect.html"><strong>Next</strong>5.2.7. Periodically Print I/O Block Time</a></li></ul></body></html> \ No newline at end of file
diff --git a/SystemTap_Beginners_Guide/inodewatchsect.html b/SystemTap_Beginners_Guide/inodewatchsect.html
index 83f2c8de..4b06943b 100644
--- a/SystemTap_Beginners_Guide/inodewatchsect.html
+++ b/SystemTap_Beginners_Guide/inodewatchsect.html
@@ -1,7 +1,8 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">5.2.5. Monitoring Reads and Writes to a File</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="mainsect-disk.html" title="5.2. Disk" /><link rel="prev" href="traceio2sect.html" title="5.2.4. I/O Monitoring (By Device)" /><link rel="next" href="inodewatch2sect.html" title="5.2.6. Monitoring Changes to File Attributes" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="traceio2sect.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="inodewatch2sect.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="inodewatchsect"></a>5.2.5. Monitoring Reads and Writes to a File</h3></div></div></div><a id="idm47951462922528" class="indexterm"></a><a id="idm47951454720960" class="indexterm"></a><a id="idm47951416392928" class="indexterm"></a><a id="idm47951455814784" class="indexterm"></a><a id="idm47951459861888" class="indexterm"></a><a id="idm47951469034048" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">5.2.5. Monitoring Reads and Writes to a File</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="mainsect-disk.html" title="5.2. Disk" /><link rel="prev" href="traceio2sect.html" title="5.2.4. I/O Monitoring (By Device)" /><link rel="next" href="inodewatch2sect.html" title="5.2.6. Monitoring Changes to File Attributes" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="traceio2sect.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="inodewatch2sect.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="inodewatchsect">
3 ⁠</a>5.2.5. Monitoring Reads and Writes to a File</h3></div></div></div><a id="idm214013453232" class="indexterm"></a><a id="idm213974358944" class="indexterm"></a><a id="idm213971871008" class="indexterm"></a><a id="idm213974755760" class="indexterm"></a><a id="idm214026640048" class="indexterm"></a><a id="idm214012314320" class="indexterm"></a><div class="para">
3 This section describes how to monitor reads from and writes to a file in real time. 4 This section describes how to monitor reads from and writes to a file in real time.
4 </div><div class="formalpara"><div xmlns:d="http://docbook.org/ns/docbook" class="title">inodewatch.stp</div> 5 </div><div class="para"><div xmlns:d="http://docbook.org/ns/docbook" class="title">inodewatch.stp</div>
5 6
6<pre class="programlisting">#! /usr/bin/env stap 7<pre class="programlisting">#! /usr/bin/env stap
7 8
@@ -11,24 +12,25 @@ probe vfs.write, vfs.read
11 if (dev == MKDEV($1,$2) # major/minor device 12 if (dev == MKDEV($1,$2) # major/minor device
12 &amp;&amp; ino == $3) 13 &amp;&amp; ino == $3)
13 printf ("%s(%d) %s 0x%x/%u\n", 14 printf ("%s(%d) %s 0x%x/%u\n",
14 execname(), pid(), probefunc(), dev, ino) 15 execname(), pid(), ppfunc(), dev, ino)
15} 16}
16</pre> 17</pre>
17 </div><div class="para"> 18 </div><div class="para">
18 <a class="xref" href="inodewatchsect.html#inodewatch">inodewatch.stp</a> takes the following information about the file as arguments on the command line: 19 <a class="xref" href="inodewatchsect.html#inodewatch">inodewatch.stp</a> takes the following information about the file as arguments on the command line:
19 </div><a id="idm47951460633088" class="indexterm"></a><a id="idm47951476100368" class="indexterm"></a><a id="idm47951475850208" class="indexterm"></a><a id="idm47951474957296" class="indexterm"></a><div xmlns:d="http://docbook.org/ns/docbook" class="itemizedlist"><ul><li class="listitem"><div class="para"> 20 </div><a id="idm213972707568" class="indexterm"></a><a id="idm214018744944" class="indexterm"></a><a id="idm213967959744" class="indexterm"></a><a id="idm214026294656" class="indexterm"></a><div xmlns:d="http://docbook.org/ns/docbook" class="itemizedlist"><ul><li class="listitem"><div class="para">
20 The file's major device number. 21 The file's major device number.
21 </div></li><li class="listitem"><div class="para"> 22 </div></li><li class="listitem"><div class="para">
22 The file's minor device number. 23 The file's minor device number.
23 </div></li><li class="listitem"><div class="para"> 24 </div></li><li class="listitem"><div class="para">
24 The file's <code class="command">inode</code> number. 25 The file's <code class="command">inode</code> number.
25 </div></li></ul></div><a id="idm47951471156640" class="indexterm"></a><a id="idm47951475123024" class="indexterm"></a><a id="idm47951462796400" class="indexterm"></a><div class="para"> 26 </div></li></ul></div><a id="idm214015608816" class="indexterm"></a><a id="idm214008596400" class="indexterm"></a><a id="idm214026189984" class="indexterm"></a><div class="para">
26 To get this information, use <code class="command">stat -c '%D %i' <em class="replaceable"><code>filename</code></em></code>, where <code class="command"><em class="replaceable"><code>filename</code></em></code> is an absolute path. 27 To get this information, use <code class="command">stat -c '%D %i' <em class="replaceable">filename</em></code>, where <code class="command"><em class="replaceable">filename</em></code> is an absolute path.
27 </div><div class="para"> 28 </div><div class="para">
28 For instance: to monitor <code class="filename">/etc/crontab</code>, run <code class="command">stat -c '%D %i' /etc/crontab</code> first. This gives the following output: 29 For instance: to monitor <code class="filename">/etc/crontab</code>, run <code class="command">stat -c '%D %i' /etc/crontab</code> first. This gives the following output:
29 </div><pre class="screen">805 1078319</pre><a id="idm47951469525008" class="indexterm"></a><a id="idm47951416212576" class="indexterm"></a><a id="idm47951457058176" class="indexterm"></a><div class="para"> 30 </div><pre class="screen">805 1078319</pre><a id="idm213968983872" class="indexterm"></a><a id="idm213968985008" class="indexterm"></a><a id="idm214018697696" class="indexterm"></a><div class="para">
30 <code class="computeroutput">805</code> is the base-16 (hexadecimal) device number. The lower two digits are the minor device number and the upper digits are the major number. <code class="computeroutput">1078319</code> is the <code class="command">inode</code> number. To start monitoring <code class="filename">/etc/crontab</code>, run <code class="command">stap inodewatch.stp 0x8 0x05 1078319</code> (The <code class="command">0x</code> prefixes indicate base-16 values. 31 <code class="computeroutput">805</code> is the base-16 (hexadecimal) device number. The lower two digits are the minor device number and the upper digits are the major number. <code class="computeroutput">1078319</code> is the <code class="command">inode</code> number. To start monitoring <code class="filename">/etc/crontab</code>, run <code class="command">stap inodewatch.stp 0x8 0x05 1078319</code> (The <code class="command">0x</code> prefixes indicate base-16 values.
31 </div><div class="para"> 32 </div><div class="para">
32 The output of this command contains the name and ID of any process performing a read/write, the function it is performing (that is, <code class="command">vfs_read</code> or <code class="command">vfs_write</code>), the device number (in hex format), and the <code class="command">inode</code> number. <a class="xref" href="inodewatchsect.html#inodewatchoutput">Example 5.10, “inodewatch.stp Sample Output”</a> contains the output of <code class="command">stap inodewatch.stp 0x8 0x05 1078319</code> (when <code class="command">cat /etc/crontab</code> is executed while the script is running) : 33 The output of this command contains the name and ID of any process performing a read/write, the function it is performing (that is, <code class="command">vfs_read</code> or <code class="command">vfs_write</code>), the device number (in hex format), and the <code class="command">inode</code> number. <a class="xref" href="inodewatchsect.html#inodewatchoutput">Example 5.10, “inodewatch.stp Sample Output”</a> contains the output of <code class="command">stap inodewatch.stp 0x8 0x05 1078319</code> (when <code class="command">cat /etc/crontab</code> is executed while the script is running) :
33 </div><div class="example"><a id="inodewatchoutput"></a><p class="title"><strong>Example 5.10. <a class="xref" href="inodewatchsect.html#inodewatch">inodewatch.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen">cat(16437) vfs_read 0x800005/1078319 34 </div><div class="example"><a id="inodewatchoutput">
34cat(16437) vfs_read 0x800005/1078319</pre></div></div><br class="example-break" /></div><ul class="docnav"><li class="previous"><a accesskey="p" href="traceio2sect.html"><strong>Prev</strong>5.2.4. I/O Monitoring (By Device)</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="inodewatch2sect.html"><strong>Next</strong>5.2.6. Monitoring Changes to File Attributes</a></li></ul></body></html> \ No newline at end of file 35 ⁠</a><p class="title"><strong>Example 5.10. <a class="xref" href="inodewatchsect.html#inodewatch">inodewatch.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen">cat(16437) vfs_read 0x800005/1078319
36cat(16437) vfs_read 0x800005/1078319</pre></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="traceio2sect.html"><strong>Prev</strong>5.2.4. I/O Monitoring (By Device)</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="inodewatch2sect.html"><strong>Next</strong>5.2.6. Monitoring Changes to File Attributes</a></li></ul></body></html> \ No newline at end of file
diff --git a/SystemTap_Beginners_Guide/intro-systemtap-limitations.html b/SystemTap_Beginners_Guide/intro-systemtap-limitations.html
new file mode 100644
index 00000000..5474d531
--- /dev/null
+++ b/SystemTap_Beginners_Guide/intro-systemtap-limitations.html
@@ -0,0 +1,7 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">1.3. Limitations of SystemTap</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="introduction.html" title="Chapter 1. Introduction" /><link rel="prev" href="intro-systemtap-vs-others.html" title="1.2. SystemTap Capabilities" /><link rel="next" href="using-systemtap.html" title="Chapter 2. Using SystemTap" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="intro-systemtap-vs-others.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="using-systemtap.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="intro-systemtap-limitations">
3 ⁠</a>1.3. Limitations of SystemTap</h2></div></div></div><a id="idm213969607792" class="indexterm"></a><a id="idm213969606384" class="indexterm"></a><div class="para">
4 The current iteration of SystemTap allows for a multitude of options when probing kernel-space events for a wide range of kernels. However, SystemTap's ability to probe user-space events depends on kernel support (the Utrace mechanism) that is not available in many kernels. As a consequence, only some kernel versions support user-space probing.
5 </div><div class="para">
6 At present, the developmental efforts of the SystemTap community are geared towards improving SystemTap's user-space probing capabilities.
7 </div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="intro-systemtap-vs-others.html"><strong>Prev</strong>1.2. SystemTap Capabilities</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="using-systemtap.html"><strong>Next</strong>Chapter 2. Using SystemTap</a></li></ul></body></html> \ No newline at end of file
diff --git a/SystemTap_Beginners_Guide/intro-systemtap-vs-others.html b/SystemTap_Beginners_Guide/intro-systemtap-vs-others.html
index 4b53a79b..49657a42 100644
--- a/SystemTap_Beginners_Guide/intro-systemtap-vs-others.html
+++ b/SystemTap_Beginners_Guide/intro-systemtap-vs-others.html
@@ -1,5 +1,6 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">1.2. SystemTap Capabilities</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="introduction.html" title="Chapter 1. Introduction" /><link rel="prev" href="introduction.html" title="Chapter 1. Introduction" /><link rel="next" href="intro-systemtap-limitations.html" title="1.3. Limitations of SystemTap" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="introduction.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="intro-systemtap-limitations.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="intro-systemtap-vs-others"></a>1.2. SystemTap Capabilities</h2></div></div></div><a id="idm47951416823040" class="indexterm"></a><a id="idm47951416821488" class="indexterm"></a><div xmlns:d="http://docbook.org/ns/docbook" class="itemizedlist"><ul><li class="listitem"><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">1.2. SystemTap Capabilities</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="introduction.html" title="Chapter 1. Introduction" /><link rel="prev" href="introduction.html" title="Chapter 1. Introduction" /><link rel="next" href="intro-systemtap-limitations.html" title="1.3. Limitations of SystemTap" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="introduction.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="intro-systemtap-limitations.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="intro-systemtap-vs-others">
3 ⁠</a>1.2. SystemTap Capabilities</h2></div></div></div><a id="idm213977493312" class="indexterm"></a><a id="idm213977491904" class="indexterm"></a><div xmlns:d="http://docbook.org/ns/docbook" class="itemizedlist"><ul><li class="listitem"><div class="para">
3 <span class="strong strong"><strong>Flexibility:</strong></span> SystemTap's framework allows users to develop simple scripts for investigating and monitoring a wide variety of kernel functions, system calls, and other events that occur in kernel space. As a result, SystemTap is not so much a <span class="emphasis"><em>tool</em></span> as it is a system that allows you to develop your own kernel-specific forensic and monitoring tools. 4 <span class="strong strong"><strong>Flexibility:</strong></span> SystemTap's framework allows users to develop simple scripts for investigating and monitoring a wide variety of kernel functions, system calls, and other events that occur in kernel space. As a result, SystemTap is not so much a <span class="emphasis"><em>tool</em></span> as it is a system that allows you to develop your own kernel-specific forensic and monitoring tools.
4 </div></li><li class="listitem"><div class="para"> 5 </div></li><li class="listitem"><div class="para">
5 <span class="strong strong"><strong>Ease of use</strong></span>: as mentioned earlier, SystemTap allows users to probe kernel-space events without having to resort to instrument, recompile, install, and reboot the kernel. 6 <span class="strong strong"><strong>Ease of use</strong></span>: as mentioned earlier, SystemTap allows users to probe kernel-space events without having to resort to instrument, recompile, install, and reboot the kernel.
diff --git a/SystemTap_Beginners_Guide/introduction.html b/SystemTap_Beginners_Guide/introduction.html
index a3b72fa8..4a55620c 100644
--- a/SystemTap_Beginners_Guide/introduction.html
+++ b/SystemTap_Beginners_Guide/introduction.html
@@ -1,7 +1,9 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">Chapter 1. Introduction</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="index.html" title="SystemTap Beginners Guide" /><link rel="prev" href="pr01s02.html" title="2. We Need Feedback!" /><link rel="next" href="intro-systemtap-vs-others.html" title="1.2. SystemTap Capabilities" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="pr01s02.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="intro-systemtap-vs-others.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="chapter" lang="en-US"><div class="titlepage"><div><div><h1 class="title"><a id="introduction"></a>Chapter 1. Introduction</h1></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="introduction.html#goals">1.1. Documentation Goals</a></span></dt><dt><span class="section"><a href="intro-systemtap-vs-others.html">1.2. SystemTap Capabilities</a></span></dt><dt><span class="section"><a href="intro-systemtap-limitations.html">1.3. Limitations of SystemTap</a></span></dt></dl></div><a id="idm47951421532704" class="indexterm"></a><a id="idm47951476574704" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">Chapter 1. Introduction</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="index.html" title="SystemTap Beginners Guide" /><link rel="prev" href="pr01s02.html" title="2. We Need Feedback!" /><link rel="next" href="intro-systemtap-vs-others.html" title="1.2. SystemTap Capabilities" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="pr01s02.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="intro-systemtap-vs-others.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="chapter" lang="en-US"><div class="titlepage"><div><div><h1 class="title"><a id="introduction">
3 ⁠</a>Chapter 1. Introduction</h1></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="introduction.html#goals">1.1. Documentation Goals</a></span></dt><dt><span class="section"><a href="intro-systemtap-vs-others.html">1.2. SystemTap Capabilities</a></span></dt><dt><span class="section"><a href="intro-systemtap-limitations.html">1.3. Limitations of SystemTap</a></span></dt></dl></div><a id="idm214009813296" class="indexterm"></a><a id="idm214005414784" class="indexterm"></a><div class="para">
3 SystemTap is a tracing and probing tool that allows users to study and monitor the activities of the computer system (particularly, the kernel) in fine detail. It provides information similar to the output of tools like <code class="command">netstat</code>, <code class="command">ps</code>, <code class="command">top</code>, and <code class="command">iostat</code>, but is designed to provide more filtering and analysis options for collected information. 4 SystemTap is a tracing and probing tool that allows users to study and monitor the activities of the computer system (particularly, the kernel) in fine detail. It provides information similar to the output of tools like <code class="command">netstat</code>, <code class="command">ps</code>, <code class="command">top</code>, and <code class="command">iostat</code>, but is designed to provide more filtering and analysis options for collected information.
4 </div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="goals"></a>1.1. Documentation Goals</h2></div></div></div><a id="idm47951468913584" class="indexterm"></a><a id="idm47951418939472" class="indexterm"></a><a id="idm47951418170992" class="indexterm"></a><a id="idm47951476297856" class="indexterm"></a><div class="para"> 5 </div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="goals">
6 ⁠</a>1.1. Documentation Goals</h2></div></div></div><a id="idm213972874592" class="indexterm"></a><a id="idm214011735344" class="indexterm"></a><a id="idm214012139008" class="indexterm"></a><a id="idm213975270992" class="indexterm"></a><div class="para">
5 SystemTap provides the infrastructure to monitor the running Linux kernel for detailed analysis. This can assist administrators and developers in identifying the underlying cause of a bug or performance problem. 7 SystemTap provides the infrastructure to monitor the running Linux kernel for detailed analysis. This can assist administrators and developers in identifying the underlying cause of a bug or performance problem.
6 </div><div class="para"> 8 </div><div class="para">
7 Without SystemTap, monitoring the activity of a running kernel would require a tedious instrument, recompile, install, and reboot sequence. SystemTap is designed to eliminate this and allows users to gather the same information by running user-written SystemTap scripts. 9 Without SystemTap, monitoring the activity of a running kernel would require a tedious instrument, recompile, install, and reboot sequence. SystemTap is designed to eliminate this and allows users to gather the same information by running user-written SystemTap scripts.
diff --git a/SystemTap_Beginners_Guide/ioblktimesect.html b/SystemTap_Beginners_Guide/ioblktimesect.html
index 45f0c6cf..5b710b50 100644
--- a/SystemTap_Beginners_Guide/ioblktimesect.html
+++ b/SystemTap_Beginners_Guide/ioblktimesect.html
@@ -1,7 +1,8 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">5.2.7. Periodically Print I/O Block Time</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="mainsect-disk.html" title="5.2. Disk" /><link rel="prev" href="inodewatch2sect.html" title="5.2.6. Monitoring Changes to File Attributes" /><link rel="next" href="mainsect-profiling.html" title="5.3. Profiling" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="inodewatch2sect.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="mainsect-profiling.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="ioblktimesect"></a>5.2.7. Periodically Print I/O Block Time</h3></div></div></div><a id="idm47951468385792" class="indexterm"></a><a id="idm47951475099808" class="indexterm"></a><a id="idm47951424840576" class="indexterm"></a><a id="idm47951424819680" class="indexterm"></a><a id="idm47951468376176" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">5.2.7. Periodically Print I/O Block Time</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="mainsect-disk.html" title="5.2. Disk" /><link rel="prev" href="inodewatch2sect.html" title="5.2.6. Monitoring Changes to File Attributes" /><link rel="next" href="mainsect-profiling.html" title="5.3. Profiling" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="inodewatch2sect.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="mainsect-profiling.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="ioblktimesect">
3 ⁠</a>5.2.7. Periodically Print I/O Block Time</h3></div></div></div><a id="idm214022225216" class="indexterm"></a><a id="idm213974797024" class="indexterm"></a><a id="idm214007409632" class="indexterm"></a><a id="idm213968091760" class="indexterm"></a><a id="idm214018746320" class="indexterm"></a><div class="para">
3 This section describes how to track the amount of time each block I/O requests spends waiting for completion. This is useful in determining whether there are too many outstanding block I/O operations at any given time. 4 This section describes how to track the amount of time each block I/O requests spends waiting for completion. This is useful in determining whether there are too many outstanding block I/O operations at any given time.
4 </div><div class="formalpara"><div xmlns:d="http://docbook.org/ns/docbook" class="title">ioblktime.stp</div> 5 </div><div class="para"><div xmlns:d="http://docbook.org/ns/docbook" class="title">ioblktime.stp</div>
5 6
6<pre class="programlisting">#! /usr/bin/env stap 7<pre class="programlisting">#! /usr/bin/env stap
7 8
@@ -44,10 +45,11 @@ probe timer.s(10), end {
44 <a class="xref" href="ioblktimesect.html#ioblktime">ioblktime.stp</a> computes the average waiting time for block I/O per device, and prints a list every 10 seconds. As always, you can revise this refresh rate by editing the specified value in <code class="command">probe timer.s(10), end {</code>. 45 <a class="xref" href="ioblktimesect.html#ioblktime">ioblktime.stp</a> computes the average waiting time for block I/O per device, and prints a list every 10 seconds. As always, you can revise this refresh rate by editing the specified value in <code class="command">probe timer.s(10), end {</code>.
45 </div><div class="para"> 46 </div><div class="para">
46 In some cases, there can be too many outstanding block I/O operations, at which point the script can exceed the default number of <code class="command">MAXMAPENTRIES</code>. <code class="command">MAXMAPENTRIES</code> is the maximum number of rows in an array if the array size is not specified explicitly when declared. If the script exceeds the default <code class="command">MAXMAPENTRIES</code> value of 2048, run the script again with the <code class="command">stap</code> option <code class="command">-DMAXMAPENTRIES=10000</code>. 47 In some cases, there can be too many outstanding block I/O operations, at which point the script can exceed the default number of <code class="command">MAXMAPENTRIES</code>. <code class="command">MAXMAPENTRIES</code> is the maximum number of rows in an array if the array size is not specified explicitly when declared. If the script exceeds the default <code class="command">MAXMAPENTRIES</code> value of 2048, run the script again with the <code class="command">stap</code> option <code class="command">-DMAXMAPENTRIES=10000</code>.
47 </div><div class="example"><a id="ioblktimeoutput"></a><p class="title"><strong>Example 5.12. <a class="xref" href="ioblktimesect.html#ioblktime">ioblktime.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen"> device rw total (us) count avg (us) 48 </div><div class="example"><a id="ioblktimeoutput">
49 ⁠</a><p class="title"><strong>Example 5.12. <a class="xref" href="ioblktimesect.html#ioblktime">ioblktime.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen"> device rw total (us) count avg (us)
48 sda W 9659 6 1609 50 sda W 9659 6 1609
49 dm-0 W 20278 6 3379 51 dm-0 W 20278 6 3379
50 dm-0 R 20524 5 4104 52 dm-0 R 20524 5 4104
51 sda R 19277 5 3855</pre></div></div><br class="example-break" /><div class="para"> 53 sda R 19277 5 3855</pre></div></div><div class="para">
52 <a class="xref" href="ioblktimesect.html#ioblktimeoutput">Example 5.12, “ioblktime.stp Sample Output”</a> displays the device name, operations performed (<code class="command">rw</code>), total wait time of all operations (<code class="command">total(us)</code>), number of operations (<code class="command">count</code>), and average wait time for all those operations (<code class="command">avg (us)</code>). The times tallied by the script are in microseconds. 54 <a class="xref" href="ioblktimesect.html#ioblktimeoutput">Example 5.12, “ioblktime.stp Sample Output”</a> displays the device name, operations performed (<code class="command">rw</code>), total wait time of all operations (<code class="command">total(us)</code>), number of operations (<code class="command">count</code>), and average wait time for all those operations (<code class="command">avg (us)</code>). The times tallied by the script are in microseconds.
53 </div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="inodewatch2sect.html"><strong>Prev</strong>5.2.6. Monitoring Changes to File Attributes</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="mainsect-profiling.html"><strong>Next</strong>5.3. Profiling</a></li></ul></body></html> \ No newline at end of file 55 </div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="inodewatch2sect.html"><strong>Prev</strong>5.2.6. Monitoring Changes to File Attributes</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="mainsect-profiling.html"><strong>Next</strong>5.3. Profiling</a></li></ul></body></html> \ No newline at end of file
diff --git a/SystemTap_Beginners_Guide/iotimesect.html b/SystemTap_Beginners_Guide/iotimesect.html
index ca6f7a74..1529afce 100644
--- a/SystemTap_Beginners_Guide/iotimesect.html
+++ b/SystemTap_Beginners_Guide/iotimesect.html
@@ -1,7 +1,8 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">5.2.2. Tracking I/O Time For Each File Read or Write</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="mainsect-disk.html" title="5.2. Disk" /><link rel="prev" href="mainsect-disk.html" title="5.2. Disk" /><link rel="next" href="traceiosect.html" title="5.2.3. Track Cumulative IO" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="mainsect-disk.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="traceiosect.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="iotimesect"></a>5.2.2. Tracking I/O Time For Each File Read or Write</h3></div></div></div><a id="idm47951455847408" class="indexterm"></a><a id="idm47951459407088" class="indexterm"></a><a id="idm47951468753488" class="indexterm"></a><a id="idm47951475916832" class="indexterm"></a><a id="idm47951455859712" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">5.2.2. Tracking I/O Time For Each File Read or Write</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="mainsect-disk.html" title="5.2. Disk" /><link rel="prev" href="mainsect-disk.html" title="5.2. Disk" /><link rel="next" href="traceiosect.html" title="5.2.3. Track Cumulative IO" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="mainsect-disk.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="traceiosect.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="iotimesect">
3 ⁠</a>5.2.2. Tracking I/O Time For Each File Read or Write</h3></div></div></div><a id="idm214018786048" class="indexterm"></a><a id="idm213974995472" class="indexterm"></a><a id="idm213978825136" class="indexterm"></a><a id="idm214007049936" class="indexterm"></a><a id="idm213968122400" class="indexterm"></a><div class="para">
3 This section describes how to monitor the amount of time it takes for each process to read from or write to any file. This is useful to determine what files are slow to load on a given system. 4 This section describes how to monitor the amount of time it takes for each process to read from or write to any file. This is useful to determine what files are slow to load on a given system.
4 </div><div class="formalpara"><div xmlns:d="http://docbook.org/ns/docbook" class="title">iotime.stp</div> 5 </div><div class="para"><div xmlns:d="http://docbook.org/ns/docbook" class="title">iotime.stp</div>
5 6
6<pre class="programlisting">#! /usr/bin/env stap 7<pre class="programlisting">#! /usr/bin/env stap
7 8
@@ -90,9 +91,10 @@ probe syscall.close {
90</pre> 91</pre>
91 </div><div class="para"> 92 </div><div class="para">
92 <a class="xref" href="iotimesect.html#iotime">iotime.stp</a> tracks each time a system call opens, closes, reads from, and writes to a file. For each file any system call accesses, <a class="xref" href="iotimesect.html#iotime">iotime.stp</a> counts the number of microseconds it takes for any reads or writes to finish and tracks the amount of data (in bytes) read from or written to the file. 93 <a class="xref" href="iotimesect.html#iotime">iotime.stp</a> tracks each time a system call opens, closes, reads from, and writes to a file. For each file any system call accesses, <a class="xref" href="iotimesect.html#iotime">iotime.stp</a> counts the number of microseconds it takes for any reads or writes to finish and tracks the amount of data (in bytes) read from or written to the file.
93 </div><a id="idm47951474974528" class="indexterm"></a><a id="idm47951456584032" class="indexterm"></a><a id="idm47951456460432" class="indexterm"></a><div class="para"> 94 </div><a id="idm213978404080" class="indexterm"></a><a id="idm213975012832" class="indexterm"></a><a id="idm214011661232" class="indexterm"></a><div class="para">
94 <a class="xref" href="iotimesect.html#iotime">iotime.stp</a> also uses the local variable <code class="command">$count</code> to track the amount of data (in bytes) that any system call <span class="emphasis"><em>attempts</em></span> to read or write. Note that <code class="command">$return</code> (as used in <a class="xref" href="mainsect-disk.html#scriptdisktop">disktop.stp</a> from <a class="xref" href="mainsect-disk.html#disktop">Section 5.2.1, “Summarizing Disk Read/Write Traffic”</a>) stores the <span class="emphasis"><em>actual</em></span> amount of data read/written. <code class="command">$count</code> can only be used on probes that track data reads or writes (that is, <code class="command">syscall.read</code> and <code class="command">syscall.write</code>). 95 <a class="xref" href="iotimesect.html#iotime">iotime.stp</a> also uses the local variable <code class="command">$count</code> to track the amount of data (in bytes) that any system call <span class="emphasis"><em>attempts</em></span> to read or write. Note that <code class="command">$return</code> (as used in <a class="xref" href="mainsect-disk.html#scriptdisktop">disktop.stp</a> from <a class="xref" href="mainsect-disk.html#disktop">Section 5.2.1, “Summarizing Disk Read/Write Traffic”</a>) stores the <span class="emphasis"><em>actual</em></span> amount of data read/written. <code class="command">$count</code> can only be used on probes that track data reads or writes (that is, <code class="command">syscall.read</code> and <code class="command">syscall.write</code>).
95 </div><div class="example"><a id="iotimeoutput"></a><p class="title"><strong>Example 5.7. <a class="xref" href="iotimesect.html#iotime">iotime.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen">[...] 96 </div><div class="example"><a id="iotimeoutput">
97 ⁠</a><p class="title"><strong>Example 5.7. <a class="xref" href="iotimesect.html#iotime">iotime.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen">[...]
96825946 3364 (NetworkManager) access /sys/class/net/eth0/carrier read: 8190 write: 0 98825946 3364 (NetworkManager) access /sys/class/net/eth0/carrier read: 8190 write: 0
97825955 3364 (NetworkManager) iotime /sys/class/net/eth0/carrier time: 9 99825955 3364 (NetworkManager) iotime /sys/class/net/eth0/carrier time: 9
98[...] 100[...]
@@ -101,7 +103,7 @@ probe syscall.close {
101[...] 103[...]
1023973737 2886 (sendmail) access /proc/loadavg read: 4096 write: 0 1043973737 2886 (sendmail) access /proc/loadavg read: 4096 write: 0
1033973744 2886 (sendmail) iotime /proc/loadavg time: 11 1053973744 2886 (sendmail) iotime /proc/loadavg time: 11
104[...]</pre></div></div><br class="example-break" /><div class="para"> 106[...]</pre></div></div><div class="para">
105 <a class="xref" href="iotimesect.html#iotimeoutput">Example 5.7, “iotime.stp Sample Output”</a> prints out the following data: 107 <a class="xref" href="iotimesect.html#iotimeoutput">Example 5.7, “iotime.stp Sample Output”</a> prints out the following data:
106 </div><div xmlns:d="http://docbook.org/ns/docbook" class="itemizedlist"><ul><li class="listitem"><div class="para"> 108 </div><div xmlns:d="http://docbook.org/ns/docbook" class="itemizedlist"><ul><li class="listitem"><div class="para">
107 A timestamp, in microseconds. 109 A timestamp, in microseconds.
diff --git a/SystemTap_Beginners_Guide/ix01.html b/SystemTap_Beginners_Guide/ix01.html
index 369e84cc..8bd4e28d 100644
--- a/SystemTap_Beginners_Guide/ix01.html
+++ b/SystemTap_Beginners_Guide/ix01.html
@@ -1,2 +1,3 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">Index</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="index.html" title="SystemTap Beginners Guide" /><link rel="prev" href="appe-Publican-Revision_History.html" title="Appendix A. Revision History" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="appe-Publican-Revision_History.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"></li></ul><div class="index"><div class="titlepage"><div><div><h1 class="title"><a id="idm47951417768400"></a>Index</h1></div></div></div><div class="index"><div class="indexdiv"><h3>Symbols</h3><dl><dt>$count</dt><dd><dl><dt>sample usage</dt><dd><dl><dt>local variables, <a class="indexterm" href="iotimesect.html">Tracking I/O Time For Each File Read or Write</a></dt></dl></dd></dl></dd><dt>$return</dt><dd><dl><dt>sample usage</dt><dd><dl><dt>local variables, <a class="indexterm" href="mainsect-disk.html#disktop">Summarizing Disk Read/Write Traffic</a>, <a class="indexterm" href="traceiosect.html">Track Cumulative IO</a></dt></dl></dd></dl></dd><dt>@avg (integer extractor)</dt><dd><dl><dt>computing for statistical aggregates</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt></dl></dd></dl></dd><dt>@count (integer extractor)</dt><dd><dl><dt>computing for statistical aggregates</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt></dl></dd></dl></dd><dt>@max (integer extractor)</dt><dd><dl><dt>computing for statistical aggregates</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt></dl></dd></dl></dd><dt>@min (integer extractor)</dt><dd><dl><dt>computing for statistical aggregates</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt></dl></dd></dl></dd><dt>@sum (integer extractor)</dt><dd><dl><dt>computing for statistical aggregates</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt></dl></dd></dl></dd></dl></div><div class="indexdiv"><h3>A</h3><dl><dt>adding values to statistical aggregates</dt><dd><dl><dt>computing for statistical aggregates</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt></dl></dd></dl></dd><dt>advantages of cross-instrumentation, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt><dt>aggregate element not found</dt><dd><dl><dt>runtime errors/warnings</dt><dd><dl><dt>understainding SystemTap errors, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt></dl></dd></dl></dd><dt>aggregates (statistical)</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt></dl></dd><dt>aggregation overflow</dt><dd><dl><dt>runtime errors/warnings</dt><dd><dl><dt>understainding SystemTap errors, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt></dl></dd></dl></dd><dt>algebraic formulas using arrays</dt><dd><dl><dt>reading values from arrays</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt></dl></dd></dl></dd><dt>architecture notation, determining, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt><dt>architecture of SystemTap, <a class="indexterm" href="understanding-how-systemtap-works.html#understanding-architecture-tools">Architecture</a></dt><dt>array locals not supported</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>array operations</dt><dd><dl><dt>assigning associated values, <a class="indexterm" href="arrayoperators.html#arrayops-assignvalue">Assigning an Associated Value</a></dt><dd><dl><dt>associating timestamps to process names, <a class="indexterm" href="arrayoperators.html#arrayops-assignvalue">Assigning an Associated Value</a></dt></dl></dd><dt>associative arrays, <a class="indexterm" href="arrayoperators.html">Array Operations in SystemTap</a></dt><dt>clearing arrays/array elements, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt><dd><dl><dt>delete operator, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt><dt>multiple array operations within the same probe, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt><dt>virtual file system reads (non-cumulative), tallying, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt></dl></dd><dt>computing for statistical aggregates, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dd><dl><dt>@avg (integer extractor), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>@count (integer extractor), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>@max (integer extractor), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>@min (integer extractor), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>@sum (integer extractor), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>adding values to statistical aggregates, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>count (operator), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>extracting data collected by statistical aggregates, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt></dl></dd><dt>conditional statements, using arrays in, <a class="indexterm" href="arrayops-conditionals.html">Using Arrays in Conditional Statements</a></dt><dd><dl><dt>testing for array membership, <a class="indexterm" href="arrayops-conditionals.html">Using Arrays in Conditional Statements</a></dt></dl></dd><dt>deleting arrays and array elements, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt><dt>incrementing associated values, <a class="indexterm" href="arrayops-increment.html">Incrementing Associated Values</a></dt><dd><dl><dt>tallying virtual file system reads (VFS reads), <a class="indexterm" href="arrayops-increment.html">Incrementing Associated Values</a></dt></dl></dd><dt>multiple elements in an array, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt><dt>processing multiple elements in an array, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt><dd><dl><dt>cumulative virtual file system reads, tallying, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt><dt>foreach, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt><dt>iterations, processing elements in an array as, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt><dt>limiting the output of foreach, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt><dt>ordering the output of foreach, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt></dl></dd><dt>reading values from arrays, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt><dd><dl><dt>computing for timestamp deltas, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt><dt>empty unique keys, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt><dt>using arrays in simple computations, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt></dl></dd></dl></dd><dt>arrays, <a class="indexterm" href="associativearrays.html">Associative Arrays</a></dt><dd><dl><dt>(see also associative arrays)</dt></dl></dd><dt>assigning associated values</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayoperators.html#arrayops-assignvalue">Assigning an Associated Value</a></dt><dd><dl><dt>associating timestamps to process names, <a class="indexterm" href="arrayoperators.html#arrayops-assignvalue">Assigning an Associated Value</a></dt></dl></dd><dt>associating timestamps to process names</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayoperators.html#arrayops-assignvalue">Assigning an Associated Value</a></dt></dl></dd></dl></dd><dt>associated values</dt><dd><dl><dt>introduction</dt><dd><dl><dt>arrays, <a class="indexterm" href="associativearrays.html">Associative Arrays</a></dt></dl></dd></dl></dd><dt>associating timestamps to process names</dt><dd><dl><dt>assigning associated values</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayoperators.html#arrayops-assignvalue">Assigning an Associated Value</a></dt></dl></dd></dl></dd><dt>associative arrays</dt><dd><dl><dt>introduction, <a class="indexterm" href="associativearrays.html">Associative Arrays</a></dt><dd><dl><dt>associated values, <a class="indexterm" href="associativearrays.html">Associative Arrays</a></dt><dt>example, <a class="indexterm" href="associativearrays.html">Associative Arrays</a></dt><dt>index expression, <a class="indexterm" href="associativearrays.html">Associative Arrays</a></dt><dt>key pairs, <a class="indexterm" href="associativearrays.html">Associative Arrays</a></dt><dt>syntax, <a class="indexterm" href="associativearrays.html">Associative Arrays</a></dt><dt>unique keys, <a class="indexterm" href="associativearrays.html">Associative Arrays</a></dt></dl></dd></dl></dd><dt>asynchronous events</dt><dd><dl><dt>Events, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt></dl></dd></dl></div><div class="indexdiv"><h3>B</h3><dl><dt>begin</dt><dd><dl><dt>Events, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt></dl></dd><dt>building instrumentation modules from SystemTap scripts, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt><dt>building kernel modules from SystemTap scripts, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt></dl></div><div class="indexdiv"><h3>C</h3><dl><dt>call graph tracing</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt></dl></dd><dt>capabilities of SystemTap</dt><dd><dl><dt>Introduction, <a class="indexterm" href="intro-systemtap-vs-others.html">SystemTap Capabilities</a></dt></dl></dd><dt>changes to file attributes, monitoring</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="inodewatch2sect.html">Monitoring Changes to File Attributes</a></dt></dl></dd><dt>clearing arrays/array elements</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt><dd><dl><dt>delete operator, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt><dt>multiple array operations within the same probe, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt><dt>virtual file system reads (non-cumulative), tallying, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt></dl></dd></dl></dd><dt>command-line arguments</dt><dd><dl><dt>SystemTap handler constructs</dt><dd><dl><dt>handlers, <a class="indexterm" href="commandlineargssect.html">Command-Line Arguments</a></dt></dl></dd></dl></dd><dt>compiling instrumentation/kernel modules from SystemTap scripts, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt><dt>components</dt><dd><dl><dt>SystemTap scripts</dt><dd><dl><dt>introduction, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt></dl></dd></dl></dd><dt>computing for statistical aggregates</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dd><dl><dt>@avg (integer extractor), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>@count (integer extractor), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>@max (integer extractor), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>@min (integer extractor), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>@sum (integer extractor), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>adding values to statistical aggregates, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>count (operator), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>extracting data collected by statistical aggregates, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt></dl></dd></dl></dd><dt>computing for timestamp deltas</dt><dd><dl><dt>reading values from arrays</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt></dl></dd></dl></dd><dt>conditional operators</dt><dd><dl><dt>conditional statements</dt><dd><dl><dt>handlers, <a class="indexterm" href="handlerconditionalstatements.html">Conditional Statements</a></dt></dl></dd></dl></dd><dt>conditional statements, using arrays in</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-conditionals.html">Using Arrays in Conditional Statements</a></dt><dd><dl><dt>testing for array membership, <a class="indexterm" href="arrayops-conditionals.html">Using Arrays in Conditional Statements</a></dt></dl></dd></dl></dd><dt>CONFIG_HZ, computing for, <a class="indexterm" href="scriptconstructions.html#variablesconstructs">Variables</a></dt><dt>contended user-space locks (futex contentions), identifying</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="futexcontentionsect.html">Identifying Contended User-Space Locks</a></dt></dl></dd><dt>copy fault</dt><dd><dl><dt>runtime errors/warnings</dt><dd><dl><dt>understainding SystemTap errors, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt></dl></dd></dl></dd><dt>count operator</dt><dd><dl><dt>computing for statistical aggregates</dt><dd><dl><dt>array (operator), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt></dl></dd></dl></dd><dt>counting function calls</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="mainsect-profiling.html#countcallssect">Counting Function Calls Made</a></dt></dl></dd><dt>CPU ticks</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="threadtimessect.html">Determining Time Spent in Kernel and User Space</a></dt></dl></dd><dt>cpu()</dt><dd><dl><dt>functions, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt></dl></dd><dt>cross-compiling, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt><dt>cross-instrumentation</dt><dd><dl><dt>advantages of, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt><dt>building kernel modules from SystemTap scripts, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt><dt>configuration</dt><dd><dl><dt>host system and target system, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt></dl></dd><dt>generating instrumentation from SystemTap scripts, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt><dt>host system, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt><dt>instrumentation module, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt><dt>target kernel, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt><dt>target system, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt></dl></dd><dt>ctime()</dt><dd><dl><dt>functions, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt></dl></dd><dt>ctime(), example of usage</dt><dd><dl><dt>script examples, <a class="indexterm" href="mainsect-disk.html#disktop">Summarizing Disk Read/Write Traffic</a></dt></dl></dd><dt>cumulative I/O, tracking</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="traceiosect.html">Track Cumulative IO</a></dt></dl></dd><dt>cumulative virtual file system reads, tallying</dt><dd><dl><dt>processing multiple elements in an array</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt></dl></dd></dl></dd></dl></div><div class="indexdiv"><h3>D</h3><dl><dt>delete operator</dt><dd><dl><dt>clearing arrays/array elements</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt></dl></dd></dl></dd><dt>determining architecture notation, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt><dt>determining the kernel version, <a class="indexterm" href="using-systemtap.html#install-kinfo">Installing Required Kernel Information Packages Manually</a></dt><dt>determining time spent in kernel and user space</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="threadtimessect.html">Determining Time Spent in Kernel and User Space</a></dt></dl></dd><dt>device I/O, monitoring</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="traceio2sect.html">I/O Monitoring (By Device)</a></dt></dl></dd><dt>device number of a file (integer format)</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="inodewatchsect.html">Monitoring Reads and Writes to a File</a></dt></dl></dd><dt>disk I/O traffic, summarizing</dt><dd><dl><dt>script examples, <a class="indexterm" href="mainsect-disk.html#disktop">Summarizing Disk Read/Write Traffic</a></dt></dl></dd><dt>division by 0</dt><dd><dl><dt>runtime errors/warnings</dt><dd><dl><dt>understainding SystemTap errors, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt></dl></dd></dl></dd><dt>documentation goals</dt><dd><dl><dt>Introduction, <a class="indexterm" href="introduction.html#goals">Documentation Goals</a></dt></dl></dd></dl></div><div class="indexdiv"><h3>E</h3><dl><dt>embedded code in unprivileged script</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>empty unique keys</dt><dd><dl><dt>reading values from arrays</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt></dl></dd></dl></dd><dt>end</dt><dd><dl><dt>Events, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt></dl></dd><dt>errors</dt><dd><dl><dt>parse/semantics error, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dd><dl><dt>embedded code in unprivileged script, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>expected symbol/array index expression, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>grammatical/typographical script error, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>guru mode, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>invalid values to variables/arrays, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>libdwfl failure, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>no match for probe point, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>non-global arrays, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>probe mismatch, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>type mismatch for identifier, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>unresolved function call, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>unresolved target-symbol expression, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>unresolved type for identifier, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>variable modified during 'foreach', <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd><dt>runtime errors/warnings, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dd><dl><dt>aggregate element not found, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>aggregation overflow, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>copy fault, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>division by 0, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>MAXACTION exceeded, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>MAXNESTING exceeded, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>number of errors: N, skipped probes: M, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>pointer dereference fault, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt></dl></dd></dl></dd><dt>event types</dt><dd><dl><dt>Understanding How SystemTap Works, <a class="indexterm" href="understanding-how-systemtap-works.html">Understanding How SystemTap Works</a></dt></dl></dd><dt>Events</dt><dd><dl><dt>asynchronous events, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt><dt>begin, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt><dt>end, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt><dt>examples of synchronous and asynchronous events, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt><dt>introduction, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt><dt>kernel.function("function"), <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt><dt>kernel.trace("tracepoint"), <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt><dt>module("module"), <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt><dt>synchronous events, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt><dt>syscall.system_call, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt><dt>timer events, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt><dt>user-space, <a class="indexterm" href="userspace-probing.html#uevents">User-Space Events</a></dt><dt>vfs.file_operation, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt><dt>wildcards, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt></dl></dd><dt>events and handlers, <a class="indexterm" href="understanding-how-systemtap-works.html">Understanding How SystemTap Works</a></dt><dt>events wildcards, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt><dt>example</dt><dd><dl><dt>introduction</dt><dd><dl><dt>arrays, <a class="indexterm" href="associativearrays.html">Associative Arrays</a></dt></dl></dd></dl></dd><dt>example of multiple command-line arguments</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt></dl></dd><dt>examples of synchronous and asynchronous events</dt><dd><dl><dt>Events, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt></dl></dd><dt>examples of SystemTap scripts, <a class="indexterm" href="useful-systemtap-scripts.html">Useful SystemTap Scripts</a></dt><dd><dl><dt>call graph tracing, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt><dt>CPU ticks, <a class="indexterm" href="threadtimessect.html">Determining Time Spent in Kernel and User Space</a></dt><dt>ctime(), example of usage, <a class="indexterm" href="mainsect-disk.html#disktop">Summarizing Disk Read/Write Traffic</a></dt><dt>determining time spent in kernel and user space, <a class="indexterm" href="threadtimessect.html">Determining Time Spent in Kernel and User Space</a></dt><dt>file device number (integer format), <a class="indexterm" href="inodewatchsect.html">Monitoring Reads and Writes to a File</a></dt><dt>futex (lock) contentions, <a class="indexterm" href="futexcontentionsect.html">Identifying Contended User-Space Locks</a></dt><dt>futex system call, <a class="indexterm" href="futexcontentionsect.html">Identifying Contended User-Space Locks</a></dt><dt>identifying contended user-space locks (futex contentions), <a class="indexterm" href="futexcontentionsect.html">Identifying Contended User-Space Locks</a></dt><dt>if/else conditionals, alternative syntax, <a class="indexterm" href="useful-systemtap-scripts.html#nettopsect">Network Profiling</a></dt><dt>inode number, <a class="indexterm" href="inodewatchsect.html">Monitoring Reads and Writes to a File</a></dt><dt>monitoring changes to file attributes, <a class="indexterm" href="inodewatch2sect.html">Monitoring Changes to File Attributes</a></dt><dt>monitoring device I/O, <a class="indexterm" href="traceio2sect.html">I/O Monitoring (By Device)</a></dt><dt>monitoring I/O block time, <a class="indexterm" href="ioblktimesect.html">Periodically Print I/O Block Time</a></dt><dt>monitoring I/O time, <a class="indexterm" href="iotimesect.html">Tracking I/O Time For Each File Read or Write</a></dt><dt>monitoring incoming TCP connections, <a class="indexterm" href="useful-systemtap-scripts.html#tcpconnectionssect">Monitoring Incoming TCP Connections</a></dt><dt>monitoring polling applications, <a class="indexterm" href="timeoutssect.html">Monitoring Polling Applications</a></dt><dt>monitoring reads and writes to a file, <a class="indexterm" href="inodewatchsect.html">Monitoring Reads and Writes to a File</a></dt><dt>monitoring system calls, <a class="indexterm" href="topsyssect.html">Tracking Most Frequently Used System Calls</a></dt><dt>monitoring system calls (volume per process), <a class="indexterm" href="syscallsbyprocpidsect.html">Tracking System Call Volume Per Process</a></dt><dt>monitoring TCP packets, <a class="indexterm" href="useful-systemtap-scripts.html#tcpdumplikesect">Monitoring TCP Packets</a></dt><dt>multiple command-line arguments, example of, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt><dt>net/socket.c, tracing functions from, <a class="indexterm" href="useful-systemtap-scripts.html#sockettracesect">Tracing Functions Called in Network Socket Code</a></dt><dt>network profiling, <a class="indexterm" href="useful-systemtap-scripts.html#nettopsect">Network Profiling</a>, <a class="indexterm" href="useful-systemtap-scripts.html#dropwatchsect">Monitoring Network Packets Drops in Kernel</a></dt><dt>stat -c, determining file device number (integer format), <a class="indexterm" href="inodewatchsect.html">Monitoring Reads and Writes to a File</a></dt><dt>stat -c, determining whole device number, <a class="indexterm" href="traceio2sect.html">I/O Monitoring (By Device)</a></dt><dt>summarizing disk I/O traffic, <a class="indexterm" href="mainsect-disk.html#disktop">Summarizing Disk Read/Write Traffic</a></dt><dt>tallying function calls, <a class="indexterm" href="mainsect-profiling.html#countcallssect">Counting Function Calls Made</a></dt><dt>thread_indent(), sample usage, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt><dt>timer.ms(), sample usage, <a class="indexterm" href="mainsect-profiling.html#countcallssect">Counting Function Calls Made</a></dt><dt>timer.s(), sample usage, <a class="indexterm" href="timeoutssect.html">Monitoring Polling Applications</a>, <a class="indexterm" href="topsyssect.html">Tracking Most Frequently Used System Calls</a></dt><dt>tracing functions called in network socket code, <a class="indexterm" href="useful-systemtap-scripts.html#sockettracesect">Tracing Functions Called in Network Socket Code</a></dt><dt>tracking cumulative I/O, <a class="indexterm" href="traceiosect.html">Track Cumulative IO</a></dt><dt>trigger function, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt><dt>usrdev2kerndev(), <a class="indexterm" href="traceio2sect.html">I/O Monitoring (By Device)</a></dt><dt>whole device number (usage as a command-line argument), <a class="indexterm" href="traceio2sect.html">I/O Monitoring (By Device)</a></dt></dl></dd><dt>exceeded MAXACTION</dt><dd><dl><dt>runtime errors/warnings</dt><dd><dl><dt>understainding SystemTap errors, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt></dl></dd></dl></dd><dt>exceeded MAXNESTING</dt><dd><dl><dt>runtime errors/warnings</dt><dd><dl><dt>understainding SystemTap errors, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt></dl></dd></dl></dd><dt>exit()</dt><dd><dl><dt>functions, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt></dl></dd><dt>expected symbol/array index expression</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>extracting data collected by statistical aggregates</dt><dd><dl><dt>computing for statistical aggregates</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt></dl></dd></dl></dd></dl></div><div class="indexdiv"><h3>F</h3><dl><dt>feedback</dt><dd><dl><dt>contact information for this manual, <a class="indexterm" href="pr01s02.html">We Need Feedback!</a></dt></dl></dd><dt>file attributes, monitoring changes to</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="inodewatch2sect.html">Monitoring Changes to File Attributes</a></dt></dl></dd><dt>file device number (integer format)</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="inodewatchsect.html">Monitoring Reads and Writes to a File</a></dt></dl></dd><dt>file reads/writes, monitoring</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="inodewatchsect.html">Monitoring Reads and Writes to a File</a></dt></dl></dd><dt>flight recorder mode, <a class="indexterm" href="using-usage.html#flight-recorder">SystemTap Flight Recorder Mode</a></dt><dd><dl><dt>file mode, <a class="indexterm" href="using-usage.html#file-flight-recorder">File Flight Recorder</a></dt><dt>in-memory mode, <a class="indexterm" href="using-usage.html#memory-flight-recorder">In-memory Flight Recorder</a></dt></dl></dd><dt>for loops</dt><dd><dl><dt>conditional statements</dt><dd><dl><dt>handlers, <a class="indexterm" href="handlerconditionalstatements.html">Conditional Statements</a></dt></dl></dd></dl></dd><dt>foreach</dt><dd><dl><dt>processing multiple elements in an array</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt></dl></dd></dl></dd><dt>format</dt><dd><dl><dt>introduction</dt><dd><dl><dt>arrays, <a class="indexterm" href="associativearrays.html">Associative Arrays</a></dt></dl></dd></dl></dd><dt>format and syntax</dt><dd><dl><dt>printf(), <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dt>SystemTap handler constructs</dt><dd><dl><dt>handlers, <a class="indexterm" href="scriptconstructions.html#variablesconstructs">Variables</a></dt></dl></dd><dt>SystemTap scripts</dt><dd><dl><dt>introduction, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt></dl></dd></dl></dd><dt>format specifiers</dt><dd><dl><dt>printf(), <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt></dl></dd><dt>format strings</dt><dd><dl><dt>printf(), <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt></dl></dd><dt>function call (unresolved)</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>function calls (incoming/outgoing), tracing</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt></dl></dd><dt>function calls, tallying</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="mainsect-profiling.html#countcallssect">Counting Function Calls Made</a></dt></dl></dd><dt>functions, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dd><dl><dt>cpu(), <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dt>ctime(), <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dt>gettimeofday_s(), <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dt>pp(), <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dt>SystemTap scripts</dt><dd><dl><dt>introduction, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt></dl></dd><dt>target(), <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dt>thread_indent(), <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dt>tid(), <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dt>uid(), <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt></dl></dd><dt>functions (used in handlers)</dt><dd><dl><dt>exit(), <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt></dl></dd><dt>functions called in network socket code, tracing</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="useful-systemtap-scripts.html#sockettracesect">Tracing Functions Called in Network Socket Code</a></dt></dl></dd><dt>futex (lock) contentions</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="futexcontentionsect.html">Identifying Contended User-Space Locks</a></dt></dl></dd><dt>futex contention, definition</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="futexcontentionsect.html">Identifying Contended User-Space Locks</a></dt></dl></dd><dt>futex contentions, identifying</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="futexcontentionsect.html">Identifying Contended User-Space Locks</a></dt></dl></dd><dt>futex system call</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="futexcontentionsect.html">Identifying Contended User-Space Locks</a></dt></dl></dd></dl></div><div class="indexdiv"><h3>G</h3><dl><dt>gettimeofday_s()</dt><dd><dl><dt>functions, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt></dl></dd><dt>global</dt><dd><dl><dt>SystemTap handler constructs</dt><dd><dl><dt>handlers, <a class="indexterm" href="scriptconstructions.html#variablesconstructs">Variables</a></dt></dl></dd></dl></dd><dt>goals, documentation</dt><dd><dl><dt>Introduction, <a class="indexterm" href="introduction.html#goals">Documentation Goals</a></dt></dl></dd><dt>grammatical/typographical script error</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>guru mode</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd></dl></div><div class="indexdiv"><h3>H</h3><dl><dt>handler functions, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dt>handlers</dt><dd><dl><dt>conditional statements, <a class="indexterm" href="handlerconditionalstatements.html">Conditional Statements</a></dt><dd><dl><dt>conditional operators, <a class="indexterm" href="handlerconditionalstatements.html">Conditional Statements</a></dt><dt>for loops, <a class="indexterm" href="handlerconditionalstatements.html">Conditional Statements</a></dt><dt>if/else, <a class="indexterm" href="handlerconditionalstatements.html">Conditional Statements</a></dt><dt>while loops, <a class="indexterm" href="handlerconditionalstatements.html">Conditional Statements</a></dt></dl></dd><dt>introduction, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dt>SystemTap handler constructs, <a class="indexterm" href="scriptconstructions.html">Basic SystemTap Handler Constructs</a></dt><dd><dl><dt>command-line arguments, <a class="indexterm" href="commandlineargssect.html">Command-Line Arguments</a></dt><dt>global, <a class="indexterm" href="scriptconstructions.html#variablesconstructs">Variables</a></dt><dt>syntax and format, <a class="indexterm" href="scriptconstructions.html">Basic SystemTap Handler Constructs</a></dt><dt>variable notations, <a class="indexterm" href="commandlineargssect.html">Command-Line Arguments</a></dt><dt>variables, <a class="indexterm" href="scriptconstructions.html#variablesconstructs">Variables</a></dt></dl></dd><dt>target variables, <a class="indexterm" href="targetvariables.html">Target Variables</a></dt></dl></dd><dt>handlers and events, <a class="indexterm" href="understanding-how-systemtap-works.html">Understanding How SystemTap Works</a></dt><dd><dl><dt>SystemTap scripts</dt><dd><dl><dt>introduction, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt></dl></dd></dl></dd><dt>heaviest disk reads/writes, identifying</dt><dd><dl><dt>script examples, <a class="indexterm" href="mainsect-disk.html#disktop">Summarizing Disk Read/Write Traffic</a></dt></dl></dd><dt>host system</dt><dd><dl><dt>cross-instrumentation, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt></dl></dd><dt>host system and target system</dt><dd><dl><dt>cross-instrumentation</dt><dd><dl><dt>configuration, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt></dl></dd></dl></dd></dl></div><div class="indexdiv"><h3>I</h3><dl><dt>I/O block time, monitoring</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="ioblktimesect.html">Periodically Print I/O Block Time</a></dt></dl></dd><dt>I/O monitoring (by device)</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="traceio2sect.html">I/O Monitoring (By Device)</a></dt></dl></dd><dt>I/O time, monitoring</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="iotimesect.html">Tracking I/O Time For Each File Read or Write</a></dt></dl></dd><dt>I/O traffic, summarizing</dt><dd><dl><dt>script examples, <a class="indexterm" href="mainsect-disk.html#disktop">Summarizing Disk Read/Write Traffic</a></dt></dl></dd><dt>identifier type mismatch</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>identifying contended user-space locks (futex contentions)</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="futexcontentionsect.html">Identifying Contended User-Space Locks</a></dt></dl></dd><dt>identifying heaviest disk reads/writes</dt><dd><dl><dt>script examples, <a class="indexterm" href="mainsect-disk.html#disktop">Summarizing Disk Read/Write Traffic</a></dt></dl></dd><dt>if/else</dt><dd><dl><dt>conditional statements</dt><dd><dl><dt>handlers, <a class="indexterm" href="handlerconditionalstatements.html">Conditional Statements</a></dt></dl></dd></dl></dd><dt>if/else conditionals, alternative syntax</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="useful-systemtap-scripts.html#nettopsect">Network Profiling</a></dt></dl></dd><dt>if/else statements, using arrays in</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-conditionals.html">Using Arrays in Conditional Statements</a></dt></dl></dd><dt>incoming TCP connections, monitoring</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="useful-systemtap-scripts.html#tcpconnectionssect">Monitoring Incoming TCP Connections</a></dt></dl></dd><dt>incoming/outgoing function calls, tracing</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt></dl></dd><dt>incrementing associated values</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-increment.html">Incrementing Associated Values</a></dt><dd><dl><dt>tallying virtual file system reads (VFS reads), <a class="indexterm" href="arrayops-increment.html">Incrementing Associated Values</a></dt></dl></dd></dl></dd><dt>index expression</dt><dd><dl><dt>introduction</dt><dd><dl><dt>arrays, <a class="indexterm" href="associativearrays.html">Associative Arrays</a></dt></dl></dd></dl></dd><dt>initial testing, <a class="indexterm" href="using-systemtap.html#testing">Initial Testing</a></dt><dt>inode number</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="inodewatchsect.html">Monitoring Reads and Writes to a File</a></dt></dl></dd><dt>Installation</dt><dd><dl><dt>initial testing, <a class="indexterm" href="using-systemtap.html#testing">Initial Testing</a></dt><dt>kernel information packages, <a class="indexterm" href="using-systemtap.html#install-kinfo">Installing Required Kernel Information Packages Manually</a></dt><dt>kernel version, determining the, <a class="indexterm" href="using-systemtap.html#install-kinfo">Installing Required Kernel Information Packages Manually</a></dt><dt>required packages, <a class="indexterm" href="using-systemtap.html#install-kinfo">Installing Required Kernel Information Packages Manually</a></dt><dt>Setup and Installation, <a class="indexterm" href="using-systemtap.html#using-setup">Installation and Setup</a></dt><dt>systemtap package, <a class="indexterm" href="using-systemtap.html#installproper">Installing SystemTap</a></dt><dt>systemtap-runtime package, <a class="indexterm" href="using-systemtap.html#installproper">Installing SystemTap</a></dt></dl></dd><dt>instrumentation module</dt><dd><dl><dt>cross-instrumentation, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt></dl></dd><dt>instrumentation modules from SystemTap scripts, building, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt><dt>integer extractors</dt><dd><dl><dt>computing for statistical aggregates</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt></dl></dd></dl></dd><dt>Introduction</dt><dd><dl><dt>capabilities of SystemTap, <a class="indexterm" href="intro-systemtap-vs-others.html">SystemTap Capabilities</a></dt><dt>documentation goals, <a class="indexterm" href="introduction.html#goals">Documentation Goals</a></dt><dt>goals, documentation, <a class="indexterm" href="introduction.html#goals">Documentation Goals</a></dt><dt>limitations of SystemTap, <a class="indexterm" href="intro-systemtap-limitations.html">Limitations of SystemTap</a></dt><dt>performance monitoring, <a class="indexterm" href="introduction.html">Introduction</a></dt></dl></dd><dt>invalid division</dt><dd><dl><dt>runtime errors/warnings</dt><dd><dl><dt>understainding SystemTap errors, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt></dl></dd></dl></dd><dt>invalid values to variables/arrays</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>iterations, processing elements in an array as</dt><dd><dl><dt>processing multiple elements in an array</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt></dl></dd></dl></dd></dl></div><div class="indexdiv"><h3>K</h3><dl><dt>kernel and user space, determining time spent in</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="threadtimessect.html">Determining Time Spent in Kernel and User Space</a></dt></dl></dd><dt>kernel information packages, <a class="indexterm" href="using-systemtap.html#install-kinfo">Installing Required Kernel Information Packages Manually</a></dt><dt>kernel modules from SystemTap scripts, building, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt><dt>kernel version, determining the, <a class="indexterm" href="using-systemtap.html#install-kinfo">Installing Required Kernel Information Packages Manually</a></dt><dt>kernel.function("function")</dt><dd><dl><dt>Events, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt></dl></dd><dt>kernel.trace("tracepoint")</dt><dd><dl><dt>Events, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt></dl></dd><dt>key pairs</dt><dd><dl><dt>introduction</dt><dd><dl><dt>arrays, <a class="indexterm" href="associativearrays.html">Associative Arrays</a></dt></dl></dd></dl></dd></dl></div><div class="indexdiv"><h3>L</h3><dl><dt>libdwfl failure</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>limitations of SystemTap</dt><dd><dl><dt>Introduction, <a class="indexterm" href="intro-systemtap-limitations.html">Limitations of SystemTap</a></dt></dl></dd><dt>limiting the output of foreach</dt><dd><dl><dt>processing multiple elements in an array</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt></dl></dd></dl></dd><dt>local variables</dt><dd><dl><dt>name, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dt>sample usage</dt><dd><dl><dt>$count, <a class="indexterm" href="iotimesect.html">Tracking I/O Time For Each File Read or Write</a></dt><dt>$return, <a class="indexterm" href="mainsect-disk.html#disktop">Summarizing Disk Read/Write Traffic</a>, <a class="indexterm" href="traceiosect.html">Track Cumulative IO</a></dt></dl></dd></dl></dd></dl></div><div class="indexdiv"><h3>M</h3><dl><dt>MAXACTION exceeded</dt><dd><dl><dt>runtime errors/warnings</dt><dd><dl><dt>understainding SystemTap errors, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt></dl></dd></dl></dd><dt>MAXNESTING exceeded</dt><dd><dl><dt>runtime errors/warnings</dt><dd><dl><dt>understainding SystemTap errors, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt></dl></dd></dl></dd><dt>membership (in array), testing for</dt><dd><dl><dt>conditional statements, using arrays in</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-conditionals.html">Using Arrays in Conditional Statements</a></dt></dl></dd></dl></dd><dt>module("module")</dt><dd><dl><dt>Events, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt></dl></dd><dt>monitoring changes to file attributes</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="inodewatch2sect.html">Monitoring Changes to File Attributes</a></dt></dl></dd><dt>monitoring cumulative I/O</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="traceiosect.html">Track Cumulative IO</a></dt></dl></dd><dt>monitoring device I/O</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="traceio2sect.html">I/O Monitoring (By Device)</a></dt></dl></dd><dt>monitoring I/O block time</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="ioblktimesect.html">Periodically Print I/O Block Time</a></dt></dl></dd><dt>monitoring I/O time</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="iotimesect.html">Tracking I/O Time For Each File Read or Write</a></dt></dl></dd><dt>monitoring incoming TCP connections</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="useful-systemtap-scripts.html#tcpconnectionssect">Monitoring Incoming TCP Connections</a></dt></dl></dd><dt>monitoring polling applications</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="timeoutssect.html">Monitoring Polling Applications</a></dt></dl></dd><dt>monitoring reads and writes to a file</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="inodewatchsect.html">Monitoring Reads and Writes to a File</a></dt></dl></dd><dt>monitoring system calls</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="topsyssect.html">Tracking Most Frequently Used System Calls</a></dt></dl></dd><dt>monitoring system calls (volume per process)</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="syscallsbyprocpidsect.html">Tracking System Call Volume Per Process</a></dt></dl></dd><dt>monitoring TCP packets</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="useful-systemtap-scripts.html#tcpdumplikesect">Monitoring TCP Packets</a></dt></dl></dd><dt>multiple array operations within the same probe</dt><dd><dl><dt>clearing arrays/array elements</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt></dl></dd></dl></dd><dt>multiple command-line arguments, example of</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt></dl></dd><dt>multiple elements in an array</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt></dl></dd></dl></div><div class="indexdiv"><h3>N</h3><dl><dt>name</dt><dd><dl><dt>local variables, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt></dl></dd><dt>net/socket.c, tracing functions from</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="useful-systemtap-scripts.html#sockettracesect">Tracing Functions Called in Network Socket Code</a></dt></dl></dd><dt>network profiling</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="useful-systemtap-scripts.html#nettopsect">Network Profiling</a>, <a class="indexterm" href="useful-systemtap-scripts.html#dropwatchsect">Monitoring Network Packets Drops in Kernel</a></dt></dl></dd><dt>network socket code, tracing functions called in</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="useful-systemtap-scripts.html#sockettracesect">Tracing Functions Called in Network Socket Code</a></dt></dl></dd><dt>network traffic, monitoring</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="useful-systemtap-scripts.html#nettopsect">Network Profiling</a>, <a class="indexterm" href="useful-systemtap-scripts.html#dropwatchsect">Monitoring Network Packets Drops in Kernel</a></dt></dl></dd><dt>no match for probe point</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>non-global arrays</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>number of errors: N, skipped probes: M</dt><dd><dl><dt>runtime errors/warnings</dt><dd><dl><dt>understainding SystemTap errors, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt></dl></dd></dl></dd></dl></div><div class="indexdiv"><h3>O</h3><dl><dt>operations</dt><dd><dl><dt>assigning associated values</dt><dd><dl><dt>associating timestamps to process names, <a class="indexterm" href="arrayoperators.html#arrayops-assignvalue">Assigning an Associated Value</a></dt></dl></dd><dt>associative arrays, <a class="indexterm" href="arrayoperators.html">Array Operations in SystemTap</a></dt><dt>clearing arrays/array elements, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt><dd><dl><dt>delete operator, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt><dt>multiple array operations within the same probe, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt><dt>virtual file system reads (non-cumulative), tallying, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt></dl></dd><dt>computing for statistical aggregates, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dd><dl><dt>@avg (integer extractor), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>@count (integer extractor), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>@max (integer extractor), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>@min (integer extractor), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>@sum (integer extractor), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>adding values to statistical aggregates, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>count (operator), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>extracting data collected by statistical aggregates, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt></dl></dd><dt>conditional statements, using arrays in, <a class="indexterm" href="arrayops-conditionals.html">Using Arrays in Conditional Statements</a></dt><dd><dl><dt>testing for array membership, <a class="indexterm" href="arrayops-conditionals.html">Using Arrays in Conditional Statements</a></dt></dl></dd><dt>deleting arrays and array elements, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt><dt>incrementing associated values, <a class="indexterm" href="arrayops-increment.html">Incrementing Associated Values</a></dt><dd><dl><dt>tallying virtual file system reads (VFS reads), <a class="indexterm" href="arrayops-increment.html">Incrementing Associated Values</a></dt></dl></dd><dt>multiple elements in an array, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt><dt>processing multiple elements in an array, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt><dd><dl><dt>cumulative virtual file system reads, tallying, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt><dt>foreach, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt><dt>iterations, processing elements in an array as, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt><dt>limiting the output of foreach, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt><dt>ordering the output of foreach, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt></dl></dd><dt>reading values from arrays, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt><dd><dl><dt>computing for timestamp deltas, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt><dt>empty unique keys, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt><dt>using arrays in simple computations, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt></dl></dd></dl></dd><dt>options, stap</dt><dd><dl><dt>Usage, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt></dl></dd><dt>ordering the output of foreach</dt><dd><dl><dt>processing multiple elements in an array</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt></dl></dd></dl></dd><dt>overflow of aggregation</dt><dd><dl><dt>runtime errors/warnings</dt><dd><dl><dt>understainding SystemTap errors, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt></dl></dd></dl></dd></dl></div><div class="indexdiv"><h3>P</h3><dl><dt>packages required to run SystemTap, <a class="indexterm" href="using-systemtap.html#install-kinfo">Installing Required Kernel Information Packages Manually</a></dt><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dd><dl><dt>embedded code in unprivileged script, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>expected symbol/array index expression, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>grammatical/typographical script error, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>guru mode, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>invalid values to variables/arrays, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>libdwfl failure, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>no match for probe point, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>non-global arrays, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>probe mismatch, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>type mismatch for identifier, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>unresolved function call, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>unresolved target-symbol expression, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>unresolved type for identifier, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>variable modified during 'foreach', <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>performance monitoring</dt><dd><dl><dt>Introduction, <a class="indexterm" href="introduction.html">Introduction</a></dt></dl></dd><dt>pointer dereference fault</dt><dd><dl><dt>runtime errors/warnings</dt><dd><dl><dt>understainding SystemTap errors, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt></dl></dd></dl></dd><dt>polling applications, monitoring</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="timeoutssect.html">Monitoring Polling Applications</a></dt></dl></dd><dt>pp()</dt><dd><dl><dt>functions, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt></dl></dd><dt>printf()</dt><dd><dl><dt>format specifiers, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dt>format strings, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dt>syntax and format, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt></dl></dd><dt>printing I/O activity (cumulative)</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="traceiosect.html">Track Cumulative IO</a></dt></dl></dd><dt>printing I/O block time (periodically)</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="ioblktimesect.html">Periodically Print I/O Block Time</a></dt></dl></dd><dt>probe mismatch</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>probe point (no match for)</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>probes</dt><dd><dl><dt>SystemTap scripts</dt><dd><dl><dt>introduction, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt></dl></dd></dl></dd><dt>processing multiple elements in an array</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt><dt>cumulative virtual file system reads, tallying</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt></dl></dd><dt>foreach</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt></dl></dd><dt>limiting the output of foreach</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt></dl></dd><dt>ordering the output of foreach</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt></dl></dd></dl></dd><dt>profiling the network</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="useful-systemtap-scripts.html#nettopsect">Network Profiling</a>, <a class="indexterm" href="useful-systemtap-scripts.html#dropwatchsect">Monitoring Network Packets Drops in Kernel</a></dt></dl></dd></dl></div><div class="indexdiv"><h3>R</h3><dl><dt>reading values from arrays</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt><dd><dl><dt>empty unique keys, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt><dt>using arrays in simple computations, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt></dl></dd><dt>computing for timestamp deltas</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt></dl></dd></dl></dd><dt>reads/writes to a file, monitoring</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="inodewatchsect.html">Monitoring Reads and Writes to a File</a></dt></dl></dd><dt>required packages, <a class="indexterm" href="using-systemtap.html#install-kinfo">Installing Required Kernel Information Packages Manually</a></dt><dt>RPMs required to run SystemTap, <a class="indexterm" href="using-systemtap.html#install-kinfo">Installing Required Kernel Information Packages Manually</a></dt><dt>running scripts from standard input, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt><dt>running SystemTap scripts</dt><dd><dl><dt>Usage, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt></dl></dd><dt>runtime errors/warnings</dt><dd><dl><dt>understainding SystemTap errors, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dd><dl><dt>aggregate element not found, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>aggregation overflow, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>copy fault, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>division by 0, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>MAXACTION exceeded, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>MAXNESTING exceeded, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>number of errors: N, skipped probes: M, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>pointer dereference fault, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt></dl></dd></dl></dd></dl></div><div class="indexdiv"><h3>S</h3><dl><dt>script examples</dt><dd><dl><dt>call graph tracing, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt><dt>CPU ticks, <a class="indexterm" href="threadtimessect.html">Determining Time Spent in Kernel and User Space</a></dt><dt>ctime(), example of usage, <a class="indexterm" href="mainsect-disk.html#disktop">Summarizing Disk Read/Write Traffic</a></dt><dt>determining time spent in kernel and user space, <a class="indexterm" href="threadtimessect.html">Determining Time Spent in Kernel and User Space</a></dt><dt>file device number (integer format), <a class="indexterm" href="inodewatchsect.html">Monitoring Reads and Writes to a File</a></dt><dt>futex (lock) contentions, <a class="indexterm" href="futexcontentionsect.html">Identifying Contended User-Space Locks</a></dt><dt>futex system call, <a class="indexterm" href="futexcontentionsect.html">Identifying Contended User-Space Locks</a></dt><dt>identifying contended user-space locks (futex contentions), <a class="indexterm" href="futexcontentionsect.html">Identifying Contended User-Space Locks</a></dt><dt>if/else conditionals, alternative syntax, <a class="indexterm" href="useful-systemtap-scripts.html#nettopsect">Network Profiling</a></dt><dt>inode number, <a class="indexterm" href="inodewatchsect.html">Monitoring Reads and Writes to a File</a></dt><dt>monitoring changes to file attributes, <a class="indexterm" href="inodewatch2sect.html">Monitoring Changes to File Attributes</a></dt><dt>monitoring device I/O, <a class="indexterm" href="traceio2sect.html">I/O Monitoring (By Device)</a></dt><dt>monitoring I/O block time, <a class="indexterm" href="ioblktimesect.html">Periodically Print I/O Block Time</a></dt><dt>monitoring I/O time, <a class="indexterm" href="iotimesect.html">Tracking I/O Time For Each File Read or Write</a></dt><dt>monitoring incoming TCP connections, <a class="indexterm" href="useful-systemtap-scripts.html#tcpconnectionssect">Monitoring Incoming TCP Connections</a></dt><dt>monitoring polling applications, <a class="indexterm" href="timeoutssect.html">Monitoring Polling Applications</a></dt><dt>monitoring reads and writes to a file, <a class="indexterm" href="inodewatchsect.html">Monitoring Reads and Writes to a File</a></dt><dt>monitoring system calls, <a class="indexterm" href="topsyssect.html">Tracking Most Frequently Used System Calls</a></dt><dt>monitoring system calls (volume per process), <a class="indexterm" href="syscallsbyprocpidsect.html">Tracking System Call Volume Per Process</a></dt><dt>monitoring TCP packets, <a class="indexterm" href="useful-systemtap-scripts.html#tcpdumplikesect">Monitoring TCP Packets</a></dt><dt>multiple command-line arguments, example of, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt><dt>net/socket.c, tracing functions from, <a class="indexterm" href="useful-systemtap-scripts.html#sockettracesect">Tracing Functions Called in Network Socket Code</a></dt><dt>network profiling, <a class="indexterm" href="useful-systemtap-scripts.html#nettopsect">Network Profiling</a>, <a class="indexterm" href="useful-systemtap-scripts.html#dropwatchsect">Monitoring Network Packets Drops in Kernel</a></dt><dt>stat -c, determining file device number (integer format), <a class="indexterm" href="inodewatchsect.html">Monitoring Reads and Writes to a File</a></dt><dt>stat -c, determining whole device number, <a class="indexterm" href="traceio2sect.html">I/O Monitoring (By Device)</a></dt><dt>summarizing disk I/O traffic, <a class="indexterm" href="mainsect-disk.html#disktop">Summarizing Disk Read/Write Traffic</a></dt><dt>tallying function calls, <a class="indexterm" href="mainsect-profiling.html#countcallssect">Counting Function Calls Made</a></dt><dt>thread_indent(), sample usage, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt><dt>timer.ms(), sample usage, <a class="indexterm" href="mainsect-profiling.html#countcallssect">Counting Function Calls Made</a></dt><dt>timer.s(), sample usage, <a class="indexterm" href="timeoutssect.html">Monitoring Polling Applications</a>, <a class="indexterm" href="topsyssect.html">Tracking Most Frequently Used System Calls</a></dt><dt>tracing functions called in network socket code, <a class="indexterm" href="useful-systemtap-scripts.html#sockettracesect">Tracing Functions Called in Network Socket Code</a></dt><dt>tracking cumulative I/O, <a class="indexterm" href="traceiosect.html">Track Cumulative IO</a></dt><dt>trigger function, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt><dt>usrdev2kerndev(), <a class="indexterm" href="traceio2sect.html">I/O Monitoring (By Device)</a></dt><dt>whole device number (usage as a command-line argument), <a class="indexterm" href="traceio2sect.html">I/O Monitoring (By Device)</a></dt></dl></dd><dt>scripts</dt><dd><dl><dt>introduction, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt><dd><dl><dt>components, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt><dt>events and handlers, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt><dt>format and syntax, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt><dt>functions, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt><dt>probes, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt><dt>statement blocks, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt></dl></dd></dl></dd><dt>sessions, SystemTap, <a class="indexterm" href="understanding-how-systemtap-works.html#understanding-architecture-tools">Architecture</a></dt><dt>Setup and Installation, <a class="indexterm" href="using-systemtap.html#using-setup">Installation and Setup</a></dt><dt>Stack backtrace</dt><dd><dl><dt>user-space, <a class="indexterm" href="ustack.html">User-Space Stack Backtraces</a></dt></dl></dd><dt>standard input, running scripts from</dt><dd><dl><dt>Usage, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt></dl></dd><dt>stap</dt><dd><dl><dt>Usage, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt></dl></dd><dt>stap options, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt><dt>stapdev</dt><dd><dl><dt>Usage, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt></dl></dd><dt>staprun</dt><dd><dl><dt>Usage, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt></dl></dd><dt>stapusr</dt><dd><dl><dt>Usage, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt></dl></dd><dt>stat -c, determining file device number (integer format)</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="inodewatchsect.html">Monitoring Reads and Writes to a File</a></dt></dl></dd><dt>stat -c, determining whole device number</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="traceio2sect.html">I/O Monitoring (By Device)</a></dt></dl></dd><dt>statement blocks</dt><dd><dl><dt>SystemTap scripts</dt><dd><dl><dt>introduction, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt></dl></dd></dl></dd><dt>statistical aggregates</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt></dl></dd><dt>summarizing disk I/O traffic</dt><dd><dl><dt>script examples, <a class="indexterm" href="mainsect-disk.html#disktop">Summarizing Disk Read/Write Traffic</a></dt></dl></dd><dt>synchronous events</dt><dd><dl><dt>Events, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt></dl></dd><dt>syntax</dt><dd><dl><dt>introduction</dt><dd><dl><dt>arrays, <a class="indexterm" href="associativearrays.html">Associative Arrays</a></dt></dl></dd></dl></dd><dt>syntax and format</dt><dd><dl><dt>printf(), <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dt>SystemTap handler constructs</dt><dd><dl><dt>handlers, <a class="indexterm" href="scriptconstructions.html">Basic SystemTap Handler Constructs</a></dt></dl></dd><dt>SystemTap scripts</dt><dd><dl><dt>introduction, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt></dl></dd></dl></dd><dt>syscall.system_call</dt><dd><dl><dt>Events, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt></dl></dd><dt>system calls volume (per process), monitoring</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="syscallsbyprocpidsect.html">Tracking System Call Volume Per Process</a></dt></dl></dd><dt>system calls, monitoring</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="topsyssect.html">Tracking Most Frequently Used System Calls</a></dt></dl></dd><dt>SystemTap architecture, <a class="indexterm" href="understanding-how-systemtap-works.html#understanding-architecture-tools">Architecture</a></dt><dt>SystemTap handlers</dt><dd><dl><dt>SystemTap handler constructs, <a class="indexterm" href="scriptconstructions.html">Basic SystemTap Handler Constructs</a></dt><dd><dl><dt>syntax and format, <a class="indexterm" href="scriptconstructions.html">Basic SystemTap Handler Constructs</a></dt></dl></dd></dl></dd><dt>systemtap package, <a class="indexterm" href="using-systemtap.html#installproper">Installing SystemTap</a></dt><dt>SystemTap script functions, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dt>SystemTap scripts</dt><dd><dl><dt>introduction, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt><dd><dl><dt>components, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt><dt>events and handlers, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt><dt>format and syntax, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt><dt>functions, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt><dt>probes, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt><dt>statement blocks, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt></dl></dd><dt>useful examples, <a class="indexterm" href="useful-systemtap-scripts.html">Useful SystemTap Scripts</a></dt></dl></dd><dt>SystemTap scripts, how to run, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt><dt>SystemTap sessions, <a class="indexterm" href="understanding-how-systemtap-works.html#understanding-architecture-tools">Architecture</a></dt><dt>SystemTap statements</dt><dd><dl><dt>conditional statements, <a class="indexterm" href="handlerconditionalstatements.html">Conditional Statements</a></dt><dd><dl><dt>conditional operators, <a class="indexterm" href="handlerconditionalstatements.html">Conditional Statements</a></dt><dt>for loops, <a class="indexterm" href="handlerconditionalstatements.html">Conditional Statements</a></dt><dt>if/else, <a class="indexterm" href="handlerconditionalstatements.html">Conditional Statements</a></dt><dt>while loops, <a class="indexterm" href="handlerconditionalstatements.html">Conditional Statements</a></dt></dl></dd><dt>SystemTap handler constructs</dt><dd><dl><dt>command-line arguments, <a class="indexterm" href="commandlineargssect.html">Command-Line Arguments</a></dt><dt>global, <a class="indexterm" href="scriptconstructions.html#variablesconstructs">Variables</a></dt><dt>variable notations, <a class="indexterm" href="commandlineargssect.html">Command-Line Arguments</a></dt><dt>variables, <a class="indexterm" href="scriptconstructions.html#variablesconstructs">Variables</a></dt></dl></dd></dl></dd><dt>systemtap-runtime package, <a class="indexterm" href="using-systemtap.html#installproper">Installing SystemTap</a></dt><dt>systemtap-testsuite package</dt><dd><dl><dt>sample scripts, <a class="indexterm" href="useful-systemtap-scripts.html">Useful SystemTap Scripts</a></dt></dl></dd></dl></div><div class="indexdiv"><h3>T</h3><dl><dt>tallying function calls</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="mainsect-profiling.html#countcallssect">Counting Function Calls Made</a></dt></dl></dd><dt>tallying virtual file system reads (VFS reads)</dt><dd><dl><dt>incrementing associated values</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-increment.html">Incrementing Associated Values</a></dt></dl></dd></dl></dd><dt>Tapsets</dt><dd><dl><dt>definition of, <a class="indexterm" href="understanding-tapsets.html">Tapsets</a></dt></dl></dd><dt>target kernel</dt><dd><dl><dt>cross-instrumentation, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt></dl></dd><dt>target system</dt><dd><dl><dt>cross-instrumentation, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt></dl></dd><dt>target system and host system</dt><dd><dl><dt>configuration, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt></dl></dd><dt>target variables, <a class="indexterm" href="targetvariables.html">Target Variables</a></dt><dd><dl><dt>pretty printing, <a class="indexterm" href="targetvariables.html#targetprettyprinting">Pretty Printing Target Variables</a></dt><dt>typecasting, <a class="indexterm" href="typecasting.html">Typecasting</a></dt><dt>user-space, <a class="indexterm" href="utargetvariable.html">Accessing User-Space Target Variables</a></dt><dt>variable availability, <a class="indexterm" href="targetavailable.html">Checking Target Variable Availability</a></dt></dl></dd><dt>target()</dt><dd><dl><dt>functions, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt></dl></dd><dt>target-symbol expression, unresolved</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>TCP connections (incoming), monitoring</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="useful-systemtap-scripts.html#tcpconnectionssect">Monitoring Incoming TCP Connections</a></dt></dl></dd><dt>TCP packets, monitoring</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="useful-systemtap-scripts.html#tcpdumplikesect">Monitoring TCP Packets</a></dt></dl></dd><dt>testing for array membership</dt><dd><dl><dt>conditional statements, using arrays in</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-conditionals.html">Using Arrays in Conditional Statements</a></dt></dl></dd></dl></dd><dt>testing, initial, <a class="indexterm" href="using-systemtap.html#testing">Initial Testing</a></dt><dt>thread_indent()</dt><dd><dl><dt>functions, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt></dl></dd><dt>thread_indent(), sample usage</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt></dl></dd><dt>tid()</dt><dd><dl><dt>functions, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt></dl></dd><dt>time of I/O </dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="iotimesect.html">Tracking I/O Time For Each File Read or Write</a></dt></dl></dd><dt>time spent in kernel/user space, determining</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="threadtimessect.html">Determining Time Spent in Kernel and User Space</a></dt></dl></dd><dt>timer events</dt><dd><dl><dt>Events, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt></dl></dd><dt>timer.ms(), sample usage</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="mainsect-profiling.html#countcallssect">Counting Function Calls Made</a></dt></dl></dd><dt>timer.s(), sample usage</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="timeoutssect.html">Monitoring Polling Applications</a>, <a class="indexterm" href="topsyssect.html">Tracking Most Frequently Used System Calls</a></dt></dl></dd><dt>timestamp deltas, computing for</dt><dd><dl><dt>reading values from arrays</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt></dl></dd></dl></dd><dt>timestamps, association thereof to process names</dt><dd><dl><dt>assigning associated values</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayoperators.html#arrayops-assignvalue">Assigning an Associated Value</a></dt></dl></dd></dl></dd><dt>tracepoint, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a>, <a class="indexterm" href="useful-systemtap-scripts.html#dropwatchsect">Monitoring Network Packets Drops in Kernel</a></dt><dt>tracing call graph</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt></dl></dd><dt>tracing functions called in network socket code</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="useful-systemtap-scripts.html#sockettracesect">Tracing Functions Called in Network Socket Code</a></dt></dl></dd><dt>tracing incoming/outgoing function calls</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt></dl></dd><dt>tracking cumulative I/O</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="traceiosect.html">Track Cumulative IO</a></dt></dl></dd><dt>trigger function</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt></dl></dd><dt>type mismatch for identifier</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>typographical script error</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd></dl></div><div class="indexdiv"><h3>U</h3><dl><dt>uid()</dt><dd><dl><dt>functions, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt></dl></dd><dt>uname -m, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt><dt>uname -r, <a class="indexterm" href="using-systemtap.html#install-kinfo">Installing Required Kernel Information Packages Manually</a></dt><dt>understainding SystemTap errors</dt><dd><dl><dt>runtime errors/warnings, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dd><dl><dt>aggregate element not found, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>aggregation overflow, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>copy fault, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>division by 0, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>MAXACTION exceeded, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>MAXNESTING exceeded, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>number of errors: N, skipped probes: M, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>pointer dereference fault, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt></dl></dd></dl></dd><dt>Understanding How SystemTap Works, <a class="indexterm" href="understanding-how-systemtap-works.html">Understanding How SystemTap Works</a></dt><dd><dl><dt>architecture, <a class="indexterm" href="understanding-how-systemtap-works.html#understanding-architecture-tools">Architecture</a></dt><dt>event types, <a class="indexterm" href="understanding-how-systemtap-works.html">Understanding How SystemTap Works</a></dt><dt>events and handlers, <a class="indexterm" href="understanding-how-systemtap-works.html">Understanding How SystemTap Works</a></dt><dt>SystemTap sessions, <a class="indexterm" href="understanding-how-systemtap-works.html#understanding-architecture-tools">Architecture</a></dt></dl></dd><dt>understanding SystemTap errors</dt><dd><dl><dt>parse/semantics error, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dd><dl><dt>embedded code in unprivileged script, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>expected symbol/array index expression, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>grammatical/typographical script error, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>guru mode, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>invalid values to variables/arrays, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>libdwfl failure, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>no match for probe point, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>non-global arrays, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>probe mismatch, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>type mismatch for identifier, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>unresolved function call, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>unresolved target-symbol expression, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>unresolved type for identifier, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>variable modified during 'foreach', <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>unique keys</dt><dd><dl><dt>introduction</dt><dd><dl><dt>arrays, <a class="indexterm" href="associativearrays.html">Associative Arrays</a></dt></dl></dd></dl></dd><dt>unprivileged script, embedded code in</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>unresolved function call</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>unresolved target-symbol expression</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>unresolved type for identifier</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>unsafe embedded code in unprivileged script</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>Usage</dt><dd><dl><dt>options, stap, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt><dt>running SystemTap scripts, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt><dt>standard input, running scripts from, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt><dt>stap, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt><dt>stapdev, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt><dt>staprun, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt><dt>stapusr, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt></dl></dd><dt>useful examples of SystemTap scripts, <a class="indexterm" href="useful-systemtap-scripts.html">Useful SystemTap Scripts</a></dt><dt>user and kernel space, determining time spent in</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="threadtimessect.html">Determining Time Spent in Kernel and User Space</a></dt></dl></dd><dt>using arrays in simple computations</dt><dd><dl><dt>reading values from arrays</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt></dl></dd></dl></dd><dt>Using SystemTap, <a class="indexterm" href="using-systemtap.html">Using SystemTap</a></dt><dt>usrdev2kerndev()</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="traceio2sect.html">I/O Monitoring (By Device)</a></dt></dl></dd></dl></div><div class="indexdiv"><h3>V</h3><dl><dt>values, assignment of</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayoperators.html#arrayops-assignvalue">Assigning an Associated Value</a></dt></dl></dd><dt>variable modified during 'foreach'</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>variable notations</dt><dd><dl><dt>SystemTap handler constructs</dt><dd><dl><dt>handlers, <a class="indexterm" href="commandlineargssect.html">Command-Line Arguments</a></dt></dl></dd></dl></dd><dt>variables</dt><dd><dl><dt>SystemTap handler constructs</dt><dd><dl><dt>handlers, <a class="indexterm" href="scriptconstructions.html#variablesconstructs">Variables</a></dt></dl></dd></dl></dd><dt>variables (local)</dt><dd><dl><dt>name, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dt>sample usage</dt><dd><dl><dt>$count, <a class="indexterm" href="iotimesect.html">Tracking I/O Time For Each File Read or Write</a></dt><dt>$return, <a class="indexterm" href="mainsect-disk.html#disktop">Summarizing Disk Read/Write Traffic</a>, <a class="indexterm" href="traceiosect.html">Track Cumulative IO</a></dt></dl></dd></dl></dd><dt>VFS reads, tallying of</dt><dd><dl><dt>incrementing associated values</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-increment.html">Incrementing Associated Values</a></dt></dl></dd></dl></dd><dt>vfs.file_operation</dt><dd><dl><dt>Events, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt></dl></dd><dt>virtual file system reads (cumulative), tallying</dt><dd><dl><dt>processing multiple elements in an array</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt></dl></dd></dl></dd><dt>virtual file system reads (non-cumulative), tallying</dt><dd><dl><dt>clearing arrays/array elements</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt></dl></dd></dl></dd></dl></div><div class="indexdiv"><h3>W</h3><dl><dt>while loops</dt><dd><dl><dt>conditional statements</dt><dd><dl><dt>handlers, <a class="indexterm" href="handlerconditionalstatements.html">Conditional Statements</a></dt></dl></dd></dl></dd><dt>whole device number (usage as a command-line argument)</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="traceio2sect.html">I/O Monitoring (By Device)</a></dt></dl></dd><dt>wildcards in events, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt><dt>writes/reads to a file, monitoring</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="inodewatchsect.html">Monitoring Reads and Writes to a File</a></dt></dl></dd></dl></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="appe-Publican-Revision_History.html"><strong>Prev</strong>Appendix A. Revision History</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li></ul></body></html> \ No newline at end of file 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">Index</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="index.html" title="SystemTap Beginners Guide" /><link rel="prev" href="appe-Publican-Revision_History.html" title="Appendix A. Revision History" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="appe-Publican-Revision_History.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"></li></ul><div class="index"><div class="titlepage"><div><div><h1 class="title"><a id="idm213969160496">
3 ⁠</a>Index</h1></div></div></div><div class="index"><div class="indexdiv"><h3>Symbols</h3><dl><dt>$count</dt><dd><dl><dt>sample usage</dt><dd><dl><dt>local variables, <a class="indexterm" href="iotimesect.html">Tracking I/O Time For Each File Read or Write</a></dt></dl></dd></dl></dd><dt>$return</dt><dd><dl><dt>sample usage</dt><dd><dl><dt>local variables, <a class="indexterm" href="mainsect-disk.html#disktop">Summarizing Disk Read/Write Traffic</a>, <a class="indexterm" href="traceiosect.html">Track Cumulative IO</a></dt></dl></dd></dl></dd><dt>@avg (integer extractor)</dt><dd><dl><dt>computing for statistical aggregates</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt></dl></dd></dl></dd><dt>@count (integer extractor)</dt><dd><dl><dt>computing for statistical aggregates</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt></dl></dd></dl></dd><dt>@max (integer extractor)</dt><dd><dl><dt>computing for statistical aggregates</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt></dl></dd></dl></dd><dt>@min (integer extractor)</dt><dd><dl><dt>computing for statistical aggregates</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt></dl></dd></dl></dd><dt>@sum (integer extractor)</dt><dd><dl><dt>computing for statistical aggregates</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt></dl></dd></dl></dd></dl></div><div class="indexdiv"><h3>A</h3><dl><dt>adding values to statistical aggregates</dt><dd><dl><dt>computing for statistical aggregates</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt></dl></dd></dl></dd><dt>advantages of cross-instrumentation, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt><dt>aggregate element not found</dt><dd><dl><dt>runtime errors/warnings</dt><dd><dl><dt>understainding SystemTap errors, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt></dl></dd></dl></dd><dt>aggregates (statistical)</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt></dl></dd><dt>aggregation overflow</dt><dd><dl><dt>runtime errors/warnings</dt><dd><dl><dt>understainding SystemTap errors, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt></dl></dd></dl></dd><dt>algebraic formulas using arrays</dt><dd><dl><dt>reading values from arrays</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt></dl></dd></dl></dd><dt>architecture notation, determining, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt><dt>architecture of SystemTap, <a class="indexterm" href="understanding-how-systemtap-works.html#understanding-architecture-tools">Architecture</a></dt><dt>array locals not supported</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>array operations</dt><dd><dl><dt>assigning associated values, <a class="indexterm" href="arrayoperators.html#arrayops-assignvalue">Assigning an Associated Value</a></dt><dd><dl><dt>associating timestamps to process names, <a class="indexterm" href="arrayoperators.html#arrayops-assignvalue">Assigning an Associated Value</a></dt></dl></dd><dt>associative arrays, <a class="indexterm" href="arrayoperators.html">Array Operations in SystemTap</a></dt><dt>clearing arrays/array elements, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt><dd><dl><dt>delete operator, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt><dt>multiple array operations within the same probe, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt><dt>virtual file system reads (non-cumulative), tallying, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt></dl></dd><dt>computing for statistical aggregates, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dd><dl><dt>@avg (integer extractor), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>@count (integer extractor), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>@max (integer extractor), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>@min (integer extractor), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>@sum (integer extractor), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>adding values to statistical aggregates, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>count (operator), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>extracting data collected by statistical aggregates, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt></dl></dd><dt>conditional statements, using arrays in, <a class="indexterm" href="arrayops-conditionals.html">Using Arrays in Conditional Statements</a></dt><dd><dl><dt>testing for array membership, <a class="indexterm" href="arrayops-conditionals.html">Using Arrays in Conditional Statements</a></dt></dl></dd><dt>deleting arrays and array elements, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt><dt>incrementing associated values, <a class="indexterm" href="arrayops-increment.html">Incrementing Associated Values</a></dt><dd><dl><dt>tallying virtual file system reads (VFS reads), <a class="indexterm" href="arrayops-increment.html">Incrementing Associated Values</a></dt></dl></dd><dt>multiple elements in an array, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt><dt>processing multiple elements in an array, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt><dd><dl><dt>cumulative virtual file system reads, tallying, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt><dt>foreach, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt><dt>iterations, processing elements in an array as, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt><dt>limiting the output of foreach, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt><dt>ordering the output of foreach, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt></dl></dd><dt>reading values from arrays, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt><dd><dl><dt>computing for timestamp deltas, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt><dt>empty unique keys, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt><dt>using arrays in simple computations, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt></dl></dd></dl></dd><dt>arrays, <a class="indexterm" href="associativearrays.html">Associative Arrays</a></dt><dd><dl><dt>(see also associative arrays)</dt></dl></dd><dt>assigning associated values</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayoperators.html#arrayops-assignvalue">Assigning an Associated Value</a></dt><dd><dl><dt>associating timestamps to process names, <a class="indexterm" href="arrayoperators.html#arrayops-assignvalue">Assigning an Associated Value</a></dt></dl></dd><dt>associating timestamps to process names</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayoperators.html#arrayops-assignvalue">Assigning an Associated Value</a></dt></dl></dd></dl></dd><dt>associated values</dt><dd><dl><dt>introduction</dt><dd><dl><dt>arrays, <a class="indexterm" href="associativearrays.html">Associative Arrays</a></dt></dl></dd></dl></dd><dt>associating timestamps to process names</dt><dd><dl><dt>assigning associated values</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayoperators.html#arrayops-assignvalue">Assigning an Associated Value</a></dt></dl></dd></dl></dd><dt>associative arrays</dt><dd><dl><dt>introduction, <a class="indexterm" href="associativearrays.html">Associative Arrays</a></dt><dd><dl><dt>associated values, <a class="indexterm" href="associativearrays.html">Associative Arrays</a></dt><dt>example, <a class="indexterm" href="associativearrays.html">Associative Arrays</a></dt><dt>index expression, <a class="indexterm" href="associativearrays.html">Associative Arrays</a></dt><dt>key pairs, <a class="indexterm" href="associativearrays.html">Associative Arrays</a></dt><dt>syntax, <a class="indexterm" href="associativearrays.html">Associative Arrays</a></dt><dt>unique keys, <a class="indexterm" href="associativearrays.html">Associative Arrays</a></dt></dl></dd></dl></dd><dt>asynchronous events</dt><dd><dl><dt>Events, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt></dl></dd></dl></div><div class="indexdiv"><h3>B</h3><dl><dt>begin</dt><dd><dl><dt>Events, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt></dl></dd><dt>building instrumentation modules from SystemTap scripts, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt><dt>building kernel modules from SystemTap scripts, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt></dl></div><div class="indexdiv"><h3>C</h3><dl><dt>call graph tracing</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt></dl></dd><dt>capabilities of SystemTap</dt><dd><dl><dt>Introduction, <a class="indexterm" href="intro-systemtap-vs-others.html">SystemTap Capabilities</a></dt></dl></dd><dt>changes to file attributes, monitoring</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="inodewatch2sect.html">Monitoring Changes to File Attributes</a></dt></dl></dd><dt>clearing arrays/array elements</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt><dd><dl><dt>delete operator, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt><dt>multiple array operations within the same probe, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt><dt>virtual file system reads (non-cumulative), tallying, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt></dl></dd></dl></dd><dt>command-line arguments</dt><dd><dl><dt>SystemTap handler constructs</dt><dd><dl><dt>handlers, <a class="indexterm" href="commandlineargssect.html">Command-Line Arguments</a></dt></dl></dd></dl></dd><dt>compiling instrumentation/kernel modules from SystemTap scripts, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt><dt>components</dt><dd><dl><dt>SystemTap scripts</dt><dd><dl><dt>introduction, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt></dl></dd></dl></dd><dt>computing for statistical aggregates</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dd><dl><dt>@avg (integer extractor), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>@count (integer extractor), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>@max (integer extractor), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>@min (integer extractor), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>@sum (integer extractor), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>adding values to statistical aggregates, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>count (operator), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>extracting data collected by statistical aggregates, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt></dl></dd></dl></dd><dt>computing for timestamp deltas</dt><dd><dl><dt>reading values from arrays</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt></dl></dd></dl></dd><dt>conditional operators</dt><dd><dl><dt>conditional statements</dt><dd><dl><dt>handlers, <a class="indexterm" href="handlerconditionalstatements.html">Conditional Statements</a></dt></dl></dd></dl></dd><dt>conditional statements, using arrays in</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-conditionals.html">Using Arrays in Conditional Statements</a></dt><dd><dl><dt>testing for array membership, <a class="indexterm" href="arrayops-conditionals.html">Using Arrays in Conditional Statements</a></dt></dl></dd></dl></dd><dt>CONFIG_HZ, computing for, <a class="indexterm" href="scriptconstructions.html#variablesconstructs">Variables</a></dt><dt>contended user-space locks (futex contentions), identifying</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="futexcontentionsect.html">Identifying Contended User-Space Locks</a></dt></dl></dd><dt>copy fault</dt><dd><dl><dt>runtime errors/warnings</dt><dd><dl><dt>understainding SystemTap errors, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt></dl></dd></dl></dd><dt>count operator</dt><dd><dl><dt>computing for statistical aggregates</dt><dd><dl><dt>array (operator), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt></dl></dd></dl></dd><dt>counting function calls</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="mainsect-profiling.html#countcallssect">Counting Function Calls Made</a></dt></dl></dd><dt>CPU ticks</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="threadtimessect.html">Determining Time Spent in Kernel and User Space</a></dt></dl></dd><dt>cpu()</dt><dd><dl><dt>functions, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt></dl></dd><dt>cross-compiling, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt><dt>cross-instrumentation</dt><dd><dl><dt>advantages of, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt><dt>building kernel modules from SystemTap scripts, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt><dt>configuration</dt><dd><dl><dt>host system and target system, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt></dl></dd><dt>generating instrumentation from SystemTap scripts, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt><dt>host system, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt><dt>instrumentation module, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt><dt>target kernel, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt><dt>target system, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt></dl></dd><dt>ctime()</dt><dd><dl><dt>functions, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt></dl></dd><dt>ctime(), example of usage</dt><dd><dl><dt>script examples, <a class="indexterm" href="mainsect-disk.html#disktop">Summarizing Disk Read/Write Traffic</a></dt></dl></dd><dt>cumulative I/O, tracking</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="traceiosect.html">Track Cumulative IO</a></dt></dl></dd><dt>cumulative virtual file system reads, tallying</dt><dd><dl><dt>processing multiple elements in an array</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt></dl></dd></dl></dd></dl></div><div class="indexdiv"><h3>D</h3><dl><dt>delete operator</dt><dd><dl><dt>clearing arrays/array elements</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt></dl></dd></dl></dd><dt>determining architecture notation, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt><dt>determining the kernel version, <a class="indexterm" href="using-systemtap.html#install-kinfo">Installing Required Kernel Information Packages Manually</a></dt><dt>determining time spent in kernel and user space</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="threadtimessect.html">Determining Time Spent in Kernel and User Space</a></dt></dl></dd><dt>device I/O, monitoring</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="traceio2sect.html">I/O Monitoring (By Device)</a></dt></dl></dd><dt>device number of a file (integer format)</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="inodewatchsect.html">Monitoring Reads and Writes to a File</a></dt></dl></dd><dt>disk I/O traffic, summarizing</dt><dd><dl><dt>script examples, <a class="indexterm" href="mainsect-disk.html#disktop">Summarizing Disk Read/Write Traffic</a></dt></dl></dd><dt>division by 0</dt><dd><dl><dt>runtime errors/warnings</dt><dd><dl><dt>understainding SystemTap errors, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt></dl></dd></dl></dd><dt>documentation goals</dt><dd><dl><dt>Introduction, <a class="indexterm" href="introduction.html#goals">Documentation Goals</a></dt></dl></dd></dl></div><div class="indexdiv"><h3>E</h3><dl><dt>embedded code in unprivileged script</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>empty unique keys</dt><dd><dl><dt>reading values from arrays</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt></dl></dd></dl></dd><dt>end</dt><dd><dl><dt>Events, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt></dl></dd><dt>errors</dt><dd><dl><dt>parse/semantics error, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dd><dl><dt>embedded code in unprivileged script, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>expected symbol/array index expression, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>grammatical/typographical script error, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>guru mode, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>invalid values to variables/arrays, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>libdwfl failure, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>no match for probe point, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>non-global arrays, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>probe mismatch, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>type mismatch for identifier, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>unresolved function call, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>unresolved target-symbol expression, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>unresolved type for identifier, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>variable modified during 'foreach', <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd><dt>runtime errors/warnings, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dd><dl><dt>aggregate element not found, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>aggregation overflow, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>copy fault, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>division by 0, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>MAXACTION exceeded, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>MAXNESTING exceeded, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>number of errors: N, skipped probes: M, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>pointer dereference fault, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt></dl></dd></dl></dd><dt>event types</dt><dd><dl><dt>Understanding How SystemTap Works, <a class="indexterm" href="understanding-how-systemtap-works.html">Understanding How SystemTap Works</a></dt></dl></dd><dt>Events</dt><dd><dl><dt>asynchronous events, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt><dt>begin, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt><dt>end, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt><dt>examples of synchronous and asynchronous events, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt><dt>introduction, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt><dt>kernel.function("function"), <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt><dt>kernel.trace("tracepoint"), <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt><dt>module("module"), <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt><dt>synchronous events, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt><dt>syscall.system_call, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt><dt>timer events, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt><dt>user-space, <a class="indexterm" href="userspace-probing.html#uevents">User-Space Events</a></dt><dt>vfs.file_operation, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt><dt>wildcards, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt></dl></dd><dt>events and handlers, <a class="indexterm" href="understanding-how-systemtap-works.html">Understanding How SystemTap Works</a></dt><dt>events wildcards, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt><dt>example</dt><dd><dl><dt>introduction</dt><dd><dl><dt>arrays, <a class="indexterm" href="associativearrays.html">Associative Arrays</a></dt></dl></dd></dl></dd><dt>example of multiple command-line arguments</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt></dl></dd><dt>examples of synchronous and asynchronous events</dt><dd><dl><dt>Events, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt></dl></dd><dt>examples of SystemTap scripts, <a class="indexterm" href="useful-systemtap-scripts.html">Useful SystemTap Scripts</a></dt><dd><dl><dt>call graph tracing, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt><dt>CPU ticks, <a class="indexterm" href="threadtimessect.html">Determining Time Spent in Kernel and User Space</a></dt><dt>ctime(), example of usage, <a class="indexterm" href="mainsect-disk.html#disktop">Summarizing Disk Read/Write Traffic</a></dt><dt>determining time spent in kernel and user space, <a class="indexterm" href="threadtimessect.html">Determining Time Spent in Kernel and User Space</a></dt><dt>file device number (integer format), <a class="indexterm" href="inodewatchsect.html">Monitoring Reads and Writes to a File</a></dt><dt>futex (lock) contentions, <a class="indexterm" href="futexcontentionsect.html">Identifying Contended User-Space Locks</a></dt><dt>futex system call, <a class="indexterm" href="futexcontentionsect.html">Identifying Contended User-Space Locks</a></dt><dt>identifying contended user-space locks (futex contentions), <a class="indexterm" href="futexcontentionsect.html">Identifying Contended User-Space Locks</a></dt><dt>if/else conditionals, alternative syntax, <a class="indexterm" href="useful-systemtap-scripts.html#nettopsect">Network Profiling</a></dt><dt>inode number, <a class="indexterm" href="inodewatchsect.html">Monitoring Reads and Writes to a File</a></dt><dt>monitoring changes to file attributes, <a class="indexterm" href="inodewatch2sect.html">Monitoring Changes to File Attributes</a></dt><dt>monitoring device I/O, <a class="indexterm" href="traceio2sect.html">I/O Monitoring (By Device)</a></dt><dt>monitoring I/O block time, <a class="indexterm" href="ioblktimesect.html">Periodically Print I/O Block Time</a></dt><dt>monitoring I/O time, <a class="indexterm" href="iotimesect.html">Tracking I/O Time For Each File Read or Write</a></dt><dt>monitoring incoming TCP connections, <a class="indexterm" href="useful-systemtap-scripts.html#tcpconnectionssect">Monitoring Incoming TCP Connections</a></dt><dt>monitoring polling applications, <a class="indexterm" href="timeoutssect.html">Monitoring Polling Applications</a></dt><dt>monitoring reads and writes to a file, <a class="indexterm" href="inodewatchsect.html">Monitoring Reads and Writes to a File</a></dt><dt>monitoring system calls, <a class="indexterm" href="topsyssect.html">Tracking Most Frequently Used System Calls</a></dt><dt>monitoring system calls (volume per process), <a class="indexterm" href="syscallsbyprocpidsect.html">Tracking System Call Volume Per Process</a></dt><dt>monitoring TCP packets, <a class="indexterm" href="useful-systemtap-scripts.html#tcpdumplikesect">Monitoring TCP Packets</a></dt><dt>multiple command-line arguments, example of, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt><dt>net/socket.c, tracing functions from, <a class="indexterm" href="useful-systemtap-scripts.html#sockettracesect">Tracing Functions Called in Network Socket Code</a></dt><dt>network profiling, <a class="indexterm" href="useful-systemtap-scripts.html#nettopsect">Network Profiling</a>, <a class="indexterm" href="useful-systemtap-scripts.html#dropwatchsect">Monitoring Network Packets Drops in Kernel</a></dt><dt>stat -c, determining file device number (integer format), <a class="indexterm" href="inodewatchsect.html">Monitoring Reads and Writes to a File</a></dt><dt>stat -c, determining whole device number, <a class="indexterm" href="traceio2sect.html">I/O Monitoring (By Device)</a></dt><dt>summarizing disk I/O traffic, <a class="indexterm" href="mainsect-disk.html#disktop">Summarizing Disk Read/Write Traffic</a></dt><dt>tallying function calls, <a class="indexterm" href="mainsect-profiling.html#countcallssect">Counting Function Calls Made</a></dt><dt>thread_indent(), sample usage, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt><dt>timer.ms(), sample usage, <a class="indexterm" href="mainsect-profiling.html#countcallssect">Counting Function Calls Made</a></dt><dt>timer.s(), sample usage, <a class="indexterm" href="timeoutssect.html">Monitoring Polling Applications</a>, <a class="indexterm" href="topsyssect.html">Tracking Most Frequently Used System Calls</a></dt><dt>tracing functions called in network socket code, <a class="indexterm" href="useful-systemtap-scripts.html#sockettracesect">Tracing Functions Called in Network Socket Code</a></dt><dt>tracking cumulative I/O, <a class="indexterm" href="traceiosect.html">Track Cumulative IO</a></dt><dt>trigger function, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt><dt>usrdev2kerndev(), <a class="indexterm" href="traceio2sect.html">I/O Monitoring (By Device)</a></dt><dt>whole device number (usage as a command-line argument), <a class="indexterm" href="traceio2sect.html">I/O Monitoring (By Device)</a></dt></dl></dd><dt>exceeded MAXACTION</dt><dd><dl><dt>runtime errors/warnings</dt><dd><dl><dt>understainding SystemTap errors, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt></dl></dd></dl></dd><dt>exceeded MAXNESTING</dt><dd><dl><dt>runtime errors/warnings</dt><dd><dl><dt>understainding SystemTap errors, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt></dl></dd></dl></dd><dt>exit()</dt><dd><dl><dt>functions, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt></dl></dd><dt>expected symbol/array index expression</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>extracting data collected by statistical aggregates</dt><dd><dl><dt>computing for statistical aggregates</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt></dl></dd></dl></dd></dl></div><div class="indexdiv"><h3>F</h3><dl><dt>feedback</dt><dd><dl><dt>contact information for this manual, <a class="indexterm" href="pr01s02.html">We Need Feedback!</a></dt></dl></dd><dt>file attributes, monitoring changes to</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="inodewatch2sect.html">Monitoring Changes to File Attributes</a></dt></dl></dd><dt>file device number (integer format)</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="inodewatchsect.html">Monitoring Reads and Writes to a File</a></dt></dl></dd><dt>file reads/writes, monitoring</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="inodewatchsect.html">Monitoring Reads and Writes to a File</a></dt></dl></dd><dt>flight recorder mode, <a class="indexterm" href="using-usage.html#flight-recorder">SystemTap Flight Recorder Mode</a></dt><dd><dl><dt>file mode, <a class="indexterm" href="using-usage.html#file-flight-recorder">File Flight Recorder</a></dt><dt>in-memory mode, <a class="indexterm" href="using-usage.html#memory-flight-recorder">In-memory Flight Recorder</a></dt></dl></dd><dt>for loops</dt><dd><dl><dt>conditional statements</dt><dd><dl><dt>handlers, <a class="indexterm" href="handlerconditionalstatements.html">Conditional Statements</a></dt></dl></dd></dl></dd><dt>foreach</dt><dd><dl><dt>processing multiple elements in an array</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt></dl></dd></dl></dd><dt>format</dt><dd><dl><dt>introduction</dt><dd><dl><dt>arrays, <a class="indexterm" href="associativearrays.html">Associative Arrays</a></dt></dl></dd></dl></dd><dt>format and syntax</dt><dd><dl><dt>printf(), <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dt>SystemTap handler constructs</dt><dd><dl><dt>handlers, <a class="indexterm" href="scriptconstructions.html#variablesconstructs">Variables</a></dt></dl></dd><dt>SystemTap scripts</dt><dd><dl><dt>introduction, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt></dl></dd></dl></dd><dt>format specifiers</dt><dd><dl><dt>printf(), <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt></dl></dd><dt>format strings</dt><dd><dl><dt>printf(), <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt></dl></dd><dt>function call (unresolved)</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>function calls (incoming/outgoing), tracing</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt></dl></dd><dt>function calls, tallying</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="mainsect-profiling.html#countcallssect">Counting Function Calls Made</a></dt></dl></dd><dt>functions, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dd><dl><dt>cpu(), <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dt>ctime(), <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dt>gettimeofday_s(), <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dt>pp(), <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dt>SystemTap scripts</dt><dd><dl><dt>introduction, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt></dl></dd><dt>target(), <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dt>thread_indent(), <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dt>tid(), <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dt>uid(), <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt></dl></dd><dt>functions (used in handlers)</dt><dd><dl><dt>exit(), <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt></dl></dd><dt>functions called in network socket code, tracing</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="useful-systemtap-scripts.html#sockettracesect">Tracing Functions Called in Network Socket Code</a></dt></dl></dd><dt>futex (lock) contentions</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="futexcontentionsect.html">Identifying Contended User-Space Locks</a></dt></dl></dd><dt>futex contention, definition</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="futexcontentionsect.html">Identifying Contended User-Space Locks</a></dt></dl></dd><dt>futex contentions, identifying</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="futexcontentionsect.html">Identifying Contended User-Space Locks</a></dt></dl></dd><dt>futex system call</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="futexcontentionsect.html">Identifying Contended User-Space Locks</a></dt></dl></dd></dl></div><div class="indexdiv"><h3>G</h3><dl><dt>gettimeofday_s()</dt><dd><dl><dt>functions, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt></dl></dd><dt>global</dt><dd><dl><dt>SystemTap handler constructs</dt><dd><dl><dt>handlers, <a class="indexterm" href="scriptconstructions.html#variablesconstructs">Variables</a></dt></dl></dd></dl></dd><dt>goals, documentation</dt><dd><dl><dt>Introduction, <a class="indexterm" href="introduction.html#goals">Documentation Goals</a></dt></dl></dd><dt>grammatical/typographical script error</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>guru mode</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd></dl></div><div class="indexdiv"><h3>H</h3><dl><dt>handler functions, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dt>handlers</dt><dd><dl><dt>conditional statements, <a class="indexterm" href="handlerconditionalstatements.html">Conditional Statements</a></dt><dd><dl><dt>conditional operators, <a class="indexterm" href="handlerconditionalstatements.html">Conditional Statements</a></dt><dt>for loops, <a class="indexterm" href="handlerconditionalstatements.html">Conditional Statements</a></dt><dt>if/else, <a class="indexterm" href="handlerconditionalstatements.html">Conditional Statements</a></dt><dt>while loops, <a class="indexterm" href="handlerconditionalstatements.html">Conditional Statements</a></dt></dl></dd><dt>introduction, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dt>SystemTap handler constructs, <a class="indexterm" href="scriptconstructions.html">Basic SystemTap Handler Constructs</a></dt><dd><dl><dt>command-line arguments, <a class="indexterm" href="commandlineargssect.html">Command-Line Arguments</a></dt><dt>global, <a class="indexterm" href="scriptconstructions.html#variablesconstructs">Variables</a></dt><dt>syntax and format, <a class="indexterm" href="scriptconstructions.html">Basic SystemTap Handler Constructs</a></dt><dt>variable notations, <a class="indexterm" href="commandlineargssect.html">Command-Line Arguments</a></dt><dt>variables, <a class="indexterm" href="scriptconstructions.html#variablesconstructs">Variables</a></dt></dl></dd><dt>target variables, <a class="indexterm" href="targetvariables.html">Target Variables</a></dt></dl></dd><dt>handlers and events, <a class="indexterm" href="understanding-how-systemtap-works.html">Understanding How SystemTap Works</a></dt><dd><dl><dt>SystemTap scripts</dt><dd><dl><dt>introduction, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt></dl></dd></dl></dd><dt>heaviest disk reads/writes, identifying</dt><dd><dl><dt>script examples, <a class="indexterm" href="mainsect-disk.html#disktop">Summarizing Disk Read/Write Traffic</a></dt></dl></dd><dt>host system</dt><dd><dl><dt>cross-instrumentation, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt></dl></dd><dt>host system and target system</dt><dd><dl><dt>cross-instrumentation</dt><dd><dl><dt>configuration, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt></dl></dd></dl></dd></dl></div><div class="indexdiv"><h3>I</h3><dl><dt>I/O block time, monitoring</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="ioblktimesect.html">Periodically Print I/O Block Time</a></dt></dl></dd><dt>I/O monitoring (by device)</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="traceio2sect.html">I/O Monitoring (By Device)</a></dt></dl></dd><dt>I/O time, monitoring</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="iotimesect.html">Tracking I/O Time For Each File Read or Write</a></dt></dl></dd><dt>I/O traffic, summarizing</dt><dd><dl><dt>script examples, <a class="indexterm" href="mainsect-disk.html#disktop">Summarizing Disk Read/Write Traffic</a></dt></dl></dd><dt>identifier type mismatch</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>identifying contended user-space locks (futex contentions)</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="futexcontentionsect.html">Identifying Contended User-Space Locks</a></dt></dl></dd><dt>identifying heaviest disk reads/writes</dt><dd><dl><dt>script examples, <a class="indexterm" href="mainsect-disk.html#disktop">Summarizing Disk Read/Write Traffic</a></dt></dl></dd><dt>if/else</dt><dd><dl><dt>conditional statements</dt><dd><dl><dt>handlers, <a class="indexterm" href="handlerconditionalstatements.html">Conditional Statements</a></dt></dl></dd></dl></dd><dt>if/else conditionals, alternative syntax</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="useful-systemtap-scripts.html#nettopsect">Network Profiling</a></dt></dl></dd><dt>if/else statements, using arrays in</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-conditionals.html">Using Arrays in Conditional Statements</a></dt></dl></dd><dt>incoming TCP connections, monitoring</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="useful-systemtap-scripts.html#tcpconnectionssect">Monitoring Incoming TCP Connections</a></dt></dl></dd><dt>incoming/outgoing function calls, tracing</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt></dl></dd><dt>incrementing associated values</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-increment.html">Incrementing Associated Values</a></dt><dd><dl><dt>tallying virtual file system reads (VFS reads), <a class="indexterm" href="arrayops-increment.html">Incrementing Associated Values</a></dt></dl></dd></dl></dd><dt>index expression</dt><dd><dl><dt>introduction</dt><dd><dl><dt>arrays, <a class="indexterm" href="associativearrays.html">Associative Arrays</a></dt></dl></dd></dl></dd><dt>initial testing, <a class="indexterm" href="using-systemtap.html#testing">Initial Testing</a></dt><dt>inode number</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="inodewatchsect.html">Monitoring Reads and Writes to a File</a></dt></dl></dd><dt>Installation</dt><dd><dl><dt>initial testing, <a class="indexterm" href="using-systemtap.html#testing">Initial Testing</a></dt><dt>kernel information packages, <a class="indexterm" href="using-systemtap.html#install-kinfo">Installing Required Kernel Information Packages Manually</a></dt><dt>kernel version, determining the, <a class="indexterm" href="using-systemtap.html#install-kinfo">Installing Required Kernel Information Packages Manually</a></dt><dt>required packages, <a class="indexterm" href="using-systemtap.html#install-kinfo">Installing Required Kernel Information Packages Manually</a></dt><dt>Setup and Installation, <a class="indexterm" href="using-systemtap.html#using-setup">Installation and Setup</a></dt><dt>systemtap package, <a class="indexterm" href="using-systemtap.html#installproper">Installing SystemTap</a></dt><dt>systemtap-runtime package, <a class="indexterm" href="using-systemtap.html#installproper">Installing SystemTap</a></dt></dl></dd><dt>instrumentation module</dt><dd><dl><dt>cross-instrumentation, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt></dl></dd><dt>instrumentation modules from SystemTap scripts, building, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt><dt>integer extractors</dt><dd><dl><dt>computing for statistical aggregates</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt></dl></dd></dl></dd><dt>Introduction</dt><dd><dl><dt>capabilities of SystemTap, <a class="indexterm" href="intro-systemtap-vs-others.html">SystemTap Capabilities</a></dt><dt>documentation goals, <a class="indexterm" href="introduction.html#goals">Documentation Goals</a></dt><dt>goals, documentation, <a class="indexterm" href="introduction.html#goals">Documentation Goals</a></dt><dt>limitations of SystemTap, <a class="indexterm" href="intro-systemtap-limitations.html">Limitations of SystemTap</a></dt><dt>performance monitoring, <a class="indexterm" href="introduction.html">Introduction</a></dt></dl></dd><dt>invalid division</dt><dd><dl><dt>runtime errors/warnings</dt><dd><dl><dt>understainding SystemTap errors, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt></dl></dd></dl></dd><dt>invalid values to variables/arrays</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>iterations, processing elements in an array as</dt><dd><dl><dt>processing multiple elements in an array</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt></dl></dd></dl></dd></dl></div><div class="indexdiv"><h3>K</h3><dl><dt>kernel and user space, determining time spent in</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="threadtimessect.html">Determining Time Spent in Kernel and User Space</a></dt></dl></dd><dt>kernel information packages, <a class="indexterm" href="using-systemtap.html#install-kinfo">Installing Required Kernel Information Packages Manually</a></dt><dt>kernel modules from SystemTap scripts, building, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt><dt>kernel version, determining the, <a class="indexterm" href="using-systemtap.html#install-kinfo">Installing Required Kernel Information Packages Manually</a></dt><dt>kernel.function("function")</dt><dd><dl><dt>Events, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt></dl></dd><dt>kernel.trace("tracepoint")</dt><dd><dl><dt>Events, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt></dl></dd><dt>key pairs</dt><dd><dl><dt>introduction</dt><dd><dl><dt>arrays, <a class="indexterm" href="associativearrays.html">Associative Arrays</a></dt></dl></dd></dl></dd></dl></div><div class="indexdiv"><h3>L</h3><dl><dt>libdwfl failure</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>limitations of SystemTap</dt><dd><dl><dt>Introduction, <a class="indexterm" href="intro-systemtap-limitations.html">Limitations of SystemTap</a></dt></dl></dd><dt>limiting the output of foreach</dt><dd><dl><dt>processing multiple elements in an array</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt></dl></dd></dl></dd><dt>local variables</dt><dd><dl><dt>name, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dt>sample usage</dt><dd><dl><dt>$count, <a class="indexterm" href="iotimesect.html">Tracking I/O Time For Each File Read or Write</a></dt><dt>$return, <a class="indexterm" href="mainsect-disk.html#disktop">Summarizing Disk Read/Write Traffic</a>, <a class="indexterm" href="traceiosect.html">Track Cumulative IO</a></dt></dl></dd></dl></dd></dl></div><div class="indexdiv"><h3>M</h3><dl><dt>MAXACTION exceeded</dt><dd><dl><dt>runtime errors/warnings</dt><dd><dl><dt>understainding SystemTap errors, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt></dl></dd></dl></dd><dt>MAXNESTING exceeded</dt><dd><dl><dt>runtime errors/warnings</dt><dd><dl><dt>understainding SystemTap errors, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt></dl></dd></dl></dd><dt>membership (in array), testing for</dt><dd><dl><dt>conditional statements, using arrays in</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-conditionals.html">Using Arrays in Conditional Statements</a></dt></dl></dd></dl></dd><dt>module("module")</dt><dd><dl><dt>Events, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt></dl></dd><dt>monitoring changes to file attributes</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="inodewatch2sect.html">Monitoring Changes to File Attributes</a></dt></dl></dd><dt>monitoring cumulative I/O</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="traceiosect.html">Track Cumulative IO</a></dt></dl></dd><dt>monitoring device I/O</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="traceio2sect.html">I/O Monitoring (By Device)</a></dt></dl></dd><dt>monitoring I/O block time</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="ioblktimesect.html">Periodically Print I/O Block Time</a></dt></dl></dd><dt>monitoring I/O time</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="iotimesect.html">Tracking I/O Time For Each File Read or Write</a></dt></dl></dd><dt>monitoring incoming TCP connections</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="useful-systemtap-scripts.html#tcpconnectionssect">Monitoring Incoming TCP Connections</a></dt></dl></dd><dt>monitoring polling applications</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="timeoutssect.html">Monitoring Polling Applications</a></dt></dl></dd><dt>monitoring reads and writes to a file</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="inodewatchsect.html">Monitoring Reads and Writes to a File</a></dt></dl></dd><dt>monitoring system calls</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="topsyssect.html">Tracking Most Frequently Used System Calls</a></dt></dl></dd><dt>monitoring system calls (volume per process)</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="syscallsbyprocpidsect.html">Tracking System Call Volume Per Process</a></dt></dl></dd><dt>monitoring TCP packets</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="useful-systemtap-scripts.html#tcpdumplikesect">Monitoring TCP Packets</a></dt></dl></dd><dt>multiple array operations within the same probe</dt><dd><dl><dt>clearing arrays/array elements</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt></dl></dd></dl></dd><dt>multiple command-line arguments, example of</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt></dl></dd><dt>multiple elements in an array</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt></dl></dd></dl></div><div class="indexdiv"><h3>N</h3><dl><dt>name</dt><dd><dl><dt>local variables, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt></dl></dd><dt>net/socket.c, tracing functions from</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="useful-systemtap-scripts.html#sockettracesect">Tracing Functions Called in Network Socket Code</a></dt></dl></dd><dt>network profiling</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="useful-systemtap-scripts.html#nettopsect">Network Profiling</a>, <a class="indexterm" href="useful-systemtap-scripts.html#dropwatchsect">Monitoring Network Packets Drops in Kernel</a></dt></dl></dd><dt>network socket code, tracing functions called in</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="useful-systemtap-scripts.html#sockettracesect">Tracing Functions Called in Network Socket Code</a></dt></dl></dd><dt>network traffic, monitoring</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="useful-systemtap-scripts.html#nettopsect">Network Profiling</a>, <a class="indexterm" href="useful-systemtap-scripts.html#dropwatchsect">Monitoring Network Packets Drops in Kernel</a></dt></dl></dd><dt>no match for probe point</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>non-global arrays</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>number of errors: N, skipped probes: M</dt><dd><dl><dt>runtime errors/warnings</dt><dd><dl><dt>understainding SystemTap errors, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt></dl></dd></dl></dd></dl></div><div class="indexdiv"><h3>O</h3><dl><dt>operations</dt><dd><dl><dt>assigning associated values</dt><dd><dl><dt>associating timestamps to process names, <a class="indexterm" href="arrayoperators.html#arrayops-assignvalue">Assigning an Associated Value</a></dt></dl></dd><dt>associative arrays, <a class="indexterm" href="arrayoperators.html">Array Operations in SystemTap</a></dt><dt>clearing arrays/array elements, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt><dd><dl><dt>delete operator, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt><dt>multiple array operations within the same probe, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt><dt>virtual file system reads (non-cumulative), tallying, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt></dl></dd><dt>computing for statistical aggregates, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dd><dl><dt>@avg (integer extractor), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>@count (integer extractor), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>@max (integer extractor), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>@min (integer extractor), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>@sum (integer extractor), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>adding values to statistical aggregates, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>count (operator), <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt><dt>extracting data collected by statistical aggregates, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt></dl></dd><dt>conditional statements, using arrays in, <a class="indexterm" href="arrayops-conditionals.html">Using Arrays in Conditional Statements</a></dt><dd><dl><dt>testing for array membership, <a class="indexterm" href="arrayops-conditionals.html">Using Arrays in Conditional Statements</a></dt></dl></dd><dt>deleting arrays and array elements, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt><dt>incrementing associated values, <a class="indexterm" href="arrayops-increment.html">Incrementing Associated Values</a></dt><dd><dl><dt>tallying virtual file system reads (VFS reads), <a class="indexterm" href="arrayops-increment.html">Incrementing Associated Values</a></dt></dl></dd><dt>multiple elements in an array, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt><dt>processing multiple elements in an array, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt><dd><dl><dt>cumulative virtual file system reads, tallying, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt><dt>foreach, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt><dt>iterations, processing elements in an array as, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt><dt>limiting the output of foreach, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt><dt>ordering the output of foreach, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt></dl></dd><dt>reading values from arrays, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt><dd><dl><dt>computing for timestamp deltas, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt><dt>empty unique keys, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt><dt>using arrays in simple computations, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt></dl></dd></dl></dd><dt>options, stap</dt><dd><dl><dt>Usage, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt></dl></dd><dt>ordering the output of foreach</dt><dd><dl><dt>processing multiple elements in an array</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt></dl></dd></dl></dd><dt>overflow of aggregation</dt><dd><dl><dt>runtime errors/warnings</dt><dd><dl><dt>understainding SystemTap errors, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt></dl></dd></dl></dd></dl></div><div class="indexdiv"><h3>P</h3><dl><dt>packages required to run SystemTap, <a class="indexterm" href="using-systemtap.html#install-kinfo">Installing Required Kernel Information Packages Manually</a></dt><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dd><dl><dt>embedded code in unprivileged script, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>expected symbol/array index expression, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>grammatical/typographical script error, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>guru mode, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>invalid values to variables/arrays, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>libdwfl failure, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>no match for probe point, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>non-global arrays, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>probe mismatch, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>type mismatch for identifier, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>unresolved function call, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>unresolved target-symbol expression, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>unresolved type for identifier, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>variable modified during 'foreach', <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>performance monitoring</dt><dd><dl><dt>Introduction, <a class="indexterm" href="introduction.html">Introduction</a></dt></dl></dd><dt>pointer dereference fault</dt><dd><dl><dt>runtime errors/warnings</dt><dd><dl><dt>understainding SystemTap errors, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt></dl></dd></dl></dd><dt>polling applications, monitoring</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="timeoutssect.html">Monitoring Polling Applications</a></dt></dl></dd><dt>pp()</dt><dd><dl><dt>functions, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt></dl></dd><dt>printf()</dt><dd><dl><dt>format specifiers, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dt>format strings, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dt>syntax and format, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt></dl></dd><dt>printing I/O activity (cumulative)</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="traceiosect.html">Track Cumulative IO</a></dt></dl></dd><dt>printing I/O block time (periodically)</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="ioblktimesect.html">Periodically Print I/O Block Time</a></dt></dl></dd><dt>probe mismatch</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>probe point (no match for)</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>probes</dt><dd><dl><dt>SystemTap scripts</dt><dd><dl><dt>introduction, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt></dl></dd></dl></dd><dt>processing multiple elements in an array</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt><dt>cumulative virtual file system reads, tallying</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt></dl></dd><dt>foreach</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt></dl></dd><dt>limiting the output of foreach</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt></dl></dd><dt>ordering the output of foreach</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt></dl></dd></dl></dd><dt>profiling the network</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="useful-systemtap-scripts.html#nettopsect">Network Profiling</a>, <a class="indexterm" href="useful-systemtap-scripts.html#dropwatchsect">Monitoring Network Packets Drops in Kernel</a></dt></dl></dd></dl></div><div class="indexdiv"><h3>R</h3><dl><dt>reading values from arrays</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt><dd><dl><dt>empty unique keys, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt><dt>using arrays in simple computations, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt></dl></dd><dt>computing for timestamp deltas</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt></dl></dd></dl></dd><dt>reads/writes to a file, monitoring</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="inodewatchsect.html">Monitoring Reads and Writes to a File</a></dt></dl></dd><dt>required packages, <a class="indexterm" href="using-systemtap.html#install-kinfo">Installing Required Kernel Information Packages Manually</a></dt><dt>RPMs required to run SystemTap, <a class="indexterm" href="using-systemtap.html#install-kinfo">Installing Required Kernel Information Packages Manually</a></dt><dt>running scripts from standard input, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt><dt>running SystemTap scripts</dt><dd><dl><dt>Usage, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt></dl></dd><dt>runtime errors/warnings</dt><dd><dl><dt>understainding SystemTap errors, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dd><dl><dt>aggregate element not found, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>aggregation overflow, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>copy fault, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>division by 0, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>MAXACTION exceeded, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>MAXNESTING exceeded, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>number of errors: N, skipped probes: M, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>pointer dereference fault, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt></dl></dd></dl></dd></dl></div><div class="indexdiv"><h3>S</h3><dl><dt>script examples</dt><dd><dl><dt>call graph tracing, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt><dt>CPU ticks, <a class="indexterm" href="threadtimessect.html">Determining Time Spent in Kernel and User Space</a></dt><dt>ctime(), example of usage, <a class="indexterm" href="mainsect-disk.html#disktop">Summarizing Disk Read/Write Traffic</a></dt><dt>determining time spent in kernel and user space, <a class="indexterm" href="threadtimessect.html">Determining Time Spent in Kernel and User Space</a></dt><dt>file device number (integer format), <a class="indexterm" href="inodewatchsect.html">Monitoring Reads and Writes to a File</a></dt><dt>futex (lock) contentions, <a class="indexterm" href="futexcontentionsect.html">Identifying Contended User-Space Locks</a></dt><dt>futex system call, <a class="indexterm" href="futexcontentionsect.html">Identifying Contended User-Space Locks</a></dt><dt>identifying contended user-space locks (futex contentions), <a class="indexterm" href="futexcontentionsect.html">Identifying Contended User-Space Locks</a></dt><dt>if/else conditionals, alternative syntax, <a class="indexterm" href="useful-systemtap-scripts.html#nettopsect">Network Profiling</a></dt><dt>inode number, <a class="indexterm" href="inodewatchsect.html">Monitoring Reads and Writes to a File</a></dt><dt>monitoring changes to file attributes, <a class="indexterm" href="inodewatch2sect.html">Monitoring Changes to File Attributes</a></dt><dt>monitoring device I/O, <a class="indexterm" href="traceio2sect.html">I/O Monitoring (By Device)</a></dt><dt>monitoring I/O block time, <a class="indexterm" href="ioblktimesect.html">Periodically Print I/O Block Time</a></dt><dt>monitoring I/O time, <a class="indexterm" href="iotimesect.html">Tracking I/O Time For Each File Read or Write</a></dt><dt>monitoring incoming TCP connections, <a class="indexterm" href="useful-systemtap-scripts.html#tcpconnectionssect">Monitoring Incoming TCP Connections</a></dt><dt>monitoring polling applications, <a class="indexterm" href="timeoutssect.html">Monitoring Polling Applications</a></dt><dt>monitoring reads and writes to a file, <a class="indexterm" href="inodewatchsect.html">Monitoring Reads and Writes to a File</a></dt><dt>monitoring system calls, <a class="indexterm" href="topsyssect.html">Tracking Most Frequently Used System Calls</a></dt><dt>monitoring system calls (volume per process), <a class="indexterm" href="syscallsbyprocpidsect.html">Tracking System Call Volume Per Process</a></dt><dt>monitoring TCP packets, <a class="indexterm" href="useful-systemtap-scripts.html#tcpdumplikesect">Monitoring TCP Packets</a></dt><dt>multiple command-line arguments, example of, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt><dt>net/socket.c, tracing functions from, <a class="indexterm" href="useful-systemtap-scripts.html#sockettracesect">Tracing Functions Called in Network Socket Code</a></dt><dt>network profiling, <a class="indexterm" href="useful-systemtap-scripts.html#nettopsect">Network Profiling</a>, <a class="indexterm" href="useful-systemtap-scripts.html#dropwatchsect">Monitoring Network Packets Drops in Kernel</a></dt><dt>stat -c, determining file device number (integer format), <a class="indexterm" href="inodewatchsect.html">Monitoring Reads and Writes to a File</a></dt><dt>stat -c, determining whole device number, <a class="indexterm" href="traceio2sect.html">I/O Monitoring (By Device)</a></dt><dt>summarizing disk I/O traffic, <a class="indexterm" href="mainsect-disk.html#disktop">Summarizing Disk Read/Write Traffic</a></dt><dt>tallying function calls, <a class="indexterm" href="mainsect-profiling.html#countcallssect">Counting Function Calls Made</a></dt><dt>thread_indent(), sample usage, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt><dt>timer.ms(), sample usage, <a class="indexterm" href="mainsect-profiling.html#countcallssect">Counting Function Calls Made</a></dt><dt>timer.s(), sample usage, <a class="indexterm" href="timeoutssect.html">Monitoring Polling Applications</a>, <a class="indexterm" href="topsyssect.html">Tracking Most Frequently Used System Calls</a></dt><dt>tracing functions called in network socket code, <a class="indexterm" href="useful-systemtap-scripts.html#sockettracesect">Tracing Functions Called in Network Socket Code</a></dt><dt>tracking cumulative I/O, <a class="indexterm" href="traceiosect.html">Track Cumulative IO</a></dt><dt>trigger function, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt><dt>usrdev2kerndev(), <a class="indexterm" href="traceio2sect.html">I/O Monitoring (By Device)</a></dt><dt>whole device number (usage as a command-line argument), <a class="indexterm" href="traceio2sect.html">I/O Monitoring (By Device)</a></dt></dl></dd><dt>scripts</dt><dd><dl><dt>introduction, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt><dd><dl><dt>components, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt><dt>events and handlers, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt><dt>format and syntax, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt><dt>functions, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt><dt>probes, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt><dt>statement blocks, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt></dl></dd></dl></dd><dt>sessions, SystemTap, <a class="indexterm" href="understanding-how-systemtap-works.html#understanding-architecture-tools">Architecture</a></dt><dt>Setup and Installation, <a class="indexterm" href="using-systemtap.html#using-setup">Installation and Setup</a></dt><dt>Stack backtrace</dt><dd><dl><dt>user-space, <a class="indexterm" href="ustack.html">User-Space Stack Backtraces</a></dt></dl></dd><dt>standard input, running scripts from</dt><dd><dl><dt>Usage, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt></dl></dd><dt>stap</dt><dd><dl><dt>Usage, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt></dl></dd><dt>stap options, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt><dt>stapdev</dt><dd><dl><dt>Usage, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt></dl></dd><dt>staprun</dt><dd><dl><dt>Usage, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt></dl></dd><dt>stapusr</dt><dd><dl><dt>Usage, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt></dl></dd><dt>stat -c, determining file device number (integer format)</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="inodewatchsect.html">Monitoring Reads and Writes to a File</a></dt></dl></dd><dt>stat -c, determining whole device number</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="traceio2sect.html">I/O Monitoring (By Device)</a></dt></dl></dd><dt>statement blocks</dt><dd><dl><dt>SystemTap scripts</dt><dd><dl><dt>introduction, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt></dl></dd></dl></dd><dt>statistical aggregates</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-aggregates.html">Computing for Statistical Aggregates</a></dt></dl></dd><dt>summarizing disk I/O traffic</dt><dd><dl><dt>script examples, <a class="indexterm" href="mainsect-disk.html#disktop">Summarizing Disk Read/Write Traffic</a></dt></dl></dd><dt>synchronous events</dt><dd><dl><dt>Events, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt></dl></dd><dt>syntax</dt><dd><dl><dt>introduction</dt><dd><dl><dt>arrays, <a class="indexterm" href="associativearrays.html">Associative Arrays</a></dt></dl></dd></dl></dd><dt>syntax and format</dt><dd><dl><dt>printf(), <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dt>SystemTap handler constructs</dt><dd><dl><dt>handlers, <a class="indexterm" href="scriptconstructions.html">Basic SystemTap Handler Constructs</a></dt></dl></dd><dt>SystemTap scripts</dt><dd><dl><dt>introduction, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt></dl></dd></dl></dd><dt>syscall.system_call</dt><dd><dl><dt>Events, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt></dl></dd><dt>system calls volume (per process), monitoring</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="syscallsbyprocpidsect.html">Tracking System Call Volume Per Process</a></dt></dl></dd><dt>system calls, monitoring</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="topsyssect.html">Tracking Most Frequently Used System Calls</a></dt></dl></dd><dt>SystemTap architecture, <a class="indexterm" href="understanding-how-systemtap-works.html#understanding-architecture-tools">Architecture</a></dt><dt>SystemTap handlers</dt><dd><dl><dt>SystemTap handler constructs, <a class="indexterm" href="scriptconstructions.html">Basic SystemTap Handler Constructs</a></dt><dd><dl><dt>syntax and format, <a class="indexterm" href="scriptconstructions.html">Basic SystemTap Handler Constructs</a></dt></dl></dd></dl></dd><dt>systemtap package, <a class="indexterm" href="using-systemtap.html#installproper">Installing SystemTap</a></dt><dt>SystemTap script functions, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dt>SystemTap scripts</dt><dd><dl><dt>introduction, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt><dd><dl><dt>components, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt><dt>events and handlers, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt><dt>format and syntax, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt><dt>functions, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt><dt>probes, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt><dt>statement blocks, <a class="indexterm" href="scripts.html">SystemTap Scripts</a></dt></dl></dd><dt>useful examples, <a class="indexterm" href="useful-systemtap-scripts.html">Useful SystemTap Scripts</a></dt></dl></dd><dt>SystemTap scripts, how to run, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt><dt>SystemTap sessions, <a class="indexterm" href="understanding-how-systemtap-works.html#understanding-architecture-tools">Architecture</a></dt><dt>SystemTap statements</dt><dd><dl><dt>conditional statements, <a class="indexterm" href="handlerconditionalstatements.html">Conditional Statements</a></dt><dd><dl><dt>conditional operators, <a class="indexterm" href="handlerconditionalstatements.html">Conditional Statements</a></dt><dt>for loops, <a class="indexterm" href="handlerconditionalstatements.html">Conditional Statements</a></dt><dt>if/else, <a class="indexterm" href="handlerconditionalstatements.html">Conditional Statements</a></dt><dt>while loops, <a class="indexterm" href="handlerconditionalstatements.html">Conditional Statements</a></dt></dl></dd><dt>SystemTap handler constructs</dt><dd><dl><dt>command-line arguments, <a class="indexterm" href="commandlineargssect.html">Command-Line Arguments</a></dt><dt>global, <a class="indexterm" href="scriptconstructions.html#variablesconstructs">Variables</a></dt><dt>variable notations, <a class="indexterm" href="commandlineargssect.html">Command-Line Arguments</a></dt><dt>variables, <a class="indexterm" href="scriptconstructions.html#variablesconstructs">Variables</a></dt></dl></dd></dl></dd><dt>systemtap-runtime package, <a class="indexterm" href="using-systemtap.html#installproper">Installing SystemTap</a></dt><dt>systemtap-testsuite package</dt><dd><dl><dt>sample scripts, <a class="indexterm" href="useful-systemtap-scripts.html">Useful SystemTap Scripts</a></dt></dl></dd></dl></div><div class="indexdiv"><h3>T</h3><dl><dt>tallying function calls</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="mainsect-profiling.html#countcallssect">Counting Function Calls Made</a></dt></dl></dd><dt>tallying virtual file system reads (VFS reads)</dt><dd><dl><dt>incrementing associated values</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-increment.html">Incrementing Associated Values</a></dt></dl></dd></dl></dd><dt>Tapsets</dt><dd><dl><dt>definition of, <a class="indexterm" href="understanding-tapsets.html">Tapsets</a></dt></dl></dd><dt>target kernel</dt><dd><dl><dt>cross-instrumentation, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt></dl></dd><dt>target system</dt><dd><dl><dt>cross-instrumentation, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt></dl></dd><dt>target system and host system</dt><dd><dl><dt>configuration, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt></dl></dd><dt>target variables, <a class="indexterm" href="targetvariables.html">Target Variables</a></dt><dd><dl><dt>pretty printing, <a class="indexterm" href="targetvariables.html#targetprettyprinting">Pretty Printing Target Variables</a></dt><dt>typecasting, <a class="indexterm" href="typecasting.html">Typecasting</a></dt><dt>user-space, <a class="indexterm" href="utargetvariable.html">Accessing User-Space Target Variables</a></dt><dt>variable availability, <a class="indexterm" href="targetavailable.html">Checking Target Variable Availability</a></dt></dl></dd><dt>target()</dt><dd><dl><dt>functions, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt></dl></dd><dt>target-symbol expression, unresolved</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>TCP connections (incoming), monitoring</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="useful-systemtap-scripts.html#tcpconnectionssect">Monitoring Incoming TCP Connections</a></dt></dl></dd><dt>TCP packets, monitoring</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="useful-systemtap-scripts.html#tcpdumplikesect">Monitoring TCP Packets</a></dt></dl></dd><dt>testing for array membership</dt><dd><dl><dt>conditional statements, using arrays in</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-conditionals.html">Using Arrays in Conditional Statements</a></dt></dl></dd></dl></dd><dt>testing, initial, <a class="indexterm" href="using-systemtap.html#testing">Initial Testing</a></dt><dt>thread_indent()</dt><dd><dl><dt>functions, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt></dl></dd><dt>thread_indent(), sample usage</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt></dl></dd><dt>tid()</dt><dd><dl><dt>functions, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt></dl></dd><dt>time of I/O </dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="iotimesect.html">Tracking I/O Time For Each File Read or Write</a></dt></dl></dd><dt>time spent in kernel/user space, determining</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="threadtimessect.html">Determining Time Spent in Kernel and User Space</a></dt></dl></dd><dt>timer events</dt><dd><dl><dt>Events, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt></dl></dd><dt>timer.ms(), sample usage</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="mainsect-profiling.html#countcallssect">Counting Function Calls Made</a></dt></dl></dd><dt>timer.s(), sample usage</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="timeoutssect.html">Monitoring Polling Applications</a>, <a class="indexterm" href="topsyssect.html">Tracking Most Frequently Used System Calls</a></dt></dl></dd><dt>timestamp deltas, computing for</dt><dd><dl><dt>reading values from arrays</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt></dl></dd></dl></dd><dt>timestamps, association thereof to process names</dt><dd><dl><dt>assigning associated values</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayoperators.html#arrayops-assignvalue">Assigning an Associated Value</a></dt></dl></dd></dl></dd><dt>tracepoint, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a>, <a class="indexterm" href="useful-systemtap-scripts.html#dropwatchsect">Monitoring Network Packets Drops in Kernel</a></dt><dt>tracing call graph</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt></dl></dd><dt>tracing functions called in network socket code</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="useful-systemtap-scripts.html#sockettracesect">Tracing Functions Called in Network Socket Code</a></dt></dl></dd><dt>tracing incoming/outgoing function calls</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt></dl></dd><dt>tracking cumulative I/O</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="traceiosect.html">Track Cumulative IO</a></dt></dl></dd><dt>trigger function</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="paracallgraph.html">Call Graph Tracing</a></dt></dl></dd><dt>type mismatch for identifier</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>typographical script error</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd></dl></div><div class="indexdiv"><h3>U</h3><dl><dt>uid()</dt><dd><dl><dt>functions, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt></dl></dd><dt>uname -m, <a class="indexterm" href="cross-compiling.html">Generating Instrumentation for Other Computers</a></dt><dt>uname -r, <a class="indexterm" href="using-systemtap.html#install-kinfo">Installing Required Kernel Information Packages Manually</a></dt><dt>understainding SystemTap errors</dt><dd><dl><dt>runtime errors/warnings, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dd><dl><dt>aggregate element not found, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>aggregation overflow, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>copy fault, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>division by 0, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>MAXACTION exceeded, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>MAXNESTING exceeded, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>number of errors: N, skipped probes: M, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt><dt>pointer dereference fault, <a class="indexterm" href="runtimeerror.html">Runtime Errors and Warnings</a></dt></dl></dd></dl></dd><dt>Understanding How SystemTap Works, <a class="indexterm" href="understanding-how-systemtap-works.html">Understanding How SystemTap Works</a></dt><dd><dl><dt>architecture, <a class="indexterm" href="understanding-how-systemtap-works.html#understanding-architecture-tools">Architecture</a></dt><dt>event types, <a class="indexterm" href="understanding-how-systemtap-works.html">Understanding How SystemTap Works</a></dt><dt>events and handlers, <a class="indexterm" href="understanding-how-systemtap-works.html">Understanding How SystemTap Works</a></dt><dt>SystemTap sessions, <a class="indexterm" href="understanding-how-systemtap-works.html#understanding-architecture-tools">Architecture</a></dt></dl></dd><dt>understanding SystemTap errors</dt><dd><dl><dt>parse/semantics error, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dd><dl><dt>embedded code in unprivileged script, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>expected symbol/array index expression, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>grammatical/typographical script error, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>guru mode, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>invalid values to variables/arrays, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>libdwfl failure, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>no match for probe point, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>non-global arrays, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>probe mismatch, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>type mismatch for identifier, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>unresolved function call, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>unresolved target-symbol expression, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>unresolved type for identifier, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt><dt>variable modified during 'foreach', <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>unique keys</dt><dd><dl><dt>introduction</dt><dd><dl><dt>arrays, <a class="indexterm" href="associativearrays.html">Associative Arrays</a></dt></dl></dd></dl></dd><dt>unprivileged script, embedded code in</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>unresolved function call</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>unresolved target-symbol expression</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>unresolved type for identifier</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>unsafe embedded code in unprivileged script</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>Usage</dt><dd><dl><dt>options, stap, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt><dt>running SystemTap scripts, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt><dt>standard input, running scripts from, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt><dt>stap, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt><dt>stapdev, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt><dt>staprun, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt><dt>stapusr, <a class="indexterm" href="using-usage.html">Running SystemTap Scripts</a></dt></dl></dd><dt>useful examples of SystemTap scripts, <a class="indexterm" href="useful-systemtap-scripts.html">Useful SystemTap Scripts</a></dt><dt>user and kernel space, determining time spent in</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="threadtimessect.html">Determining Time Spent in Kernel and User Space</a></dt></dl></dd><dt>using arrays in simple computations</dt><dd><dl><dt>reading values from arrays</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-readvalues.html">Reading Values From Arrays</a></dt></dl></dd></dl></dd><dt>Using SystemTap, <a class="indexterm" href="using-systemtap.html">Using SystemTap</a></dt><dt>usrdev2kerndev()</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="traceio2sect.html">I/O Monitoring (By Device)</a></dt></dl></dd></dl></div><div class="indexdiv"><h3>V</h3><dl><dt>values, assignment of</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayoperators.html#arrayops-assignvalue">Assigning an Associated Value</a></dt></dl></dd><dt>variable modified during 'foreach'</dt><dd><dl><dt>parse/semantics error</dt><dd><dl><dt>understanding SystemTap errors, <a class="indexterm" href="errors.html#parsetype">Parse and Semantic Errors</a></dt></dl></dd></dl></dd><dt>variable notations</dt><dd><dl><dt>SystemTap handler constructs</dt><dd><dl><dt>handlers, <a class="indexterm" href="commandlineargssect.html">Command-Line Arguments</a></dt></dl></dd></dl></dd><dt>variables</dt><dd><dl><dt>SystemTap handler constructs</dt><dd><dl><dt>handlers, <a class="indexterm" href="scriptconstructions.html#variablesconstructs">Variables</a></dt></dl></dd></dl></dd><dt>variables (local)</dt><dd><dl><dt>name, <a class="indexterm" href="systemtapscript-handler.html">SystemTap Handler/Body</a></dt><dt>sample usage</dt><dd><dl><dt>$count, <a class="indexterm" href="iotimesect.html">Tracking I/O Time For Each File Read or Write</a></dt><dt>$return, <a class="indexterm" href="mainsect-disk.html#disktop">Summarizing Disk Read/Write Traffic</a>, <a class="indexterm" href="traceiosect.html">Track Cumulative IO</a></dt></dl></dd></dl></dd><dt>VFS reads, tallying of</dt><dd><dl><dt>incrementing associated values</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-increment.html">Incrementing Associated Values</a></dt></dl></dd></dl></dd><dt>vfs.file_operation</dt><dd><dl><dt>Events, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt></dl></dd><dt>virtual file system reads (cumulative), tallying</dt><dd><dl><dt>processing multiple elements in an array</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-foreach.html">Processing Multiple Elements in an Array</a></dt></dl></dd></dl></dd><dt>virtual file system reads (non-cumulative), tallying</dt><dd><dl><dt>clearing arrays/array elements</dt><dd><dl><dt>array operations, <a class="indexterm" href="arrayops-deleting.html">Clearing/Deleting Arrays and Array Elements</a></dt></dl></dd></dl></dd></dl></div><div class="indexdiv"><h3>W</h3><dl><dt>while loops</dt><dd><dl><dt>conditional statements</dt><dd><dl><dt>handlers, <a class="indexterm" href="handlerconditionalstatements.html">Conditional Statements</a></dt></dl></dd></dl></dd><dt>whole device number (usage as a command-line argument)</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="traceio2sect.html">I/O Monitoring (By Device)</a></dt></dl></dd><dt>wildcards in events, <a class="indexterm" href="scripts.html#systemtapscript-events">Event</a></dt><dt>writes/reads to a file, monitoring</dt><dd><dl><dt>examples of SystemTap scripts, <a class="indexterm" href="inodewatchsect.html">Monitoring Reads and Writes to a File</a></dt></dl></dd></dl></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="appe-Publican-Revision_History.html"><strong>Prev</strong>Appendix A. Revision History</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li></ul></body></html> \ No newline at end of file
diff --git a/SystemTap_Beginners_Guide/mainsect-disk.html b/SystemTap_Beginners_Guide/mainsect-disk.html
index 621a7b51..e57d76b1 100644
--- a/SystemTap_Beginners_Guide/mainsect-disk.html
+++ b/SystemTap_Beginners_Guide/mainsect-disk.html
@@ -1,9 +1,11 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">5.2. Disk</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="useful-systemtap-scripts.html" title="Chapter 5. Useful SystemTap Scripts" /><link rel="prev" href="useful-systemtap-scripts.html" title="Chapter 5. Useful SystemTap Scripts" /><link rel="next" href="iotimesect.html" title="5.2.2. Tracking I/O Time For Each File Read or Write" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="useful-systemtap-scripts.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="iotimesect.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="mainsect-disk"></a>5.2. Disk</h2></div></div></div><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">5.2. Disk</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="useful-systemtap-scripts.html" title="Chapter 5. Useful SystemTap Scripts" /><link rel="prev" href="useful-systemtap-scripts.html" title="Chapter 5. Useful SystemTap Scripts" /><link rel="next" href="iotimesect.html" title="5.2.2. Tracking I/O Time For Each File Read or Write" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="useful-systemtap-scripts.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="iotimesect.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="mainsect-disk">
3 ⁠</a>5.2. Disk</h2></div></div></div><div class="para">
3 The following sections showcase scripts that monitor disk and I/O activity. 4 The following sections showcase scripts that monitor disk and I/O activity.
4 </div><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="disktop"></a>5.2.1. Summarizing Disk Read/Write Traffic</h3></div></div></div><a id="idm47951462923920" class="indexterm"></a><a id="idm47951455972784" class="indexterm"></a><a id="idm47951418835376" class="indexterm"></a><a id="idm47951457634480" class="indexterm"></a><a id="idm47951456425536" class="indexterm"></a><a id="idm47951468384880" class="indexterm"></a><a id="idm47951424907200" class="indexterm"></a><a id="idm47951455618752" class="indexterm"></a><div class="para"> 5 </div><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="disktop">
6 ⁠</a>5.2.1. Summarizing Disk Read/Write Traffic</h3></div></div></div><a id="idm214011890976" class="indexterm"></a><a id="idm213973864736" class="indexterm"></a><a id="idm214022229856" class="indexterm"></a><a id="idm214020414048" class="indexterm"></a><a id="idm214018814336" class="indexterm"></a><a id="idm213972994016" class="indexterm"></a><a id="idm213979319920" class="indexterm"></a><a id="idm214015345248" class="indexterm"></a><div class="para">
5 This section describes how to identify which processes are performing the heaviest disk reads/writes to the system. 7 This section describes how to identify which processes are performing the heaviest disk reads/writes to the system.
6 </div><div class="formalpara"><div xmlns:d="http://docbook.org/ns/docbook" class="title">disktop.stp</div> 8 </div><div class="para"><div xmlns:d="http://docbook.org/ns/docbook" class="title">disktop.stp</div>
7 9
8<pre class="programlisting">#!/usr/bin/env stap 10<pre class="programlisting">#!/usr/bin/env stap
9# 11#
@@ -93,11 +95,12 @@ probe end{
93 <code class="computeroutput">T</code> — the type of action performed by the listed process; <code class="computeroutput">W</code> refers to write, while <code class="computeroutput">R</code> refers to read. 95 <code class="computeroutput">T</code> — the type of action performed by the listed process; <code class="computeroutput">W</code> refers to write, while <code class="computeroutput">R</code> refers to read.
94 </div></li><li class="listitem"><div class="para"> 96 </div></li><li class="listitem"><div class="para">
95 <code class="computeroutput">BYTES</code> — the amount of data read to or written from disk. 97 <code class="computeroutput">BYTES</code> — the amount of data read to or written from disk.
96 </div></li></ul></div><a id="idm47951456225840" class="indexterm"></a><a id="idm47951456731648" class="indexterm"></a><a id="idm47951462803264" class="indexterm"></a><div class="para"> 98 </div></li></ul></div><a id="idm213969990768" class="indexterm"></a><a id="idm214018631888" class="indexterm"></a><a id="idm214012345520" class="indexterm"></a><div class="para">
97 The time and date in the output of <a class="xref" href="mainsect-disk.html#scriptdisktop">disktop.stp</a> is returned by the functions <code class="command">ctime()</code> and <code class="command">gettimeofday_s()</code>. <code class="command">ctime()</code> derives calendar time in terms of seconds passed since the Unix epoch (January 1, 1970). <code class="command">gettimeofday_s()</code> counts the <span class="emphasis"><em>actual</em></span> number of seconds since Unix epoch, which gives a fairly accurate human-readable timestamp for the output. 99 The time and date in the output of <a class="xref" href="mainsect-disk.html#scriptdisktop">disktop.stp</a> is returned by the functions <code class="command">ctime()</code> and <code class="command">gettimeofday_s()</code>. <code class="command">ctime()</code> derives calendar time in terms of seconds passed since the Unix epoch (January 1, 1970). <code class="command">gettimeofday_s()</code> counts the <span class="emphasis"><em>actual</em></span> number of seconds since Unix epoch, which gives a fairly accurate human-readable timestamp for the output.
98 </div><a id="idm47951466541760" class="indexterm"></a><a id="idm47951416875872" class="indexterm"></a><a id="idm47951424881904" class="indexterm"></a><div class="para"> 100 </div><a id="idm213973588928" class="indexterm"></a><a id="idm214012910352" class="indexterm"></a><a id="idm214011792784" class="indexterm"></a><div class="para">
99 In this script, the <code class="command">$return</code> is a local variable that stores the actual number of bytes each process reads or writes from the virtual file system. <code class="command">$return</code> can only be used in return probes (for example, <code class="command">vfs.read.return</code> and <code class="command">vfs.read.return</code>). 101 In this script, the <code class="command">$return</code> is a local variable that stores the actual number of bytes each process reads or writes from the virtual file system. <code class="command">$return</code> can only be used in return probes (for example, <code class="command">vfs.read.return</code> and <code class="command">vfs.read.return</code>).
100 </div><div class="example"><a id="disktopoutput"></a><p class="title"><strong>Example 5.6. <a class="xref" href="mainsect-disk.html#scriptdisktop">disktop.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen">[...] 102 </div><div class="example"><a id="disktopoutput">
103 ⁠</a><p class="title"><strong>Example 5.6. <a class="xref" href="mainsect-disk.html#scriptdisktop">disktop.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen">[...]
101Mon Sep 29 03:38:28 2008 , Average: 19Kb/sec, Read: 7Kb, Write: 89Kb 104Mon Sep 29 03:38:28 2008 , Average: 19Kb/sec, Read: 7Kb, Write: 89Kb
102 105
103UID PID PPID CMD DEVICE T BYTES 106UID PID PPID CMD DEVICE T BYTES
@@ -109,4 +112,4 @@ Mon Sep 29 03:38:38 2008 , Average: 1Kb/sec, Read: 7Kb, Write: 1Kb
109 112
110UID PID PPID CMD DEVICE T BYTES 113UID PID PPID CMD DEVICE T BYTES
1110 2758 2757 pam_timestamp_c sda5 R 8064 1140 2758 2757 pam_timestamp_c sda5 R 8064
1120 2885 1 cupsd sda5 W 1678</pre></div></div><br class="example-break" /></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="useful-systemtap-scripts.html"><strong>Prev</strong>Chapter 5. Useful SystemTap Scripts</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="iotimesect.html"><strong>Next</strong>5.2.2. Tracking I/O Time For Each File Read or Wr...</a></li></ul></body></html> \ No newline at end of file 1150 2885 1 cupsd sda5 W 1678</pre></div></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="useful-systemtap-scripts.html"><strong>Prev</strong>Chapter 5. Useful SystemTap Scripts</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="iotimesect.html"><strong>Next</strong>5.2.2. Tracking I/O Time For Each File Read or Wr...</a></li></ul></body></html> \ No newline at end of file
diff --git a/SystemTap_Beginners_Guide/mainsect-profiling.html b/SystemTap_Beginners_Guide/mainsect-profiling.html
index d0fb8e5b..f8ea3178 100644
--- a/SystemTap_Beginners_Guide/mainsect-profiling.html
+++ b/SystemTap_Beginners_Guide/mainsect-profiling.html
@@ -1,9 +1,11 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">5.3. Profiling</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="useful-systemtap-scripts.html" title="Chapter 5. Useful SystemTap Scripts" /><link rel="prev" href="ioblktimesect.html" title="5.2.7. Periodically Print I/O Block Time" /><link rel="next" href="paracallgraph.html" title="5.3.2. Call Graph Tracing" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="ioblktimesect.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="paracallgraph.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="mainsect-profiling"></a>5.3. Profiling</h2></div></div></div><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">5.3. Profiling</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="useful-systemtap-scripts.html" title="Chapter 5. Useful SystemTap Scripts" /><link rel="prev" href="ioblktimesect.html" title="5.2.7. Periodically Print I/O Block Time" /><link rel="next" href="paracallgraph.html" title="5.3.2. Call Graph Tracing" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="ioblktimesect.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="paracallgraph.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="mainsect-profiling">
3 ⁠</a>5.3. Profiling</h2></div></div></div><div class="para">
3 The following sections showcase scripts that profile kernel activity by monitoring function calls. 4 The following sections showcase scripts that profile kernel activity by monitoring function calls.
4 </div><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="countcallssect"></a>5.3.1. Counting Function Calls Made</h3></div></div></div><a id="idm47951424519024" class="indexterm"></a><a id="idm47951476424032" class="indexterm"></a><a id="idm47951463940448" class="indexterm"></a><a id="idm47951427724544" class="indexterm"></a><a id="idm47951457800736" class="indexterm"></a><div class="para"> 5 </div><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="countcallssect">
6 ⁠</a>5.3.1. Counting Function Calls Made</h3></div></div></div><a id="idm213979379680" class="indexterm"></a><a id="idm214026200672" class="indexterm"></a><a id="idm213969741168" class="indexterm"></a><a id="idm214013605104" class="indexterm"></a><a id="idm213978698832" class="indexterm"></a><div class="para">
5 This section describes how to identify how many times the system called a specific kernel function in a 30-second sample. Depending on the use of wildcards, you can also use this script to target multiple kernel functions. 7 This section describes how to identify how many times the system called a specific kernel function in a 30-second sample. Depending on the use of wildcards, you can also use this script to target multiple kernel functions.
6 </div><div class="formalpara"><div xmlns:d="http://docbook.org/ns/docbook" class="title">functioncallcount.stp</div> 8 </div><div class="para"><div xmlns:d="http://docbook.org/ns/docbook" class="title">functioncallcount.stp</div>
7 9
8<pre class="programlisting">#! /usr/bin/env stap 10<pre class="programlisting">#! /usr/bin/env stap
9# The following line command will probe all the functions 11# The following line command will probe all the functions
@@ -12,7 +14,7 @@
12# stap functioncallcount.stp "*@mm/*.c" 14# stap functioncallcount.stp "*@mm/*.c"
13 15
14probe kernel.function(@1).call { # probe functions listed on commandline 16probe kernel.function(@1).call { # probe functions listed on commandline
15 called[probefunc()] &lt;&lt;&lt; 1 # add a count efficiently 17 called[ppfunc()] &lt;&lt;&lt; 1 # add a count efficiently
16} 18}
17 19
18global called 20global called
@@ -26,9 +28,10 @@ probe end {
26</pre> 28</pre>
27 </div><div class="para"> 29 </div><div class="para">
28 <a class="xref" href="mainsect-profiling.html#countcalls">functioncallcount.stp</a> takes the targeted kernel function as an argument. The argument supports wildcards, which enables you to target multiple kernel functions up to a certain extent. 30 <a class="xref" href="mainsect-profiling.html#countcalls">functioncallcount.stp</a> takes the targeted kernel function as an argument. The argument supports wildcards, which enables you to target multiple kernel functions up to a certain extent.
29 </div><a id="idm47951424678960" class="indexterm"></a><a id="idm47951415679760" class="indexterm"></a><a id="idm47951415619632" class="indexterm"></a><div class="para"> 31 </div><a id="idm214015814528" class="indexterm"></a><a id="idm213972462592" class="indexterm"></a><a id="idm214026301584" class="indexterm"></a><div class="para">
30 The output of <a class="xref" href="mainsect-profiling.html#countcalls">functioncallcount.stp</a> contains the name of the function called and how many times it was called during the sample time (in alphabetical order). <a class="xref" href="mainsect-profiling.html#countcallsoutput">Example 5.13, “functioncallcount.stp Sample Output”</a> contains an excerpt from the output of <code class="command">stap functioncallcount.stp "*@mm/*.c"</code>: 32 The output of <a class="xref" href="mainsect-profiling.html#countcalls">functioncallcount.stp</a> contains the name of the function called and how many times it was called during the sample time (in alphabetical order). <a class="xref" href="mainsect-profiling.html#countcallsoutput">Example 5.13, “functioncallcount.stp Sample Output”</a> contains an excerpt from the output of <code class="command">stap functioncallcount.stp "*@mm/*.c"</code>:
31 </div><div class="example"><a id="countcallsoutput"></a><p class="title"><strong>Example 5.13. <a class="xref" href="mainsect-profiling.html#countcalls">functioncallcount.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen">[...] 33 </div><div class="example"><a id="countcallsoutput">
34 ⁠</a><p class="title"><strong>Example 5.13. <a class="xref" href="mainsect-profiling.html#countcalls">functioncallcount.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen">[...]
32__vma_link 97 35__vma_link 97
33__vma_link_file 66 36__vma_link_file 66
34__vma_link_list 97 37__vma_link_list 97
@@ -55,4 +58,4 @@ atomic_add_negative 97
55atomic_dec_and_test 5153 58atomic_dec_and_test 5153
56atomic_inc 470 59atomic_inc 470
57atomic_inc_and_test 1 60atomic_inc_and_test 1
58[...]</pre></div></div><br class="example-break" /></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="ioblktimesect.html"><strong>Prev</strong>5.2.7. Periodically Print I/O Block Time</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="paracallgraph.html"><strong>Next</strong>5.3.2. Call Graph Tracing</a></li></ul></body></html> \ No newline at end of file 61[...]</pre></div></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="ioblktimesect.html"><strong>Prev</strong>5.2.7. Periodically Print I/O Block Time</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="paracallgraph.html"><strong>Next</strong>5.3.2. Call Graph Tracing</a></li></ul></body></html> \ No newline at end of file
diff --git a/SystemTap_Beginners_Guide/paracallgraph.html b/SystemTap_Beginners_Guide/paracallgraph.html
index fa407f11..43b781e8 100644
--- a/SystemTap_Beginners_Guide/paracallgraph.html
+++ b/SystemTap_Beginners_Guide/paracallgraph.html
@@ -1,7 +1,8 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">5.3.2. Call Graph Tracing</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="mainsect-profiling.html" title="5.3. Profiling" /><link rel="prev" href="mainsect-profiling.html" title="5.3. Profiling" /><link rel="next" href="threadtimessect.html" title="5.3.3. Determining Time Spent in Kernel and User Space" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="mainsect-profiling.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="threadtimessect.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="paracallgraph"></a>5.3.2. Call Graph Tracing</h3></div></div></div><a id="idm47951475848096" class="indexterm"></a><a id="idm47951422450832" class="indexterm"></a><a id="idm47951424729136" class="indexterm"></a><a id="idm47951456257440" class="indexterm"></a><a id="idm47951471107680" class="indexterm"></a><a id="idm47951463779184" class="indexterm"></a><a id="idm47951457813008" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">5.3.2. Call Graph Tracing</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="mainsect-profiling.html" title="5.3. Profiling" /><link rel="prev" href="mainsect-profiling.html" title="5.3. Profiling" /><link rel="next" href="threadtimessect.html" title="5.3.3. Determining Time Spent in Kernel and User Space" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="mainsect-profiling.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="threadtimessect.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="paracallgraph">
3 ⁠</a>5.3.2. Call Graph Tracing</h3></div></div></div><a id="idm213973261136" class="indexterm"></a><a id="idm213975220288" class="indexterm"></a><a id="idm214009586784" class="indexterm"></a><a id="idm214017166880" class="indexterm"></a><a id="idm214017951792" class="indexterm"></a><a id="idm213969139024" class="indexterm"></a><a id="idm213974810576" class="indexterm"></a><div class="para">
3 This section describes how to trace incoming and outgoing function calls. 4 This section describes how to trace incoming and outgoing function calls.
4 </div><div class="formalpara"><div xmlns:d="http://docbook.org/ns/docbook" class="title">para-callgraph.stp</div> 5 </div><div class="para"><div xmlns:d="http://docbook.org/ns/docbook" class="title">para-callgraph.stp</div>
5 6
6<pre class="programlisting">#! /usr/bin/env stap 7<pre class="programlisting">#! /usr/bin/env stap
7 8
@@ -28,17 +29,18 @@ probe $2.return {
28probe $1.call { trace(1, $$parms) } 29probe $1.call { trace(1, $$parms) }
29probe $1.return { trace(-1, $$return) } 30probe $1.return { trace(-1, $$return) }
30</pre> 31</pre>
31 </div><a id="idm47951457548512" class="indexterm"></a><a id="idm47951475156208" class="indexterm"></a><a id="idm47951423494064" class="indexterm"></a><a id="idm47951454817424" class="indexterm"></a><div class="para"> 32 </div><a id="idm213968991568" class="indexterm"></a><a id="idm214018899120" class="indexterm"></a><a id="idm213968052848" class="indexterm"></a><a id="idm213967720912" class="indexterm"></a><div class="para">
32 <a class="xref" href="paracallgraph.html#scriptcallgraph">para-callgraph.stp</a> takes two command-line arguments: 33 <a class="xref" href="paracallgraph.html#scriptcallgraph">para-callgraph.stp</a> takes two command-line arguments:
33 </div><a id="idm47951455647520" class="indexterm"></a><a id="idm47951417885424" class="indexterm"></a><a id="idm47951427870608" class="indexterm"></a><div xmlns:d="http://docbook.org/ns/docbook" class="itemizedlist"><ul><li class="listitem"><div class="para"> 34 </div><a id="idm213967976928" class="indexterm"></a><a id="idm213969716512" class="indexterm"></a><a id="idm213974727872" class="indexterm"></a><div xmlns:d="http://docbook.org/ns/docbook" class="itemizedlist"><ul><li class="listitem"><div class="para">
34 The function/s whose entry/exit call you'd like to trace (<code class="command">$1</code>). 35 The function/s whose entry/exit call you'd like to trace (<code class="command">$1</code>).
35 </div></li><li class="listitem"><div class="para"> 36 </div></li><li class="listitem"><div class="para">
36 A second optional <em class="firstterm">trigger function</em> (<code class="command">$2</code>), which enables or disables tracing on a per-thread basis. Tracing in each thread will continue as long as the trigger function has not exited yet. 37 A second optional <em class="firstterm">trigger function</em> (<code class="command">$2</code>), which enables or disables tracing on a per-thread basis. Tracing in each thread will continue as long as the trigger function has not exited yet.
37 </div></li></ul></div><a id="idm47951457295888" class="indexterm"></a><a id="idm47951468975504" class="indexterm"></a><a id="idm47951459984816" class="indexterm"></a><div class="para"> 38 </div></li></ul></div><a id="idm214009624560" class="indexterm"></a><a id="idm214012488064" class="indexterm"></a><a id="idm213972459264" class="indexterm"></a><div class="para">
38 <a class="xref" href="paracallgraph.html#scriptcallgraph">para-callgraph.stp</a> uses <code class="command">thread_indent()</code>; as such, its output contains the timestamp, process name, and thread ID of <code class="command">$1</code> (that is, the probe function you are tracing). For more information about <code class="command">thread_indent()</code>, refer to its entry in <a class="xref" href="systemtapscript-handler.html#systemtapscript-functions">SystemTap Functions</a>. 39 <a class="xref" href="paracallgraph.html#scriptcallgraph">para-callgraph.stp</a> uses <code class="command">thread_indent()</code>; as such, its output contains the timestamp, process name, and thread ID of <code class="command">$1</code> (that is, the probe function you are tracing). For more information about <code class="command">thread_indent()</code>, refer to its entry in <a class="xref" href="systemtapscript-handler.html#systemtapscript-functions">SystemTap Functions</a>.
39 </div><div class="para"> 40 </div><div class="para">
40 The following example contains an excerpt from the output for <code class="command">stap para-callgraph.stp 'kernel.function("*@fs/*.c")' 'kernel.function("sys_read")'</code>: 41 The following example contains an excerpt from the output for <code class="command">stap para-callgraph.stp 'kernel.function("*@fs/*.c")' 'kernel.function("sys_read")'</code>:
41 </div><div class="example"><a id="paracallgraphoutput"></a><p class="title"><strong>Example 5.14. <a class="xref" href="paracallgraph.html#scriptcallgraph">para-callgraph.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen">[...] 42 </div><div class="example"><a id="paracallgraphoutput">
43 ⁠</a><p class="title"><strong>Example 5.14. <a class="xref" href="paracallgraph.html#scriptcallgraph">para-callgraph.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen">[...]
42 267 gnome-terminal(2921): &lt;-do_sync_read return=0xfffffffffffffff5 44 267 gnome-terminal(2921): &lt;-do_sync_read return=0xfffffffffffffff5
43 269 gnome-terminal(2921):&lt;-vfs_read return=0xfffffffffffffff5 45 269 gnome-terminal(2921):&lt;-vfs_read return=0xfffffffffffffff5
44 0 gnome-terminal(2921):-&gt;fput file=0xffff880111eebbc0 46 0 gnome-terminal(2921):-&gt;fput file=0xffff880111eebbc0
@@ -51,4 +53,4 @@ probe $1.return { trace(-1, $$return) }
51 12 gnome-terminal(2921): -&gt;do_sync_read filp=0xffff8801116ce980 buf=0xc86504 len=0x1000 ppos=0xffff88010544df48 53 12 gnome-terminal(2921): -&gt;do_sync_read filp=0xffff8801116ce980 buf=0xc86504 len=0x1000 ppos=0xffff88010544df48
52 15 gnome-terminal(2921): &lt;-do_sync_read return=0xfffffffffffffff5 54 15 gnome-terminal(2921): &lt;-do_sync_read return=0xfffffffffffffff5
53 18 gnome-terminal(2921):&lt;-vfs_read return=0xfffffffffffffff5 55 18 gnome-terminal(2921):&lt;-vfs_read return=0xfffffffffffffff5
54 0 gnome-terminal(2921):-&gt;fput file=0xffff8801116ce980</pre></div></div><br class="example-break" /></div><ul class="docnav"><li class="previous"><a accesskey="p" href="mainsect-profiling.html"><strong>Prev</strong>5.3. Profiling</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="threadtimessect.html"><strong>Next</strong>5.3.3. Determining Time Spent in Kernel and User ...</a></li></ul></body></html> \ No newline at end of file 56 0 gnome-terminal(2921):-&gt;fput file=0xffff8801116ce980</pre></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="mainsect-profiling.html"><strong>Prev</strong>5.3. Profiling</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="threadtimessect.html"><strong>Next</strong>5.3.3. Determining Time Spent in Kernel and User ...</a></li></ul></body></html> \ No newline at end of file
diff --git a/SystemTap_Beginners_Guide/pr01s02.html b/SystemTap_Beginners_Guide/pr01s02.html
index eb71bf23..b2263f15 100644
--- a/SystemTap_Beginners_Guide/pr01s02.html
+++ b/SystemTap_Beginners_Guide/pr01s02.html
@@ -1,5 +1,6 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">2. We Need Feedback!</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="SystemTap_Beginners_Guide-Preface.html" title="Preface" /><link rel="prev" href="SystemTap_Beginners_Guide-Preface.html" title="Preface" /><link rel="next" href="introduction.html" title="Chapter 1. Introduction" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="SystemTap_Beginners_Guide-Preface.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="introduction.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h2 class="title"><a id="idm47951461369360"></a>2. We Need Feedback!</h2></div></div></div><a id="idm47951416309856" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">2. We Need Feedback!</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="SystemTap_Beginners_Guide-Preface.html" title="Preface" /><link rel="prev" href="SystemTap_Beginners_Guide-Preface.html" title="Preface" /><link rel="next" href="introduction.html" title="Chapter 1. Introduction" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="SystemTap_Beginners_Guide-Preface.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="introduction.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h2 class="title"><a id="idm213969275744">
3 ⁠</a>2. We Need Feedback!</h2></div></div></div><a id="idm214020910112" class="indexterm"></a><div class="para">
3 If you find a typographical error in this manual, or if you have thought of a way to make this manual better, we would love to hear from you! Please submit a report in Bugzilla: <a href="http://sourceware.org/bugzilla/">http://sourceware.org/bugzilla/</a> against the product <span class="application"><strong>systemtap</strong></span>. 4 If you find a typographical error in this manual, or if you have thought of a way to make this manual better, we would love to hear from you! Please submit a report in Bugzilla: <a href="http://sourceware.org/bugzilla/">http://sourceware.org/bugzilla/</a> against the product <span class="application"><strong>systemtap</strong></span>.
4 </div><div class="para"> 5 </div><div class="para">
5 When submitting a report, be sure to include the specific file or URL the report refers to and the manual's identifier: <em class="citetitle">SystemTap_Beginners_Guide</em> 6 When submitting a report, be sure to include the specific file or URL the report refers to and the manual's identifier: <em class="citetitle">SystemTap_Beginners_Guide</em>
diff --git a/SystemTap_Beginners_Guide/references.html b/SystemTap_Beginners_Guide/references.html
index 316e8e2d..1799ddc4 100644
--- a/SystemTap_Beginners_Guide/references.html
+++ b/SystemTap_Beginners_Guide/references.html
@@ -1,5 +1,6 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">Chapter 7. References</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="index.html" title="SystemTap Beginners Guide" /><link rel="prev" href="runtimeerror.html" title="6.2. Runtime Errors and Warnings" /><link rel="next" href="appe-Publican-Revision_History.html" title="Appendix A. Revision History" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="runtimeerror.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="appe-Publican-Revision_History.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="chapter" lang="en-US"><div class="titlepage"><div><div><h1 class="title"><a id="references"></a>Chapter 7. References</h1></div></div></div><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">Chapter 7. References</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="index.html" title="SystemTap Beginners Guide" /><link rel="prev" href="runtimeerror.html" title="6.2. Runtime Errors and Warnings" /><link rel="next" href="appe-Publican-Revision_History.html" title="Appendix A. Revision History" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="runtimeerror.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="appe-Publican-Revision_History.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="chapter" lang="en-US"><div class="titlepage"><div><div><h1 class="title"><a id="references">
3 ⁠</a>Chapter 7. References</h1></div></div></div><div class="para">
3 This chapter enumerates other references for more information about SystemTap. Refer to these sources in the course of writing advanced probes and tapsets. 4 This chapter enumerates other references for more information about SystemTap. Refer to these sources in the course of writing advanced probes and tapsets.
4 </div><div class="variablelist"><dl class="variablelist"><dt><span class="term">SystemTap Wiki</span></dt><dd><div class="para"> 5 </div><div class="variablelist"><dl class="variablelist"><dt><span class="term">SystemTap Wiki</span></dt><dd><div class="para">
5 The <em class="citetitle">SystemTap Wiki</em> is a collection of links and articles related to the deployment, usage, and development of SystemTap. You can find it at <a href="http://sourceware.org/systemtap/wiki/HomePage">http://sourceware.org/systemtap/wiki/HomePage</a>. 6 The <em class="citetitle">SystemTap Wiki</em> is a collection of links and articles related to the deployment, usage, and development of SystemTap. You can find it at <a href="http://sourceware.org/systemtap/wiki/HomePage">http://sourceware.org/systemtap/wiki/HomePage</a>.
diff --git a/SystemTap_Beginners_Guide/runtimeerror.html b/SystemTap_Beginners_Guide/runtimeerror.html
index 76a94915..aba4f68a 100644
--- a/SystemTap_Beginners_Guide/runtimeerror.html
+++ b/SystemTap_Beginners_Guide/runtimeerror.html
@@ -1,20 +1,29 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">6.2. Runtime Errors and Warnings</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="errors.html" title="Chapter 6. Understanding SystemTap Errors" /><link rel="prev" href="errors.html" title="Chapter 6. Understanding SystemTap Errors" /><link rel="next" href="references.html" title="Chapter 7. References" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="errors.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="references.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="runtimeerror"></a>6.2. Runtime Errors and Warnings</h2></div></div></div><a id="idm47951418180992" class="indexterm"></a><a id="idm47951418179472" class="indexterm"></a><a id="idm47951418177920" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">6.2. Runtime Errors and Warnings</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="errors.html" title="Chapter 6. Understanding SystemTap Errors" /><link rel="prev" href="errors.html" title="Chapter 6. Understanding SystemTap Errors" /><link rel="next" href="references.html" title="Chapter 7. References" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="errors.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="references.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="runtimeerror">
3 ⁠</a>6.2. Runtime Errors and Warnings</h2></div></div></div><a id="idm214020530048" class="indexterm"></a><a id="idm214020528640" class="indexterm"></a><a id="idm214020527200" class="indexterm"></a><div class="para">
3 Runtime errors and warnings occur when the SystemTap instrumentation has been installed and is collecting data on the system. 4 Runtime errors and warnings occur when the SystemTap instrumentation has been installed and is collecting data on the system.
4 </div><h3><a id="idm47951418175760"></a>WARNING: Number of errors: <em class="replaceable"><code>N</code></em>, skipped probes: <em class="replaceable"><code>M</code></em></h3><a id="idm47951459634960" class="indexterm"></a><a id="idm47951459632944" class="indexterm"></a><a id="idm47951459630896" class="indexterm"></a><a id="idm47951459628880" class="indexterm"></a><div class="para"> 5 </div><h3><a id="idm214018532592">
5 Errors and/or skipped probes occurred during this run. Both <em class="replaceable"><code>N</code></em> and <em class="replaceable"><code>M</code></em> are the counts of the number of probes that were not executed due to conditions such as too much time required to execute event handlers over an interval of time. 6 ⁠</a>WARNING: Number of errors: <em class="replaceable">N</em>, skipped probes: <em class="replaceable">M</em></h3><a id="idm214018531024" class="indexterm"></a><a id="idm214018529168" class="indexterm"></a><a id="idm214018527280" class="indexterm"></a><a id="idm214007329024" class="indexterm"></a><div class="para">
6 </div><h3><a id="idm47951416476432"></a>division by 0</h3><a id="idm47951416475552" class="indexterm"></a><a id="idm47951416473504" class="indexterm"></a><a id="idm47951416471424" class="indexterm"></a><a id="idm47951422832288" class="indexterm"></a><a id="idm47951422830240" class="indexterm"></a><div class="para"> 7 Errors and/or skipped probes occurred during this run. Both <em class="replaceable">N</em> and <em class="replaceable">M</em> are the counts of the number of probes that were not executed due to conditions such as too much time required to execute event handlers over an interval of time.
8 </div><h3><a id="idm214007325536">
9 ⁠</a>division by 0</h3><a id="idm214007324736" class="indexterm"></a><a id="idm214007322848" class="indexterm"></a><a id="idm214017358112" class="indexterm"></a><a id="idm214017356224" class="indexterm"></a><a id="idm214017354336" class="indexterm"></a><div class="para">
7 The script code performed an invalid division. 10 The script code performed an invalid division.
8 </div><h3><a id="idm47951422827696"></a>aggregate element not found</h3><a id="idm47951422826848" class="indexterm"></a><a id="idm47951427868912" class="indexterm"></a><a id="idm47951427866864" class="indexterm"></a><a id="idm47951427864848" class="indexterm"></a><div class="para"> 11 </div><h3><a id="idm214017352000">
12 ⁠</a>aggregate element not found</h3><a id="idm213973499872" class="indexterm"></a><a id="idm213973498016" class="indexterm"></a><a id="idm213973496128" class="indexterm"></a><a id="idm213973494272" class="indexterm"></a><div class="para">
9 A statistics extractor function other than <code class="command">@count</code> was invoked on an aggregate that has not had any values accumulated yet. This is similar to a division by zero. 13 A statistics extractor function other than <code class="command">@count</code> was invoked on an aggregate that has not had any values accumulated yet. This is similar to a division by zero.
10 </div><h3><a id="idm47951427861840"></a>aggregation overflow</h3><a id="idm47951456626672" class="indexterm"></a><a id="idm47951456624624" class="indexterm"></a><a id="idm47951456622544" class="indexterm"></a><a id="idm47951456620496" class="indexterm"></a><a id="idm47951454975728" class="indexterm"></a><div class="para"> 14 </div><h3><a id="idm214004752896">
15 ⁠</a>aggregation overflow</h3><a id="idm214004752096" class="indexterm"></a><a id="idm214004750208" class="indexterm"></a><a id="idm214004748288" class="indexterm"></a><a id="idm214020471024" class="indexterm"></a><a id="idm214020469136" class="indexterm"></a><div class="para">
11 An array containing aggregate values contains too many distinct key pairs at this time. 16 An array containing aggregate values contains too many distinct key pairs at this time.
12 </div><h3><a id="idm47951454972896"></a>MAXNESTING exceeded</h3><a id="idm47951454972160" class="indexterm"></a><a id="idm47951454970112" class="indexterm"></a><a id="idm47951454968032" class="indexterm"></a><a id="idm47951423625376" class="indexterm"></a><a id="idm47951423623328" class="indexterm"></a><div class="para"> 17 </div><h3><a id="idm214020466384">
18 ⁠</a>MAXNESTING exceeded</h3><a id="idm214020465712" class="indexterm"></a><a id="idm214020463824" class="indexterm"></a><a id="idm213978696928" class="indexterm"></a><a id="idm213978695040" class="indexterm"></a><a id="idm213978693152" class="indexterm"></a><div class="para">
13 Too many levels of function call nesting were attempted. The default nesting of function calls allowed is 10. 19 Too many levels of function call nesting were attempted. The default nesting of function calls allowed is 10.
14 </div><h3><a id="idm47951423620784"></a>MAXACTION exceeded</h3><a id="idm47951423619904" class="indexterm"></a><a id="idm47951468513744" class="indexterm"></a><a id="idm47951468511664" class="indexterm"></a><a id="idm47951468509616" class="indexterm"></a><a id="idm47951468507568" class="indexterm"></a><div class="para"> 20 </div><h3><a id="idm213978690688">
21 ⁠</a>MAXACTION exceeded</h3><a id="idm214026575648" class="indexterm"></a><a id="idm214026573760" class="indexterm"></a><a id="idm214026571840" class="indexterm"></a><a id="idm214026569952" class="indexterm"></a><a id="idm213978747584" class="indexterm"></a><div class="para">
15 The probe handler attempted to execute too many statements in the probe handler. The default number of actions allowed in a probe handler is 1000. 22 The probe handler attempted to execute too many statements in the probe handler. The default number of actions allowed in a probe handler is 1000.
16 </div><h3><a id="idm47951460817632"></a>kernel/user string copy fault at <em class="replaceable"><code>ADDR</code></em></h3><a id="idm47951460816432" class="indexterm"></a><a id="idm47951460814384" class="indexterm"></a><a id="idm47951460812304" class="indexterm"></a><a id="idm47951418843584" class="indexterm"></a><div class="para"> 23 </div><h3><a id="idm213978745072">
17 The probe handler attempted to copy a string from kernel or user space at an invalid address (<em class="replaceable"><code>ADDR</code></em>). 24 ⁠</a>kernel/user string copy fault at <em class="replaceable">ADDR</em></h3><a id="idm213978743984" class="indexterm"></a><a id="idm213978742096" class="indexterm"></a><a id="idm214011670928" class="indexterm"></a><a id="idm214011669040" class="indexterm"></a><div class="para">
18 </div><h3><a id="idm47951418840512"></a>pointer dereference fault</h3><a id="idm47951418839488" class="indexterm"></a><a id="idm47951418837472" class="indexterm"></a><a id="idm47951468505760" class="indexterm"></a><a id="idm47951468503744" class="indexterm"></a><div class="para"> 25 The probe handler attempted to copy a string from kernel or user space at an invalid address (<em class="replaceable">ADDR</em>).
26 </div><h3><a id="idm214011666224">
27 ⁠</a>pointer dereference fault</h3><a id="idm214011665296" class="indexterm"></a><a id="idm214011663440" class="indexterm"></a><a id="idm214021260288" class="indexterm"></a><a id="idm214021258432" class="indexterm"></a><div class="para">
19 There was a fault encountered during a pointer dereference operation such as a target variable evaluation. 28 There was a fault encountered during a pointer dereference operation such as a target variable evaluation.
20 </div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="errors.html"><strong>Prev</strong>Chapter 6. Understanding SystemTap Errors</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="references.html"><strong>Next</strong>Chapter 7. References</a></li></ul></body></html> \ No newline at end of file 29 </div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="errors.html"><strong>Prev</strong>Chapter 6. Understanding SystemTap Errors</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="references.html"><strong>Next</strong>Chapter 7. References</a></li></ul></body></html> \ No newline at end of file
diff --git a/SystemTap_Beginners_Guide/scriptconstructions.html b/SystemTap_Beginners_Guide/scriptconstructions.html
index 112c8eda..dae429ad 100644
--- a/SystemTap_Beginners_Guide/scriptconstructions.html
+++ b/SystemTap_Beginners_Guide/scriptconstructions.html
@@ -1,11 +1,14 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.3. Basic SystemTap Handler Constructs</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="understanding-how-systemtap-works.html" title="Chapter 3. Understanding How SystemTap Works" /><link rel="prev" href="systemtapscript-handler.html" title="3.2.2. SystemTap Handler/Body" /><link rel="next" href="targetvariables.html" title="3.3.2. Target Variables" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="systemtapscript-handler.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="targetvariables.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h2 class="title"><a id="scriptconstructions"></a>3.3. Basic SystemTap Handler Constructs</h2></div></div></div><a id="idm47951460962016" class="indexterm"></a><a id="idm47951457446384" class="indexterm"></a><a id="idm47951476114704" class="indexterm"></a><a id="idm47951421010480" class="indexterm"></a><a id="idm47951423265408" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.3. Basic SystemTap Handler Constructs</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="understanding-how-systemtap-works.html" title="Chapter 3. Understanding How SystemTap Works" /><link rel="prev" href="systemtapscript-handler.html" title="3.2.2. SystemTap Handler/Body" /><link rel="next" href="targetvariables.html" title="3.3.2. Target Variables" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="systemtapscript-handler.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="targetvariables.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h2 class="title"><a id="scriptconstructions">
3 ⁠</a>3.3. Basic SystemTap Handler Constructs</h2></div></div></div><a id="idm214012000240" class="indexterm"></a><a id="idm213970845792" class="indexterm"></a><a id="idm213970846112" class="indexterm"></a><a id="idm213970849760" class="indexterm"></a><a id="idm213970850240" class="indexterm"></a><div class="para">
3 SystemTap supports the use of several basic constructs in handlers. The syntax for most of these handler constructs are mostly based on C and <code class="command">awk</code> syntax. This section describes several of the most useful SystemTap handler constructs, which should provide you with enough information to write simple yet useful SystemTap scripts. 4 SystemTap supports the use of several basic constructs in handlers. The syntax for most of these handler constructs are mostly based on C and <code class="command">awk</code> syntax. This section describes several of the most useful SystemTap handler constructs, which should provide you with enough information to write simple yet useful SystemTap scripts.
4 </div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="variablesconstructs"></a>3.3.1. Variables</h3></div></div></div><a id="idm47951415728656" class="indexterm"></a><a id="idm47951475252320" class="indexterm"></a><a id="idm47951466545856" class="indexterm"></a><a id="idm47951456450928" class="indexterm"></a><div class="para"> 5 </div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="variablesconstructs">
6 ⁠</a>3.3.1. Variables</h3></div></div></div><a id="idm214012685168" class="indexterm"></a><a id="idm214015948848" class="indexterm"></a><a id="idm213978539216" class="indexterm"></a><a id="idm214009572320" class="indexterm"></a><div class="para">
5 Variables can be used freely throughout a handler; simply choose a name, assign a value from a function or expression to it, and use it in an expression. SystemTap automatically identifies whether a variable should be typed as a string or integer, based on the type of the values assigned to it. For instance, if you use set the variable <code class="command">foo</code> to <code class="command">gettimeofday_s()</code> (as in <code class="command">foo = gettimeofday_s()</code>), then <code class="command">foo</code> is typed as a number and can be printed in a <code class="command">printf()</code> with the integer format specifier (<code class="command">%d</code>). 7 Variables can be used freely throughout a handler; simply choose a name, assign a value from a function or expression to it, and use it in an expression. SystemTap automatically identifies whether a variable should be typed as a string or integer, based on the type of the values assigned to it. For instance, if you use set the variable <code class="command">foo</code> to <code class="command">gettimeofday_s()</code> (as in <code class="command">foo = gettimeofday_s()</code>), then <code class="command">foo</code> is typed as a number and can be printed in a <code class="command">printf()</code> with the integer format specifier (<code class="command">%d</code>).
6 </div><a id="idm47951456516336" class="indexterm"></a><a id="idm47951475799024" class="indexterm"></a><a id="idm47951455994592" class="indexterm"></a><div class="para"> 8 </div><a id="idm214011999104" class="indexterm"></a><a id="idm213973287120" class="indexterm"></a><a id="idm214016672400" class="indexterm"></a><div class="para">
7 Note, however, that by default variables are only local to the probe they are used in. This means that variables are initialized, used and disposed at each probe handler invocation. To share a variable between probes, declare the variable name using <code class="command">global</code> outside of the probes. Consider the following example: 9 Note, however, that by default variables are only local to the probe they are used in. This means that variables are initialized, used and disposed at each probe handler invocation. To share a variable between probes, declare the variable name using <code class="command">global</code> outside of the probes. Consider the following example:
8 </div><div class="example"><a id="timerjiffies"></a><p class="title"><strong>Example 3.8. timer-jiffies.stp</strong></p><div class="example-contents"><pre class="programlisting">global count_jiffies, count_ms 10 </div><div class="example"><a id="timerjiffies">
11 ⁠</a><p class="title"><strong>Example 3.8. timer-jiffies.stp</strong></p><div class="example-contents"><pre class="programlisting">global count_jiffies, count_ms
9probe timer.jiffies(100) { count_jiffies ++ } 12probe timer.jiffies(100) { count_jiffies ++ }
10probe timer.ms(100) { count_ms ++ } 13probe timer.ms(100) { count_ms ++ }
11probe timer.ms(12345) 14probe timer.ms(12345)
@@ -14,7 +17,7 @@ probe timer.ms(12345)
14 printf ("jiffies:ms ratio %d:%d =&gt; CONFIG_HZ=%d\n", 17 printf ("jiffies:ms ratio %d:%d =&gt; CONFIG_HZ=%d\n",
15 count_jiffies, count_ms, hz) 18 count_jiffies, count_ms, hz)
16 exit () 19 exit ()
17}</pre></div></div><br class="example-break" /><a id="idm47951469381760" class="indexterm"></a><div class="para"> 20}</pre></div></div><a id="idm214005429424" class="indexterm"></a><div class="para">
18 <a class="xref" href="scriptconstructions.html#timerjiffies">Example 3.8, “timer-jiffies.stp”</a> computes the <code class="command">CONFIG_HZ</code> setting of the kernel using timers that count jiffies and milliseconds, then computing accordingly. The <code class="command">global</code> statement allows the script to use the variables <code class="command">count_jiffies</code> and <code class="command">count_ms</code> (set in their own respective probes) to be shared with <code class="command">probe timer.ms(12345)</code>. 21 <a class="xref" href="scriptconstructions.html#timerjiffies">Example 3.8, “timer-jiffies.stp”</a> computes the <code class="command">CONFIG_HZ</code> setting of the kernel using timers that count jiffies and milliseconds, then computing accordingly. The <code class="command">global</code> statement allows the script to use the variables <code class="command">count_jiffies</code> and <code class="command">count_ms</code> (set in their own respective probes) to be shared with <code class="command">probe timer.ms(12345)</code>.
19 </div><div xmlns:d="http://docbook.org/ns/docbook" class="note"><div class="admonition_header"><p><strong>Note</strong></p></div><div class="admonition"><div class="para"> 22 </div><div xmlns:d="http://docbook.org/ns/docbook" class="note"><div class="admonition_header"><p><strong>Note</strong></p></div><div class="admonition"><div class="para">
20 The <code class="command">++</code> notation in <a class="xref" href="scriptconstructions.html#timerjiffies">Example 3.8, “timer-jiffies.stp”</a> (that is, <code class="command">count_jiffies ++</code> and <code class="command">count_ms ++</code>) is used to increment the value of a variable by 1. In the following probe, <code class="command">count_jiffies</code> is incremented by 1 every 100 jiffies: 23 The <code class="command">++</code> notation in <a class="xref" href="scriptconstructions.html#timerjiffies">Example 3.8, “timer-jiffies.stp”</a> (that is, <code class="command">count_jiffies ++</code> and <code class="command">count_ms ++</code>) is used to increment the value of a variable by 1. In the following probe, <code class="command">count_jiffies</code> is incremented by 1 every 100 jiffies:
diff --git a/SystemTap_Beginners_Guide/scripts.html b/SystemTap_Beginners_Guide/scripts.html
index 04e8e877..c1e99cce 100644
--- a/SystemTap_Beginners_Guide/scripts.html
+++ b/SystemTap_Beginners_Guide/scripts.html
@@ -1,9 +1,10 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.2. SystemTap Scripts</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="understanding-how-systemtap-works.html" title="Chapter 3. Understanding How SystemTap Works" /><link rel="prev" href="understanding-how-systemtap-works.html" title="Chapter 3. Understanding How SystemTap Works" /><link rel="next" href="systemtapscript-handler.html" title="3.2.2. SystemTap Handler/Body" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="understanding-how-systemtap-works.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="systemtapscript-handler.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h2 class="title"><a id="scripts"></a>3.2. SystemTap Scripts</h2></div></div></div><a id="idm47951460066784" class="indexterm"></a><a id="idm47951460064976" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.2. SystemTap Scripts</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="understanding-how-systemtap-works.html" title="Chapter 3. Understanding How SystemTap Works" /><link rel="prev" href="understanding-how-systemtap-works.html" title="Chapter 3. Understanding How SystemTap Works" /><link rel="next" href="systemtapscript-handler.html" title="3.2.2. SystemTap Handler/Body" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="understanding-how-systemtap-works.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="systemtapscript-handler.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h2 class="title"><a id="scripts">
3 ⁠</a>3.2. SystemTap Scripts</h2></div></div></div><a id="idm214006941488" class="indexterm"></a><a id="idm214006942640" class="indexterm"></a><div class="para">
3 For the most part, SystemTap scripts are the foundation of each SystemTap session. SystemTap scripts instruct SystemTap on what type of information to collect, and what to do once that information is collected. 4 For the most part, SystemTap scripts are the foundation of each SystemTap session. SystemTap scripts instruct SystemTap on what type of information to collect, and what to do once that information is collected.
4 </div><a id="idm47951460062176" class="indexterm"></a><a id="idm47951460059888" class="indexterm"></a><a id="idm47951460059040" class="indexterm"></a><a id="idm47951460051888" class="indexterm"></a><a id="idm47951460049520" class="indexterm"></a><a id="idm47951460047248" class="indexterm"></a><div class="para"> 5 </div><a id="idm214006945920" class="indexterm"></a><a id="idm214006946848" class="indexterm"></a><a id="idm214006948800" class="indexterm"></a><a id="idm214006950928" class="indexterm"></a><a id="idm214006952912" class="indexterm"></a><a id="idm214006954880" class="indexterm"></a><div class="para">
5 As stated in <a class="xref" href="understanding-how-systemtap-works.html">Chapter 3, <em>Understanding How SystemTap Works</em></a>, SystemTap scripts are made up of two components: <span class="emphasis"><em>events</em></span> and <span class="emphasis"><em>handlers</em></span>. Once a SystemTap session is underway, SystemTap monitors the operating system for the specified events and executes the handlers as they occur. 6 As stated in <a class="xref" href="understanding-how-systemtap-works.html">Chapter 3, <em>Understanding How SystemTap Works</em></a>, SystemTap scripts are made up of two components: <span class="emphasis"><em>events</em></span> and <span class="emphasis"><em>handlers</em></span>. Once a SystemTap session is underway, SystemTap monitors the operating system for the specified events and executes the handlers as they occur.
6 </div><div xmlns:d="http://docbook.org/ns/docbook" class="note"><div class="admonition_header"><p><strong>Note</strong></p></div><div class="admonition"><a id="idm47951460040560" class="indexterm"></a><a id="idm47951460036736" class="indexterm"></a><a id="idm47951460033584" class="indexterm"></a><div class="para"> 7 </div><div xmlns:d="http://docbook.org/ns/docbook" class="note"><div class="admonition_header"><p><strong>Note</strong></p></div><div class="admonition"><a id="idm214006961584" class="indexterm"></a><a id="idm214006963488" class="indexterm"></a><a id="idm214006965392" class="indexterm"></a><div class="para">
7 An event and its corresponding handler is collectively called a <span class="emphasis"><em>probe</em></span>. A SystemTap script can have multiple probes. 8 An event and its corresponding handler is collectively called a <span class="emphasis"><em>probe</em></span>. A SystemTap script can have multiple probes.
8 </div><div class="para"> 9 </div><div class="para">
9 A probe's handler is commonly referred to as a <span class="emphasis"><em>probe body</em></span>. 10 A probe's handler is commonly referred to as a <span class="emphasis"><em>probe body</em></span>.
@@ -11,72 +12,76 @@
11 In terms of application development, using events and handlers is similar to instrumenting the code by inserting diagnostic print statements in a program's sequence of commands. These diagnostic print statements allow you to view a history of commands executed once the program is run. 12 In terms of application development, using events and handlers is similar to instrumenting the code by inserting diagnostic print statements in a program's sequence of commands. These diagnostic print statements allow you to view a history of commands executed once the program is run.
12 </div><div class="para"> 13 </div><div class="para">
13 SystemTap scripts allow insertion of the instrumentation code without recompilation of the code and allows more flexibility with regard to handlers. Events serve as the triggers for handlers to run; handlers can be specified to record specified data and print it in a certain manner. 14 SystemTap scripts allow insertion of the instrumentation code without recompilation of the code and allows more flexibility with regard to handlers. Events serve as the triggers for handlers to run; handlers can be specified to record specified data and print it in a certain manner.
14 </div><div class="formalpara"><div xmlns:d="http://docbook.org/ns/docbook" class="title">Format</div><a id="idm47951460023536" class="indexterm"></a><a id="idm47951460018768" class="indexterm"></a><a id="idm47951460016496" class="indexterm"></a><a id="idm47951460013552" class="indexterm"></a> 15 </div><div class="para"><div xmlns:d="http://docbook.org/ns/docbook" class="title">Format</div><a id="idm214006970000" class="indexterm"></a><a id="idm214006970784" class="indexterm"></a><a id="idm214006972320" class="indexterm"></a><a id="idm214006973840" class="indexterm"></a>
15 SystemTap scripts use the file extension <code class="filename">.stp</code>, and contains probes written in the following format: 16 SystemTap scripts use the file extension <code class="filename">.stp</code>, and contains probes written in the following format:
16 </div><pre class="screen">probe <em class="replaceable"><code>event</code></em> {<em class="replaceable"><code>statements</code></em>}</pre><div class="para"> 17 </div><pre class="screen">probe <em class="replaceable">event</em> {<em class="replaceable">statements</em>}</pre><div class="para">
17 SystemTap supports multiple events per probe; multiple events are delimited by a comma (<code class="command">,</code>). If multiple events are specified in a single probe, SystemTap will execute the handler when any of the specified events occur. 18 SystemTap supports multiple events per probe; multiple events are delimited by a comma (<code class="command">,</code>). If multiple events are specified in a single probe, SystemTap will execute the handler when any of the specified events occur.
18 </div><a id="idm47951460006400" class="indexterm"></a><a id="idm47951460003264" class="indexterm"></a><a id="idm47951460000192" class="indexterm"></a><div class="para"> 19 </div><a id="idm214006979024" class="indexterm"></a><a id="idm214006980944" class="indexterm"></a><a id="idm214006982896" class="indexterm"></a><div class="para">
19 Each probe has a corresponding <em class="firstterm">statement block</em>. This statement block is enclosed in braces (<code class="command">{ }</code>) and contains the statements to be executed per event. SystemTap executes these statements in sequence; special separators or terminators are generally not necessary between multiple statements. 20 Each probe has a corresponding <em class="firstterm">statement block</em>. This statement block is enclosed in braces (<code class="command">{ }</code>) and contains the statements to be executed per event. SystemTap executes these statements in sequence; special separators or terminators are generally not necessary between multiple statements.
20 </div><div xmlns:d="http://docbook.org/ns/docbook" class="note"><div class="admonition_header"><p><strong>Note</strong></p></div><div class="admonition"><div class="para"> 21 </div><div xmlns:d="http://docbook.org/ns/docbook" class="note"><div class="admonition_header"><p><strong>Note</strong></p></div><div class="admonition"><div class="para">
21 Statement blocks in SystemTap scripts follow the same syntax and semantics as the C programming language. A statement block can be nested within another statement block. 22 Statement blocks in SystemTap scripts follow the same syntax and semantics as the C programming language. A statement block can be nested within another statement block.
22 </div></div></div><a id="idm47951425027088" class="indexterm"></a><a id="idm47951425024944" class="indexterm"></a><a id="idm47951425022064" class="indexterm"></a><div class="para"> 23 </div></div></div><a id="idm214006988048" class="indexterm"></a><a id="idm214006990096" class="indexterm"></a><a id="idm214006992064" class="indexterm"></a><div class="para">
23 SystemTap allows you to write functions to factor out code to be used by a number of probes. Thus, rather than repeatedly writing the same series of statements in multiple probes, you can just place the instructions in a <em class="firstterm">function</em>, as in: 24 SystemTap allows you to write functions to factor out code to be used by a number of probes. Thus, rather than repeatedly writing the same series of statements in multiple probes, you can just place the instructions in a <em class="firstterm">function</em>, as in:
24 </div><pre class="screen">function <em class="replaceable"><code>function_name</code></em>(<em class="replaceable"><code>arguments</code></em>) {<em class="replaceable"><code>statements</code></em>} 25 </div><pre class="screen">function <em class="replaceable">function_name</em>(<em class="replaceable">arguments</em>) {<em class="replaceable">statements</em>}
25probe <em class="replaceable"><code>event</code></em> {<em class="replaceable"><code>function_name</code></em>(<em class="replaceable"><code>arguments</code></em>)}</pre><div class="para"> 26probe <em class="replaceable">event</em> {<em class="replaceable">function_name</em>(<em class="replaceable">arguments</em>)}</pre><div class="para">
26 The <code class="command"><em class="replaceable"><code>statements</code></em></code> in <em class="replaceable"><code>function_name</code></em> are executed when the probe for <em class="replaceable"><code>event</code></em> executes. The <em class="replaceable"><code>arguments</code></em> are optional values passed into the function. 27 The <code class="command"><em class="replaceable">statements</em></code> in <em class="replaceable">function_name</em> are executed when the probe for <em class="replaceable">event</em> executes. The <em class="replaceable">arguments</em> are optional values passed into the function.
27 </div><div xmlns:d="http://docbook.org/ns/docbook" class="important"><div class="admonition_header"><p><strong>Important</strong></p></div><div class="admonition"><div class="para"> 28 </div><div xmlns:d="http://docbook.org/ns/docbook" class="important"><div class="admonition_header"><p><strong>Important</strong></p></div><div class="admonition"><div class="para">
28 <a class="xref" href="scripts.html">Section 3.2, “SystemTap Scripts”</a> is designed to introduce readers to the basics of SystemTap scripts. To understand SystemTap scripts better, it is advisable that you refer to <a class="xref" href="useful-systemtap-scripts.html">Chapter 5, <em>Useful SystemTap Scripts</em></a>; each section therein provides a detailed explanation of the script, its events, handlers, and expected output. 29 <a class="xref" href="scripts.html">Section 3.2, “SystemTap Scripts”</a> is designed to introduce readers to the basics of SystemTap scripts. To understand SystemTap scripts better, it is advisable that you refer to <a class="xref" href="useful-systemtap-scripts.html">Chapter 5, <em>Useful SystemTap Scripts</em></a>; each section therein provides a detailed explanation of the script, its events, handlers, and expected output.
29 </div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="systemtapscript-events"></a>3.2.1. Event</h3></div></div></div><a id="idm47951425005584" class="indexterm"></a><div class="para"> 30 </div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="systemtapscript-events">
31 ⁠</a>3.2.1. Event</h3></div></div></div><a id="idm214007005008" class="indexterm"></a><div class="para">
30 SystemTap events can be broadly classified into two types: <em class="firstterm">synchronous</em> and <em class="firstterm">asynchronous</em>. 32 SystemTap events can be broadly classified into two types: <em class="firstterm">synchronous</em> and <em class="firstterm">asynchronous</em>.
31 </div><div class="formalpara"><div xmlns:d="http://docbook.org/ns/docbook" class="title">Synchronous Events</div><a id="idm47951425001152" class="indexterm"></a><a id="idm47951424999024" class="indexterm"></a> 33 </div><div class="para"><div xmlns:d="http://docbook.org/ns/docbook" class="title">Synchronous Events</div><a id="idm214016627840" class="indexterm"></a><a id="idm214016628480" class="indexterm"></a>
32 A <em class="firstterm">synchronous</em> event occurs when any process executes an instruction at a particular location in kernel code. This gives other events a reference point from which more contextual data may be available. 34 A <em class="firstterm">synchronous</em> event occurs when any process executes an instruction at a particular location in kernel code. This gives other events a reference point from which more contextual data may be available.
33 </div><a id="idm47951424994560" class="indexterm"></a><a id="idm47951424995264" class="indexterm"></a><div class="para"> 35 </div><a id="idm214016631920" class="indexterm"></a><a id="idm214016633360" class="indexterm"></a><div class="para">
34 Examples of synchronous events include: 36 Examples of synchronous events include:
35 </div><div class="variablelist"><dl class="variablelist"><dt><span class="term">syscall.<em class="replaceable"><code>system_call</code></em></span></dt><dd><a id="idm47951424987344" class="indexterm"></a><a id="idm47951424984720" class="indexterm"></a><div class="para"> 37 </div><div class="variablelist"><dl class="variablelist"><dt><span class="term">syscall.<em class="replaceable">system_call</em></span></dt><dd><a id="idm214016637232" class="indexterm"></a><a id="idm214016638400" class="indexterm"></a><div class="para">
36 The entry to the system call <em class="replaceable"><code>system_call</code></em>. If the exit from a syscall is desired, appending a <code class="command">.return</code> to the event monitor the exit of the system call instead. For example, to specify the entry and exit of the system call <code class="command">close</code>, use <code class="command">syscall.close</code> and <code class="command">syscall.close.return</code> respectively. 38 The entry to the system call <em class="replaceable">system_call</em>. If the exit from a syscall is desired, appending a <code class="command">.return</code> to the event monitor the exit of the system call instead. For example, to specify the entry and exit of the system call <code class="command">close</code>, use <code class="command">syscall.close</code> and <code class="command">syscall.close.return</code> respectively.
37 </div></dd><dt><span class="term">vfs.<em class="replaceable"><code>file_operation</code></em></span></dt><dd><a id="idm47951424975792" class="indexterm"></a><a id="idm47951424973648" class="indexterm"></a><div class="para"> 39 </div></dd><dt><span class="term">vfs.<em class="replaceable">file_operation</em></span></dt><dd><a id="idm214016645856" class="indexterm"></a><a id="idm214016649232" class="indexterm"></a><div class="para">
38 The entry to the <em class="replaceable"><code>file_operation</code></em> event for Virtual File System (VFS). Similar to <code class="command">syscall</code> event, appending a <code class="command">.return</code> to the event monitors the exit of the <em class="replaceable"><code>file_operation</code></em> operation. 40 The entry to the <em class="replaceable">file_operation</em> event for Virtual File System (VFS). Similar to <code class="command">syscall</code> event, appending a <code class="command">.return</code> to the event monitors the exit of the <em class="replaceable">file_operation</em> operation.
39 </div></dd><dt><span class="term">kernel.function("<em class="replaceable"><code>function</code></em>")</span></dt><dd><a id="idm47951424966176" class="indexterm"></a><a id="idm47951424964208" class="indexterm"></a><div class="para"> 41 </div></dd><dt><span class="term">kernel.function("<em class="replaceable">function</em>")</span></dt><dd><a id="idm214016654096" class="indexterm"></a><a id="idm214016655424" class="indexterm"></a><div class="para">
40 The entry to the kernel function <em class="replaceable"><code>function</code></em>. For example, <code class="command">kernel.function("sys_open")</code> refers to the "event" that occurs when the kernel function <code class="command">sys_open</code> is called by any thread in the system. To specify the <span class="emphasis"><em>return</em></span> of the kernel function <code class="command">sys_open</code>, append the <code class="command">return</code> string to the event statement; that is, <code class="command">kernel.function("sys_open").return</code>. 42 The entry to the kernel function <em class="replaceable">function</em>. For example, <code class="command">kernel.function("sys_open")</code> refers to the "event" that occurs when the kernel function <code class="command">sys_open</code> is called by any thread in the system. To specify the <span class="emphasis"><em>return</em></span> of the kernel function <code class="command">sys_open</code>, append the <code class="command">return</code> string to the event statement; that is, <code class="command">kernel.function("sys_open").return</code>.
41 </div><a id="idm47951424958720" class="indexterm"></a><a id="idm47951424954960" class="indexterm"></a><a id="idm47951424953664" class="indexterm"></a><div class="para"> 43 </div><a id="idm214016661856" class="indexterm"></a><a id="idm214016662800" class="indexterm"></a><a id="idm214016663280" class="indexterm"></a><div class="para">
42 When defining probe events, you can use asterisk (<code class="literal">*</code>) for wildcards. You can also trace the entry or exit of a function in a kernel source file. Consider the following example: 44 When defining probe events, you can use asterisk (<code class="literal">*</code>) for wildcards. You can also trace the entry or exit of a function in a kernel source file. Consider the following example:
43 </div><div class="example"><a id="wildcards"></a><p class="title"><strong>Example 3.1. wildcards.stp</strong></p><div class="example-contents"><pre class="programlisting">probe kernel.function("*@net/socket.c") { } 45 </div><div class="example"><a id="wildcards">
44probe kernel.function("*@net/socket.c").return { }</pre></div></div><br class="example-break" /><div class="para"> 46 ⁠</a><p class="title"><strong>Example 3.1. wildcards.stp</strong></p><div class="example-contents"><pre class="programlisting">probe kernel.function("*@net/socket.c") { }
47probe kernel.function("*@net/socket.c").return { }</pre></div></div><div class="para">
45 In the previous example, the first probe's event specifies the entry of ALL functions in the kernel source file <code class="filename">net/socket.c</code>. The second probe specifies the exit of all those functions. Note that in this example, there are no statements in the handler; as such, no information will be collected or displayed. 48 In the previous example, the first probe's event specifies the entry of ALL functions in the kernel source file <code class="filename">net/socket.c</code>. The second probe specifies the exit of all those functions. Note that in this example, there are no statements in the handler; as such, no information will be collected or displayed.
46 </div></dd><dt><span class="term">kernel.trace("<em class="replaceable"><code>tracepoint</code></em>")</span></dt><dd><a id="idm47951424945056" class="indexterm"></a><a id="idm47951424943984" class="indexterm"></a><a id="idm47951424941472" class="indexterm"></a><div class="para"> 49 </div></dd><dt><span class="term">kernel.trace("<em class="replaceable">tracepoint</em>")</span></dt><dd><a id="idm214016670192" class="indexterm"></a><a id="idm214016670672" class="indexterm"></a><a id="idm214016673296" class="indexterm"></a><div class="para">
47 The static probe for <em class="replaceable"><code>tracepoint</code></em>. Recent kernels (2.6.30 and newer) include instrumentation for specific events in the kernel. These events are statically marked with tracepoints. One example of a tracepoint available in systemtap is <code class="command">kernel.trace("kfree_skb")</code> which indicates each time a network buffer is freed in the kernel. 50 The static probe for <em class="replaceable">tracepoint</em>. Recent kernels (2.6.30 and newer) include instrumentation for specific events in the kernel. These events are statically marked with tracepoints. One example of a tracepoint available in systemtap is <code class="command">kernel.trace("kfree_skb")</code> which indicates each time a network buffer is freed in the kernel.
48 </div></dd><dt><span class="term">module("<em class="replaceable"><code>module</code></em>").function("<em class="replaceable"><code>function</code></em>")</span></dt><dd><a id="idm47951424934864" class="indexterm"></a><a id="idm47951424932352" class="indexterm"></a><div class="para"> 51 </div></dd><dt><span class="term">module("<em class="replaceable">module</em>").function("<em class="replaceable">function</em>")</span></dt><dd><a id="idm214016678640" class="indexterm"></a><a id="idm214016680384" class="indexterm"></a><div class="para">
49 Allows you to probe functions within modules. For example: 52 Allows you to probe functions within modules. For example:
50 </div><div class="example"><a id="eventsmodules"></a><p class="title"><strong>Example 3.2. moduleprobe.stp</strong></p><div class="example-contents"><pre class="programlisting">probe module("ext3").function("*") { } 53 </div><div class="example"><a id="eventsmodules">
51probe module("ext3").function("*").return { }</pre></div></div><br class="example-break" /><div class="para"> 54 ⁠</a><p class="title"><strong>Example 3.2. moduleprobe.stp</strong></p><div class="example-contents"><pre class="programlisting">probe module("ext3").function("*") { }
55probe module("ext3").function("*").return { }</pre></div></div><div class="para">
52 The first probe in <a class="xref" href="scripts.html#eventsmodules">Example 3.2, “moduleprobe.stp”</a> points to the entry of <span class="emphasis"><em>all</em></span> functions for the <code class="filename">ext3</code> module. The second probe points to the exits of all functions for that same module; the use of the <code class="command">.return</code> suffix is similar to <code class="command">kernel.function()</code>. Note that the probes in <a class="xref" href="scripts.html#eventsmodules">Example 3.2, “moduleprobe.stp”</a> do not contain statements in the probe handlers, and as such will not print any useful data (as in <a class="xref" href="scripts.html#wildcards">Example 3.1, “wildcards.stp”</a>). 56 The first probe in <a class="xref" href="scripts.html#eventsmodules">Example 3.2, “moduleprobe.stp”</a> points to the entry of <span class="emphasis"><em>all</em></span> functions for the <code class="filename">ext3</code> module. The second probe points to the exits of all functions for that same module; the use of the <code class="command">.return</code> suffix is similar to <code class="command">kernel.function()</code>. Note that the probes in <a class="xref" href="scripts.html#eventsmodules">Example 3.2, “moduleprobe.stp”</a> do not contain statements in the probe handlers, and as such will not print any useful data (as in <a class="xref" href="scripts.html#wildcards">Example 3.1, “wildcards.stp”</a>).
53 </div><div class="para"> 57 </div><div class="para">
54 A system's kernel modules are typically located in <code class="filename">/lib/modules/<em class="replaceable"><code>kernel_version</code></em></code>, where <em class="replaceable"><code>kernel_version</code></em> refers to the currently loaded kernel version. Modules use the file name extension <code class="filename">.ko</code>. 58 A system's kernel modules are typically located in <code class="filename">/lib/modules/<em class="replaceable">kernel_version</em></code>, where <em class="replaceable">kernel_version</em> refers to the currently loaded kernel version. Modules use the file name extension <code class="filename">.ko</code>.
55 </div></dd></dl></div><div class="formalpara"><div xmlns:d="http://docbook.org/ns/docbook" class="title">Asynchronous Events</div><a id="idm47951424919120" class="indexterm"></a><a id="idm47951424917984" class="indexterm"></a> 59 </div></dd></dl></div><div class="para"><div xmlns:d="http://docbook.org/ns/docbook" class="title">Asynchronous Events</div><a id="idm214016691328" class="indexterm"></a><a id="idm214016692544" class="indexterm"></a>
56 <em class="firstterm">Asynchronous</em> events are not tied to a particular instruction or location in code. This family of probe points consists mainly of counters, timers, and similar constructs. 60 <em class="firstterm">Asynchronous</em> events are not tied to a particular instruction or location in code. This family of probe points consists mainly of counters, timers, and similar constructs.
57 </div><div class="para"> 61 </div><div class="para">
58 Examples of asynchronous events include: 62 Examples of asynchronous events include:
59 </div><div class="variablelist"><dl class="variablelist"><dt><span class="term">begin</span></dt><dd><a id="idm47951424908416" class="indexterm"></a><a id="idm47951424911008" class="indexterm"></a><div class="para"> 63 </div><div class="variablelist"><dl class="variablelist"><dt><span class="term">begin</span></dt><dd><a id="idm214016697648" class="indexterm"></a><a id="idm214016698944" class="indexterm"></a><div class="para">
60 The startup of a SystemTap session; that is, as soon as the SystemTap script is run. 64 The startup of a SystemTap session; that is, as soon as the SystemTap script is run.
61 </div></dd><dt><span class="term">end</span></dt><dd><a id="idm47951422297424" class="indexterm"></a><a id="idm47951422129984" class="indexterm"></a><div class="para"> 65 </div></dd><dt><span class="term">end</span></dt><dd><a id="idm214016702144" class="indexterm"></a><a id="idm214016705504" class="indexterm"></a><div class="para">
62 The end of a SystemTap session. 66 The end of a SystemTap session.
63 </div></dd><dt><span class="term">timer events</span></dt><dd><a id="idm47951460107504" class="indexterm"></a><a id="idm47951460096144" class="indexterm"></a><div class="para"> 67 </div></dd><dt><span class="term">timer events</span></dt><dd><a id="idm214016706512" class="indexterm"></a><a id="idm214016707152" class="indexterm"></a><div class="para">
64 An event that specifies a handler to be executed periodically. For example: 68 An event that specifies a handler to be executed periodically. For example:
65 </div><div class="example"><a id="timer"></a><p class="title"><strong>Example 3.3. timer-s.stp</strong></p><div class="example-contents"><pre class="programlisting">probe timer.s(4) 69 </div><div class="example"><a id="timer">
70 ⁠</a><p class="title"><strong>Example 3.3. timer-s.stp</strong></p><div class="example-contents"><pre class="programlisting">probe timer.s(4)
66{ 71{
67 printf("hello world\n") 72 printf("hello world\n")
68}</pre></div></div><br class="example-break" /><div class="para"> 73}</pre></div></div><div class="para">
69 <a class="xref" href="scripts.html#timer">Example 3.3, “timer-s.stp”</a> is an example of a probe that prints <code class="command">hello world</code> every 4 seconds. It is also possible to use the following timer events: 74 <a class="xref" href="scripts.html#timer">Example 3.3, “timer-s.stp”</a> is an example of a probe that prints <code class="command">hello world</code> every 4 seconds. It is also possible to use the following timer events:
70 </div><div xmlns:d="http://docbook.org/ns/docbook" class="itemizedlist"><ul><li class="listitem"><div class="para"> 75 </div><div xmlns:d="http://docbook.org/ns/docbook" class="itemizedlist"><ul><li class="listitem"><div class="para">
71 <code class="command">timer.ms(<em class="replaceable"><code>milliseconds</code></em>)</code> 76 <code class="command">timer.ms(<em class="replaceable">milliseconds</em>)</code>
72 </div></li><li class="listitem"><div class="para"> 77 </div></li><li class="listitem"><div class="para">
73 <code class="command">timer.us(<em class="replaceable"><code>microseconds</code></em>)</code> 78 <code class="command">timer.us(<em class="replaceable">microseconds</em>)</code>
74 </div></li><li class="listitem"><div class="para"> 79 </div></li><li class="listitem"><div class="para">
75 <code class="command">timer.ns(<em class="replaceable"><code>nanoseconds</code></em>)</code> 80 <code class="command">timer.ns(<em class="replaceable">nanoseconds</em>)</code>
76 </div></li><li class="listitem"><div class="para"> 81 </div></li><li class="listitem"><div class="para">
77 <code class="command">timer.hz(<em class="replaceable"><code>hertz</code></em>)</code> 82 <code class="command">timer.hz(<em class="replaceable">hertz</em>)</code>
78 </div></li><li class="listitem"><div class="para"> 83 </div></li><li class="listitem"><div class="para">
79 <code class="command">timer.jiffies(<em class="replaceable"><code>jiffies</code></em>)</code> 84 <code class="command">timer.jiffies(<em class="replaceable">jiffies</em>)</code>
80 </div></li></ul></div><div class="para"> 85 </div></li></ul></div><div class="para">
81 When used in conjunction with other probes that collect information, timer events allows you to print out get periodic updates and see how that information changes over time. 86 When used in conjunction with other probes that collect information, timer events allows you to print out get periodic updates and see how that information changes over time.
82 </div></dd></dl></div><div xmlns:d="http://docbook.org/ns/docbook" class="important"><div class="admonition_header"><p><strong>Important</strong></p></div><div class="admonition"><div class="para"> 87 </div></dd></dl></div><div xmlns:d="http://docbook.org/ns/docbook" class="important"><div class="admonition_header"><p><strong>Important</strong></p></div><div class="admonition"><div class="para">
diff --git a/SystemTap_Beginners_Guide/syscallsbyprocpidsect.html b/SystemTap_Beginners_Guide/syscallsbyprocpidsect.html
index 8a70d3d9..b7ac416e 100644
--- a/SystemTap_Beginners_Guide/syscallsbyprocpidsect.html
+++ b/SystemTap_Beginners_Guide/syscallsbyprocpidsect.html
@@ -1,7 +1,8 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">5.3.6. Tracking System Call Volume Per Process</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="mainsect-profiling.html" title="5.3. Profiling" /><link rel="prev" href="topsyssect.html" title="5.3.5. Tracking Most Frequently Used System Calls" /><link rel="next" href="futexcontentionsect.html" title="5.4. Identifying Contended User-Space Locks" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="topsyssect.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="futexcontentionsect.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="syscallsbyprocpidsect"></a>5.3.6. Tracking System Call Volume Per Process</h3></div></div></div><a id="idm47951476477984" class="indexterm"></a><a id="idm47951460891472" class="indexterm"></a><a id="idm47951424527632" class="indexterm"></a><a id="idm47951464380944" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">5.3.6. Tracking System Call Volume Per Process</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="mainsect-profiling.html" title="5.3. Profiling" /><link rel="prev" href="topsyssect.html" title="5.3.5. Tracking Most Frequently Used System Calls" /><link rel="next" href="futexcontentionsect.html" title="5.4. Identifying Contended User-Space Locks" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="topsyssect.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="futexcontentionsect.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="syscallsbyprocpidsect">
3 ⁠</a>5.3.6. Tracking System Call Volume Per Process</h3></div></div></div><a id="idm214016601984" class="indexterm"></a><a id="idm213973445568" class="indexterm"></a><a id="idm214026258400" class="indexterm"></a><a id="idm214008279968" class="indexterm"></a><div class="para">
3 This section illustrates how to determine which processes are performing the highest volume of system calls. In previous sections, we've described how to monitor the top system calls used by the system over time (<a class="xref" href="topsyssect.html">Section 5.3.5, “Tracking Most Frequently Used System Calls”</a>). We've also described how to identify which applications use a specific set of "polling suspect" system calls the most (<a class="xref" href="timeoutssect.html">Section 5.3.4, “Monitoring Polling Applications”</a>). Monitoring the volume of system calls made by each process provides more data in investigating your system for polling processes and other resource hogs. 4 This section illustrates how to determine which processes are performing the highest volume of system calls. In previous sections, we've described how to monitor the top system calls used by the system over time (<a class="xref" href="topsyssect.html">Section 5.3.5, “Tracking Most Frequently Used System Calls”</a>). We've also described how to identify which applications use a specific set of "polling suspect" system calls the most (<a class="xref" href="timeoutssect.html">Section 5.3.4, “Monitoring Polling Applications”</a>). Monitoring the volume of system calls made by each process provides more data in investigating your system for polling processes and other resource hogs.
4 </div><div class="formalpara"><div xmlns:d="http://docbook.org/ns/docbook" class="title">syscalls_by_proc.stp</div> 5 </div><div class="para"><div xmlns:d="http://docbook.org/ns/docbook" class="title">syscalls_by_proc.stp</div>
5 6
6<pre class="programlisting">#! /usr/bin/env stap 7<pre class="programlisting">#! /usr/bin/env stap
7 8
@@ -22,7 +23,7 @@ probe begin {
22 print ("Collecting data... Type Ctrl-C to exit and display results\n") 23 print ("Collecting data... Type Ctrl-C to exit and display results\n")
23} 24}
24 25
25probe syscall.* { 26probe nd_syscall.* {
26 syscalls[execname()]++ 27 syscalls[execname()]++
27} 28}
28 29
@@ -34,7 +35,8 @@ probe end {
34</pre> 35</pre>
35 </div><div class="para"> 36 </div><div class="para">
36 <a class="xref" href="syscallsbyprocpidsect.html#syscallsbyprocpid">syscalls_by_proc.stp</a> lists the top 20 processes performing the highest number of system calls. It also lists how many system calls each process performed during the time period. Refer to <a class="xref" href="syscallsbyprocpidsect.html#syscallsbyprocpidoutput">Example 5.18, “topsys.stp Sample Output”</a> for a sample output. 37 <a class="xref" href="syscallsbyprocpidsect.html#syscallsbyprocpid">syscalls_by_proc.stp</a> lists the top 20 processes performing the highest number of system calls. It also lists how many system calls each process performed during the time period. Refer to <a class="xref" href="syscallsbyprocpidsect.html#syscallsbyprocpidoutput">Example 5.18, “topsys.stp Sample Output”</a> for a sample output.
37 </div><div class="example"><a id="syscallsbyprocpidoutput"></a><p class="title"><strong>Example 5.18. <a class="xref" href="topsyssect.html#topsys">topsys.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen">Collecting data... Type Ctrl-C to exit and display results 38 </div><div class="example"><a id="syscallsbyprocpidoutput">
39 ⁠</a><p class="title"><strong>Example 5.18. <a class="xref" href="topsyssect.html#topsys">topsys.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen">Collecting data... Type Ctrl-C to exit and display results
38#SysCalls Process Name 40#SysCalls Process Name
391577 multiload-apple 411577 multiload-apple
40692 synergyc 42692 synergyc
@@ -49,9 +51,9 @@ probe end {
4984 scim-bridge 5184 scim-bridge
5078 gnome-screensav 5278 gnome-screensav
5166 scim-launcher 5366 scim-launcher
52[...]</pre></div></div><br class="example-break" /><div class="para"> 54[...]</pre></div></div><div class="para">
53 To display the process IDs instead of the process names, use the following script instead. 55 To display the process IDs instead of the process names, use the following script instead.
54 </div><div class="formalpara"><div xmlns:d="http://docbook.org/ns/docbook" class="title">syscalls_by_pid.stp</div> 56 </div><div class="para"><div xmlns:d="http://docbook.org/ns/docbook" class="title">syscalls_by_pid.stp</div>
55 57
56<pre class="programlisting">#! /usr/bin/env stap 58<pre class="programlisting">#! /usr/bin/env stap
57 59
@@ -72,7 +74,7 @@ probe begin {
72 print ("Collecting data... Type Ctrl-C to exit and display results\n") 74 print ("Collecting data... Type Ctrl-C to exit and display results\n")
73} 75}
74 76
75probe syscall.* { 77probe nd_syscall.* {
76 syscalls[pid()]++ 78 syscalls[pid()]++
77} 79}
78 80
diff --git a/SystemTap_Beginners_Guide/systemtapscript-handler.html b/SystemTap_Beginners_Guide/systemtapscript-handler.html
index 786a523b..dc08255f 100644
--- a/SystemTap_Beginners_Guide/systemtapscript-handler.html
+++ b/SystemTap_Beginners_Guide/systemtapscript-handler.html
@@ -1,29 +1,32 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.2.2. SystemTap Handler/Body</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="scripts.html" title="3.2. SystemTap Scripts" /><link rel="prev" href="scripts.html" title="3.2. SystemTap Scripts" /><link rel="next" href="scriptconstructions.html" title="3.3. Basic SystemTap Handler Constructs" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="scripts.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="scriptconstructions.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="systemtapscript-handler"></a>3.2.2. SystemTap Handler/Body</h3></div></div></div><a id="idm47951416175824" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.2.2. SystemTap Handler/Body</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="scripts.html" title="3.2. SystemTap Scripts" /><link rel="prev" href="scripts.html" title="3.2. SystemTap Scripts" /><link rel="next" href="scriptconstructions.html" title="3.3. Basic SystemTap Handler Constructs" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="scripts.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="scriptconstructions.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="systemtapscript-handler">
3 ⁠</a>3.2.2. SystemTap Handler/Body</h3></div></div></div><a id="idm214016995328" class="indexterm"></a><div class="para">
3 Consider the following sample script: 4 Consider the following sample script:
4 </div><div class="example"><a id="helloworld"></a><p class="title"><strong>Example 3.4. helloworld.stp</strong></p><div class="example-contents"><pre class="programlisting">probe begin 5 </div><div class="example"><a id="helloworld">
6 ⁠</a><p class="title"><strong>Example 3.4. helloworld.stp</strong></p><div class="example-contents"><pre class="programlisting">probe begin
5{ 7{
6 printf ("hello world\n") 8 printf ("hello world\n")
7 exit () 9 exit ()
8}</pre></div></div><br class="example-break" /><div class="para"> 10}</pre></div></div><div class="para">
9 In <a class="xref" href="systemtapscript-handler.html#helloworld">Example 3.4, “helloworld.stp”</a>, the event <code class="command">begin</code> (that is, the start of the session) triggers the handler enclosed in <code class="command">{ }</code>, which simply prints <code class="command">hello world</code> followed by a new-line, then exits. 11 In <a class="xref" href="systemtapscript-handler.html#helloworld">Example 3.4, “helloworld.stp”</a>, the event <code class="command">begin</code> (that is, the start of the session) triggers the handler enclosed in <code class="command">{ }</code>, which simply prints <code class="command">hello world</code> followed by a new-line, then exits.
10 </div><div xmlns:d="http://docbook.org/ns/docbook" class="note"><div class="admonition_header"><p><strong>Note</strong></p></div><div class="admonition"><a id="idm47951460077520" class="indexterm"></a><a id="idm47951460026480" class="indexterm"></a><div class="para"> 12 </div><div xmlns:d="http://docbook.org/ns/docbook" class="note"><div class="admonition_header"><p><strong>Note</strong></p></div><div class="admonition"><a id="idm214017002832" class="indexterm"></a><a id="idm214017004080" class="indexterm"></a><div class="para">
11 SystemTap scripts continue to run until the <code class="command">exit()</code> function executes. If the users wants to stop the execution of the script, it can interrupted manually with <span class="keycap"><strong>Ctrl</strong></span>+<span class="keycap"><strong>C</strong></span>. 13 SystemTap scripts continue to run until the <code class="command">exit()</code> function executes. If the users wants to stop the execution of the script, it can interrupted manually with <span class="keycap"><strong>Ctrl</strong></span>+<span class="keycap"><strong>C</strong></span>.
12 </div></div></div><div class="formalpara"><div xmlns:d="http://docbook.org/ns/docbook" class="title">printf ( ) Statements</div><a id="idm47951460002912" class="indexterm"></a> 14 </div></div></div><div class="para"><div xmlns:d="http://docbook.org/ns/docbook" class="title">printf ( ) Statements</div><a id="idm214017009104" class="indexterm"></a>
13 The <code class="command">printf ()</code> statement is one of the simplest functions for printing data. <code class="command">printf ()</code> can also be used to display data using a wide variety of SystemTap functions in the following format: 15 The <code class="command">printf ()</code> statement is one of the simplest functions for printing data. <code class="command">printf ()</code> can also be used to display data using a wide variety of SystemTap functions in the following format:
14 </div><pre class="programlisting"> printf ("<em class="replaceable"><code>format string</code></em>\n", <em class="replaceable"><code>arguments</code></em>) 16 </div><pre class="programlisting"> printf ("<em class="replaceable">format string</em>\n", <em class="replaceable">arguments</em>)
15</pre><a id="idm47951460054160" class="indexterm"></a><a id="idm47951456716944" class="indexterm"></a><div class="para"> 17</pre><a id="idm214017013296" class="indexterm"></a><a id="idm214017015024" class="indexterm"></a><div class="para">
16 The <em class="replaceable"><code>format string</code></em> specifies how <em class="replaceable"><code>arguments</code></em> should be printed. The format string of <a class="xref" href="systemtapscript-handler.html#helloworld">Example 3.4, “helloworld.stp”</a> instructs SystemTap to print <code class="command">hello world</code>, and contains no format specifiers. 18 The <em class="replaceable">format string</em> specifies how <em class="replaceable">arguments</em> should be printed. The format string of <a class="xref" href="systemtapscript-handler.html#helloworld">Example 3.4, “helloworld.stp”</a> instructs SystemTap to print <code class="command">hello world</code>, and contains no format specifiers.
17 </div><a id="idm47951420982928" class="indexterm"></a><a id="idm47951460112560" class="indexterm"></a><div class="para"> 19 </div><a id="idm214017018768" class="indexterm"></a><a id="idm214017020496" class="indexterm"></a><div class="para">
18 You can use the format specifiers <code class="command">%s</code> (for strings) and <code class="command">%d</code> (for numbers) in format strings, depending on your list of arguments. Format strings can have multiple format specifiers, each matching a corresponding argument; multiple arguments are delimited by a comma (<code class="command">,</code>). 20 You can use the format specifiers <code class="command">%s</code> (for strings) and <code class="command">%d</code> (for numbers) in format strings, depending on your list of arguments. Format strings can have multiple format specifiers, each matching a corresponding argument; multiple arguments are delimited by a comma (<code class="command">,</code>).
19 </div><div xmlns:d="http://docbook.org/ns/docbook" class="note"><div class="admonition_header"><p><strong>Note</strong></p></div><div class="admonition"><a id="idm47951427783088" class="indexterm"></a><a id="idm47951424915024" class="indexterm"></a><a id="idm47951460666464" class="indexterm"></a><div class="para"> 21 </div><div xmlns:d="http://docbook.org/ns/docbook" class="note"><div class="admonition_header"><p><strong>Note</strong></p></div><div class="admonition"><a id="idm214017024944" class="indexterm"></a><a id="idm214017027376" class="indexterm"></a><a id="idm214017029024" class="indexterm"></a><div class="para">
20 Semantically, the SystemTap <code class="command">printf</code> function is very similar to its C language counterpart. The aforementioned syntax and format for SystemTap's <code class="command">printf</code> function is identical to that of the C-style <code class="command">printf</code>. 22 Semantically, the SystemTap <code class="command">printf</code> function is very similar to its C language counterpart. The aforementioned syntax and format for SystemTap's <code class="command">printf</code> function is identical to that of the C-style <code class="command">printf</code>.
21 </div></div></div><div class="para"> 23 </div></div></div><div class="para">
22 To illustrate this, consider the following probe example: 24 To illustrate this, consider the following probe example:
23 </div><div class="example"><a id="syscall-open"></a><p class="title"><strong>Example 3.5. variables-in-printf-statements.stp</strong></p><div class="example-contents"><pre class="programlisting">probe syscall.open 25 </div><div class="example"><a id="syscall-open">
26 ⁠</a><p class="title"><strong>Example 3.5. variables-in-printf-statements.stp</strong></p><div class="example-contents"><pre class="programlisting">probe syscall.open
24{ 27{
25 printf ("%s(%d) open\n", execname(), pid()) 28 printf ("%s(%d) open\n", execname(), pid())
26}</pre></div></div><br class="example-break" /><div class="para"> 29}</pre></div></div><div class="para">
27 <a class="xref" href="systemtapscript-handler.html#syscall-open">Example 3.5, “variables-in-printf-statements.stp”</a> instructs SystemTap to probe all entries to the system call <code class="command">open</code>; for each event, it prints the current <code class="command">execname()</code> (a string with the executable name) and <code class="command">pid()</code> (the current process ID number), followed by the word <code class="command">open</code>. A snippet of this probe's output would look like: 30 <a class="xref" href="systemtapscript-handler.html#syscall-open">Example 3.5, “variables-in-printf-statements.stp”</a> instructs SystemTap to probe all entries to the system call <code class="command">open</code>; for each event, it prints the current <code class="command">execname()</code> (a string with the executable name) and <code class="command">pid()</code> (the current process ID number), followed by the word <code class="command">open</code>. A snippet of this probe's output would look like:
28 </div><pre class="screen">vmware-guestd(2206) open 31 </div><pre class="screen">vmware-guestd(2206) open
29hald(2360) open 32hald(2360) open
@@ -32,23 +35,23 @@ hald(2360) open
32df(3433) open 35df(3433) open
33df(3433) open 36df(3433) open
34df(3433) open 37df(3433) open
35hald(2360) open</pre><div class="formalpara"><div xmlns:d="http://docbook.org/ns/docbook" class="title">SystemTap Functions</div><a id="idm47951475207616" class="indexterm"></a><a id="idm47951476058800" class="indexterm"></a><a id="idm47951460918304" class="indexterm"></a> 38hald(2360) open</pre><div class="para"><div xmlns:d="http://docbook.org/ns/docbook" class="title">SystemTap Functions</div><a id="idm214015914016" class="indexterm"></a><a id="idm214015914352" class="indexterm"></a><a id="idm214015915472" class="indexterm"></a>
36 SystemTap supports a wide variety of functions that can be used as <code class="command">printf ()</code> arguments. <a class="xref" href="systemtapscript-handler.html#syscall-open">Example 3.5, “variables-in-printf-statements.stp”</a> uses the SystemTap functions <code class="command">execname()</code> (name of the process that called a kernel function/performed a system call) and <code class="command">pid()</code> (current process ID). 39 SystemTap supports a wide variety of functions that can be used as <code class="command">printf ()</code> arguments. <a class="xref" href="systemtapscript-handler.html#syscall-open">Example 3.5, “variables-in-printf-statements.stp”</a> uses the SystemTap functions <code class="command">execname()</code> (name of the process that called a kernel function/performed a system call) and <code class="command">pid()</code> (current process ID).
37 </div><div class="para"> 40 </div><div class="para">
38 The following is a list of commonly-used SystemTap functions: 41 The following is a list of commonly-used SystemTap functions:
39 </div><div class="variablelist"><dl class="variablelist"><dt><span class="term">tid()</span></dt><dd><a id="idm47951460075952" class="indexterm"></a><a id="idm47951416155168" class="indexterm"></a><a id="idm47951464471440" class="indexterm"></a><div class="para"> 42 </div><div class="variablelist"><dl class="variablelist"><dt><span class="term">tid()</span></dt><dd><a id="idm214015923152" class="indexterm"></a><a id="idm214015922672" class="indexterm"></a><a id="idm214015924096" class="indexterm"></a><div class="para">
40 The ID of the current thread. 43 The ID of the current thread.
41 </div></dd><dt><span class="term">uid()</span></dt><dd><a id="idm47951456376160" class="indexterm"></a><a id="idm47951455971456" class="indexterm"></a><div class="para"> 44 </div></dd><dt><span class="term">uid()</span></dt><dd><a id="idm214015927584" class="indexterm"></a><a id="idm214015929584" class="indexterm"></a><div class="para">
42 The ID of the current user. 45 The ID of the current user.
43 </div></dd><dt><span class="term">cpu()</span></dt><dd><a id="idm47951454917504" class="indexterm"></a><a id="idm47951416421200" class="indexterm"></a><div class="para"> 46 </div></dd><dt><span class="term">cpu()</span></dt><dd><a id="idm214015934064" class="indexterm"></a><a id="idm214015934720" class="indexterm"></a><div class="para">
44 The current CPU number. 47 The current CPU number.
45 </div></dd><dt><span class="term">gettimeofday_s()</span></dt><dd><a id="idm47951468265792" class="indexterm"></a><a id="idm47951455966704" class="indexterm"></a><div class="para"> 48 </div></dd><dt><span class="term">gettimeofday_s()</span></dt><dd><a id="idm214015938496" class="indexterm"></a><a id="idm214015940256" class="indexterm"></a><div class="para">
46 The number of seconds since UNIX epoch (January 1, 1970). 49 The number of seconds since UNIX epoch (January 1, 1970).
47 </div></dd><dt><span class="term">ctime()</span></dt><dd><a id="idm47951457249936" class="indexterm"></a><a id="idm47951456710960" class="indexterm"></a><div class="para"> 50 </div></dd><dt><span class="term">ctime()</span></dt><dd><a id="idm214015943648" class="indexterm"></a><a id="idm214015945264" class="indexterm"></a><div class="para">
48 Convert number of seconds since UNIX epoch to date. 51 Convert number of seconds since UNIX epoch to date.
49 </div></dd><dt><span class="term">pp()</span></dt><dd><a id="idm47951455600528" class="indexterm"></a><a id="idm47951474873088" class="indexterm"></a><div class="para"> 52 </div></dd><dt><span class="term">pp()</span></dt><dd><a id="idm214015949952" class="indexterm"></a><a id="idm214015951744" class="indexterm"></a><div class="para">
50 A string describing the probe point currently being handled. 53 A string describing the probe point currently being handled.
51 </div></dd><dt><span class="term">thread_indent()</span></dt><dd><a id="idm47951457294112" class="indexterm"></a><a id="idm47951459695280" class="indexterm"></a><div class="para"> 54 </div></dd><dt><span class="term">thread_indent()</span></dt><dd><a id="idm214015956176" class="indexterm"></a><a id="idm214015958128" class="indexterm"></a><div class="para">
52 This particular function is quite useful in providing you with a way to better organize your print results. The function takes one argument, an indentation delta, which indicates how many spaces to add or remove from a thread's "indentation counter". It then returns a string with some generic trace data along with an appropriate number of indentation spaces. 55 This particular function is quite useful in providing you with a way to better organize your print results. The function takes one argument, an indentation delta, which indicates how many spaces to add or remove from a thread's "indentation counter". It then returns a string with some generic trace data along with an appropriate number of indentation spaces.
53 </div><div class="para"> 56 </div><div class="para">
54 The generic data included in the returned string includes a timestamp (number of microseconds since the first call to <code class="command">thread_indent()</code> by the thread), a process name, and the thread ID. This allows you to identify what functions were called, who called them, and the duration of each function call. 57 The generic data included in the returned string includes a timestamp (number of microseconds since the first call to <code class="command">thread_indent()</code> by the thread), a process name, and the thread ID. This allows you to identify what functions were called, who called them, and the duration of each function call.
@@ -56,14 +59,15 @@ hald(2360) open</pre><div class="formalpara"><div xmlns:d="http://docbook.org/ns
56 If call entries and exits immediately precede each other, it is easy to match them. However, in most cases, after a first function call entry is made several other call entries and exits may be made before the first call exits. The indentation counter helps you match an entry with its corresponding exit by indenting the next function call if it is not the exit of the previous one. 59 If call entries and exits immediately precede each other, it is easy to match them. However, in most cases, after a first function call entry is made several other call entries and exits may be made before the first call exits. The indentation counter helps you match an entry with its corresponding exit by indenting the next function call if it is not the exit of the previous one.
57 </div><div class="para"> 60 </div><div class="para">
58 Consider the following example on the use of <code class="command">thread_indent()</code>: 61 Consider the following example on the use of <code class="command">thread_indent()</code>:
59 </div><div class="example"><a id="thread_indent"></a><p class="title"><strong>Example 3.6. thread_indent.stp</strong></p><div class="example-contents"><pre class="programlisting">probe kernel.function("*@net/socket.c").call 62 </div><div class="example"><a id="thread_indent">
63 ⁠</a><p class="title"><strong>Example 3.6. thread_indent.stp</strong></p><div class="example-contents"><pre class="programlisting">probe kernel.function("*@net/socket.c").call
60{ 64{
61 printf ("%s -&gt; %s\n", thread_indent(1), probefunc()) 65 printf ("%s -&gt; %s\n", thread_indent(1), probefunc())
62} 66}
63probe kernel.function("*@net/socket.c").return 67probe kernel.function("*@net/socket.c").return
64{ 68{
65 printf ("%s &lt;- %s\n", thread_indent(-1), probefunc()) 69 printf ("%s &lt;- %s\n", thread_indent(-1), probefunc())
66}</pre></div></div><br class="example-break" /><div class="para"> 70}</pre></div></div><div class="para">
67 <a class="xref" href="systemtapscript-handler.html#thread_indent">Example 3.6, “thread_indent.stp”</a> prints out the <code class="command">thread_indent()</code> and probe functions at each event in the following format: 71 <a class="xref" href="systemtapscript-handler.html#thread_indent">Example 3.6, “thread_indent.stp”</a> prints out the <code class="command">thread_indent()</code> and probe functions at each event in the following format:
68 </div><pre class="screen">0 ftp(7223): -&gt; sys_socketcall 72 </div><pre class="screen">0 ftp(7223): -&gt; sys_socketcall
691159 ftp(7223): -&gt; sys_socket 731159 ftp(7223): -&gt; sys_socket
@@ -90,17 +94,18 @@ probe kernel.function("*@net/socket.c").return
90 An arrow signifying whether the call was an entry (<code class="computeroutput">&lt;-</code>) or an exit (<code class="computeroutput">-&gt;</code>); the indentations help you match specific function call entries with their corresponding exits. 94 An arrow signifying whether the call was an entry (<code class="computeroutput">&lt;-</code>) or an exit (<code class="computeroutput">-&gt;</code>); the indentations help you match specific function call entries with their corresponding exits.
91 </div></li><li class="listitem"><div class="para"> 95 </div></li><li class="listitem"><div class="para">
92 The name of the function called by the process. 96 The name of the function called by the process.
93 </div></li></ul></div></dd><dt><span class="term">name</span></dt><dd><a id="idm47951469497712" class="indexterm"></a><a id="idm47951463619424" class="indexterm"></a><a id="idm47951457413824" class="indexterm"></a><div class="para"> 97 </div></li></ul></div></dd><dt><span class="term">name</span></dt><dd><a id="idm213974334768" class="indexterm"></a><a id="idm213974335744" class="indexterm"></a><a id="idm213974337120" class="indexterm"></a><div class="para">
94 Identifies the name of a specific system call. This variable can only be used in probes that use the event <code class="command">syscall.<em class="replaceable"><code>system_call</code></em></code>. 98 Identifies the name of a specific system call. This variable can only be used in probes that use the event <code class="command">syscall.<em class="replaceable">system_call</em></code>.
95 </div></dd><dt><span class="term">target()</span></dt><dd><a id="idm47951468962592" class="indexterm"></a><a id="idm47951459764016" class="indexterm"></a><div class="para"> 99 </div></dd><dt><span class="term">target()</span></dt><dd><a id="idm213974341248" class="indexterm"></a><a id="idm214011624928" class="indexterm"></a><div class="para">
96 Used in conjunction with <code class="command">stap <em class="replaceable"><code>script</code></em> -x <em class="replaceable"><code>process ID</code></em></code> or <code class="command">stap <em class="replaceable"><code>script</code></em> -c <em class="replaceable"><code>command</code></em></code>. If you want to specify a script to take an argument of a process ID or command, use <code class="command">target()</code> as the variable in the script to refer to it. For example: 100 Used in conjunction with <code class="command">stap <em class="replaceable">script</em> -x <em class="replaceable">process ID</em></code> or <code class="command">stap <em class="replaceable">script</em> -c <em class="replaceable">command</em></code>. If you want to specify a script to take an argument of a process ID or command, use <code class="command">target()</code> as the variable in the script to refer to it. For example:
97 </div><div class="example"><a id="targetexample"></a><p class="title"><strong>Example 3.7. targetexample.stp</strong></p><div class="example-contents"><pre class="programlisting">probe syscall.* { 101 </div><div class="example"><a id="targetexample">
102 ⁠</a><p class="title"><strong>Example 3.7. targetexample.stp</strong></p><div class="example-contents"><pre class="programlisting">probe syscall.* {
98 if (pid() == target()) 103 if (pid() == target())
99 printf("%s\n", name) 104 printf("%s\n", name)
100}</pre></div></div><br class="example-break" /><div class="para"> 105}</pre></div></div><div class="para">
101 When <a class="xref" href="systemtapscript-handler.html#targetexample">Example 3.7, “targetexample.stp”</a> is run with the argument <code class="command">-x <em class="replaceable"><code>process ID</code></em></code>, it watches all system calls (as specified by the event <code class="command">syscall.*</code>) and prints out the name of all system calls made by the specified process. 106 When <a class="xref" href="systemtapscript-handler.html#targetexample">Example 3.7, “targetexample.stp”</a> is run with the argument <code class="command">-x <em class="replaceable">process ID</em></code>, it watches all system calls (as specified by the event <code class="command">syscall.*</code>) and prints out the name of all system calls made by the specified process.
102 </div><div class="para"> 107 </div><div class="para">
103 This has the same effect as specifying <code class="command">if (pid() == <em class="replaceable"><code>process ID</code></em>)</code> each time you wish to target a specific process. However, using <code class="command">target()</code> makes it easier for you to re-use the script, giving you the ability to pass a process ID as an argument each time you wish to run the script (that is, <code class="command">stap targetexample.stp -x <em class="replaceable"><code>process ID</code></em></code>). 108 This has the same effect as specifying <code class="command">if (pid() == <em class="replaceable">process ID</em>)</code> each time you wish to target a specific process. However, using <code class="command">target()</code> makes it easier for you to re-use the script, giving you the ability to pass a process ID as an argument each time you wish to run the script (that is, <code class="command">stap targetexample.stp -x <em class="replaceable">process ID</em></code>).
104 </div></dd></dl></div><div class="para"> 109 </div></dd></dl></div><div class="para">
105 For more information about supported SystemTap functions, refer to <code class="command">man stapfuncs</code>. 110 For more information about supported SystemTap functions, refer to <code class="command">man stapfuncs</code>.
106 </div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="scripts.html"><strong>Prev</strong>3.2. SystemTap Scripts</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="scriptconstructions.html"><strong>Next</strong>3.3. Basic SystemTap Handler Constructs</a></li></ul></body></html> \ No newline at end of file 111 </div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="scripts.html"><strong>Prev</strong>3.2. SystemTap Scripts</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="scriptconstructions.html"><strong>Next</strong>3.3. Basic SystemTap Handler Constructs</a></li></ul></body></html> \ No newline at end of file
diff --git a/SystemTap_Beginners_Guide/targetavailable.html b/SystemTap_Beginners_Guide/targetavailable.html
index 048b90ed..feb30eee 100644
--- a/SystemTap_Beginners_Guide/targetavailable.html
+++ b/SystemTap_Beginners_Guide/targetavailable.html
@@ -1,9 +1,11 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.3.2.3. Checking Target Variable Availability</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="targetvariables.html" title="3.3.2. Target Variables" /><link rel="prev" href="typecasting.html" title="3.3.2.2. Typecasting" /><link rel="next" href="handlerconditionalstatements.html" title="3.3.3. Conditional Statements" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="typecasting.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="handlerconditionalstatements.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="targetavailable"></a>3.3.2.3. Checking Target Variable Availability</h4></div></div></div><a id="idm47951457116368" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.3.2.3. Checking Target Variable Availability</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="targetvariables.html" title="3.3.2. Target Variables" /><link rel="prev" href="typecasting.html" title="3.3.2.2. Typecasting" /><link rel="next" href="handlerconditionalstatements.html" title="3.3.3. Conditional Statements" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="typecasting.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="handlerconditionalstatements.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="targetavailable">
3 ⁠</a>3.3.2.3. Checking Target Variable Availability</h4></div></div></div><a id="idm214014537984" class="indexterm"></a><div class="para">
3 As code evolves the target variables available may change. The <code class="command">@defined</code> makes it easier to handle those variations in the available target variables. The <code class="command">@defined</code> provides a test to see if a particular target variable is available. The result of this test can be used to select the appropriate expression. 4 As code evolves the target variables available may change. The <code class="command">@defined</code> makes it easier to handle those variations in the available target variables. The <code class="command">@defined</code> provides a test to see if a particular target variable is available. The result of this test can be used to select the appropriate expression.
4 </div><div class="para"> 5 </div><div class="para">
5 The <a class="xref" href="targetavailable.html#available">Example 3.10, “Testing target variable available Example”</a> from the <code class="command">memory.stp</code> tapset provides an probe event alias. Some version of the kernel functions being probed have an argument <code class="command">$flags</code>. When available, the <code class="command">$flags</code> argument is used to generate the local variable <code class="command">write_access</code>. The versions of the probed functions that do not have the <code class="command">$flags</code> argument have a <code class="command">$write</code> argument and that is used instead for the local variable <code class="command">write_access</code>. 6 The <a class="xref" href="targetavailable.html#available">Example 3.10, “Testing target variable available Example”</a> from the <code class="command">memory.stp</code> tapset provides an probe event alias. Some version of the kernel functions being probed have an argument <code class="command">$flags</code>. When available, the <code class="command">$flags</code> argument is used to generate the local variable <code class="command">write_access</code>. The versions of the probed functions that do not have the <code class="command">$flags</code> argument have a <code class="command">$write</code> argument and that is used instead for the local variable <code class="command">write_access</code>.
6 </div><div class="example"><a id="available"></a><p class="title"><strong>Example 3.10. Testing target variable available Example</strong></p><div class="example-contents"><pre class="programlisting">probe vm.pagefault = kernel.function("__handle_mm_fault@mm/memory.c") ?, 7 </div><div class="example"><a id="available">
8 ⁠</a><p class="title"><strong>Example 3.10. Testing target variable available Example</strong></p><div class="example-contents"><pre class="programlisting">probe vm.pagefault = kernel.function("__handle_mm_fault@mm/memory.c") ?,
7 kernel.function("handle_mm_fault@mm/memory.c") ? 9 kernel.function("handle_mm_fault@mm/memory.c") ?
8{ 10{
9 name = "pagefault" 11 name = "pagefault"
@@ -11,4 +13,4 @@
11 ? $flags &amp; FAULT_FLAG_WRITE : $write_access) 13 ? $flags &amp; FAULT_FLAG_WRITE : $write_access)
12 address = $address 14 address = $address
13} 15}
14</pre></div></div><br class="example-break" /></div><ul class="docnav"><li class="previous"><a accesskey="p" href="typecasting.html"><strong>Prev</strong>3.3.2.2. Typecasting</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="handlerconditionalstatements.html"><strong>Next</strong>3.3.3. Conditional Statements</a></li></ul></body></html> \ No newline at end of file 16</pre></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="typecasting.html"><strong>Prev</strong>3.3.2.2. Typecasting</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="handlerconditionalstatements.html"><strong>Next</strong>3.3.3. Conditional Statements</a></li></ul></body></html> \ No newline at end of file
diff --git a/SystemTap_Beginners_Guide/targetvariables.html b/SystemTap_Beginners_Guide/targetvariables.html
index f0d61bda..ff16815e 100644
--- a/SystemTap_Beginners_Guide/targetvariables.html
+++ b/SystemTap_Beginners_Guide/targetvariables.html
@@ -1,12 +1,13 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.3.2. Target Variables</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="scriptconstructions.html" title="3.3. Basic SystemTap Handler Constructs" /><link rel="prev" href="scriptconstructions.html" title="3.3. Basic SystemTap Handler Constructs" /><link rel="next" href="typecasting.html" title="3.3.2.2. Typecasting" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="scriptconstructions.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="typecasting.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="targetvariables"></a>3.3.2. Target Variables</h3></div></div></div><a id="idm47951454931216" class="indexterm"></a><a id="idm47951469594800" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.3.2. Target Variables</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="scriptconstructions.html" title="3.3. Basic SystemTap Handler Constructs" /><link rel="prev" href="scriptconstructions.html" title="3.3. Basic SystemTap Handler Constructs" /><link rel="next" href="typecasting.html" title="3.3.2.2. Typecasting" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="scriptconstructions.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="typecasting.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="targetvariables">
3 The probe events that map to actual locations in the code (for example <code class="command">kernel.function("<em class="replaceable"><code>function</code></em>")</code> and <code class="command">kernel.statement("<em class="replaceable"><code>statement</code></em>")</code>) allow the use of <span class="emphasis"><em>target variables</em></span> to obtain the value of variables visible at that location in the code. You can use the <code class="command">-L</code> option to list the target variable available at a probe point. If the debug information is installed for the running kernel, you can run the following command to find out what target variables are available for the <code class="command">vfs_read</code> function: 3 ⁠</a>3.3.2. Target Variables</h3></div></div></div><a id="idm214011621104" class="indexterm"></a><a id="idm214026509296" class="indexterm"></a><div class="para">
4 The probe events that map to actual locations in the code (for example <code class="command">kernel.function("<em class="replaceable">function</em>")</code> and <code class="command">kernel.statement("<em class="replaceable">statement</em>")</code>) allow the use of <span class="emphasis"><em>target variables</em></span> to obtain the value of variables visible at that location in the code. You can use the <code class="command">-L</code> option to list the target variable available at a probe point. If the debug information is installed for the running kernel, you can run the following command to find out what target variables are available for the <code class="command">vfs_read</code> function:
4 </div><pre class="screen">stap -L 'kernel.function("vfs_read")'</pre><div class="para"> 5 </div><pre class="screen">stap -L 'kernel.function("vfs_read")'</pre><div class="para">
5 This will yield something similar to the following: 6 This will yield something similar to the following:
6 </div><pre class="screen">kernel.function("vfs_read@fs/read_write.c:277") $file:struct file* $buf:char* $count:size_t $pos:loff_t*</pre><div class="para"> 7 </div><pre class="screen">kernel.function("vfs_read@fs/read_write.c:277") $file:struct file* $buf:char* $count:size_t $pos:loff_t*</pre><div class="para">
7 Each target variable is proceeded by a <span class="quote">“<span class="quote"><code class="command">$</code></span>”</span> and the type of the target variable follows the <span class="quote">“<span class="quote"><code class="command">:</code></span>”</span>. The kernel's <code class="command">vfs_read</code> function has <code class="command">$file</code> (pointer to structure describing the file), <code class="command">$buf</code> (pointer to the user-space memory to store the read data), <code class="command">$count</code> (number of bytes to read), and <code class="command">$pos</code> (position to start reading from in the file) target variables at the entry to the function. 8 Each target variable is proceeded by a <span class="quote">“<span class="quote"><code class="command">$</code></span>”</span> and the type of the target variable follows the <span class="quote">“<span class="quote"><code class="command">:</code></span>”</span>. The kernel's <code class="command">vfs_read</code> function has <code class="command">$file</code> (pointer to structure describing the file), <code class="command">$buf</code> (pointer to the user-space memory to store the read data), <code class="command">$count</code> (number of bytes to read), and <code class="command">$pos</code> (position to start reading from in the file) target variables at the entry to the function.
8 </div><div class="para"> 9 </div><div class="para">
9 When a target variable is not local to the probe point, like a global external variable or a file local static variable defined in another file then it can be referenced through <span class="quote">“<span class="quote"><code class="command">@var("<em class="replaceable"><code>varname</code></em>@<em class="replaceable"><code>src/file.c</code></em>")</code></span>”</span>. 10 When a target variable is not local to the probe point, like a global external variable or a file local static variable defined in another file then it can be referenced through <span class="quote">“<span class="quote"><code class="command">@var("<em class="replaceable">varname</em>@<em class="replaceable">src/file.c</em>")</code></span>”</span>.
10 </div><div class="para"> 11 </div><div class="para">
11 SystemTap tracks the typing information of the target variable and can examine the fields of a structure with the <code class="command">-&gt;</code> operator. The <code class="command">-&gt;</code> operator can be chained to look at data structures contained within data structures and follow pointers to other data structures. The <code class="command">-&gt;</code> operator will obtain the value in the field of the structure. The <code class="command">-&gt;</code> operator is used regardless whether accessing a field in a substructure or accessing another structure through a pointer. 12 SystemTap tracks the typing information of the target variable and can examine the fields of a structure with the <code class="command">-&gt;</code> operator. The <code class="command">-&gt;</code> operator can be chained to look at data structures contained within data structures and follow pointers to other data structures. The <code class="command">-&gt;</code> operator will obtain the value in the field of the structure. The <code class="command">-&gt;</code> operator is used regardless whether accessing a field in a substructure or accessing another structure through a pointer.
12 </div><div class="para"> 13 </div><div class="para">
@@ -22,19 +23,20 @@ stap -e 'probe kernel.function("vfs_read") {
22current files_stat max_files: 386070 23current files_stat max_files: 386070
23</pre><div class="para"> 24</pre><div class="para">
24 For pointers to base types such as integers and strings there are a number of functions listed below to access kernel-space data. The first argument for each functions is the pointer to the data item. Similar functions are described in <a class="xref" href="utargetvariable.html">Section 4.2, “Accessing User-Space Target Variables”</a> for accessing target variables in user-space code. 25 For pointers to base types such as integers and strings there are a number of functions listed below to access kernel-space data. The first argument for each functions is the pointer to the data item. Similar functions are described in <a class="xref" href="utargetvariable.html">Section 4.2, “Accessing User-Space Target Variables”</a> for accessing target variables in user-space code.
25 </div><div class="variablelist"><dl class="variablelist"><dt><span class="term">kernel_char(<em class="replaceable"><code>address</code></em>)</span></dt><dd><div class="para"> 26 </div><div class="variablelist"><dl class="variablelist"><dt><span class="term">kernel_char(<em class="replaceable">address</em>)</span></dt><dd><div class="para">
26 Obtain the character at <em class="replaceable"><code>address</code></em> from kernel memory. 27 Obtain the character at <em class="replaceable">address</em> from kernel memory.
27 </div></dd><dt><span class="term">kernel_short(<em class="replaceable"><code>address</code></em>)</span></dt><dd><div class="para"> 28 </div></dd><dt><span class="term">kernel_short(<em class="replaceable">address</em>)</span></dt><dd><div class="para">
28 Obtain the short at <em class="replaceable"><code>address</code></em> from kernel memory. 29 Obtain the short at <em class="replaceable">address</em> from kernel memory.
29 </div></dd><dt><span class="term">kernel_int(<em class="replaceable"><code>address</code></em>)</span></dt><dd><div class="para"> 30 </div></dd><dt><span class="term">kernel_int(<em class="replaceable">address</em>)</span></dt><dd><div class="para">
30 Obtain the int at <em class="replaceable"><code>address</code></em> from kernel memory. 31 Obtain the int at <em class="replaceable">address</em> from kernel memory.
31 </div></dd><dt><span class="term">kernel_long(<em class="replaceable"><code>address</code></em>)</span></dt><dd><div class="para"> 32 </div></dd><dt><span class="term">kernel_long(<em class="replaceable">address</em>)</span></dt><dd><div class="para">
32 Obtain the long at <em class="replaceable"><code>address</code></em> from kernel memory 33 Obtain the long at <em class="replaceable">address</em> from kernel memory
33 </div></dd><dt><span class="term">kernel_string(<em class="replaceable"><code>address</code></em>)</span></dt><dd><div class="para"> 34 </div></dd><dt><span class="term">kernel_string(<em class="replaceable">address</em>)</span></dt><dd><div class="para">
34 Obtain the string at <em class="replaceable"><code>address</code></em> from kernel memory. 35 Obtain the string at <em class="replaceable">address</em> from kernel memory.
35 </div></dd><dt><span class="term">kernel_string_n(<em class="replaceable"><code>address</code></em>, <em class="replaceable"><code>n</code></em>)</span></dt><dd><div class="para"> 36 </div></dd><dt><span class="term">kernel_string_n(<em class="replaceable">address</em>, <em class="replaceable">n</em>)</span></dt><dd><div class="para">
36 Obtain the string at <em class="replaceable"><code>address</code></em> from the kernel memory and limits the string to <em class="replaceable"><code>n</code></em> bytes. 37 Obtain the string at <em class="replaceable">address</em> from the kernel memory and limits the string to <em class="replaceable">n</em> bytes.
37 </div></dd></dl></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="targetprettyprinting"></a>3.3.2.1. Pretty Printing Target Variables</h4></div></div></div><a id="idm47951427939728" class="indexterm"></a><div class="para"> 38 </div></dd></dl></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="targetprettyprinting">
39 ⁠</a>3.3.2.1. Pretty Printing Target Variables</h4></div></div></div><a id="idm213967451808" class="indexterm"></a><div class="para">
38 SystemTap scripts are often used to observe what is happening within the code. In many cases just printing the values of the various context variables is sufficient. SystemTap makes a number operations available that can generate printable strings for target variables: 40 SystemTap scripts are often used to observe what is happening within the code. In many cases just printing the values of the various context variables is sufficient. SystemTap makes a number operations available that can generate printable strings for target variables:
39 </div><div class="variablelist"><dl class="variablelist"><dt><span class="term">$$vars</span></dt><dd><div class="para"> 41 </div><div class="variablelist"><dl class="variablelist"><dt><span class="term">$$vars</span></dt><dd><div class="para">
40 Expands to a character string that is equivalent to <code class="command">sprintf("parm1=%x ... parmN=%x var1=%x ... varN=%x", parm1, ..., parmN, var1, ..., varN)</code> for each variable in scope at the probe point. Some values may be printed as <span class="quote">“<span class="quote"><code class="command">=?</code></span>”</span> if their run-time location cannot be found. 42 Expands to a character string that is equivalent to <code class="command">sprintf("parm1=%x ... parmN=%x var1=%x ... varN=%x", parm1, ..., parmN, var1, ..., varN)</code> for each variable in scope at the probe point. Some values may be printed as <span class="quote">“<span class="quote"><code class="command">=?</code></span>”</span> if their run-time location cannot be found.
diff --git a/SystemTap_Beginners_Guide/threadtimessect.html b/SystemTap_Beginners_Guide/threadtimessect.html
index b126b3d4..ac9a09e5 100644
--- a/SystemTap_Beginners_Guide/threadtimessect.html
+++ b/SystemTap_Beginners_Guide/threadtimessect.html
@@ -1,7 +1,8 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">5.3.3. Determining Time Spent in Kernel and User Space</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="mainsect-profiling.html" title="5.3. Profiling" /><link rel="prev" href="paracallgraph.html" title="5.3.2. Call Graph Tracing" /><link rel="next" href="timeoutssect.html" title="5.3.4. Monitoring Polling Applications" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="paracallgraph.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="timeoutssect.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="threadtimessect"></a>5.3.3. Determining Time Spent in Kernel and User Space</h3></div></div></div><a id="idm47951471101200" class="indexterm"></a><a id="idm47951468549120" class="indexterm"></a><a id="idm47951469203024" class="indexterm"></a><a id="idm47951424834928" class="indexterm"></a><a id="idm47951457566992" class="indexterm"></a><a id="idm47951474822528" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">5.3.3. Determining Time Spent in Kernel and User Space</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="mainsect-profiling.html" title="5.3. Profiling" /><link rel="prev" href="paracallgraph.html" title="5.3.2. Call Graph Tracing" /><link rel="next" href="timeoutssect.html" title="5.3.4. Monitoring Polling Applications" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="paracallgraph.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="timeoutssect.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="threadtimessect">
3 ⁠</a>5.3.3. Determining Time Spent in Kernel and User Space</h3></div></div></div><a id="idm214010484672" class="indexterm"></a><a id="idm214009579664" class="indexterm"></a><a id="idm214007010976" class="indexterm"></a><a id="idm213974343744" class="indexterm"></a><a id="idm213974763824" class="indexterm"></a><a id="idm214021218032" class="indexterm"></a><div class="para">
3 This section illustrates how to determine the amount of time any given thread is spending in either kernel or user-space. 4 This section illustrates how to determine the amount of time any given thread is spending in either kernel or user-space.
4 </div><div class="formalpara"><div xmlns:d="http://docbook.org/ns/docbook" class="title">thread-times.stp</div> 5 </div><div class="para"><div xmlns:d="http://docbook.org/ns/docbook" class="title">thread-times.stp</div>
5 6
6<pre class="programlisting">#! /usr/bin/env stap 7<pre class="programlisting">#! /usr/bin/env stap
7 8
@@ -39,11 +40,12 @@ probe timer.s(5), end {
39 delete tids 40 delete tids
40} 41}
41</pre> 42</pre>
42 </div><a id="idm47951475561776" class="indexterm"></a><a id="idm47951457747312" class="indexterm"></a><a id="idm47951454728560" class="indexterm"></a><div class="para"> 43 </div><a id="idm214026296384" class="indexterm"></a><a id="idm214020868752" class="indexterm"></a><a id="idm213978659648" class="indexterm"></a><div class="para">
43 <a class="xref" href="threadtimessect.html#threadtimes">thread-times.stp</a> lists the top 20 processes currently taking up CPU time within a 5-second sample, along with the total number of CPU ticks made during the sample. The output of this script also notes the percentage of CPU time each process used, as well as whether that time was spent in kernel space or user space. 44 <a class="xref" href="threadtimessect.html#threadtimes">thread-times.stp</a> lists the top 20 processes currently taking up CPU time within a 5-second sample, along with the total number of CPU ticks made during the sample. The output of this script also notes the percentage of CPU time each process used, as well as whether that time was spent in kernel space or user space.
44 </div><div class="para"> 45 </div><div class="para">
45 <a class="xref" href="threadtimessect.html#threadtimesoutput">Example 5.15, “thread-times.stp Sample Output”</a> contains a 5-second sample of the output for <a class="xref" href="threadtimessect.html#threadtimes">thread-times.stp</a>: 46 <a class="xref" href="threadtimessect.html#threadtimesoutput">Example 5.15, “thread-times.stp Sample Output”</a> contains a 5-second sample of the output for <a class="xref" href="threadtimessect.html#threadtimes">thread-times.stp</a>:
46 </div><div class="example"><a id="threadtimesoutput"></a><p class="title"><strong>Example 5.15. <a class="xref" href="threadtimessect.html#threadtimes">thread-times.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen"> tid %user %kernel (of 20002 ticks) 47 </div><div class="example"><a id="threadtimesoutput">
48 ⁠</a><p class="title"><strong>Example 5.15. <a class="xref" href="threadtimessect.html#threadtimes">thread-times.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen"> tid %user %kernel (of 20002 ticks)
47 0 0.00% 87.88% 49 0 0.00% 87.88%
4832169 5.24% 0.03% 5032169 5.24% 0.03%
49 9815 3.33% 0.36% 51 9815 3.33% 0.36%
@@ -63,4 +65,4 @@ probe timer.s(5), end {
63 3883 0.00% 0.00% 65 3883 0.00% 0.00%
64 3775 0.00% 0.00% 66 3775 0.00% 0.00%
65 3943 0.00% 0.00% 67 3943 0.00% 0.00%
66 3873 0.00% 0.00%</pre></div></div><br class="example-break" /></div><ul class="docnav"><li class="previous"><a accesskey="p" href="paracallgraph.html"><strong>Prev</strong>5.3.2. Call Graph Tracing</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="timeoutssect.html"><strong>Next</strong>5.3.4. Monitoring Polling Applications</a></li></ul></body></html> \ No newline at end of file 68 3873 0.00% 0.00%</pre></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="paracallgraph.html"><strong>Prev</strong>5.3.2. Call Graph Tracing</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="timeoutssect.html"><strong>Next</strong>5.3.4. Monitoring Polling Applications</a></li></ul></body></html> \ No newline at end of file
diff --git a/SystemTap_Beginners_Guide/timeoutssect.html b/SystemTap_Beginners_Guide/timeoutssect.html
index 034099ab..c55d47a7 100644
--- a/SystemTap_Beginners_Guide/timeoutssect.html
+++ b/SystemTap_Beginners_Guide/timeoutssect.html
@@ -1,7 +1,8 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">5.3.4. Monitoring Polling Applications</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="mainsect-profiling.html" title="5.3. Profiling" /><link rel="prev" href="threadtimessect.html" title="5.3.3. Determining Time Spent in Kernel and User Space" /><link rel="next" href="topsyssect.html" title="5.3.5. Tracking Most Frequently Used System Calls" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="threadtimessect.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="topsyssect.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="timeoutssect"></a>5.3.4. Monitoring Polling Applications</h3></div></div></div><a id="idm47951469027664" class="indexterm"></a><a id="idm47951469626352" class="indexterm"></a><a id="idm47951462934544" class="indexterm"></a><a id="idm47951469170320" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">5.3.4. Monitoring Polling Applications</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="mainsect-profiling.html" title="5.3. Profiling" /><link rel="prev" href="threadtimessect.html" title="5.3.3. Determining Time Spent in Kernel and User Space" /><link rel="next" href="topsyssect.html" title="5.3.5. Tracking Most Frequently Used System Calls" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="threadtimessect.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="topsyssect.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="timeoutssect">
3 ⁠</a>5.3.4. Monitoring Polling Applications</h3></div></div></div><a id="idm213973910736" class="indexterm"></a><a id="idm214015557648" class="indexterm"></a><a id="idm213978415376" class="indexterm"></a><a id="idm214018640624" class="indexterm"></a><div class="para">
3 This section describes how to identify and monitor which applications are polling. Doing so allows you to track unnecessary or excessive polling, which can help you pinpoint areas for improvement in terms of CPU usage and power savings. 4 This section describes how to identify and monitor which applications are polling. Doing so allows you to track unnecessary or excessive polling, which can help you pinpoint areas for improvement in terms of CPU usage and power savings.
4 </div><div class="formalpara"><div xmlns:d="http://docbook.org/ns/docbook" class="title">timeout.stp</div> 5 </div><div class="para"><div xmlns:d="http://docbook.org/ns/docbook" class="title">timeout.stp</div>
5 6
6<pre class="programlisting">#! /usr/bin/env stap 7<pre class="programlisting">#! /usr/bin/env stap
7# Copyright (C) 2009 Red Hat, Inc. 8# Copyright (C) 2009 Red Hat, Inc.
@@ -122,7 +123,8 @@ probe timer.s(1) {
122 <code class="command">nanosleep</code> 123 <code class="command">nanosleep</code>
123 </div></li><li class="listitem"><div class="para"> 124 </div></li><li class="listitem"><div class="para">
124 <code class="command">signal</code> 125 <code class="command">signal</code>
125 </div></li></ul></div><a id="idm47951421461840" class="indexterm"></a><a id="idm47951476561392" class="indexterm"></a><a id="idm47951455672992" class="indexterm"></a><div class="example"><a id="timeoutsoutput"></a><p class="title"><strong>Example 5.16. <a class="xref" href="timeoutssect.html#timeouts">timeout.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen"> uid | poll select epoll itimer futex nanosle signal| process 126 </div></li></ul></div><a id="idm214018122256" class="indexterm"></a><a id="idm214026305984" class="indexterm"></a><a id="idm214014608464" class="indexterm"></a><div class="example"><a id="timeoutsoutput">
127 ⁠</a><p class="title"><strong>Example 5.16. <a class="xref" href="timeoutssect.html#timeouts">timeout.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen"> uid | poll select epoll itimer futex nanosle signal| process
12628937 | 148793 0 0 4727 37288 0 0| firefox 12828937 | 148793 0 0 4727 37288 0 0| firefox
12722945 | 0 56949 0 1 0 0 0| scim-bridge 12922945 | 0 56949 0 1 0 0 0| scim-bridge
128 0 | 0 0 0 36414 0 0 0| swapper 130 0 | 0 0 0 36414 0 0 0| swapper
@@ -142,6 +144,6 @@ probe timer.s(1) {
142 4248 | 1591 0 0 0 0 0 0| nm-applet 144 4248 | 1591 0 0 0 0 0 0| nm-applet
143 3165 | 0 1441 0 0 0 0 0| xterm 145 3165 | 0 1441 0 0 0 0 0| xterm
14429548 | 0 1440 0 0 0 0 0| httpd 14629548 | 0 1440 0 0 0 0 0| httpd
145 1862 | 0 0 0 0 0 1438 0| iscsid</pre></div></div><br class="example-break" /><div class="para"> 147 1862 | 0 0 0 0 0 1438 0| iscsid</pre></div></div><div class="para">
146 You can increase the sample time by editing the second probe (<code class="command">timer.s(1)</code>). The output of <a class="xref" href="timeoutssect.html#timeouts">timeout.stp</a> contains the name and UID of the top 20 polling applications, along with how many times each application performed each polling system call (over time). <a class="xref" href="timeoutssect.html#timeoutsoutput">Example 5.16, “timeout.stp Sample Output”</a> contains an excerpt of the script. In this particular example firefox is doing an excessive amount of polling due to a plugin module. 148 You can increase the sample time by editing the second probe (<code class="command">timer.s(1)</code>). The output of <a class="xref" href="timeoutssect.html#timeouts">timeout.stp</a> contains the name and UID of the top 20 polling applications, along with how many times each application performed each polling system call (over time). <a class="xref" href="timeoutssect.html#timeoutsoutput">Example 5.16, “timeout.stp Sample Output”</a> contains an excerpt of the script. In this particular example firefox is doing an excessive amount of polling due to a plugin module.
147 </div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="threadtimessect.html"><strong>Prev</strong>5.3.3. Determining Time Spent in Kernel and User ...</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="topsyssect.html"><strong>Next</strong>5.3.5. Tracking Most Frequently Used System Calls</a></li></ul></body></html> \ No newline at end of file 149 </div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="threadtimessect.html"><strong>Prev</strong>5.3.3. Determining Time Spent in Kernel and User ...</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="topsyssect.html"><strong>Next</strong>5.3.5. Tracking Most Frequently Used System Calls</a></li></ul></body></html> \ No newline at end of file
diff --git a/SystemTap_Beginners_Guide/topsyssect.html b/SystemTap_Beginners_Guide/topsyssect.html
index d0c58bfa..8e410052 100644
--- a/SystemTap_Beginners_Guide/topsyssect.html
+++ b/SystemTap_Beginners_Guide/topsyssect.html
@@ -1,7 +1,8 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">5.3.5. Tracking Most Frequently Used System Calls</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="mainsect-profiling.html" title="5.3. Profiling" /><link rel="prev" href="timeoutssect.html" title="5.3.4. Monitoring Polling Applications" /><link rel="next" href="syscallsbyprocpidsect.html" title="5.3.6. Tracking System Call Volume Per Process" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="timeoutssect.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="syscallsbyprocpidsect.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="topsyssect"></a>5.3.5. Tracking Most Frequently Used System Calls</h3></div></div></div><a id="idm47951476006736" class="indexterm"></a><a id="idm47951419144688" class="indexterm"></a><a id="idm47951456278880" class="indexterm"></a><a id="idm47951460773520" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">5.3.5. Tracking Most Frequently Used System Calls</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="mainsect-profiling.html" title="5.3. Profiling" /><link rel="prev" href="timeoutssect.html" title="5.3.4. Monitoring Polling Applications" /><link rel="next" href="syscallsbyprocpidsect.html" title="5.3.6. Tracking System Call Volume Per Process" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="timeoutssect.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="syscallsbyprocpidsect.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="topsyssect">
3 ⁠</a>5.3.5. Tracking Most Frequently Used System Calls</h3></div></div></div><a id="idm214026283728" class="indexterm"></a><a id="idm214012706720" class="indexterm"></a><a id="idm214013302448" class="indexterm"></a><a id="idm214011824752" class="indexterm"></a><div class="para">
3 <a class="xref" href="timeoutssect.html#timeouts">timeout.stp</a> from <a class="xref" href="timeoutssect.html">Section 5.3.4, “Monitoring Polling Applications”</a> helps you identify which applications are polling by examining a small subset of system calls ( <code class="command">poll</code>, <code class="command">select</code>, <code class="command">epoll</code>, <code class="command">itimer</code>, <code class="command">futex</code>, <code class="command">nanosleep</code>, and <code class="command">signal</code>). However, in some systems, an excessive number of system calls outside that small subset might be responsible for time spent in the kernel. If you suspect that an application is using system calls excessively, you need to identify the most frequently used system calls on the system. To do this, use <a class="xref" href="topsyssect.html#topsys">topsys.stp</a>. 4 <a class="xref" href="timeoutssect.html#timeouts">timeout.stp</a> from <a class="xref" href="timeoutssect.html">Section 5.3.4, “Monitoring Polling Applications”</a> helps you identify which applications are polling by examining a small subset of system calls ( <code class="command">poll</code>, <code class="command">select</code>, <code class="command">epoll</code>, <code class="command">itimer</code>, <code class="command">futex</code>, <code class="command">nanosleep</code>, and <code class="command">signal</code>). However, in some systems, an excessive number of system calls outside that small subset might be responsible for time spent in the kernel. If you suspect that an application is using system calls excessively, you need to identify the most frequently used system calls on the system. To do this, use <a class="xref" href="topsyssect.html#topsys">topsys.stp</a>.
4 </div><div class="formalpara"><div xmlns:d="http://docbook.org/ns/docbook" class="title">topsys.stp</div> 5 </div><div class="para"><div xmlns:d="http://docbook.org/ns/docbook" class="title">topsys.stp</div>
5 6
6<pre class="programlisting">#! /usr/bin/env stap 7<pre class="programlisting">#! /usr/bin/env stap
7# 8#
@@ -30,7 +31,8 @@ probe timer.s(5) {
30</pre> 31</pre>
31 </div><div class="para"> 32 </div><div class="para">
32 <a class="xref" href="topsyssect.html#topsys">topsys.stp</a> lists the top 20 system calls used by the system per 5-second interval. It also lists how many times each system call was used during that period. Refer to <a class="xref" href="topsyssect.html#topsysoutput">Example 5.17, “topsys.stp Sample Output”</a> for a sample output. 33 <a class="xref" href="topsyssect.html#topsys">topsys.stp</a> lists the top 20 system calls used by the system per 5-second interval. It also lists how many times each system call was used during that period. Refer to <a class="xref" href="topsyssect.html#topsysoutput">Example 5.17, “topsys.stp Sample Output”</a> for a sample output.
33 </div><a id="idm47951441832400" class="indexterm"></a><a id="idm47951471238816" class="indexterm"></a><a id="idm47951471237296" class="indexterm"></a><div class="example"><a id="topsysoutput"></a><p class="title"><strong>Example 5.17. <a class="xref" href="topsyssect.html#topsys">topsys.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen">-------------------------------------------------------------- 34 </div><a id="idm213973632080" class="indexterm"></a><a id="idm214021294016" class="indexterm"></a><a id="idm214014006928" class="indexterm"></a><div class="example"><a id="topsysoutput">
35 ⁠</a><p class="title"><strong>Example 5.17. <a class="xref" href="topsyssect.html#topsys">topsys.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen">--------------------------------------------------------------
34 SYSCALL COUNT 36 SYSCALL COUNT
35 gettimeofday 1857 37 gettimeofday 1857
36 read 1821 38 read 1821
@@ -52,4 +54,4 @@ probe timer.s(5) {
52 time 81 54 time 81
53 sigreturn 72 55 sigreturn 72
54 fstat 66 56 fstat 66
55--------------------------------------------------------------</pre></div></div><br class="example-break" /></div><ul class="docnav"><li class="previous"><a accesskey="p" href="timeoutssect.html"><strong>Prev</strong>5.3.4. Monitoring Polling Applications</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="syscallsbyprocpidsect.html"><strong>Next</strong>5.3.6. Tracking System Call Volume Per Process</a></li></ul></body></html> \ No newline at end of file 57--------------------------------------------------------------</pre></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="timeoutssect.html"><strong>Prev</strong>5.3.4. Monitoring Polling Applications</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="syscallsbyprocpidsect.html"><strong>Next</strong>5.3.6. Tracking System Call Volume Per Process</a></li></ul></body></html> \ No newline at end of file
diff --git a/SystemTap_Beginners_Guide/traceio2sect.html b/SystemTap_Beginners_Guide/traceio2sect.html
index c58d4d8b..f3cc0b59 100644
--- a/SystemTap_Beginners_Guide/traceio2sect.html
+++ b/SystemTap_Beginners_Guide/traceio2sect.html
@@ -1,7 +1,8 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">5.2.4. I/O Monitoring (By Device)</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="mainsect-disk.html" title="5.2. Disk" /><link rel="prev" href="traceiosect.html" title="5.2.3. Track Cumulative IO" /><link rel="next" href="inodewatchsect.html" title="5.2.5. Monitoring Reads and Writes to a File" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="traceiosect.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="inodewatchsect.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="traceio2sect"></a>5.2.4. I/O Monitoring (By Device)</h3></div></div></div><a id="idm47951460871504" class="indexterm"></a><a id="idm47951475125568" class="indexterm"></a><a id="idm47951466270576" class="indexterm"></a><a id="idm47951468336480" class="indexterm"></a><a id="idm47951416383104" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">5.2.4. I/O Monitoring (By Device)</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="mainsect-disk.html" title="5.2. Disk" /><link rel="prev" href="traceiosect.html" title="5.2.3. Track Cumulative IO" /><link rel="next" href="inodewatchsect.html" title="5.2.5. Monitoring Reads and Writes to a File" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="traceiosect.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="inodewatchsect.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="traceio2sect">
3 ⁠</a>5.2.4. I/O Monitoring (By Device)</h3></div></div></div><a id="idm213969459984" class="indexterm"></a><a id="idm213978634144" class="indexterm"></a><a id="idm214018689616" class="indexterm"></a><a id="idm214013718096" class="indexterm"></a><a id="idm213973259536" class="indexterm"></a><div class="para">
3 This section describes how to monitor I/O activity on a specific device. 4 This section describes how to monitor I/O activity on a specific device.
4 </div><div class="formalpara"><div xmlns:d="http://docbook.org/ns/docbook" class="title">traceio2.stp</div> 5 </div><div class="para"><div xmlns:d="http://docbook.org/ns/docbook" class="title">traceio2.stp</div>
5 6
6<pre class="programlisting">#! /usr/bin/env stap 7<pre class="programlisting">#! /usr/bin/env stap
7 8
@@ -20,21 +21,22 @@ probe vfs.write, vfs.read
20{ 21{
21 if (dev == device_of_interest) 22 if (dev == device_of_interest)
22 printf ("%s(%d) %s 0x%x\n", 23 printf ("%s(%d) %s 0x%x\n",
23 execname(), pid(), probefunc(), dev) 24 execname(), pid(), ppfunc(), dev)
24} 25}
25</pre> 26</pre>
26 </div><a id="idm47951471276752" class="indexterm"></a><a id="idm47951427975520" class="indexterm"></a><a id="idm47951424717712" class="indexterm"></a><a id="idm47951471222928" class="indexterm"></a><a id="idm47951427967808" class="indexterm"></a><a id="idm47951457641664" class="indexterm"></a><div class="para"> 27 </div><a id="idm214015602080" class="indexterm"></a><a id="idm213979347424" class="indexterm"></a><a id="idm214012896000" class="indexterm"></a><a id="idm213979413120" class="indexterm"></a><a id="idm214014362672" class="indexterm"></a><a id="idm214013451584" class="indexterm"></a><div class="para">
27 <a class="xref" href="traceio2sect.html#traceio2">traceio2.stp</a> takes 1 argument: the whole device number. To get this number, use <code class="command">stat -c "0x%D" <em class="replaceable"><code>directory</code></em></code>, where <code class="command"><em class="replaceable"><code>directory</code></em></code> is located in the device to be monitored. 28 <a class="xref" href="traceio2sect.html#traceio2">traceio2.stp</a> takes 1 argument: the whole device number. To get this number, use <code class="command">stat -c "0x%D" <em class="replaceable">directory</em></code>, where <code class="command"><em class="replaceable">directory</em></code> is located in the device to be monitored.
28 </div><a id="idm47951456527008" class="indexterm"></a><a id="idm47951421614416" class="indexterm"></a><a id="idm47951423497344" class="indexterm"></a><div class="para"> 29 </div><a id="idm214014464800" class="indexterm"></a><a id="idm214014596752" class="indexterm"></a><a id="idm214014610896" class="indexterm"></a><div class="para">
29 The <code class="command">usrdev2kerndev()</code> function converts the whole device number into the format understood by the kernel. The output produced by <code class="command">usrdev2kerndev()</code> is used in conjunction with the <code class="command">MKDEV()</code>, <code class="command">MINOR()</code>, and <code class="command">MAJOR()</code> functions to determine the major and minor numbers of a specific device. 30 The <code class="command">usrdev2kerndev()</code> function converts the whole device number into the format understood by the kernel. The output produced by <code class="command">usrdev2kerndev()</code> is used in conjunction with the <code class="command">MKDEV()</code>, <code class="command">MINOR()</code>, and <code class="command">MAJOR()</code> functions to determine the major and minor numbers of a specific device.
30 </div><div class="para"> 31 </div><div class="para">
31 The output of <a class="xref" href="traceio2sect.html#traceio2">traceio2.stp</a> includes the name and ID of any process performing a read/write, the function it is performing (that is, <code class="command">vfs_read</code> or <code class="command">vfs_write</code>), and the kernel device number. 32 The output of <a class="xref" href="traceio2sect.html#traceio2">traceio2.stp</a> includes the name and ID of any process performing a read/write, the function it is performing (that is, <code class="command">vfs_read</code> or <code class="command">vfs_write</code>), and the kernel device number.
32 </div><div class="para"> 33 </div><div class="para">
33 The following example is an excerpt from the full output of <code class="command">stap traceio2.stp 0x805</code>, where <code class="literal">0x805</code> is the whole device number of <code class="filename">/home</code>. <code class="filename">/home</code> resides in <code class="filename">/dev/sda5</code>, which is the device we wish to monitor. 34 The following example is an excerpt from the full output of <code class="command">stap traceio2.stp 0x805</code>, where <code class="literal">0x805</code> is the whole device number of <code class="filename">/home</code>. <code class="filename">/home</code> resides in <code class="filename">/dev/sda5</code>, which is the device we wish to monitor.
34 </div><div class="example"><a id="traceio2output"></a><p class="title"><strong>Example 5.9. <a class="xref" href="traceio2sect.html#traceio2">traceio2.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen">[...] 35 </div><div class="example"><a id="traceio2output">
36 ⁠</a><p class="title"><strong>Example 5.9. <a class="xref" href="traceio2sect.html#traceio2">traceio2.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen">[...]
35synergyc(3722) vfs_read 0x800005 37synergyc(3722) vfs_read 0x800005
36synergyc(3722) vfs_read 0x800005 38synergyc(3722) vfs_read 0x800005
37cupsd(2889) vfs_write 0x800005 39cupsd(2889) vfs_write 0x800005
38cupsd(2889) vfs_write 0x800005 40cupsd(2889) vfs_write 0x800005
39cupsd(2889) vfs_write 0x800005 41cupsd(2889) vfs_write 0x800005
40[...]</pre></div></div><br class="example-break" /></div><ul class="docnav"><li class="previous"><a accesskey="p" href="traceiosect.html"><strong>Prev</strong>5.2.3. Track Cumulative IO</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="inodewatchsect.html"><strong>Next</strong>5.2.5. Monitoring Reads and Writes to a File</a></li></ul></body></html> \ No newline at end of file 42[...]</pre></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="traceiosect.html"><strong>Prev</strong>5.2.3. Track Cumulative IO</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="inodewatchsect.html"><strong>Next</strong>5.2.5. Monitoring Reads and Writes to a File</a></li></ul></body></html> \ No newline at end of file
diff --git a/SystemTap_Beginners_Guide/traceiosect.html b/SystemTap_Beginners_Guide/traceiosect.html
index 60c29a71..f2735807 100644
--- a/SystemTap_Beginners_Guide/traceiosect.html
+++ b/SystemTap_Beginners_Guide/traceiosect.html
@@ -1,7 +1,8 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">5.2.3. Track Cumulative IO</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="mainsect-disk.html" title="5.2. Disk" /><link rel="prev" href="iotimesect.html" title="5.2.2. Tracking I/O Time For Each File Read or Write" /><link rel="next" href="traceio2sect.html" title="5.2.4. I/O Monitoring (By Device)" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="iotimesect.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="traceio2sect.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="traceiosect"></a>5.2.3. Track Cumulative IO</h3></div></div></div><a id="idm47951460788400" class="indexterm"></a><a id="idm47951469148976" class="indexterm"></a><a id="idm47951459802416" class="indexterm"></a><a id="idm47951415698160" class="indexterm"></a><a id="idm47951426523728" class="indexterm"></a><a id="idm47951429320848" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">5.2.3. Track Cumulative IO</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="mainsect-disk.html" title="5.2. Disk" /><link rel="prev" href="iotimesect.html" title="5.2.2. Tracking I/O Time For Each File Read or Write" /><link rel="next" href="traceio2sect.html" title="5.2.4. I/O Monitoring (By Device)" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="iotimesect.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="traceio2sect.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="traceiosect">
3 ⁠</a>5.2.3. Track Cumulative IO</h3></div></div></div><a id="idm214011790880" class="indexterm"></a><a id="idm214018821584" class="indexterm"></a><a id="idm213969128960" class="indexterm"></a><a id="idm213973159488" class="indexterm"></a><a id="idm213974818528" class="indexterm"></a><a id="idm213979313600" class="indexterm"></a><div class="para">
3 This section describes how to track the cumulative amount of I/O to the system. 4 This section describes how to track the cumulative amount of I/O to the system.
4 </div><div class="formalpara"><div xmlns:d="http://docbook.org/ns/docbook" class="title">traceio.stp</div> 5 </div><div class="para"><div xmlns:d="http://docbook.org/ns/docbook" class="title">traceio.stp</div>
5 6
6<pre class="programlisting">#! /usr/bin/env stap 7<pre class="programlisting">#! /usr/bin/env stap
7# traceio.stp 8# traceio.stp
@@ -55,9 +56,10 @@ probe timer.s(1) {
55</pre> 56</pre>
56 </div><div class="para"> 57 </div><div class="para">
57 <a class="xref" href="traceiosect.html#traceio">traceio.stp</a> prints the top ten executables generating I/O traffic over time. In addition, it also tracks the cumulative amount of I/O reads and writes done by those ten executables. This information is tracked and printed out in 1-second intervals, and in descending order. 58 <a class="xref" href="traceiosect.html#traceio">traceio.stp</a> prints the top ten executables generating I/O traffic over time. In addition, it also tracks the cumulative amount of I/O reads and writes done by those ten executables. This information is tracked and printed out in 1-second intervals, and in descending order.
58 </div><a id="idm47951422444624" class="indexterm"></a><a id="idm47951457385200" class="indexterm"></a><a id="idm47951455674544" class="indexterm"></a><div class="para"> 59 </div><a id="idm214011513184" class="indexterm"></a><a id="idm213967543504" class="indexterm"></a><a id="idm214026148288" class="indexterm"></a><div class="para">
59 Note that <a class="xref" href="traceiosect.html#traceio">traceio.stp</a> also uses the local variable <code class="command">$return</code>, which is also used by <a class="xref" href="mainsect-disk.html#scriptdisktop">disktop.stp</a> from <a class="xref" href="mainsect-disk.html#disktop">Section 5.2.1, “Summarizing Disk Read/Write Traffic”</a>. 60 Note that <a class="xref" href="traceiosect.html#traceio">traceio.stp</a> also uses the local variable <code class="command">$return</code>, which is also used by <a class="xref" href="mainsect-disk.html#scriptdisktop">disktop.stp</a> from <a class="xref" href="mainsect-disk.html#disktop">Section 5.2.1, “Summarizing Disk Read/Write Traffic”</a>.
60 </div><div class="example"><a id="traceiooutput"></a><p class="title"><strong>Example 5.8. <a class="xref" href="traceiosect.html#traceio">traceio.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen">[...] 61 </div><div class="example"><a id="traceiooutput">
62 ⁠</a><p class="title"><strong>Example 5.8. <a class="xref" href="traceiosect.html#traceio">traceio.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen">[...]
61 Xorg r: 583401 KiB w: 0 KiB 63 Xorg r: 583401 KiB w: 0 KiB
62 floaters r: 96 KiB w: 7130 KiB 64 floaters r: 96 KiB w: 7130 KiB
63multiload-apple r: 538 KiB w: 537 KiB 65multiload-apple r: 538 KiB w: 537 KiB
@@ -78,4 +80,4 @@ pam_timestamp_c r: 138 KiB w: 0 KiB
78 snmpd r: 46 KiB w: 0 KiB 80 snmpd r: 46 KiB w: 0 KiB
79 pcscd r: 28 KiB w: 0 KiB 81 pcscd r: 28 KiB w: 0 KiB
80 irqbalance r: 27 KiB w: 4 KiB 82 irqbalance r: 27 KiB w: 4 KiB
81 cupsd r: 4 KiB w: 18 KiB</pre></div></div><br class="example-break" /></div><ul class="docnav"><li class="previous"><a accesskey="p" href="iotimesect.html"><strong>Prev</strong>5.2.2. Tracking I/O Time For Each File Read or Wr...</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="traceio2sect.html"><strong>Next</strong>5.2.4. I/O Monitoring (By Device)</a></li></ul></body></html> \ No newline at end of file 83 cupsd r: 4 KiB w: 18 KiB</pre></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="iotimesect.html"><strong>Prev</strong>5.2.2. Tracking I/O Time For Each File Read or Wr...</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="traceio2sect.html"><strong>Next</strong>5.2.4. I/O Monitoring (By Device)</a></li></ul></body></html> \ No newline at end of file
diff --git a/SystemTap_Beginners_Guide/typecasting.html b/SystemTap_Beginners_Guide/typecasting.html
index a67cadaf..e7f62bf3 100644
--- a/SystemTap_Beginners_Guide/typecasting.html
+++ b/SystemTap_Beginners_Guide/typecasting.html
@@ -1,10 +1,12 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.3.2.2. Typecasting</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="targetvariables.html" title="3.3.2. Target Variables" /><link rel="prev" href="targetvariables.html" title="3.3.2. Target Variables" /><link rel="next" href="targetavailable.html" title="3.3.2.3. Checking Target Variable Availability" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="targetvariables.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="targetavailable.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="typecasting"></a>3.3.2.2. Typecasting</h4></div></div></div><a id="idm47951468963824" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.3.2.2. Typecasting</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="targetvariables.html" title="3.3.2. Target Variables" /><link rel="prev" href="targetvariables.html" title="3.3.2. Target Variables" /><link rel="next" href="targetavailable.html" title="3.3.2.3. Checking Target Variable Availability" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="targetvariables.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="targetavailable.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="typecasting">
3 ⁠</a>3.3.2.2. Typecasting</h4></div></div></div><a id="idm214006918560" class="indexterm"></a><div class="para">
3 In most cases SystemTap can determine a variable's type from the debug information. However, code may use void pointers for variables (for example memory allocation routines) and typing information is not available. Also the typing information available within a probe handler is not available within a function; SystemTap functions arguments use a long in place of a typed pointer. SystemTap's <code class="command">@cast</code> operator (first available in SystemTap 0.9) can be used to indicate the correct type of the object. 4 In most cases SystemTap can determine a variable's type from the debug information. However, code may use void pointers for variables (for example memory allocation routines) and typing information is not available. Also the typing information available within a probe handler is not available within a function; SystemTap functions arguments use a long in place of a typed pointer. SystemTap's <code class="command">@cast</code> operator (first available in SystemTap 0.9) can be used to indicate the correct type of the object.
4 </div><div class="para"> 5 </div><div class="para">
5 The <a class="xref" href="typecasting.html#casting">Example 3.9, “Casting Example”</a> is from the <code class="command">task.stp</code> tapset. The function returns the value of the <code class="command">state</code> field from a <code class="command">task_struct</code> pointed to by the long <code class="command">task</code>. The first argument of the <code class="command">@cast</code> operator, <code class="command">task</code>, is the pointer to the object. The second argument is the type to cast the object to, <code class="command">task_struct</code>. The third argument lists what file that the type definition information comes from and is optional. With the <code class="command">@cast</code> operator the various fields of this particular <code class="command">task_struct</code> <code class="command">task</code> can be accessed; in this example the <code class="command">state</code> field is obtained. 6 The <a class="xref" href="typecasting.html#casting">Example 3.9, “Casting Example”</a> is from the <code class="command">task.stp</code> tapset. The function returns the value of the <code class="command">state</code> field from a <code class="command">task_struct</code> pointed to by the long <code class="command">task</code>. The first argument of the <code class="command">@cast</code> operator, <code class="command">task</code>, is the pointer to the object. The second argument is the type to cast the object to, <code class="command">task_struct</code>. The third argument lists what file that the type definition information comes from and is optional. With the <code class="command">@cast</code> operator the various fields of this particular <code class="command">task_struct</code> <code class="command">task</code> can be accessed; in this example the <code class="command">state</code> field is obtained.
6 </div><div class="example"><a id="casting"></a><p class="title"><strong>Example 3.9. Casting Example</strong></p><div class="example-contents"><pre class="programlisting">function task_state:long (task:long) 7 </div><div class="example"><a id="casting">
8 ⁠</a><p class="title"><strong>Example 3.9. Casting Example</strong></p><div class="example-contents"><pre class="programlisting">function task_state:long (task:long)
7{ 9{
8 return @cast(task, "task_struct", "kernel&lt;linux/sched.h&gt;")-&gt;state 10 return @cast(task, "task_struct", "kernel&lt;linux/sched.h&gt;")-&gt;state
9} 11}
10</pre></div></div><br class="example-break" /></div><ul class="docnav"><li class="previous"><a accesskey="p" href="targetvariables.html"><strong>Prev</strong>3.3.2. Target Variables</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="targetavailable.html"><strong>Next</strong>3.3.2.3. Checking Target Variable Availability</a></li></ul></body></html> \ No newline at end of file 12</pre></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="targetvariables.html"><strong>Prev</strong>3.3.2. Target Variables</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="targetavailable.html"><strong>Next</strong>3.3.2.3. Checking Target Variable Availability</a></li></ul></body></html> \ No newline at end of file
diff --git a/SystemTap_Beginners_Guide/understanding-how-systemtap-works.html b/SystemTap_Beginners_Guide/understanding-how-systemtap-works.html
index 303a8973..8461a12f 100644
--- a/SystemTap_Beginners_Guide/understanding-how-systemtap-works.html
+++ b/SystemTap_Beginners_Guide/understanding-how-systemtap-works.html
@@ -1,13 +1,16 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">Chapter 3. Understanding How SystemTap Works</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="index.html" title="SystemTap Beginners Guide" /><link rel="prev" href="using-usage.html" title="2.3. Running SystemTap Scripts" /><link rel="next" href="scripts.html" title="3.2. SystemTap Scripts" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="using-usage.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="scripts.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="chapter" lang="en-US"><div class="titlepage"><div><div><h1 class="title"><a id="understanding-how-systemtap-works"></a>Chapter 3. Understanding How SystemTap Works</h1></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="understanding-how-systemtap-works.html#understanding-architecture-tools">3.1. Architecture</a></span></dt><dt><span class="section"><a href="scripts.html">3.2. SystemTap Scripts</a></span></dt><dd><dl><dt><span class="section"><a href="scripts.html#systemtapscript-events">3.2.1. Event</a></span></dt><dt><span class="section"><a href="systemtapscript-handler.html">3.2.2. SystemTap Handler/Body</a></span></dt></dl></dd><dt><span class="section"><a href="scriptconstructions.html">3.3. Basic SystemTap Handler Constructs</a></span></dt><dd><dl><dt><span class="section"><a href="scriptconstructions.html#variablesconstructs">3.3.1. Variables</a></span></dt><dt><span class="section"><a href="targetvariables.html">3.3.2. Target Variables</a></span></dt><dt><span class="section"><a href="handlerconditionalstatements.html">3.3.3. Conditional Statements</a></span></dt><dt><span class="section"><a href="commandlineargssect.html">3.3.4. Command-Line Arguments</a></span></dt></dl></dd><dt><span class="section"><a href="associativearrays.html">3.4. Associative Arrays</a></span></dt><dt><span class="section"><a href="arrayoperators.html">3.5. Array Operations in SystemTap</a></span></dt><dd><dl><dt><span class="section"><a href="arrayoperators.html#arrayops-assignvalue">3.5.1. Assigning an Associated Value</a></span></dt><dt><span class="section"><a href="arrayops-readvalues.html">3.5.2. Reading Values From Arrays</a></span></dt><dt><span class="section"><a href="arrayops-increment.html">3.5.3. Incrementing Associated Values</a></span></dt><dt><span class="section"><a href="arrayops-foreach.html">3.5.4. Processing Multiple Elements in an Array</a></span></dt><dt><span class="section"><a href="arrayops-deleting.html">3.5.5. Clearing/Deleting Arrays and Array Elements</a></span></dt><dt><span class="section"><a href="arrayops-conditionals.html">3.5.6. Using Arrays in Conditional Statements</a></span></dt><dt><span class="section"><a href="arrayops-aggregates.html">3.5.7. Computing for Statistical Aggregates</a></span></dt></dl></dd><dt><span class="section"><a href="understanding-tapsets.html">3.6. Tapsets</a></span></dt></dl></div><a id="idm47951460110992" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">Chapter 3. Understanding How SystemTap Works</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="index.html" title="SystemTap Beginners Guide" /><link rel="prev" href="using-usage.html" title="2.3. Running SystemTap Scripts" /><link rel="next" href="scripts.html" title="3.2. SystemTap Scripts" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="using-usage.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="scripts.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="chapter" lang="en-US"><div class="titlepage"><div><div><h1 class="title"><a id="understanding-how-systemtap-works">
3 ⁠</a>Chapter 3. Understanding How SystemTap Works</h1></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="understanding-how-systemtap-works.html#understanding-architecture-tools">3.1. Architecture</a></span></dt><dt><span class="section"><a href="scripts.html">3.2. SystemTap Scripts</a></span></dt><dd><dl><dt><span class="section"><a href="scripts.html#systemtapscript-events">3.2.1. Event</a></span></dt><dt><span class="section"><a href="systemtapscript-handler.html">3.2.2. SystemTap Handler/Body</a></span></dt></dl></dd><dt><span class="section"><a href="scriptconstructions.html">3.3. Basic SystemTap Handler Constructs</a></span></dt><dd><dl><dt><span class="section"><a href="scriptconstructions.html#variablesconstructs">3.3.1. Variables</a></span></dt><dt><span class="section"><a href="targetvariables.html">3.3.2. Target Variables</a></span></dt><dt><span class="section"><a href="handlerconditionalstatements.html">3.3.3. Conditional Statements</a></span></dt><dt><span class="section"><a href="commandlineargssect.html">3.3.4. Command-Line Arguments</a></span></dt></dl></dd><dt><span class="section"><a href="associativearrays.html">3.4. Associative Arrays</a></span></dt><dt><span class="section"><a href="arrayoperators.html">3.5. Array Operations in SystemTap</a></span></dt><dd><dl><dt><span class="section"><a href="arrayoperators.html#arrayops-assignvalue">3.5.1. Assigning an Associated Value</a></span></dt><dt><span class="section"><a href="arrayops-readvalues.html">3.5.2. Reading Values From Arrays</a></span></dt><dt><span class="section"><a href="arrayops-increment.html">3.5.3. Incrementing Associated Values</a></span></dt><dt><span class="section"><a href="arrayops-foreach.html">3.5.4. Processing Multiple Elements in an Array</a></span></dt><dt><span class="section"><a href="arrayops-deleting.html">3.5.5. Clearing/Deleting Arrays and Array Elements</a></span></dt><dt><span class="section"><a href="arrayops-conditionals.html">3.5.6. Using Arrays in Conditional Statements</a></span></dt><dt><span class="section"><a href="arrayops-aggregates.html">3.5.7. Computing for Statistical Aggregates</a></span></dt></dl></dd><dt><span class="section"><a href="understanding-tapsets.html">3.6. Tapsets</a></span></dt></dl></div><a id="idm214013373952" class="indexterm"></a><div class="para">
3 SystemTap allows users to write and reuse simple scripts to deeply examine the activities of a running Linux system. These scripts can be designed to extract data, filter it, and summarize it quickly (and safely), enabling the diagnosis of complex performance (or even functional) problems. 4 SystemTap allows users to write and reuse simple scripts to deeply examine the activities of a running Linux system. These scripts can be designed to extract data, filter it, and summarize it quickly (and safely), enabling the diagnosis of complex performance (or even functional) problems.
4 </div><a id="idm47951460108896" class="indexterm"></a><a id="idm47951460106608" class="indexterm"></a><a id="idm47951460105552" class="indexterm"></a><div class="para"> 5 </div><a id="idm214013375360" class="indexterm"></a><a id="idm214013377056" class="indexterm"></a><a id="idm214013380816" class="indexterm"></a><div class="para">
5 The essential idea behind a SystemTap script is to name <span class="emphasis"><em>events</em></span>, and to give them <span class="emphasis"><em>handlers</em></span>. When SystemTap runs the script, SystemTap monitors for the event; once the event occurs, the Linux kernel then runs the handler as a quick sub-routine, then resumes. 6 The essential idea behind a SystemTap script is to name <span class="emphasis"><em>events</em></span>, and to give them <span class="emphasis"><em>handlers</em></span>. When SystemTap runs the script, SystemTap monitors for the event; once the event occurs, the Linux kernel then runs the handler as a quick sub-routine, then resumes.
6 </div><a id="idm47951460102624" class="indexterm"></a><a id="idm47951460100704" class="indexterm"></a><div class="para"> 7 </div><a id="idm214013382048" class="indexterm"></a><a id="idm214013384336" class="indexterm"></a><div class="para">
7 There are several kind of events; entering/exiting a function, timer expiration, session termination, etc. A handler is a series of script language statements that specify the work to be done whenever the event occurs. This work normally includes extracting data from the event context, storing them into internal variables, and printing results. 8 There are several kind of events; entering/exiting a function, timer expiration, session termination, etc. A handler is a series of script language statements that specify the work to be done whenever the event occurs. This work normally includes extracting data from the event context, storing them into internal variables, and printing results.
8 </div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="understanding-architecture-tools"></a>3.1. Architecture</h2></div></div></div><a id="idm47951460094944" class="indexterm"></a><a id="idm47951460092096" class="indexterm"></a><a id="idm47951460095120" class="indexterm"></a><div class="para"> 9 </div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="understanding-architecture-tools">
10 ⁠</a>3.1. Architecture</h2></div></div></div><a id="idm214006920608" class="indexterm"></a><a id="idm214006922016" class="indexterm"></a><a id="idm214006922976" class="indexterm"></a><div class="para">
9 A SystemTap session begins when you run a SystemTap script. This session occurs in the following fashion: 11 A SystemTap session begins when you run a SystemTap script. This session occurs in the following fashion:
10 </div><div xmlns:d="http://docbook.org/ns/docbook" class="procedure"><a id="systemtapsession"></a><p class="title"><strong>Procedure 3.1. SystemTap Session</strong></p><a id="idm47951468570272" class="indexterm"></a><a id="idm47951460085696" class="indexterm"></a><a id="idm47951460083040" class="indexterm"></a><ol class="1"><li class="step"><div class="para"> 12 </div><div xmlns:d="http://docbook.org/ns/docbook" class="procedure"><a id="systemtapsession">
13 ⁠</a><p class="title"><strong>Procedure 3.1. SystemTap Session</strong></p><a id="idm214006925344" class="indexterm"></a><a id="idm214006927152" class="indexterm"></a><a id="idm214006928144" class="indexterm"></a><ol class="1"><li class="step"><div class="para">
11 First, SystemTap checks the script against the existing tapset library (normally in <code class="filename">/usr/share/systemtap/tapset/</code> for any tapsets used. SystemTap will then substitute any located tapsets with their corresponding definitions in the tapset library. 14 First, SystemTap checks the script against the existing tapset library (normally in <code class="filename">/usr/share/systemtap/tapset/</code> for any tapsets used. SystemTap will then substitute any located tapsets with their corresponding definitions in the tapset library.
12 </div></li><li class="step"><div class="para"> 15 </div></li><li class="step"><div class="para">
13 SystemTap then translates the script to C, running the system C compiler to create a kernel module from it. The tools that perform this step are contained in the <code class="filename">systemtap</code> package (refer to <a class="xref" href="using-systemtap.html#installproper">Section 2.1.1, “Installing SystemTap”</a> for more information). 16 SystemTap then translates the script to C, running the system C compiler to create a kernel module from it. The tools that perform this step are contained in the <code class="filename">systemtap</code> package (refer to <a class="xref" href="using-systemtap.html#installproper">Section 2.1.1, “Installing SystemTap”</a> for more information).
diff --git a/SystemTap_Beginners_Guide/understanding-tapsets.html b/SystemTap_Beginners_Guide/understanding-tapsets.html
index 724a5dcd..ab848e0c 100644
--- a/SystemTap_Beginners_Guide/understanding-tapsets.html
+++ b/SystemTap_Beginners_Guide/understanding-tapsets.html
@@ -1,5 +1,6 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.6. Tapsets</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="understanding-how-systemtap-works.html" title="Chapter 3. Understanding How SystemTap Works" /><link rel="prev" href="arrayops-aggregates.html" title="3.5.7. Computing for Statistical Aggregates" /><link rel="next" href="userspace-probing.html" title="Chapter 4. User-space Probing" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="arrayops-aggregates.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="userspace-probing.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="understanding-tapsets"></a>3.6. Tapsets</h2></div></div></div><a id="idm47951457483920" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">3.6. Tapsets</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="understanding-how-systemtap-works.html" title="Chapter 3. Understanding How SystemTap Works" /><link rel="prev" href="arrayops-aggregates.html" title="3.5.7. Computing for Statistical Aggregates" /><link rel="next" href="userspace-probing.html" title="Chapter 4. User-space Probing" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="arrayops-aggregates.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="userspace-probing.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="understanding-tapsets">
3 ⁠</a>3.6. Tapsets</h2></div></div></div><a id="idm213967474432" class="indexterm"></a><div class="para">
3 <em class="firstterm">Tapsets</em> are scripts that form a library of pre-written probes and functions to be used in SystemTap scripts. When a user runs a SystemTap script, SystemTap checks the script's probe events and handlers against the tapset library; SystemTap then loads the corresponding probes and functions before translating the script to C (refer to <a class="xref" href="understanding-how-systemtap-works.html#understanding-architecture-tools">Section 3.1, “Architecture”</a> for information on what transpires in a SystemTap session). 4 <em class="firstterm">Tapsets</em> are scripts that form a library of pre-written probes and functions to be used in SystemTap scripts. When a user runs a SystemTap script, SystemTap checks the script's probe events and handlers against the tapset library; SystemTap then loads the corresponding probes and functions before translating the script to C (refer to <a class="xref" href="understanding-how-systemtap-works.html#understanding-architecture-tools">Section 3.1, “Architecture”</a> for information on what transpires in a SystemTap session).
4 </div><div class="para"> 5 </div><div class="para">
5 Like SystemTap scripts, tapsets use the file name extension <code class="filename">.stp</code>. The standard library of tapsets is located in <code class="filename">/usr/share/systemtap/tapset/</code> by default. However, unlike SystemTap scripts, tapsets are not meant for direct execution; rather, they constitute the library from which other scripts can pull definitions. 6 Like SystemTap scripts, tapsets use the file name extension <code class="filename">.stp</code>. The standard library of tapsets is located in <code class="filename">/usr/share/systemtap/tapset/</code> by default. However, unlike SystemTap scripts, tapsets are not meant for direct execution; rather, they constitute the library from which other scripts can pull definitions.
diff --git a/SystemTap_Beginners_Guide/useful-systemtap-scripts.html b/SystemTap_Beginners_Guide/useful-systemtap-scripts.html
index 892ea1f7..e7278a6c 100644
--- a/SystemTap_Beginners_Guide/useful-systemtap-scripts.html
+++ b/SystemTap_Beginners_Guide/useful-systemtap-scripts.html
@@ -1,11 +1,14 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">Chapter 5. Useful SystemTap Scripts</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="index.html" title="SystemTap Beginners Guide" /><link rel="prev" href="ustack.html" title="4.3. User-Space Stack Backtraces" /><link rel="next" href="mainsect-disk.html" title="5.2. Disk" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="ustack.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="mainsect-disk.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="chapter" lang="en-US"><div class="titlepage"><div><div><h1 class="title"><a id="useful-systemtap-scripts"></a>Chapter 5. Useful SystemTap Scripts</h1></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="useful-systemtap-scripts.html#mainsect-network">5.1. Network</a></span></dt><dd><dl><dt><span class="section"><a href="useful-systemtap-scripts.html#nettopsect">5.1.1. Network Profiling</a></span></dt><dt><span class="section"><a href="useful-systemtap-scripts.html#sockettracesect">5.1.2. Tracing Functions Called in Network Socket Code</a></span></dt><dt><span class="section"><a href="useful-systemtap-scripts.html#tcpconnectionssect">5.1.3. Monitoring Incoming TCP Connections</a></span></dt><dt><span class="section"><a href="useful-systemtap-scripts.html#tcpdumplikesect">5.1.4. Monitoring TCP Packets</a></span></dt><dt><span class="section"><a href="useful-systemtap-scripts.html#dropwatchsect">5.1.5. Monitoring Network Packets Drops in Kernel</a></span></dt></dl></dd><dt><span class="section"><a href="mainsect-disk.html">5.2. Disk</a></span></dt><dd><dl><dt><span class="section"><a href="mainsect-disk.html#disktop">5.2.1. Summarizing Disk Read/Write Traffic</a></span></dt><dt><span class="section"><a href="iotimesect.html">5.2.2. Tracking I/O Time For Each File Read or Write</a></span></dt><dt><span class="section"><a href="traceiosect.html">5.2.3. Track Cumulative IO</a></span></dt><dt><span class="section"><a href="traceio2sect.html">5.2.4. I/O Monitoring (By Device)</a></span></dt><dt><span class="section"><a href="inodewatchsect.html">5.2.5. Monitoring Reads and Writes to a File</a></span></dt><dt><span class="section"><a href="inodewatch2sect.html">5.2.6. Monitoring Changes to File Attributes</a></span></dt><dt><span class="section"><a href="ioblktimesect.html">5.2.7. Periodically Print I/O Block Time</a></span></dt></dl></dd><dt><span class="section"><a href="mainsect-profiling.html">5.3. Profiling</a></span></dt><dd><dl><dt><span class="section"><a href="mainsect-profiling.html#countcallssect">5.3.1. Counting Function Calls Made</a></span></dt><dt><span class="section"><a href="paracallgraph.html">5.3.2. Call Graph Tracing</a></span></dt><dt><span class="section"><a href="threadtimessect.html">5.3.3. Determining Time Spent in Kernel and User Space</a></span></dt><dt><span class="section"><a href="timeoutssect.html">5.3.4. Monitoring Polling Applications</a></span></dt><dt><span class="section"><a href="topsyssect.html">5.3.5. Tracking Most Frequently Used System Calls</a></span></dt><dt><span class="section"><a href="syscallsbyprocpidsect.html">5.3.6. Tracking System Call Volume Per Process</a></span></dt></dl></dd><dt><span class="section"><a href="futexcontentionsect.html">5.4. Identifying Contended User-Space Locks</a></span></dt></dl></div><a id="idm47951468601264" class="indexterm"></a><a id="idm47951468600416" class="indexterm"></a><a id="idm47951455715904" class="indexterm"></a><a id="idm47951455715056" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">Chapter 5. Useful SystemTap Scripts</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="index.html" title="SystemTap Beginners Guide" /><link rel="prev" href="ustack.html" title="4.3. User-Space Stack Backtraces" /><link rel="next" href="mainsect-disk.html" title="5.2. Disk" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="ustack.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="mainsect-disk.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="chapter" lang="en-US"><div class="titlepage"><div><div><h1 class="title"><a id="useful-systemtap-scripts">
3 ⁠</a>Chapter 5. Useful SystemTap Scripts</h1></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="useful-systemtap-scripts.html#mainsect-network">5.1. Network</a></span></dt><dd><dl><dt><span class="section"><a href="useful-systemtap-scripts.html#nettopsect">5.1.1. Network Profiling</a></span></dt><dt><span class="section"><a href="useful-systemtap-scripts.html#sockettracesect">5.1.2. Tracing Functions Called in Network Socket Code</a></span></dt><dt><span class="section"><a href="useful-systemtap-scripts.html#tcpconnectionssect">5.1.3. Monitoring Incoming TCP Connections</a></span></dt><dt><span class="section"><a href="useful-systemtap-scripts.html#tcpdumplikesect">5.1.4. Monitoring TCP Packets</a></span></dt><dt><span class="section"><a href="useful-systemtap-scripts.html#dropwatchsect">5.1.5. Monitoring Network Packets Drops in Kernel</a></span></dt></dl></dd><dt><span class="section"><a href="mainsect-disk.html">5.2. Disk</a></span></dt><dd><dl><dt><span class="section"><a href="mainsect-disk.html#disktop">5.2.1. Summarizing Disk Read/Write Traffic</a></span></dt><dt><span class="section"><a href="iotimesect.html">5.2.2. Tracking I/O Time For Each File Read or Write</a></span></dt><dt><span class="section"><a href="traceiosect.html">5.2.3. Track Cumulative IO</a></span></dt><dt><span class="section"><a href="traceio2sect.html">5.2.4. I/O Monitoring (By Device)</a></span></dt><dt><span class="section"><a href="inodewatchsect.html">5.2.5. Monitoring Reads and Writes to a File</a></span></dt><dt><span class="section"><a href="inodewatch2sect.html">5.2.6. Monitoring Changes to File Attributes</a></span></dt><dt><span class="section"><a href="ioblktimesect.html">5.2.7. Periodically Print I/O Block Time</a></span></dt></dl></dd><dt><span class="section"><a href="mainsect-profiling.html">5.3. Profiling</a></span></dt><dd><dl><dt><span class="section"><a href="mainsect-profiling.html#countcallssect">5.3.1. Counting Function Calls Made</a></span></dt><dt><span class="section"><a href="paracallgraph.html">5.3.2. Call Graph Tracing</a></span></dt><dt><span class="section"><a href="threadtimessect.html">5.3.3. Determining Time Spent in Kernel and User Space</a></span></dt><dt><span class="section"><a href="timeoutssect.html">5.3.4. Monitoring Polling Applications</a></span></dt><dt><span class="section"><a href="topsyssect.html">5.3.5. Tracking Most Frequently Used System Calls</a></span></dt><dt><span class="section"><a href="syscallsbyprocpidsect.html">5.3.6. Tracking System Call Volume Per Process</a></span></dt></dl></dd><dt><span class="section"><a href="futexcontentionsect.html">5.4. Identifying Contended User-Space Locks</a></span></dt></dl></div><a id="idm214017423952" class="indexterm"></a><a id="idm214017425360" class="indexterm"></a><a id="idm214017426288" class="indexterm"></a><a id="idm214017427216" class="indexterm"></a><div class="para">
3 This chapter enumerates several SystemTap scripts you can use to monitor and investigate different subsystems. All of these scripts are available at <code class="filename">/usr/share/systemtap/testsuite/systemtap.examples/</code> once you install the <code class="filename">systemtap-testsuite</code> RPM. 4 This chapter enumerates several SystemTap scripts you can use to monitor and investigate different subsystems. All of these scripts are available at <code class="filename">/usr/share/systemtap/testsuite/systemtap.examples/</code> once you install the <code class="filename">systemtap-testsuite</code> RPM.
4 </div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="mainsect-network"></a>5.1. Network</h2></div></div></div><div class="para"> 5 </div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="mainsect-network">
6 ⁠</a>5.1. Network</h2></div></div></div><div class="para">
5 The following sections showcase scripts that trace network-related functions and build a profile of network activity. 7 The following sections showcase scripts that trace network-related functions and build a profile of network activity.
6 </div><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="nettopsect"></a>5.1.1. Network Profiling</h3></div></div></div><a id="idm47951456339840" class="indexterm"></a><a id="idm47951456336768" class="indexterm"></a><a id="idm47951456335168" class="indexterm"></a><a id="idm47951469304736" class="indexterm"></a><a id="idm47951469304384" class="indexterm"></a><div class="para"> 8 </div><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="nettopsect">
9 ⁠</a>5.1.1. Network Profiling</h3></div></div></div><a id="idm214018045936" class="indexterm"></a><a id="idm214018047376" class="indexterm"></a><a id="idm214018047664" class="indexterm"></a><a id="idm214014564016" class="indexterm"></a><a id="idm214014565488" class="indexterm"></a><div class="para">
7 This section describes how to profile network activity. <a class="xref" href="useful-systemtap-scripts.html#nettop">nettop.stp</a> provides a glimpse into how much network traffic each process is generating on a machine. 10 This section describes how to profile network activity. <a class="xref" href="useful-systemtap-scripts.html#nettop">nettop.stp</a> provides a glimpse into how much network traffic each process is generating on a machine.
8 </div><div class="formalpara"><div xmlns:d="http://docbook.org/ns/docbook" class="title">nettop.stp</div> 11 </div><div class="para"><div xmlns:d="http://docbook.org/ns/docbook" class="title">nettop.stp</div>
9 12
10<pre class="programlisting">#! /usr/bin/env stap 13<pre class="programlisting">#! /usr/bin/env stap
11 14
@@ -56,7 +59,7 @@ probe timer.ms(5000), end, error
56 print_activity() 59 print_activity()
57} 60}
58</pre> 61</pre>
59 </div><a id="idm47951458454592" class="indexterm"></a><a id="idm47951475774080" class="indexterm"></a><a id="idm47951462910832" class="indexterm"></a><div class="para"> 62 </div><a id="idm213967982048" class="indexterm"></a><a id="idm214014569888" class="indexterm"></a><a id="idm214018100688" class="indexterm"></a><div class="para">
60 Note that <code class="command">function print_activity()</code> uses the following expressions: 63 Note that <code class="command">function print_activity()</code> uses the following expressions:
61 </div><pre class="screen">n_xmit ? @sum(ifxmit[pid, dev, exec, uid])/1024 : 0 64 </div><pre class="screen">n_xmit ? @sum(ifxmit[pid, dev, exec, uid])/1024 : 0
62n_recv ? @sum(ifrecv[pid, dev, exec, uid])/1024 : 0</pre><div class="para"> 65n_recv ? @sum(ifrecv[pid, dev, exec, uid])/1024 : 0</pre><div class="para">
@@ -82,7 +85,8 @@ else
82 <code class="computeroutput">RECV_KB</code> — amount of data received by the service, in kilobytes 85 <code class="computeroutput">RECV_KB</code> — amount of data received by the service, in kilobytes
83 </div></li></ul></div><div class="para"> 86 </div></li></ul></div><div class="para">
84 <a class="xref" href="useful-systemtap-scripts.html#nettop">nettop.stp</a> provides network profile sampling every 5 seconds. You can change this setting by editing <code class="command">probe timer.ms(5000)</code> accordingly. <a class="xref" href="useful-systemtap-scripts.html#nettopoutput">Example 5.1, “nettop.stp Sample Output”</a> contains an excerpt of the output from <a class="xref" href="useful-systemtap-scripts.html#nettop">nettop.stp</a> over a 20-second period: 87 <a class="xref" href="useful-systemtap-scripts.html#nettop">nettop.stp</a> provides network profile sampling every 5 seconds. You can change this setting by editing <code class="command">probe timer.ms(5000)</code> accordingly. <a class="xref" href="useful-systemtap-scripts.html#nettopoutput">Example 5.1, “nettop.stp Sample Output”</a> contains an excerpt of the output from <a class="xref" href="useful-systemtap-scripts.html#nettop">nettop.stp</a> over a 20-second period:
85 </div><div class="example"><a id="nettopoutput"></a><p class="title"><strong>Example 5.1. <a class="xref" href="useful-systemtap-scripts.html#nettop">nettop.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen">[...] 88 </div><div class="example"><a id="nettopoutput">
89 ⁠</a><p class="title"><strong>Example 5.1. <a class="xref" href="useful-systemtap-scripts.html#nettop">nettop.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen">[...]
86 PID UID DEV XMIT_PK RECV_PK XMIT_KB RECV_KB COMMAND 90 PID UID DEV XMIT_PK RECV_PK XMIT_KB RECV_KB COMMAND
87 0 0 eth0 0 5 0 0 swapper 91 0 0 eth0 0 5 0 0 swapper
8811178 0 eth0 2 0 0 0 synergyc 9211178 0 eth0 2 0 0 0 synergyc
@@ -105,9 +109,10 @@ else
10511178 0 eth0 43 1 3 0 synergyc 10911178 0 eth0 43 1 3 0 synergyc
10611362 0 eth0 0 7 0 0 firefox 11011362 0 eth0 0 7 0 0 firefox
107 3897 0 eth0 0 1 0 0 multiload-apple 111 3897 0 eth0 0 1 0 0 multiload-apple
108[...]</pre></div></div><br class="example-break" /></div><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="sockettracesect"></a>5.1.2. Tracing Functions Called in Network Socket Code</h3></div></div></div><a id="idm47951455627440" class="indexterm"></a><a id="idm47951460799584" class="indexterm"></a><a id="idm47951471504752" class="indexterm"></a><a id="idm47951423151200" class="indexterm"></a><a id="idm47951476444704" class="indexterm"></a><a id="idm47951460984912" class="indexterm"></a><a id="idm47951468599920" class="indexterm"></a><a id="idm47951457380992" class="indexterm"></a><div class="para"> 112[...]</pre></div></div></div><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="sockettracesect">
113 ⁠</a>5.1.2. Tracing Functions Called in Network Socket Code</h3></div></div></div><a id="idm214013246016" class="indexterm"></a><a id="idm214009839936" class="indexterm"></a><a id="idm214011472704" class="indexterm"></a><a id="idm214017950256" class="indexterm"></a><a id="idm213978755088" class="indexterm"></a><a id="idm213972036448" class="indexterm"></a><a id="idm214010632656" class="indexterm"></a><a id="idm214013772256" class="indexterm"></a><div class="para">
109 This section describes how to trace functions called from the kernel's <code class="filename">net/socket.c</code> file. This task helps you identify, in finer detail, how each process interacts with the network at the kernel level. 114 This section describes how to trace functions called from the kernel's <code class="filename">net/socket.c</code> file. This task helps you identify, in finer detail, how each process interacts with the network at the kernel level.
110 </div><div class="formalpara"><div xmlns:d="http://docbook.org/ns/docbook" class="title">socket-trace.stp</div> 115 </div><div class="para"><div xmlns:d="http://docbook.org/ns/docbook" class="title">socket-trace.stp</div>
111 116
112<pre class="programlisting">#! /usr/bin/env stap 117<pre class="programlisting">#! /usr/bin/env stap
113 118
@@ -120,7 +125,8 @@ probe kernel.function("*@net/socket.c").return {
120</pre> 125</pre>
121 </div><div class="para"> 126 </div><div class="para">
122 <a class="xref" href="useful-systemtap-scripts.html#sockettrace">socket-trace.stp</a> is identical to <a class="xref" href="systemtapscript-handler.html#thread_indent">Example 3.6, “thread_indent.stp”</a>, which was earlier used in <a class="xref" href="systemtapscript-handler.html#systemtapscript-functions">SystemTap Functions</a> to illustrate how <code class="command">thread_indent()</code> works. 127 <a class="xref" href="useful-systemtap-scripts.html#sockettrace">socket-trace.stp</a> is identical to <a class="xref" href="systemtapscript-handler.html#thread_indent">Example 3.6, “thread_indent.stp”</a>, which was earlier used in <a class="xref" href="systemtapscript-handler.html#systemtapscript-functions">SystemTap Functions</a> to illustrate how <code class="command">thread_indent()</code> works.
123 </div><div class="example"><a id="sockettraceoutput"></a><p class="title"><strong>Example 5.2. <a class="xref" href="useful-systemtap-scripts.html#sockettrace">socket-trace.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen">[...] 128 </div><div class="example"><a id="sockettraceoutput">
129 ⁠</a><p class="title"><strong>Example 5.2. <a class="xref" href="useful-systemtap-scripts.html#sockettrace">socket-trace.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen">[...]
1240 Xorg(3611): -&gt; sock_poll 1300 Xorg(3611): -&gt; sock_poll
1253 Xorg(3611): &lt;- sock_poll 1313 Xorg(3611): &lt;- sock_poll
1260 Xorg(3611): -&gt; sock_poll 1320 Xorg(3611): -&gt; sock_poll
@@ -139,11 +145,12 @@ probe kernel.function("*@net/socket.c").return {
13928 scim-bridge(3883): &lt;- sys_recvfrom 14528 scim-bridge(3883): &lt;- sys_recvfrom
14031 scim-bridge(3883): &lt;- sys_recv 14631 scim-bridge(3883): &lt;- sys_recv
14135 scim-bridge(3883): &lt;- sys_socketcall 14735 scim-bridge(3883): &lt;- sys_socketcall
142[...]</pre></div></div><br class="example-break" /><div class="para"> 148[...]</pre></div></div><div class="para">
143 <a class="xref" href="useful-systemtap-scripts.html#sockettraceoutput">Example 5.2, “socket-trace.stp Sample Output”</a> contains a 3-second excerpt of the output for <a class="xref" href="useful-systemtap-scripts.html#sockettrace">socket-trace.stp</a>. For more information about the output of this script as provided by <code class="command">thread_indent()</code>, refer to <a class="xref" href="systemtapscript-handler.html#systemtapscript-functions">SystemTap Functions</a> <a class="xref" href="systemtapscript-handler.html#thread_indent">Example 3.6, “thread_indent.stp”</a>. 149 <a class="xref" href="useful-systemtap-scripts.html#sockettraceoutput">Example 5.2, “socket-trace.stp Sample Output”</a> contains a 3-second excerpt of the output for <a class="xref" href="useful-systemtap-scripts.html#sockettrace">socket-trace.stp</a>. For more information about the output of this script as provided by <code class="command">thread_indent()</code>, refer to <a class="xref" href="systemtapscript-handler.html#systemtapscript-functions">SystemTap Functions</a> <a class="xref" href="systemtapscript-handler.html#thread_indent">Example 3.6, “thread_indent.stp”</a>.
144 </div></div><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="tcpconnectionssect"></a>5.1.3. Monitoring Incoming TCP Connections</h3></div></div></div><a id="idm47951471266240" class="indexterm"></a><a id="idm47951464255376" class="indexterm"></a><a id="idm47951474892880" class="indexterm"></a><a id="idm47951416228560" class="indexterm"></a><a id="idm47951457807088" class="indexterm"></a><div class="para"> 150 </div></div><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="tcpconnectionssect">
151 ⁠</a>5.1.3. Monitoring Incoming TCP Connections</h3></div></div></div><a id="idm214018617632" class="indexterm"></a><a id="idm213968001936" class="indexterm"></a><a id="idm213967674208" class="indexterm"></a><a id="idm214013709904" class="indexterm"></a><a id="idm213970577680" class="indexterm"></a><div class="para">
145 This section illustrates how to monitor incoming TCP connections. This task is useful in identifying any unauthorized, suspicious, or otherwise unwanted network access requests in real time. 152 This section illustrates how to monitor incoming TCP connections. This task is useful in identifying any unauthorized, suspicious, or otherwise unwanted network access requests in real time.
146 </div><div class="formalpara"><div xmlns:d="http://docbook.org/ns/docbook" class="title">tcp_connections.stp</div> 153 </div><div class="para"><div xmlns:d="http://docbook.org/ns/docbook" class="title">tcp_connections.stp</div>
147 154
148<pre class="programlisting">#! /usr/bin/env stap 155<pre class="programlisting">#! /usr/bin/env stap
149 156
@@ -172,11 +179,13 @@ probe kernel.function("tcp_accept").return?,
172 Port used by the connection 179 Port used by the connection
173 </div></li><li class="listitem"><div class="para"> 180 </div></li><li class="listitem"><div class="para">
174 IP address from which the TCP connection originated 181 IP address from which the TCP connection originated
175 </div></li></ul></div><div class="example"><a id="tcpconnectionsoutput"></a><p class="title"><strong>Example 5.3. <a class="xref" href="useful-systemtap-scripts.html#tcpconnections">tcp_connections.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen">UID CMD PID PORT IP_SOURCE 182 </div></li></ul></div><div class="example"><a id="tcpconnectionsoutput">
183 ⁠</a><p class="title"><strong>Example 5.3. <a class="xref" href="useful-systemtap-scripts.html#tcpconnections">tcp_connections.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen">UID CMD PID PORT IP_SOURCE
1760 sshd 3165 22 10.64.0.227 1840 sshd 3165 22 10.64.0.227
1770 sshd 3165 22 10.64.0.227</pre></div></div><br class="example-break" /></div><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="tcpdumplikesect"></a>5.1.4. Monitoring TCP Packets</h3></div></div></div><a id="idm47951457379232" class="indexterm"></a><a id="idm47951424892912" class="indexterm"></a><a id="idm47951424876992" class="indexterm"></a><a id="idm47951419128896" class="indexterm"></a><a id="idm47951457210944" class="indexterm"></a><div class="para"> 1850 sshd 3165 22 10.64.0.227</pre></div></div></div><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="tcpdumplikesect">
186 ⁠</a>5.1.4. Monitoring TCP Packets</h3></div></div></div><a id="idm213974798448" class="indexterm"></a><a id="idm213967507264" class="indexterm"></a><a id="idm214018712544" class="indexterm"></a><a id="idm214017347280" class="indexterm"></a><a id="idm213973864096" class="indexterm"></a><div class="para">
178 This section illustrates how to monitor TCP packets received by the system. This is useful in analyzing network traffic generated by applications running on the system. 187 This section illustrates how to monitor TCP packets received by the system. This is useful in analyzing network traffic generated by applications running on the system.
179 </div><div class="formalpara"><div xmlns:d="http://docbook.org/ns/docbook" class="title">tcpdumplike.stp</div> 188 </div><div class="para"><div xmlns:d="http://docbook.org/ns/docbook" class="title">tcpdumplike.stp</div>
180 189
181<pre class="programlisting"> #! /usr/bin/env stap 190<pre class="programlisting"> #! /usr/bin/env stap
182 191
@@ -222,7 +231,8 @@ probe tcp.receive {
222 <code class="command">fin</code> - finished 231 <code class="command">fin</code> - finished
223 </div></li></ul></div><div class="para"> 232 </div></li></ul></div><div class="para">
224 The aforementioned functions return <code class="command">1</code> or <code class="command">0</code> to specify whether the packet uses the corresponding flag. 233 The aforementioned functions return <code class="command">1</code> or <code class="command">0</code> to specify whether the packet uses the corresponding flag.
225 </div><div class="example"><a id="tcpdumplikeoutput"></a><p class="title"><strong>Example 5.4. <a class="xref" href="useful-systemtap-scripts.html#tcpdumplike">tcpdumplike.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen">----------------------------------------------------------------- 234 </div><div class="example"><a id="tcpdumplikeoutput">
235 ⁠</a><p class="title"><strong>Example 5.4. <a class="xref" href="useful-systemtap-scripts.html#tcpdumplike">tcpdumplike.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen">-----------------------------------------------------------------
226 Source IP Dest IP SPort DPort U A P R S F 236 Source IP Dest IP SPort DPort U A P R S F
227----------------------------------------------------------------- 237-----------------------------------------------------------------
228 209.85.229.147 10.0.2.15 80 20373 0 1 1 0 0 0 238 209.85.229.147 10.0.2.15 80 20373 0 1 1 0 0 0
@@ -236,9 +246,10 @@ probe tcp.receive {
236 209.85.229.147 10.0.2.15 80 21141 0 1 1 0 0 0 246 209.85.229.147 10.0.2.15 80 21141 0 1 1 0 0 0
237 209.85.229.147 10.0.2.15 80 21141 0 1 1 0 0 0 247 209.85.229.147 10.0.2.15 80 21141 0 1 1 0 0 0
238 209.85.229.118 10.0.2.15 80 63433 0 1 1 0 0 0 248 209.85.229.118 10.0.2.15 80 63433 0 1 1 0 0 0
239[...]</pre></div></div><br class="example-break" /></div><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="dropwatchsect"></a>5.1.5. Monitoring Network Packets Drops in Kernel</h3></div></div></div><a id="idm47951415789296" class="indexterm"></a><a id="idm47951460612512" class="indexterm"></a><a id="idm47951459636128" class="indexterm"></a><a id="idm47951475103872" class="indexterm"></a><a id="idm47951459808448" class="indexterm"></a><div class="para"> 249[...]</pre></div></div></div><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="dropwatchsect">
240 <a id="idm47951455992688" class="indexterm"></a> The network stack in Linux can discard packets for various reasons. Some Linux kernels include a tracepoint, <code class="command">kernel.trace("kfree_skb")</code>, which easily tracks where packets are discarded. <a class="xref" href="useful-systemtap-scripts.html#dropwatch">dropwatch.stp</a> uses <code class="command">kernel.trace("kfree_skb")</code> to trace packet discards; the script summarizes which locations discard packets every five-second interval. 250 ⁠</a>5.1.5. Monitoring Network Packets Drops in Kernel</h3></div></div></div><a id="idm213967713600" class="indexterm"></a><a id="idm214017759008" class="indexterm"></a><a id="idm214011780416" class="indexterm"></a><a id="idm214013638656" class="indexterm"></a><a id="idm213969713760" class="indexterm"></a><div class="para">
241 </div><div class="formalpara"><div xmlns:d="http://docbook.org/ns/docbook" class="title">dropwatch.stp</div> 251 <a id="idm214020754736" class="indexterm"></a> The network stack in Linux can discard packets for various reasons. Some Linux kernels include a tracepoint, <code class="command">kernel.trace("kfree_skb")</code>, which easily tracks where packets are discarded. <a class="xref" href="useful-systemtap-scripts.html#dropwatch">dropwatch.stp</a> uses <code class="command">kernel.trace("kfree_skb")</code> to trace packet discards; the script summarizes which locations discard packets every five-second interval.
252 </div><div class="para"><div xmlns:d="http://docbook.org/ns/docbook" class="title">dropwatch.stp</div>
242 253
243<pre class="programlisting">#! /usr/bin/env stap 254<pre class="programlisting">#! /usr/bin/env stap
244 255
@@ -278,7 +289,8 @@ probe timer.sec(5)
278`cat /proc/modules | awk 'BEGIN { ORS = " " } {print "-d"$1}'` \ 289`cat /proc/modules | awk 'BEGIN { ORS = " " } {print "-d"$1}'` \
279dropwatch.stp</pre><div class="para"> 290dropwatch.stp</pre><div class="para">
280 Running the dropwatch.stp script 15 seconds would result in output similar in <a class="xref" href="useful-systemtap-scripts.html#dropwatchoutput">Example 5.5, “dropwatch.stp Sample Output”</a>. The output lists the number of misses for each tracepoint location with either the function name or the address. 291 Running the dropwatch.stp script 15 seconds would result in output similar in <a class="xref" href="useful-systemtap-scripts.html#dropwatchoutput">Example 5.5, “dropwatch.stp Sample Output”</a>. The output lists the number of misses for each tracepoint location with either the function name or the address.
281 </div><div class="example"><a id="dropwatchoutput"></a><p class="title"><strong>Example 5.5. <a class="xref" href="useful-systemtap-scripts.html#dropwatch">dropwatch.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen">Monitoring for dropped packets 292 </div><div class="example"><a id="dropwatchoutput">
293 ⁠</a><p class="title"><strong>Example 5.5. <a class="xref" href="useful-systemtap-scripts.html#dropwatch">dropwatch.stp</a> Sample Output</strong></p><div class="example-contents"><pre class="screen">Monitoring for dropped packets
282 294
2831762 packets dropped at unix_stream_recvmsg 2951762 packets dropped at unix_stream_recvmsg
2844 packets dropped at tun_do_read 2964 packets dropped at tun_do_read
@@ -292,7 +304,7 @@ dropwatch.stp</pre><div class="para">
2924 packets dropped at tun_do_read 3044 packets dropped at tun_do_read
2934 packets dropped at nf_hook_slow 3054 packets dropped at nf_hook_slow
294Stopping dropped packet monitor 306Stopping dropped packet monitor
295</pre></div></div><br class="example-break" /><div class="para"> 307</pre></div></div><div class="para">
296 When the script is being compiled on one machine and run on another the <code class="command">--all-modules</code> and <code class="filename">/proc/modules</code> directory are not available; the <code class="command">symname</code> function will just print out the raw address. To make the raw address of packet drops more meaningful, refer to the <code class="filename">/boot/System.map-`uname -r`</code> file. This file lists the starting addresses for each function, allowing you to map the addresses in the output of <a class="xref" href="useful-systemtap-scripts.html#dropwatchoutput">Example 5.5, “dropwatch.stp Sample Output”</a> to a specific function name. Given the following snippet of the <code class="filename">/boot/System.map-`uname -r`</code> file, the address 0xffffffff8149a8ed maps to the function <code class="command">unix_stream_recvmsg</code>: 308 When the script is being compiled on one machine and run on another the <code class="command">--all-modules</code> and <code class="filename">/proc/modules</code> directory are not available; the <code class="command">symname</code> function will just print out the raw address. To make the raw address of packet drops more meaningful, refer to the <code class="filename">/boot/System.map-`uname -r`</code> file. This file lists the starting addresses for each function, allowing you to map the addresses in the output of <a class="xref" href="useful-systemtap-scripts.html#dropwatchoutput">Example 5.5, “dropwatch.stp Sample Output”</a> to a specific function name. Given the following snippet of the <code class="filename">/boot/System.map-`uname -r`</code> file, the address 0xffffffff8149a8ed maps to the function <code class="command">unix_stream_recvmsg</code>:
297 </div><pre class="screen">[...] 309 </div><pre class="screen">[...]
298ffffffff8149a420 t unix_dgram_poll 310ffffffff8149a420 t unix_dgram_poll
diff --git a/SystemTap_Beginners_Guide/userspace-probing.html b/SystemTap_Beginners_Guide/userspace-probing.html
index 3c1362fb..7d12ca59 100644
--- a/SystemTap_Beginners_Guide/userspace-probing.html
+++ b/SystemTap_Beginners_Guide/userspace-probing.html
@@ -1,5 +1,6 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">Chapter 4. User-space Probing</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="index.html" title="SystemTap Beginners Guide" /><link rel="prev" href="understanding-tapsets.html" title="3.6. Tapsets" /><link rel="next" href="utargetvariable.html" title="4.2. Accessing User-Space Target Variables" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="understanding-tapsets.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="utargetvariable.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="chapter" lang="en-US"><div class="titlepage"><div><div><h1 class="title"><a id="userspace-probing"></a>Chapter 4. User-space Probing</h1></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="userspace-probing.html#uevents">4.1. User-Space Events</a></span></dt><dt><span class="section"><a href="utargetvariable.html">4.2. Accessing User-Space Target Variables</a></span></dt><dt><span class="section"><a href="ustack.html">4.3. User-Space Stack Backtraces</a></span></dt></dl></div><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">Chapter 4. User-space Probing</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="index.html" title="SystemTap Beginners Guide" /><link rel="prev" href="understanding-tapsets.html" title="3.6. Tapsets" /><link rel="next" href="utargetvariable.html" title="4.2. Accessing User-Space Target Variables" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="understanding-tapsets.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="utargetvariable.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="chapter" lang="en-US"><div class="titlepage"><div><div><h1 class="title"><a id="userspace-probing">
3 ⁠</a>Chapter 4. User-space Probing</h1></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="userspace-probing.html#uevents">4.1. User-Space Events</a></span></dt><dt><span class="section"><a href="utargetvariable.html">4.2. Accessing User-Space Target Variables</a></span></dt><dt><span class="section"><a href="ustack.html">4.3. User-Space Stack Backtraces</a></span></dt></dl></div><div class="para">
3 SystemTap initially focused on kernel-space probing. Because there are many instances where user-space probing can help diagnose a problem, SystemTap 0.6 added support to allow probing user-space processes. SystemTap can probe the entry into and return from a function in user-space processes, probe predefined markers in user-space code, and monitor user-process events. 4 SystemTap initially focused on kernel-space probing. Because there are many instances where user-space probing can help diagnose a problem, SystemTap 0.6 added support to allow probing user-space processes. SystemTap can probe the entry into and return from a function in user-space processes, probe predefined markers in user-space code, and monitor user-process events.
4 </div><div class="para"> 5 </div><div class="para">
5 SystemTap requires the uprobes module to perform user-space probing. If your Linux kernel is version 3.5 or higher, it already includes uprobes. To verify that the current kernel supports uprobes natively, run the following command: 6 SystemTap requires the uprobes module to perform user-space probing. If your Linux kernel is version 3.5 or higher, it already includes uprobes. To verify that the current kernel supports uprobes natively, run the following command:
@@ -9,16 +10,17 @@
9 If you are running a kernel prior to version 3.5, SystemTap automatically builds the uprobes module. However, you also need the utrace kernel extensions required by the SystemTap user-space probing to track various user-space events. More details about the utrace infrastructure are available at <a href="http://sourceware.org/systemtap/wiki/utrace">http://sourceware.org/systemtap/wiki/utrace</a>. To determine whether the currently running Linux kernel provides the needed utrace support, type the following at a shell prompt: 10 If you are running a kernel prior to version 3.5, SystemTap automatically builds the uprobes module. However, you also need the utrace kernel extensions required by the SystemTap user-space probing to track various user-space events. More details about the utrace infrastructure are available at <a href="http://sourceware.org/systemtap/wiki/utrace">http://sourceware.org/systemtap/wiki/utrace</a>. To determine whether the currently running Linux kernel provides the needed utrace support, type the following at a shell prompt:
10 </div><pre class="screen"><code class="command">grep CONFIG_UTRACE /boot/config-`uname -r`</code></pre><div class="para"> 11 </div><pre class="screen"><code class="command">grep CONFIG_UTRACE /boot/config-`uname -r`</code></pre><div class="para">
11 If the Linux kernel supports user-space probing, the command produces the following output: 12 If the Linux kernel supports user-space probing, the command produces the following output:
12 </div><pre class="screen">CONFIG_UTRACE=y</pre><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="uevents"></a>4.1. User-Space Events</h2></div></div></div><a id="idm47951420330640" class="indexterm"></a><div class="para"> 13 </div><pre class="screen">CONFIG_UTRACE=y</pre><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="uevents">
14 ⁠</a>4.1. User-Space Events</h2></div></div></div><a id="idm213974235040" class="indexterm"></a><div class="para">
13 All user-space event probes begin with <span class="emphasis"><em>process</em></span>. You can limit the process events to a specific running process by specifying the process ID. You can also limit the process events to monitor a particular executable by specifying the path to the executable (PATH). SystemTap makes use of the <code class="envar">PATH</code> environment variable, which allows you to use both the name used on the command-line to start the executable and the absolute path to the executable. 15 All user-space event probes begin with <span class="emphasis"><em>process</em></span>. You can limit the process events to a specific running process by specifying the process ID. You can also limit the process events to monitor a particular executable by specifying the path to the executable (PATH). SystemTap makes use of the <code class="envar">PATH</code> environment variable, which allows you to use both the name used on the command-line to start the executable and the absolute path to the executable.
14 </div><div class="para"> 16 </div><div class="para">
15 Several of the user-space probe events limit their scope to a particular executable name (PATH), because SystemTap must use debug information to statically analyze where to place the probes. But for many user-space probe events, the process ID and executable name are optional. Any <code class="command">process</code> event in the list below that include process ID or the path to the executable must include those arguments. The process ID and path to the executable are optional for the <code class="command">process</code> events that do not list them: 17 Several of the user-space probe events limit their scope to a particular executable name (PATH), because SystemTap must use debug information to statically analyze where to place the probes. But for many user-space probe events, the process ID and executable name are optional. Any <code class="command">process</code> event in the list below that include process ID or the path to the executable must include those arguments. The process ID and path to the executable are optional for the <code class="command">process</code> events that do not list them:
16 </div><div class="variablelist"><dl class="variablelist"><dt><span class="term">process("<em class="replaceable"><code>PATH</code></em>").function("<em class="replaceable"><code>function</code></em>")</span></dt><dd><div class="para"> 18 </div><div class="variablelist"><dl class="variablelist"><dt><span class="term">process("<em class="replaceable">PATH</em>").function("<em class="replaceable">function</em>")</span></dt><dd><div class="para">
17 The entry to the user-space function <em class="replaceable"><code>function</code></em> for the executable <em class="replaceable"><code>PATH</code></em>. This event is the user-space analogue of the <code class="command">kernel.function("<em class="replaceable"><code>function</code></em>")</code> event. It allows wildcards for the function <em class="replaceable"><code>function</code></em> and <code class="literal">.return</code> suffix. 19 The entry to the user-space function <em class="replaceable">function</em> for the executable <em class="replaceable">PATH</em>. This event is the user-space analogue of the <code class="command">kernel.function("<em class="replaceable">function</em>")</code> event. It allows wildcards for the function <em class="replaceable">function</em> and <code class="literal">.return</code> suffix.
18 </div></dd><dt><span class="term">process("<em class="replaceable"><code>PATH</code></em>").statement("<em class="replaceable"><code>statement</code></em>")</span></dt><dd><div class="para"> 20 </div></dd><dt><span class="term">process("<em class="replaceable">PATH</em>").statement("<em class="replaceable">statement</em>")</span></dt><dd><div class="para">
19 The earliest instruction in the code for <em class="replaceable"><code>statement</code></em>. This is the user-space analogue of <code class="command">kernel.statement("<em class="replaceable"><code>statement</code></em>")</code>. 21 The earliest instruction in the code for <em class="replaceable">statement</em>. This is the user-space analogue of <code class="command">kernel.statement("<em class="replaceable">statement</em>")</code>.
20 </div></dd><dt><span class="term">process("<em class="replaceable"><code>PATH</code></em>").mark("<em class="replaceable"><code>marker</code></em>")</span></dt><dd><div class="para"> 22 </div></dd><dt><span class="term">process("<em class="replaceable">PATH</em>").mark("<em class="replaceable">marker</em>")</span></dt><dd><div class="para">
21 The static probe point <em class="replaceable"><code>marker</code></em> defined in <em class="replaceable"><code>PATH</code></em>. You can use wildcards for <em class="replaceable"><code>marker</code></em> to specify multiple marks with a single probe. The static probe points may also have numbered arguments ($1, $2, and so on) available to the probe. 23 The static probe point <em class="replaceable">marker</em> defined in <em class="replaceable">PATH</em>. You can use wildcards for <em class="replaceable">marker</em> to specify multiple marks with a single probe. The static probe points may also have numbered arguments ($1, $2, and so on) available to the probe.
22 </div><div class="para"> 24 </div><div class="para">
23 A variety of user-space packages such as Java include these static probe points. Most packages that provide static probe points also provide aliases for the raw user-space mark events. Below is one such alias for the x86_64 Java hotspot JVM: 25 A variety of user-space packages such as Java include these static probe points. Most packages that provide static probe points also provide aliases for the raw user-space mark events. Below is one such alias for the x86_64 Java hotspot JVM:
24 </div><pre class="programlisting">probe hotspot.gc_begin = 26 </div><pre class="programlisting">probe hotspot.gc_begin =
diff --git a/SystemTap_Beginners_Guide/using-systemtap.html b/SystemTap_Beginners_Guide/using-systemtap.html
index d719b9ce..0aa880df 100644
--- a/SystemTap_Beginners_Guide/using-systemtap.html
+++ b/SystemTap_Beginners_Guide/using-systemtap.html
@@ -1,15 +1,18 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">Chapter 2. Using SystemTap</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="index.html" title="SystemTap Beginners Guide" /><link rel="prev" href="intro-systemtap-limitations.html" title="1.3. Limitations of SystemTap" /><link rel="next" href="cross-compiling.html" title="2.2. Generating Instrumentation for Other Computers" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="intro-systemtap-limitations.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="cross-compiling.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="chapter" lang="en-US"><div class="titlepage"><div><div><h1 class="title"><a id="using-systemtap"></a>Chapter 2. Using SystemTap</h1></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="using-systemtap.html#using-setup">2.1. Installation and Setup</a></span></dt><dd><dl><dt><span class="section"><a href="using-systemtap.html#installproper">2.1.1. Installing SystemTap</a></span></dt><dt><span class="section"><a href="using-systemtap.html#install-kinfo">2.1.2. Installing Required Kernel Information Packages Manually</a></span></dt><dt><span class="section"><a href="using-systemtap.html#testing">2.1.3. Initial Testing</a></span></dt></dl></dd><dt><span class="section"><a href="cross-compiling.html">2.2. Generating Instrumentation for Other Computers</a></span></dt><dt><span class="section"><a href="using-usage.html">2.3. Running SystemTap Scripts</a></span></dt><dd><dl><dt><span class="section"><a href="using-usage.html#flight-recorder">2.3.1. SystemTap Flight Recorder Mode</a></span></dt></dl></dd></dl></div><a id="idm47951416040304" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">Chapter 2. Using SystemTap</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="index.html" title="SystemTap Beginners Guide" /><link rel="prev" href="intro-systemtap-limitations.html" title="1.3. Limitations of SystemTap" /><link rel="next" href="cross-compiling.html" title="2.2. Generating Instrumentation for Other Computers" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="intro-systemtap-limitations.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="cross-compiling.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="chapter" lang="en-US"><div class="titlepage"><div><div><h1 class="title"><a id="using-systemtap">
3 ⁠</a>Chapter 2. Using SystemTap</h1></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="using-systemtap.html#using-setup">2.1. Installation and Setup</a></span></dt><dd><dl><dt><span class="section"><a href="using-systemtap.html#installproper">2.1.1. Installing SystemTap</a></span></dt><dt><span class="section"><a href="using-systemtap.html#install-kinfo">2.1.2. Installing Required Kernel Information Packages Manually</a></span></dt><dt><span class="section"><a href="using-systemtap.html#testing">2.1.3. Initial Testing</a></span></dt></dl></dd><dt><span class="section"><a href="cross-compiling.html">2.2. Generating Instrumentation for Other Computers</a></span></dt><dt><span class="section"><a href="using-usage.html">2.3. Running SystemTap Scripts</a></span></dt><dd><dl><dt><span class="section"><a href="using-usage.html#flight-recorder">2.3.1. SystemTap Flight Recorder Mode</a></span></dt></dl></dd></dl></div><a id="idm214007235856" class="indexterm"></a><div class="para">
3 This chapter documents how to install SystemTap in the system and explains how to use the <code class="command">stap</code> utility to run SystemTap scripts. 4 This chapter documents how to install SystemTap in the system and explains how to use the <code class="command">stap</code> utility to run SystemTap scripts.
4 </div><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h2 class="title"><a id="using-setup"></a>2.1. Installation and Setup</h2></div></div></div><a id="idm47951464610576" class="indexterm"></a><a id="idm47951464606544" class="indexterm"></a><div class="para"> 5 </div><div xml:lang="en-US" class="section" lang="en-US"><div class="titlepage"><div><div><h2 class="title"><a id="using-setup">
6 ⁠</a>2.1. Installation and Setup</h2></div></div></div><a id="idm214007241088" class="indexterm"></a><a id="idm214007242320" class="indexterm"></a><div class="para">
5 To deploy SystemTap, install the SystemTap packages along with the corresponding set of <span class="package">-devel</span>, <span class="package">-debuginfo</span>, and <span class="package">-debuginfo-common</span> packages for your kernel. If your system has multiple kernels installed and you intend to use SystemTap on more than one of them, also install the <span class="package">-devel</span> and <span class="package">-debuginfo</span> packages for <span class="emphasis"><em>each</em></span> of those kernel versions. 7 To deploy SystemTap, install the SystemTap packages along with the corresponding set of <span class="package">-devel</span>, <span class="package">-debuginfo</span>, and <span class="package">-debuginfo-common</span> packages for your kernel. If your system has multiple kernels installed and you intend to use SystemTap on more than one of them, also install the <span class="package">-devel</span> and <span class="package">-debuginfo</span> packages for <span class="emphasis"><em>each</em></span> of those kernel versions.
6 </div><div class="para"> 8 </div><div class="para">
7 The following sections discuss the installation procedures in greater detail. 9 The following sections discuss the installation procedures in greater detail.
8 </div><div xmlns:d="http://docbook.org/ns/docbook" class="important"><div class="admonition_header"><p><strong>Important</strong></p></div><div class="admonition"><div class="para"> 10 </div><div xmlns:d="http://docbook.org/ns/docbook" class="important"><div class="admonition_header"><p><strong>Important</strong></p></div><div class="admonition"><div class="para">
9 Many users confuse <span class="package">-debuginfo</span> with <span class="package">-debug</span>. Remember that the deployment of SystemTap requires the installation of the <span class="package">-debuginfo</span> package of the kernel, not the <span class="package">-debug</span> version of the kernel. 11 Many users confuse <span class="package">-debuginfo</span> with <span class="package">-debug</span>. Remember that the deployment of SystemTap requires the installation of the <span class="package">-debuginfo</span> package of the kernel, not the <span class="package">-debug</span> version of the kernel.
10 </div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="installproper"></a>2.1.1. Installing SystemTap</h3></div></div></div><div class="para"> 12 </div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="installproper">
13 ⁠</a>2.1.1. Installing SystemTap</h3></div></div></div><div class="para">
11 To deploy SystemTap, install the following RPM packages: 14 To deploy SystemTap, install the following RPM packages:
12 </div><a id="idm47951461384864" class="indexterm"></a><a id="idm47951461382704" class="indexterm"></a><a id="idm47951461381472" class="indexterm"></a><a id="idm47951476330496" class="indexterm"></a><div xmlns:d="http://docbook.org/ns/docbook" class="itemizedlist"><ul><li class="listitem"><div class="para"> 15 </div><a id="idm214007252256" class="indexterm"></a><a id="idm214007253712" class="indexterm"></a><a id="idm214007254816" class="indexterm"></a><a id="idm214007257712" class="indexterm"></a><div xmlns:d="http://docbook.org/ns/docbook" class="itemizedlist"><ul><li class="listitem"><div class="para">
13 <span class="package">systemtap</span> 16 <span class="package">systemtap</span>
14 </div></li><li class="listitem"><div class="para"> 17 </div></li><li class="listitem"><div class="para">
15 <span class="package">systemtap-runtime</span> 18 <span class="package">systemtap-runtime</span>
@@ -19,7 +22,8 @@
19 Note that before using SystemTap, you still need to install the required kernel information packages. On modern systems, run the following command as root to install these packages: 22 Note that before using SystemTap, you still need to install the required kernel information packages. On modern systems, run the following command as root to install these packages:
20 </div><pre class="screen"><code class="command">stap-prep</code></pre><div class="para"> 23 </div><pre class="screen"><code class="command">stap-prep</code></pre><div class="para">
21 If this command does not work, try manual installation as described below. 24 If this command does not work, try manual installation as described below.
22 </div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="install-kinfo"></a>2.1.2. Installing Required Kernel Information Packages Manually</h3></div></div></div><a id="idm47951476320512" class="indexterm"></a><a id="idm47951476318992" class="indexterm"></a><a id="idm47951476315824" class="indexterm"></a><a id="idm47951469090048" class="indexterm"></a><a id="idm47951469088976" class="indexterm"></a><a id="idm47951469087392" class="indexterm"></a><div class="para"> 25 </div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="install-kinfo">
26 ⁠</a>2.1.2. Installing Required Kernel Information Packages Manually</h3></div></div></div><a id="idm214007264384" class="indexterm"></a><a id="idm214007265808" class="indexterm"></a><a id="idm214007267120" class="indexterm"></a><a id="idm214007268048" class="indexterm"></a><a id="idm214007269024" class="indexterm"></a><a id="idm214007270496" class="indexterm"></a><div class="para">
23 SystemTap needs information about the kernel in order to place instrumentation in it (in other words, probe it). This information also allows SystemTap to generate the code for the instrumentation. 27 SystemTap needs information about the kernel in order to place instrumentation in it (in other words, probe it). This information also allows SystemTap to generate the code for the instrumentation.
24 </div><div class="para"> 28 </div><div class="para">
25 The required information is contained in the matching <span class="package">-devel</span>, <span class="package">-debuginfo</span>, and <span class="package">-debuginfo-common</span> packages for your kernel. The necessary <span class="package">-devel</span> and <span class="package">-debuginfo</span> packages for the ordinary "vanilla" kernel are as follows: 29 The required information is contained in the matching <span class="package">-devel</span>, <span class="package">-debuginfo</span>, and <span class="package">-debuginfo-common</span> packages for your kernel. The necessary <span class="package">-devel</span> and <span class="package">-debuginfo</span> packages for the ordinary "vanilla" kernel are as follows:
@@ -31,7 +35,7 @@
31 <span class="package">kernel-devel</span> 35 <span class="package">kernel-devel</span>
32 </div></li></ul></div><div class="para"> 36 </div></li></ul></div><div class="para">
33 Likewise, the necessary packages for the PAE kernel are <span class="package">kernel-PAE-debuginfo</span>, <span class="package">kernel-PAE-debuginfo-common</span>, and <span class="package">kernel-PAE-devel</span>. 37 Likewise, the necessary packages for the PAE kernel are <span class="package">kernel-PAE-debuginfo</span>, <span class="package">kernel-PAE-debuginfo-common</span>, and <span class="package">kernel-PAE-devel</span>.
34 </div><a id="idm47951469072832" class="indexterm"></a><a id="idm47951469071200" class="indexterm"></a><a id="idm47951469070144" class="indexterm"></a><a id="idm47951469068224" class="indexterm"></a><div class="para"> 38 </div><a id="idm214018386736" class="indexterm"></a><a id="idm214018387856" class="indexterm"></a><a id="idm214018388816" class="indexterm"></a><a id="idm214018436288" class="indexterm"></a><div class="para">
35 To determine what kernel your system is currently using, use: 39 To determine what kernel your system is currently using, use:
36 </div><pre class="screen">uname -r</pre><div class="para"> 40 </div><pre class="screen">uname -r</pre><div class="para">
37 For example, if you intend to use SystemTap on kernel version <span class="emphasis"><em>2.6.18-53.el5</em></span> on an <span class="emphasis"><em>i686</em></span> machine, download and install the following RPM packages: 41 For example, if you intend to use SystemTap on kernel version <span class="emphasis"><em>2.6.18-53.el5</em></span> on an <span class="emphasis"><em>i686</em></span> machine, download and install the following RPM packages:
@@ -47,13 +51,14 @@
47 The easiest way to install the required kernel information packages is through <code class="command">yum install</code> and <code class="command">debuginfo-install</code> commands. The <code class="command">debuginfo-install</code> command is included with later versions of the <span class="package">yum-utils</span> package (for example, version 1.1.10) and also requires an appropriate <code class="command">yum</code> repository from which to download and install <span class="package">-debuginfo</span> and <span class="package">-debuginfo-common</span> packages. You can install the required <span class="package">-devel</span>, <span class="package">-debuginfo</span>, and <span class="package">-debuginfo-common</span> packages for your kernel. 51 The easiest way to install the required kernel information packages is through <code class="command">yum install</code> and <code class="command">debuginfo-install</code> commands. The <code class="command">debuginfo-install</code> command is included with later versions of the <span class="package">yum-utils</span> package (for example, version 1.1.10) and also requires an appropriate <code class="command">yum</code> repository from which to download and install <span class="package">-debuginfo</span> and <span class="package">-debuginfo-common</span> packages. You can install the required <span class="package">-devel</span>, <span class="package">-debuginfo</span>, and <span class="package">-debuginfo-common</span> packages for your kernel.
48 </div><div class="para"> 52 </div><div class="para">
49 When the appropriate software repositories are enabled, install the corresponding packages for a specific kernel with the following commands: 53 When the appropriate software repositories are enabled, install the corresponding packages for a specific kernel with the following commands:
50 </div><pre class="screen"><code class="command">yum install <em class="replaceable"><code>kernelname</code></em>-devel-<em class="replaceable"><code>version</code></em></code> 54 </div><pre class="screen"><code class="command">yum install <em class="replaceable">kernelname</em>-devel-<em class="replaceable">version</em></code>
51<code class="command">debuginfo-install <em class="replaceable"><code>kernelname</code></em>-<em class="replaceable"><code>version</code></em></code></pre><div class="para"> 55<code class="command">debuginfo-install <em class="replaceable">kernelname</em>-<em class="replaceable">version</em></code></pre><div class="para">
52 Replace <em class="replaceable"><code>kernelname</code></em> with the appropriate kernel variant name (for example, <code class="option">kernel-PAE</code>), and <em class="replaceable"><code>version</code></em> with the target kernel's version. For example, to install the required kernel information packages for the <code class="systemitem">kernel-PAE-2.6.18-53.1.13.el5</code> kernel, run: 56 Replace <em class="replaceable">kernelname</em> with the appropriate kernel variant name (for example, <code class="option">kernel-PAE</code>), and <em class="replaceable">version</em> with the target kernel's version. For example, to install the required kernel information packages for the <code class="systemitem">kernel-PAE-2.6.18-53.1.13.el5</code> kernel, run:
53 </div><pre class="screen"><code class="command">yum install kernel-PAE-devel-2.6.18-53.1.13.el5</code> 57 </div><pre class="screen"><code class="command">yum install kernel-PAE-devel-2.6.18-53.1.13.el5</code>
54<code class="command">debuginfo-install kernel-PAE-2.6.18-53.1.13.el5</code></pre><div class="para"> 58<code class="command">debuginfo-install kernel-PAE-2.6.18-53.1.13.el5</code></pre><div class="para">
55 Once you have manually downloaded the required packages to the machine, run the following command as root to install them: 59 Once you have manually downloaded the required packages to the machine, run the following command as root to install them:
56 </div><pre class="screen"><code class="command">rpm --force -ivh <em class="replaceable"><code>package_names</code></em></code></pre></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="testing"></a>2.1.3. Initial Testing</h3></div></div></div><a id="idm47951421598192" class="indexterm"></a><a id="idm47951418798880" class="indexterm"></a><a id="idm47951441687728" class="indexterm"></a><div class="para"> 60 </div><pre class="screen"><code class="command">rpm --force -ivh <em class="replaceable">package_names</em></code></pre></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="testing">
61 ⁠</a>2.1.3. Initial Testing</h3></div></div></div><a id="idm214010617504" class="indexterm"></a><a id="idm214026486640" class="indexterm"></a><a id="idm214026487568" class="indexterm"></a><div class="para">
57 If you are currently using the kernel you intend to probe with SystemTap, you can immediately test whether the deployment was successful. If not, you restart the system and load the appropriate kernel. 62 If you are currently using the kernel you intend to probe with SystemTap, you can immediately test whether the deployment was successful. If not, you restart the system and load the appropriate kernel.
58 </div><div class="para"> 63 </div><div class="para">
59 To start the test, run the following command: 64 To start the test, run the following command:
diff --git a/SystemTap_Beginners_Guide/using-usage.html b/SystemTap_Beginners_Guide/using-usage.html
index d0a6d4c5..e353e4af 100644
--- a/SystemTap_Beginners_Guide/using-usage.html
+++ b/SystemTap_Beginners_Guide/using-usage.html
@@ -1,43 +1,46 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">2.3. Running SystemTap Scripts</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="using-systemtap.html" title="Chapter 2. Using SystemTap" /><link rel="prev" href="cross-compiling.html" title="2.2. Generating Instrumentation for Other Computers" /><link rel="next" href="understanding-how-systemtap-works.html" title="Chapter 3. Understanding How SystemTap Works" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="cross-compiling.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="understanding-how-systemtap-works.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="using-usage"></a>2.3. Running SystemTap Scripts</h2></div></div></div><a id="idm47951415801648" class="indexterm"></a><a id="idm47951415800096" class="indexterm"></a><a id="idm47951415798544" class="indexterm"></a><a id="idm47951420981024" class="indexterm"></a><a id="idm47951420979120" class="indexterm"></a><a id="idm47951421073008" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">2.3. Running SystemTap Scripts</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="using-systemtap.html" title="Chapter 2. Using SystemTap" /><link rel="prev" href="cross-compiling.html" title="2.2. Generating Instrumentation for Other Computers" /><link rel="next" href="understanding-how-systemtap-works.html" title="Chapter 3. Understanding How SystemTap Works" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="cross-compiling.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="understanding-how-systemtap-works.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="using-usage">
3 ⁠</a>2.3. Running SystemTap Scripts</h2></div></div></div><a id="idm213967504016" class="indexterm"></a><a id="idm214020979488" class="indexterm"></a><a id="idm214020978080" class="indexterm"></a><a id="idm214017322192" class="indexterm"></a><a id="idm214017320464" class="indexterm"></a><a id="idm214017319024" class="indexterm"></a><div class="para">
3 SystemTap is distributed with a number of command line tools that allow you to monitor the activities of the system. The <code class="command">stap</code> command reads probing instructions from a SystemTap script, translates these instructions into C code, builds a kernel module, and loads it into the running Linux kernel. The <code class="command">staprun</code> command runs SystemTap instrumentation, that is, a kernel module built from SystemTap scripts during a cross-instrumentation. 4 SystemTap is distributed with a number of command line tools that allow you to monitor the activities of the system. The <code class="command">stap</code> command reads probing instructions from a SystemTap script, translates these instructions into C code, builds a kernel module, and loads it into the running Linux kernel. The <code class="command">staprun</code> command runs SystemTap instrumentation, that is, a kernel module built from SystemTap scripts during a cross-instrumentation.
4 </div><a id="idm47951475955776" class="indexterm"></a><div class="para"> 5 </div><a id="idm214021173232" class="indexterm"></a><div class="para">
5 Running <code class="command">stap</code> and <code class="command">staprun</code> requires elevated privileges to the system. Because not all users can be granted root access just to run SystemTap, you can allow a non-privileged user to run SystemTap instrumentation on their machine by adding them to one of the following user groups: 6 Running <code class="command">stap</code> and <code class="command">staprun</code> requires elevated privileges to the system. Because not all users can be granted root access just to run SystemTap, you can allow a non-privileged user to run SystemTap instrumentation on their machine by adding them to one of the following user groups:
6 </div><div class="variablelist"><dl class="variablelist"><dt><span class="term">stapdev</span></dt><dd><a id="idm47951464641232" class="indexterm"></a><a id="idm47951464639648" class="indexterm"></a><div class="para"> 7 </div><div class="variablelist"><dl class="variablelist"><dt><span class="term">stapdev</span></dt><dd><a id="idm213970859328" class="indexterm"></a><a id="idm213970858368" class="indexterm"></a><div class="para">
7 Members of this group can use the <code class="command">stap</code> command to run SystemTap scripts, or <code class="command">staprun</code> to run SystemTap instrumentation modules. 8 Members of this group can use the <code class="command">stap</code> command to run SystemTap scripts, or <code class="command">staprun</code> to run SystemTap instrumentation modules.
8 </div><div class="para"> 9 </div><div class="para">
9 Running the <code class="command">stap</code> command involves compiling SystemTap scripts into kernel modules and loading them into the kernel. This operation requires elevated privileges to the system, which are granted to <code class="systemitem">stapdev</code> members. Unfortunately, such privileges also grant effective root access to <code class="systemitem">stapdev</code> members. As a consequence, only grant <code class="systemitem">stapdev</code> group membership to users whom you can trust with root access. 10 Running the <code class="command">stap</code> command involves compiling SystemTap scripts into kernel modules and loading them into the kernel. This operation requires elevated privileges to the system, which are granted to <code class="systemitem">stapdev</code> members. Unfortunately, such privileges also grant effective root access to <code class="systemitem">stapdev</code> members. As a consequence, only grant <code class="systemitem">stapdev</code> group membership to users whom you can trust with root access.
10 </div></dd><dt><span class="term">stapusr</span></dt><dd><a id="idm47951416426720" class="indexterm"></a><a id="idm47951416425136" class="indexterm"></a><div class="para"> 11 </div></dd><dt><span class="term">stapusr</span></dt><dd><a id="idm214018114544" class="indexterm"></a><a id="idm214018113584" class="indexterm"></a><div class="para">
11 Members of this group can only use the <code class="command">staprun</code> command to run SystemTap instrumentation modules. In addition, they can only run modules from the <code class="filename">/lib/modules/<em class="replaceable"><code>kernel_version</code></em>/systemtap/</code> directory. Note that this directory must be owned only by the root user, and must only be writable by the root user. 12 Members of this group can only use the <code class="command">staprun</code> command to run SystemTap instrumentation modules. In addition, they can only run modules from the <code class="filename">/lib/modules/<em class="replaceable">kernel_version</em>/systemtap/</code> directory. Note that this directory must be owned only by the root user, and must only be writable by the root user.
12 </div></dd></dl></div><div class="para"> 13 </div></dd></dl></div><div class="para">
13 The <code class="command">stap</code> command reads a SystemTap script either from a file, or from standard input. To tell <code class="command">stap</code> to read a SystemTap script from a file, specify the file name on the command line: 14 The <code class="command">stap</code> command reads a SystemTap script either from a file, or from standard input. To tell <code class="command">stap</code> to read a SystemTap script from a file, specify the file name on the command line:
14 </div><pre class="screen"><code class="command">stap <em class="replaceable"><code>file_name</code></em></code></pre><a id="idm47951476455200" class="indexterm"></a><a id="idm47951476453648" class="indexterm"></a><a id="idm47951476452096" class="indexterm"></a><div class="para"> 15 </div><pre class="screen"><code class="command">stap <em class="replaceable">file_name</em></code></pre><a id="idm214026368912" class="indexterm"></a><a id="idm214022261312" class="indexterm"></a><a id="idm214022259904" class="indexterm"></a><div class="para">
15 To instruct <code class="command">stap</code> to read a SystemTap script from standard input, use the <code class="option">-</code> switch instead of the file name. Note that any command-line options you wish to use must be inserted before the <code class="option">-</code> switch. For example, to make the output of the <code class="command">stap</code> command more verbose, type: 16 To instruct <code class="command">stap</code> to read a SystemTap script from standard input, use the <code class="option">-</code> switch instead of the file name. Note that any command-line options you wish to use must be inserted before the <code class="option">-</code> switch. For example, to make the output of the <code class="command">stap</code> command more verbose, type:
16 </div><pre class="screen"><code class="command">echo "probe timer.s(1) {exit()}" | stap -v -</code></pre><div class="para"> 17 </div><pre class="screen"><code class="command">echo "probe timer.s(1) {exit()}" | stap -v -</code></pre><div class="para">
17 Below is a list of commonly used <code class="command">stap</code> options: 18 Below is a list of commonly used <code class="command">stap</code> options:
18 </div><a id="idm47951461450880" class="indexterm"></a><a id="idm47951468792704" class="indexterm"></a><div class="variablelist"><a id="idm47951468790768" class="indexterm"></a><dl class="variablelist"><dt><span class="term">-v</span></dt><dd><div class="para"> 19 </div><a id="idm213978798832" class="indexterm"></a><a id="idm214013832448" class="indexterm"></a><div class="variablelist"><a id="idm214013830688" class="indexterm"></a><dl class="variablelist"><dt><span class="term">-v</span></dt><dd><div class="para">
19 Makes the output of the SystemTap session more verbose. You can repeat this option multiple times to provide more details on the script's execution, for example: 20 Makes the output of the SystemTap session more verbose. You can repeat this option multiple times to provide more details on the script's execution, for example:
20 </div><pre class="screen"><code class="command">stap -vvv script.stp</code></pre><div class="para"> 21 </div><pre class="screen"><code class="command">stap -vvv script.stp</code></pre><div class="para">
21 This option is particularly useful if you encounter any errors in running the script. For more information about common SystemTap script errors, refer to <a class="xref" href="errors.html">Chapter 6, <em>Understanding SystemTap Errors</em></a>. 22 This option is particularly useful if you encounter any errors in running the script. For more information about common SystemTap script errors, refer to <a class="xref" href="errors.html">Chapter 6, <em>Understanding SystemTap Errors</em></a>.
22 </div></dd><dt><span class="term">-o <em class="replaceable"><code>file_name</code></em></span></dt><dd><div class="para"> 23 </div></dd><dt><span class="term">-o <em class="replaceable">file_name</em></span></dt><dd><div class="para">
23 Sends the standard output to a file named <em class="replaceable"><code>file_name</code></em>. 24 Sends the standard output to a file named <em class="replaceable">file_name</em>.
24 </div></dd><dt><span class="term">-S <em class="replaceable"><code>size</code></em>,<em class="replaceable"><code>count</code></em></span></dt><dd><div class="para"> 25 </div></dd><dt><span class="term">-S <em class="replaceable">size</em>,<em class="replaceable">count</em></span></dt><dd><div class="para">
25 Limits the maximum size of output files to <em class="replaceable"><code>size</code></em> megabytes and the maximum number of stored files to <em class="replaceable"><code>count</code></em>. This option implements logrotate operations for SystemTap and the resulting file names have a sequence number suffix. 26 Limits the maximum size of output files to <em class="replaceable">size</em> megabytes and the maximum number of stored files to <em class="replaceable">count</em>. This option implements logrotate operations for SystemTap and the resulting file names have a sequence number suffix.
26 </div></dd><dt><span class="term">-x <em class="replaceable"><code>process_id</code></em></span></dt><dd><div class="para"> 27 </div></dd><dt><span class="term">-x <em class="replaceable">process_id</em></span></dt><dd><div class="para">
27 Sets the SystemTap handler function <code class="function">target()</code> to the specified process ID. For more information about <code class="function">target()</code>, refer to <a class="xref" href="systemtapscript-handler.html#systemtapscript-functions">SystemTap Functions</a>. 28 Sets the SystemTap handler function <code class="function">target()</code> to the specified process ID. For more information about <code class="function">target()</code>, refer to <a class="xref" href="systemtapscript-handler.html#systemtapscript-functions">SystemTap Functions</a>.
28 </div></dd><dt><span class="term">-c '<em class="replaceable"><code>command</code></em>'</span></dt><dd><div class="para"> 29 </div></dd><dt><span class="term">-c '<em class="replaceable">command</em>'</span></dt><dd><div class="para">
29 Sets the SystemTap handler function <code class="function">target()</code> to the specified command and runs the SystemTap instrumentation for the duration of this command. For more information about <code class="function">target()</code>, refer to <a class="xref" href="systemtapscript-handler.html#systemtapscript-functions">SystemTap Functions</a>. 30 Sets the SystemTap handler function <code class="function">target()</code> to the specified command and runs the SystemTap instrumentation for the duration of this command. For more information about <code class="function">target()</code>, refer to <a class="xref" href="systemtapscript-handler.html#systemtapscript-functions">SystemTap Functions</a>.
30 </div></dd><dt><span class="term">-e '<em class="replaceable"><code>script</code></em>'</span></dt><dd><div class="para"> 31 </div></dd><dt><span class="term">-e '<em class="replaceable">script</em>'</span></dt><dd><div class="para">
31 Uses <em class="replaceable"><code>script</code></em> rather than a file as input for the SystemTap translator. 32 Uses <em class="replaceable">script</em> rather than a file as input for the SystemTap translator.
32 </div></dd><dt><span class="term">-F</span></dt><dd><div class="para"> 33 </div></dd><dt><span class="term">-F</span></dt><dd><div class="para">
33 Uses SystemTap's flight recorder mode and makes the script a background process. For more information about flight recorder mode, refer to <a class="xref" href="using-usage.html#flight-recorder">Section 2.3.1, “SystemTap Flight Recorder Mode”</a>. 34 Uses SystemTap's flight recorder mode and makes the script a background process. For more information about flight recorder mode, refer to <a class="xref" href="using-usage.html#flight-recorder">Section 2.3.1, “SystemTap Flight Recorder Mode”</a>.
34 </div></dd></dl></div><div class="para"> 35 </div></dd></dl></div><div class="para">
35 For more information about the <code class="command">stap</code> command, refer to the <span class="citerefentry"><span class="refentrytitle">stap</span>(1)</span> man page. For more information about the <code class="command">staprun</code> command and cross-instrumentation, refer to <a class="xref" href="cross-compiling.html">Section 2.2, “Generating Instrumentation for Other Computers”</a> or the <span class="citerefentry"><span class="refentrytitle">staprun</span>(8)</span> man page. 36 For more information about the <code class="command">stap</code> command, refer to the <span class="citerefentry"><span class="refentrytitle">stap</span>(1)</span> man page. For more information about the <code class="command">staprun</code> command and cross-instrumentation, refer to <a class="xref" href="cross-compiling.html">Section 2.2, “Generating Instrumentation for Other Computers”</a> or the <span class="citerefentry"><span class="refentrytitle">staprun</span>(8)</span> man page.
36 </div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="flight-recorder"></a>2.3.1. SystemTap Flight Recorder Mode</h3></div></div></div><a id="idm47951427890768" class="indexterm"></a><div class="para"> 37 </div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="flight-recorder">
38 ⁠</a>2.3.1. SystemTap Flight Recorder Mode</h3></div></div></div><a id="idm214014450816" class="indexterm"></a><div class="para">
37 SystemTap's flight recorder mode allows you to run a SystemTap script for long periods of time and just focus on recent output. The flight recorder mode limits the amount of output generated. 39 SystemTap's flight recorder mode allows you to run a SystemTap script for long periods of time and just focus on recent output. The flight recorder mode limits the amount of output generated.
38 </div><div class="para"> 40 </div><div class="para">
39 There are two variations of the flight recorder mode: <em class="firstterm">in-memory</em> and <em class="firstterm">file</em> mode. In both cases, the SystemTap script runs as a background process. 41 There are two variations of the flight recorder mode: <em class="firstterm">in-memory</em> and <em class="firstterm">file</em> mode. In both cases, the SystemTap script runs as a background process.
40 </div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="memory-flight-recorder"></a>2.3.1.1. In-memory Flight Recorder</h4></div></div></div><a id="idm47951427886352" class="indexterm"></a><div class="para"> 42 </div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="memory-flight-recorder">
43 ⁠</a>2.3.1.1. In-memory Flight Recorder</h4></div></div></div><a id="idm214014446704" class="indexterm"></a><div class="para">
41 When flight recorder mode is used without a file name, SystemTap uses a buffer in kernel memory to store the output of the script. Once the SystemTap instrumentation module is loaded and the probes start running, the instrumentation detaches and is put in the background. When the interesting event occurs, you can reattach to the instrumentation to see the recent output in the memory buffer and any continuing output. 44 When flight recorder mode is used without a file name, SystemTap uses a buffer in kernel memory to store the output of the script. Once the SystemTap instrumentation module is loaded and the probes start running, the instrumentation detaches and is put in the background. When the interesting event occurs, you can reattach to the instrumentation to see the recent output in the memory buffer and any continuing output.
42 </div><div class="para"> 45 </div><div class="para">
43 To run a SystemTap script by using the flight recorder in-memory mode, run the <code class="command">stap</code> command with the <code class="option">-F</code> command line option: 46 To run a SystemTap script by using the flight recorder in-memory mode, run the <code class="command">stap</code> command with the <code class="option">-F</code> command line option:
@@ -48,10 +51,11 @@ To reconnect, type "staprun -A stap_5dd0073edcb1f13f7565d8c343063e68_19556"</pre
48 When the interesting event occurs, run the following command to connect to the currently running script, output the recent data in the memory buffer, and get continuing output: 51 When the interesting event occurs, run the following command to connect to the currently running script, output the recent data in the memory buffer, and get continuing output:
49 </div><pre class="screen"><code class="command">staprun -A stap_5dd0073edcb1f13f7565d8c343063e68_19556</code></pre><div class="para"> 52 </div><pre class="screen"><code class="command">staprun -A stap_5dd0073edcb1f13f7565d8c343063e68_19556</code></pre><div class="para">
50 By default, the kernel buffer is 1MB in size. You can increase this value by using the <code class="option">-s</code> option with the size in megabytes (rounded up to the next power over 2) for the buffer. For example, <code class="option">-s2</code> on the SystemTap command line would specify 2MB for the buffer. 53 By default, the kernel buffer is 1MB in size. You can increase this value by using the <code class="option">-s</code> option with the size in megabytes (rounded up to the next power over 2) for the buffer. For example, <code class="option">-s2</code> on the SystemTap command line would specify 2MB for the buffer.
51 </div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="file-flight-recorder"></a>2.3.1.2. File Flight Recorder</h4></div></div></div><a id="idm47951457042880" class="indexterm"></a><div class="para"> 54 </div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="file-flight-recorder">
55 ⁠</a>2.3.1.2. File Flight Recorder</h4></div></div></div><a id="idm214011949600" class="indexterm"></a><div class="para">
52 The flight recorder mode can also store data to files. You can control the number and size of the files kept by using the <code class="option">-S</code> option followed by two numerical arguments separated by a comma: the first argument is the maximum size in megabytes for the each output file, the second argument is the number of recent files to keep. To specify the file name, use the <code class="option">-o</code> option followed by the name. SystemTap automatically adds a number suffix to the file name to indicate the order of the files. 56 The flight recorder mode can also store data to files. You can control the number and size of the files kept by using the <code class="option">-S</code> option followed by two numerical arguments separated by a comma: the first argument is the maximum size in megabytes for the each output file, the second argument is the number of recent files to keep. To specify the file name, use the <code class="option">-o</code> option followed by the name. SystemTap automatically adds a number suffix to the file name to indicate the order of the files.
53 </div><div class="para"> 57 </div><div class="para">
54 The following command starts SystemTap in file flight recorder mode with the output going to files named <code class="filename">/tmp/iotime.log.<em class="replaceable"><code>[0-9]+</code></em></code>, each file 1MB or smaller, and keeping latest two files: 58 The following command starts SystemTap in file flight recorder mode with the output going to files named <code class="filename">/tmp/iotime.log.<em class="replaceable">[0-9]+</em></code>, each file 1MB or smaller, and keeping latest two files:
55 </div><pre class="screen"><code class="command">stap -F -o /tmp/pfaults.log -S 1,2 pfaults.stp</code></pre><div class="para"> 59 </div><pre class="screen"><code class="command">stap -F -o /tmp/pfaults.log -S 1,2 pfaults.stp</code></pre><div class="para">
56 The command prints the process ID to standard output. Sending a SIGTERM to the process terminates the SystemTap script and stops the data collection. For example, if the previous command listed 7590 as the process ID, the following command would stop the SystemTap script: 60 The command prints the process ID to standard output. Sending a SIGTERM to the process terminates the SystemTap script and stops the data collection. For example, if the previous command listed 7590 as the process ID, the following command would stop the SystemTap script:
57 </div><pre class="screen"><code class="command">kill -s SIGTERM 7590</code></pre><div class="para"> 61 </div><pre class="screen"><code class="command">kill -s SIGTERM 7590</code></pre><div class="para">
diff --git a/SystemTap_Beginners_Guide/ustack.html b/SystemTap_Beginners_Guide/ustack.html
index 116620aa..e6e21f2a 100644
--- a/SystemTap_Beginners_Guide/ustack.html
+++ b/SystemTap_Beginners_Guide/ustack.html
@@ -1,8 +1,9 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">4.3. User-Space Stack Backtraces</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="userspace-probing.html" title="Chapter 4. User-space Probing" /><link rel="prev" href="utargetvariable.html" title="4.2. Accessing User-Space Target Variables" /><link rel="next" href="useful-systemtap-scripts.html" title="Chapter 5. Useful SystemTap Scripts" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="utargetvariable.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="useful-systemtap-scripts.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="ustack"></a>4.3. User-Space Stack Backtraces</h2></div></div></div><a id="idm47951427807952" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">4.3. User-Space Stack Backtraces</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="userspace-probing.html" title="Chapter 4. User-space Probing" /><link rel="prev" href="utargetvariable.html" title="4.2. Accessing User-Space Target Variables" /><link rel="next" href="useful-systemtap-scripts.html" title="Chapter 5. Useful SystemTap Scripts" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="utargetvariable.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="useful-systemtap-scripts.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="ustack">
3 ⁠</a>4.3. User-Space Stack Backtraces</h2></div></div></div><a id="idm214012410256" class="indexterm"></a><div class="para">
3 The probe point (<code class="function">pp</code>) function indicates which particular event triggered the SystemTap event handler. A probe on the entry into a function would list the function name. However, in many cases the same probe point event may be triggered by many different modules in the program; this is particularly true for functions in shared libraries. A SystemTap backtrace of the user-space stack can provide additional context on how the probe point event is triggered. 4 The probe point (<code class="function">pp</code>) function indicates which particular event triggered the SystemTap event handler. A probe on the entry into a function would list the function name. However, in many cases the same probe point event may be triggered by many different modules in the program; this is particularly true for functions in shared libraries. A SystemTap backtrace of the user-space stack can provide additional context on how the probe point event is triggered.
4 </div><div class="para"> 5 </div><div class="para">
5 The user-space stack backtrace generation is complicated by the compiler producing code optimized to eliminate stack frame pointers. However, the compiler also includes information in the debug information section to allow debugging tools to produce stack backtraces. SystemTap user-space stack backtrace mechanism makes use of that debug information to walk the stack to generate stack traces for 32-bit and 64-bit x86 processors; other processor architectures do not yet support the use of debug information to unwind the user-space stack. To ensure that the needed debug information is used to produce the user-space stack backtraces, use the <code class="option">-d <em class="replaceable"><code>executable</code></em></code> option for executables and <code class="option">-ldd</code> for shared libraries. 6 The user-space stack backtrace generation is complicated by the compiler producing code optimized to eliminate stack frame pointers. However, the compiler also includes information in the debug information section to allow debugging tools to produce stack backtraces. SystemTap user-space stack backtrace mechanism makes use of that debug information to walk the stack to generate stack traces for 32-bit and 64-bit x86 processors; other processor architectures do not yet support the use of debug information to unwind the user-space stack. To ensure that the needed debug information is used to produce the user-space stack backtraces, use the <code class="option">-d <em class="replaceable">executable</em></code> option for executables and <code class="option">-ldd</code> for shared libraries.
6 </div><div class="para"> 7 </div><div class="para">
7 For example, you can use the user-space backtrack functions to see how the <code class="function">xmalloc</code> function is being called by the <code class="command">ls</code> command. With the debuginfo for the <code class="command">ls</code> command installed, the following SystemTap command provides a backtrace each time the <code class="function">xmalloc</code> function is called: 8 For example, you can use the user-space backtrack functions to see how the <code class="function">xmalloc</code> function is being called by the <code class="command">ls</code> command. With the debuginfo for the <code class="command">ls</code> command installed, the following SystemTap command provides a backtrace each time the <code class="function">xmalloc</code> function is called:
8 </div><pre class="screen"><code class="command">stap -d /bin/ls --ldd \</code> 9 </div><pre class="screen"><code class="command">stap -d /bin/ls --ldd \</code>
diff --git a/SystemTap_Beginners_Guide/utargetvariable.html b/SystemTap_Beginners_Guide/utargetvariable.html
index a844a6a4..670bfcf1 100644
--- a/SystemTap_Beginners_Guide/utargetvariable.html
+++ b/SystemTap_Beginners_Guide/utargetvariable.html
@@ -1,18 +1,19 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">4.2. Accessing User-Space Target Variables</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.0.0" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="userspace-probing.html" title="Chapter 4. User-space Probing" /><link rel="prev" href="userspace-probing.html" title="Chapter 4. User-space Probing" /><link rel="next" href="ustack.html" title="4.3. User-Space Stack Backtraces" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="userspace-probing.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="ustack.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="utargetvariable"></a>4.2. Accessing User-Space Target Variables</h2></div></div></div><a id="idm47951417223648" class="indexterm"></a><div class="para"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title xmlns:d="http://docbook.org/ns/docbook">4.2. Accessing User-Space Target Variables</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta xmlns:d="http://docbook.org/ns/docbook" name="generator" content="publican v4.1.3" /><meta xmlns:d="http://docbook.org/ns/docbook" name="package" content="SystemTap-SystemTap_Beginners_Guide-2.6-en-US-2.0-1" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="userspace-probing.html" title="Chapter 4. User-space Probing" /><link rel="prev" href="userspace-probing.html" title="Chapter 4. User-space Probing" /><link rel="next" href="ustack.html" title="4.3. User-Space Stack Backtraces" /></head><body><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img alt="Product Site" src="Common_Content/images//image_left.png" /></a><a class="right" href="https://fedorahosted.org/publican"><img alt="Documentation Site" src="Common_Content/images//image_right.png" /></a></p><ul class="docnav top"><li class="previous"><a accesskey="p" href="userspace-probing.html"><strong>Prev</strong></a></li><li class="home">SystemTap Beginners Guide</li><li class="next"><a accesskey="n" href="ustack.html"><strong>Next</strong></a></li></ul><div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="utargetvariable">
3 ⁠</a>4.2. Accessing User-Space Target Variables</h2></div></div></div><a id="idm214014154976" class="indexterm"></a><div class="para">
3 You can access user-space target variables in the same manner as described in <a class="xref" href="targetvariables.html">Section 3.3.2, “Target Variables”</a>. In Linux, however, there are separate address spaces for the user and kernel code. When using the <code class="literal">-&gt;</code> operator, SystemTap accesses the appropriate address space. 4 You can access user-space target variables in the same manner as described in <a class="xref" href="targetvariables.html">Section 3.3.2, “Target Variables”</a>. In Linux, however, there are separate address spaces for the user and kernel code. When using the <code class="literal">-&gt;</code> operator, SystemTap accesses the appropriate address space.
4 </div><div class="para"> 5 </div><div class="para">
5 For pointers to base types such as integers and strings, there are a number of functions listed below to access user-space data. The first argument for each functions is the pointer to the data item. 6 For pointers to base types such as integers and strings, there are a number of functions listed below to access user-space data. The first argument for each functions is the pointer to the data item.
6 </div><div class="variablelist"><dl class="variablelist"><dt><span class="term">user_char(<em class="replaceable"><code>address</code></em>)</span></dt><dd><div class="para"> 7 </div><div class="variablelist"><dl class="variablelist"><dt><span class="term">user_char(<em class="replaceable">address</em>)</span></dt><dd><div class="para">
7 Obtains the character at <em class="replaceable"><code>address</code></em> for the current user process. 8 Obtains the character at <em class="replaceable">address</em> for the current user process.
8 </div></dd><dt><span class="term">user_short(<em class="replaceable"><code>address</code></em>)</span></dt><dd><div class="para"> 9 </div></dd><dt><span class="term">user_short(<em class="replaceable">address</em>)</span></dt><dd><div class="para">
9 Obtains the short integer at <em class="replaceable"><code>address</code></em> for the current user process. 10 Obtains the short integer at <em class="replaceable">address</em> for the current user process.
10 </div></dd><dt><span class="term">user_int(<em class="replaceable"><code>address</code></em>)</span></dt><dd><div class="para"> 11 </div></dd><dt><span class="term">user_int(<em class="replaceable">address</em>)</span></dt><dd><div class="para">
11 Obtains the integer at <em class="replaceable"><code>address</code></em> for the current user process. 12 Obtains the integer at <em class="replaceable">address</em> for the current user process.
12 </div></dd><dt><span class="term">user_long(<em class="replaceable"><code>address</code></em>)</span></dt><dd><div class="para"> 13 </div></dd><dt><span class="term">user_long(<em class="replaceable">address</em>)</span></dt><dd><div class="para">
13 Obtains the long integer at <em class="replaceable"><code>address</code></em> for the current user process. 14 Obtains the long integer at <em class="replaceable">address</em> for the current user process.
14 </div></dd><dt><span class="term">user_string(<em class="replaceable"><code>address</code></em>)</span></dt><dd><div class="para"> 15 </div></dd><dt><span class="term">user_string(<em class="replaceable">address</em>)</span></dt><dd><div class="para">
15 Obtains the string at <em class="replaceable"><code>address</code></em> for the current user process. 16 Obtains the string at <em class="replaceable">address</em> for the current user process.
16 </div></dd><dt><span class="term">user_string_n(<em class="replaceable"><code>address</code></em>, <em class="replaceable"><code>n</code></em>)</span></dt><dd><div class="para"> 17 </div></dd><dt><span class="term">user_string_n(<em class="replaceable">address</em>, <em class="replaceable">n</em>)</span></dt><dd><div class="para">
17 Obtains the string at <em class="replaceable"><code>address</code></em> for the current user process and limits the string to <em class="replaceable"><code>n</code></em> bytes. 18 Obtains the string at <em class="replaceable">address</em> for the current user process and limits the string to <em class="replaceable">n</em> bytes.
18 </div></dd></dl></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="userspace-probing.html"><strong>Prev</strong>Chapter 4. User-space Probing</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="ustack.html"><strong>Next</strong>4.3. User-Space Stack Backtraces</a></li></ul></body></html> \ No newline at end of file 19 </div></dd></dl></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="userspace-probing.html"><strong>Prev</strong>Chapter 4. User-space Probing</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="ustack.html"><strong>Next</strong>4.3. User-Space Stack Backtraces</a></li></ul></body></html> \ No newline at end of file