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

Linux Tools Project/Profiling/User Guide

< Linux Tools Project
Revision as of 15:16, 5 October 2012 by Jjohnstn.redhat.com (Talk | contribs) (Introduction)

Introduction

The Linux Tools project provides Eclipse interfaces to a number of system tools sufficient to profile a C/C++ application. For example, the Valgrind plug-in provides the ability to profile an application's memory usage while the Perf plug-in allows an end-user to acquire details regarding the amount of time taken in various functions or methods. From the user point-of-view, the user wants to profile a C/C++ executable and this is available via the Profile as.. right-click context menu or via the Profile Configurations... dialog or via the Profile button found next to the Debug and Run buttons at the top of the Eclipse Window.

Support exists for:

  • Valgrind (memcheck, massif, cachegrind, and helgrind sub-tools)
  • OProfile
  • Perf
  • SystemTap (using a systemtap script to get call-graph)
  • Gcov (code coverage)
  • GProf

Profiling Categories

In the past, some of the Linux Tools profiling plug-ins, such as Valgrind, would add a default launch short-cut. The launch short-cut would use a set of default parameters for the profiling tool and would launch the selected executable appropriately. In the case of Valgrind, which supports multiple tools, the short-cut would default one particular tool to use (in Valgrind's case, this is the memcheck tool which checks for memory leaks). In the Eclipse Debug Launch framework, each launch short-cut can specify which mode or modes it applies to (run, debug, and profile). For those short-cuts that specify the profile mode, this results in an added menu entry under the Profile as... context menu. For example, there are short-cuts for Perf, OProfile, and Valgrind which show up as Profile With Perf, Profile With OProfile, and Profile With Valgrind, respectively.

This can be confusing to end-users who are not familiar with the various tools that are out there and what they can do. For example, both OProfile and Perf provide timing results for an application so there is overlap of functionality within the various tools. To alleviate this, the current profiling tools have been grouped into task categories. By default, there are three initial categories:

  • Timing - this measure the amount of time taken in functions and methods
    • includes Linux Tools Perf, OProfile, Callgraph (via SystemTap), and Gprof
  • Memory - this profiles heap/stack/cache usage for an application
    • includes Linux Tools Memcheck, Massif, Cachegrind, and Helgrind tools from Valgrind
  • Coverage - this measures how much of the code gets exercised in a run
    • includes Gcov

The framework is extensible and additional tools such as third-party profiling tools can be added to the basic three categories or create a new category if needed (e.g. other).

Each tool in a category is prioritized so when multiple tools are installed from the same category, the one with the highest priority becomes the initial default for that category. For example, the Perf tool has the highest priority of the profile timing category tools and so becomes the initial default, if installed. Valgrind memcheck is the default for profiling memory and Gcov is the default for profiling code coverage.

The default for any category can be set/modified by the end-user via Eclipse Preferences -> Profiling. Each category of installed tools using the framework will present a sub-page of the Profiling category and any tools for that category that are installed will present a radio button to choose them. The initial defaults mentioned earlier are only used if the user has not made a specific setting.

The following shows the Profiling Preferences page for the Timing Category with the

Back to the top