Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Linux Tools Project/Systemtap/User Guide/ide/lesson3.html"

(New page: <h2> IDE Tutorial, Lesson Three: Running Your Script </h2> In this lesson we will cover running your script. You may use either the example script you opened in Lesson 1 or the script you...)
 
Line 1: Line 1:
<h2>
+
== IDE Tutorial, Lesson Three: Running Your Script ==
IDE Tutorial, Lesson Three: Running Your Script
+
</h2>
+
  
In this lesson we will cover running your script. You may use either the example script you opened in Lesson
+
In this lesson we will cover running your script. You may use either the example script you opened in Lesson 1 or the script you wrote in Lesson two. Select <u>R</u>un-&gt;<u>R</u>un. Enter the remote server details. You should receive output in the console similar to the following, which shows the reads and write per second. <br><br>  
1 or the script you wrote in Lesson two. Select <u>R</u>un-><u>R</u>un. Enter the remote server details. You should receive output in the console  
+
similar to the following, which shows the reads and write per second. If you do not, please refer to
+
<a href="crap.html">troubleshooting</a>.<br><br>
+
  
<img src="images/output.png"><br><br>
+
[[Image:IDEOutput.png]]
  
Now we will demonstrate running Systemtap scripts with graphs. In order to run the chart example you'll  
+
Now we will demonstrate running Systemtap scripts with graphs. In order to run the chart example you'll need to use the code provided in [[Linux_Tools_Project/Systemtap/User_Guide/ide/lesson2.html | Lesson 2: Writing Your First Script ]];. To do this select '''<u>R</u>un-&gt;Run w/ <u>C</u>hart'''. This feature will prompt the user for the number of columns for the chart, in addition to their titles and regular expressions. The regular expressions are used to parse the console output for the script and determine the values of each column at a certain sample point. The combined regular expression is shown at the bottom of the dialogue box.  
need to use the code provided in <a href="lesson2.html">Lesson 2</a>. To do this select  
+
<b><u>R</u>un->Run w/ <u>C</u>hart</b>. This feature will prompt the user for the number of columns for the chart, in addition to  
+
their titles and regular expressions. The regular expressions are used to parse the console output for  
+
the script and determine the values of each column at a certain sample point. The combined regular
+
expression is shown at the bottom of the dialogue box.  
+
  
<br><img src="images/chartbox1.png"><br><br></li>
+
[[Image:chartbox1.png]]
 
+
For this example enter the following:<br>
+
  
 +
For this example enter the following:<br>
 
<pre> Columns: 3
 
<pre> Columns: 3
  
Line 27: Line 16:
 
Read \d+ .* \D+
 
Read \d+ .* \D+
 
Write \d+ .* \D+
 
Write \d+ .* \D+
</pre><br>
+
</pre>
 +
 
 +
 
 +
The title fields simply display the associated string in the column's header. After clicking OK the script will prompt you for details regarding the Remote Server. Provide the ip address of the remote server that is running the systemtapgui Server or the Data Management Daemon. The port is by default 22462. Enter a username and password.This will give the application permissions to run your script on the remote machine. You have the option of saving your password as well, however be warned this is currently NOT encrypted so this convenience runs at a risk. The username is also used to transfer the file to the remote system using SCP. If the same machine is used as both the server and the client enter 'localhost' for the Host field. When the script is executed the application will switch into the Graphing perspective. A Data View chart is populated with live data, in addition to the output in the console. <br><br> You should see a screen similar to the following:<br><br>  
  
The title fields simply display the associated string in the column's header. After clicking OK the
+
[[Image:IDEGraphics.png]]
script will prompt you for details regarding the Remote Server. Provide the ip address of the remote server
+
that is running the systemtapgui Server or the Data Management Daemon. The port is by default 22462. Enter
+
a username and password.This will give the application permissions to run your script on the remote machine.
+
You have the option of saving your password as well, however be warned this is currently NOT encrypted so this
+
convenience runs at a risk. The username is also used to transfer the file to the remote system using SCP. If the
+
same machine is used as both the server and the client enter 'localhost' for the Host field.
+
When the script is executed the application will switch into the Graphing perspective. A Data View chart is
+
populated with live data, in addition to the output in the console. <br><br>
+
You should see a screen similar to the following:<br><br>
+
  
<img src="images/graphics.png"><br><br>
+
You will see that the data table poplulates from live data parsed from the console. Now we'll make a graph to briefly illustrate the Graphing perspective. Click the Create Graph button next to bring up the Select Chart dialogue.Select line graph. You will be prompted to select a column of the X series and Y series; select "Time" and "Write" respectively. After you click ok you should see the line graph as follows:<br><br>  
  
You will see that the data table poplulates from live data parsed from the console. Now we'll make a
 
graph to briefly illustrate the Graphing perspective. Click the Create Graph button next to bring up the
 
Select Chart dialogue.Select line graph. You will be prompted to select a column of the X series and Y
 
series; select "Time" and "Write" respectively. After you click ok you should see the line graph as follows:<br><br>
 
  
<img src="images/graph.png"><br><br>
+
[[Image:IDEGraph.png]]
  
Note that the multiple series graphs (Multi-Line, Multi-Bar, and Multi-Scatter) will request two Y series, Y1  
+
Note that the multiple series graphs (Multi-Line, Multi-Bar, and Multi-Scatter) will request two Y series, Y1 and Y2. In the case of our example, these would be "Read" and "Write". Each series will be assigned a different color value for the purposes of differentiation and will be plotted both in respect to the specified X series.&lt;
and Y2. In the case of our example, these would be "Read" and "Write". Each series will be assigned a different
+
color value for the purposes of differentiation and will be plotted both in respect to the specified X series.<
+
  
Those are the basics behind running a script in Systemtap GUI.<br><br>
+
Those are the basics behind running a script in Systemtap GUI.<br><br>  
  
<a href="../IDETutorial.html>Back to Tutorial Contents</a>
+
[[Linux_Tools_Project/Systemtap/User_Guide/ide/IDETutorial.html | Back to IDE Tutorial ]]

Revision as of 07:16, 10 November 2010

IDE Tutorial, Lesson Three: Running Your Script

In this lesson we will cover running your script. You may use either the example script you opened in Lesson 1 or the script you wrote in Lesson two. Select Run->Run. Enter the remote server details. You should receive output in the console similar to the following, which shows the reads and write per second.

IDEOutput.png

Now we will demonstrate running Systemtap scripts with graphs. In order to run the chart example you'll need to use the code provided in Lesson 2: Writing Your First Script ;. To do this select Run->Run w/ Chart. This feature will prompt the user for the number of columns for the chart, in addition to their titles and regular expressions. The regular expressions are used to parse the console output for the script and determine the values of each column at a certain sample point. The combined regular expression is shown at the bottom of the dialogue box.

Chartbox1.png

For this example enter the following:

	Columns: 3

	TITLE	REGULAR EXPRESSION	DELIMITER
	Time		\d+		.*			\D+
	Read		\d+		.*			\D+
	Write		\d+		.*			\D+


The title fields simply display the associated string in the column's header. After clicking OK the script will prompt you for details regarding the Remote Server. Provide the ip address of the remote server that is running the systemtapgui Server or the Data Management Daemon. The port is by default 22462. Enter a username and password.This will give the application permissions to run your script on the remote machine. You have the option of saving your password as well, however be warned this is currently NOT encrypted so this convenience runs at a risk. The username is also used to transfer the file to the remote system using SCP. If the same machine is used as both the server and the client enter 'localhost' for the Host field. When the script is executed the application will switch into the Graphing perspective. A Data View chart is populated with live data, in addition to the output in the console.

You should see a screen similar to the following:

IDEGraphics.png

You will see that the data table poplulates from live data parsed from the console. Now we'll make a graph to briefly illustrate the Graphing perspective. Click the Create Graph button next to bring up the Select Chart dialogue.Select line graph. You will be prompted to select a column of the X series and Y series; select "Time" and "Write" respectively. After you click ok you should see the line graph as follows:


IDEGraph.png

Note that the multiple series graphs (Multi-Line, Multi-Bar, and Multi-Scatter) will request two Y series, Y1 and Y2. In the case of our example, these would be "Read" and "Write". Each series will be assigned a different color value for the purposes of differentiation and will be plotted both in respect to the specified X series.<

Those are the basics behind running a script in Systemtap GUI.

Back to IDE Tutorial

Copyright © Eclipse Foundation, Inc. All Rights Reserved.