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 "HackingSystemTapWithEclipse"

(New page: '''Hacking SystemTap with Eclipse''' This is a page about how to hack on [http://sourceware.org/systemtap/ SystemTap] source code using Eclipse's CDT. For information on building SystemTa...)
 
(Requirements)
Line 9: Line 9:
 
#Eclipse-CDT (Available from the Eclipse Update Site)
 
#Eclipse-CDT (Available from the Eclipse Update Site)
 
#Eclipse C/C++ Autotools plugin ([[Linux_Tools_Project/PluginInstallHelp#Installing_Updates_From_the_Linux_Tools_Update_Site|Installation Instructions]])
 
#Eclipse C/C++ Autotools plugin ([[Linux_Tools_Project/PluginInstallHelp#Installing_Updates_From_the_Linux_Tools_Update_Site|Installation Instructions]])
#Git or EGit
+
#[http://git-scm.com/download Git] or [http://www.eclipse.org/egit/install.php EGit]
  
 
==Need help?==
 
==Need help?==

Revision as of 12:29, 27 November 2009

Hacking SystemTap with Eclipse

This is a page about how to hack on SystemTap source code using Eclipse's CDT. For information on building SystemTap scripts using Eclipse, see SystemTapGUI.


Requirements

You need the following:

  1. Eclipse-CDT (Available from the Eclipse Update Site)
  2. Eclipse C/C++ Autotools plugin (Installation Instructions)
  3. Git or EGit

Need help?

Need something that isn't covered by this guide? Find charley on #eclipse on irc.freenode.net, and he will be happy to assist.

Getting started

Perform a git pull on the SystemTap source:

git clone git://sources.redhat.com/git/systemtap.git

Next, open up Eclipse and select File -> New Project -> C Project -> GNU Autotools -> Empty Project. At the top of the New Project box, specify the location to which you cloned the SystemTap source, and name the project (I named it Fluffy). Click Next, and then Finish.

Importing SystemTap using Eclipse


Eclipse will now import the SystemTap project. During this process, the SystemTap configuration may throw a few errors about missing packages - please download these. The configuration output can be found in the Configuration console.

Congratulations! You're good to start hacking. Make sure to read the HACKING document in the SystemTap root folder for standard practices and additional tips.

Building

Autotools should be able to automatically make the project for you whenever you select Build. However, if this does not seem to be working, you can add a make target by right clicking the project and selecting Make Targets --> Create and creating a new target called all.

Because SystemTap is made to be installed on the kernel, in order to actually install your newly made version of SystemTap, you'll have to run sudo make install -- it is suggested that you do this from the command line, since it involves root access.

Running

Running is good for your health! If you want to run SystemTap in Eclipse, just right click the project and choose Run As --> C/C++ Application. Then select the binary that you want to run (it is probably the 'stap' binary). You can send program arguments through the Run Configurations option. If asked for a further binary selection, choose gdb/Debugger.

Keep in mind that if you want to take full advantage of SystemTap's power, you'll need to install kernel debuginfo, as well as run the command: make -C /usr/local/share/systemtap/runtime/uprobes.

Back to the top