diff --git a/src/plugins/callgrind/Callgrind.pluginspec.in b/src/plugins/callgrind/Callgrind.pluginspec.in
deleted file mode 100644
index e2ca63846b011c0acef0d92846eed94fcf684aaf..0000000000000000000000000000000000000000
--- a/src/plugins/callgrind/Callgrind.pluginspec.in
+++ /dev/null
@@ -1,22 +0,0 @@
-<plugin name=\"Callgrind\" version=\"$$QTCREATOR_VERSION\" compatVersion=\"$$QTCREATOR_VERSION\">
-    <vendor>Nokia Corporation</vendor>
-    <copyright>(C) 2011 Nokia Corporation</copyright>
-    <license>
-Commercial Usage
-
-Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.
-
-GNU Lesser General Public License Usage
-
-Alternatively, this plugin may be used under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation.  Please review the following information to ensure the GNU Lesser General Public License version 2.1 requirements will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-    </license>
-    <category>Code Analyzer</category>
-    <description>Valgrind Callgrind Tool Plugin</description>
-    <url>http://qt.nokia.com</url>
-    <dependencyList>
-        <dependency name=\"Core\" version=\"$$QTCREATOR_VERSION\"/>
-        <dependency name=\"TextEditor\" version=\"$$QTCREATOR_VERSION\"/>
-        <dependency name=\"AnalyzerBase\" version=\"$$QTCREATOR_VERSION\"/>
-        <dependency name=\"ValgrindToolBase\" version=\"$$QTCREATOR_VERSION\"/>
-    </dependencyList>
-</plugin>
diff --git a/src/plugins/callgrind/callgrind.pri b/src/plugins/callgrind/callgrind.pri
deleted file mode 100644
index 3453c69508181f76d5e4187cb97a610825ce82bf..0000000000000000000000000000000000000000
--- a/src/plugins/callgrind/callgrind.pri
+++ /dev/null
@@ -1,5 +0,0 @@
-include(callgrind_dependencies.pri)
-
-INCLUDEPATH += $$PWD
-DEPENDPATH += $$PWD
-LIBS *= -l$$qtLibraryName(Callgrind)
diff --git a/src/plugins/callgrind/callgrind.pro b/src/plugins/callgrind/callgrind.pro
deleted file mode 100644
index 6bbddf58b55de5d90a530bb83dcb615292303347..0000000000000000000000000000000000000000
--- a/src/plugins/callgrind/callgrind.pro
+++ /dev/null
@@ -1,44 +0,0 @@
-TEMPLATE = lib
-TARGET = Callgrind
-
-DEFINES += CALLGRIND_LIBRARY
-
-include(../../qtcreatorplugin.pri)
-include(callgrind_dependencies.pri)
-
-# Callgrind files
-
-HEADERS += \
-    callgrindplugin.h \
-    callgrind_global.h \
-    callgrindconfigwidget.h \
-    callgrindconstants.h \
-    callgrindcostdelegate.h \
-    callgrindcostview.h \
-    callgrindhelper.h \
-    callgrindnamedelegate.h \
-    callgrindsettings.h \
-    callgrindtool.h \
-    callgrindvisualisation.h \
-    callgrindwidgethandler.h \
-    callgrindengine.h \
-    workarounds.h \
-    callgrindtextmark.h
-
-SOURCES += \
-    callgrindplugin.cpp \
-    callgrindconfigwidget.cpp \
-    callgrindcostdelegate.cpp \
-    callgrindcostview.cpp \
-    callgrindhelper.cpp \
-    callgrindnamedelegate.cpp \
-    callgrindsettings.cpp \
-    callgrindtool.cpp \
-    callgrindvisualisation.cpp \
-    callgrindwidgethandler.cpp \
-    callgrindengine.cpp \
-    workarounds.cpp \
-    callgrindtextmark.cpp
-
-FORMS += \
-    callgrindconfigwidget.ui
diff --git a/src/plugins/callgrind/callgrind_global.h b/src/plugins/callgrind/callgrind_global.h
deleted file mode 100644
index a42506b4208a31b4fd0c76cbddece6083a041550..0000000000000000000000000000000000000000
--- a/src/plugins/callgrind/callgrind_global.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/**************************************************************************
-**
-** This file is part of Qt Creator
-**
-** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Nokia Corporation (info@qt.nokia.com)
-**
-**
-** GNU Lesser General Public License Usage
-**
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this file.
-** Please review the following information to ensure the GNU Lesser General
-** Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** Other Usage
-**
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at info@qt.nokia.com.
-**
-**************************************************************************/
-
-#ifndef CALLGRIND_GLOBAL_H
-#define CALLGRIND_GLOBAL_H
-
-#include <QtCore/qglobal.h>
-
-#if defined(CALLGRIND_LIBRARY)
-#  define CALLGRINDSHARED_EXPORT Q_DECL_EXPORT
-#else
-#  define CALLGRINDSHARED_EXPORT Q_DECL_IMPORT
-#endif
-
-#endif // CALLGRIND_GLOBAL_H
diff --git a/src/plugins/callgrind/callgrindconstants.h b/src/plugins/callgrind/callgrindconstants.h
deleted file mode 100644
index 7fa5630fbc98588e17697ae7242986d09baa158b..0000000000000000000000000000000000000000
--- a/src/plugins/callgrind/callgrindconstants.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/**************************************************************************
-**
-** This file is part of Qt Creator
-**
-** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Nokia Corporation (info@qt.nokia.com)
-**
-**
-** GNU Lesser General Public License Usage
-**
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this file.
-** Please review the following information to ensure the GNU Lesser General
-** Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** Other Usage
-**
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at info@qt.nokia.com.
-**
-**************************************************************************/
-
-#ifndef CALLGRINDCONSTANTS_H
-#define CALLGRINDCONSTANTS_H
-
-#endif // CALLGRINDCONSTANTS_H
diff --git a/src/plugins/callgrind/callgrindplugin.cpp b/src/plugins/callgrind/callgrindplugin.cpp
deleted file mode 100644
index 060a926bfa2cdd584ebc5b1c54569e027d12c3ff..0000000000000000000000000000000000000000
--- a/src/plugins/callgrind/callgrindplugin.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-/**************************************************************************
-**
-** This file is part of Qt Creator
-**
-** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Nokia Corporation (info@qt.nokia.com)
-**
-**
-** GNU Lesser General Public License Usage
-**
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this file.
-** Please review the following information to ensure the GNU Lesser General
-** Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** Other Usage
-**
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at info@qt.nokia.com.
-**
-**************************************************************************/
-
-#include "callgrindplugin.h"
-
-#include "callgrindtool.h"
-#include "callgrindsettings.h"
-
-#include <analyzerbase/analyzermanager.h>
-
-#include <QtCore/QStringList>
-#include <QtCore/QtPlugin>
-
-using namespace Analyzer;
-
-namespace Callgrind {
-namespace Internal {
-
-static Analyzer::AbstractAnalyzerSubConfig *globalFactory()
-{
-    return new CallgrindGlobalSettings();
-}
-
-static Analyzer::AbstractAnalyzerSubConfig *projectFactory()
-{
-    return new CallgrindProjectSettings();
-}
-
-bool CallgrindPlugin::initialize(const QStringList &/*arguments*/, QString */*errorString*/)
-{
-    AnalyzerGlobalSettings::instance()->registerSubConfigs(&globalFactory, &projectFactory);
-    AnalyzerManager::instance()->addTool(new CallgrindTool(this));
-
-    return true;
-}
-
-
-void CallgrindPlugin::extensionsInitialized()
-{
-}
-
-} // namespace Internal
-} // namespace Callgrind
-
-Q_EXPORT_PLUGIN(Callgrind::Internal::CallgrindPlugin)
diff --git a/src/plugins/callgrind/callgrindtool.cpp b/src/plugins/callgrind/callgrindtool.cpp
deleted file mode 100644
index 3d158e5563714b550efe828e78186cb5d6979d2e..0000000000000000000000000000000000000000
--- a/src/plugins/callgrind/callgrindtool.cpp
+++ /dev/null
@@ -1,487 +0,0 @@
-/**************************************************************************
-**
-** This file is part of Qt Creator
-**
-** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Nokia Corporation (info@qt.nokia.com)
-**
-**
-** GNU Lesser General Public License Usage
-**
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this file.
-** Please review the following information to ensure the GNU Lesser General
-** Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** Other Usage
-**
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at info@qt.nokia.com.
-**
-**************************************************************************/
-
-#include "callgrindtool.h"
-
-#include "callgrindconstants.h"
-#include "callgrindcostview.h"
-#include "callgrindengine.h"
-#include "callgrindwidgethandler.h"
-#include "callgrindtextmark.h"
-#include "callgrindvisualisation.h"
-#include "callgrindsettings.h"
-
-#include <analyzerbase/analyzermanager.h>
-#include <analyzerbase/analyzersettings.h>
-#include <analyzerbase/analyzerutils.h>
-
-#include <coreplugin/coreconstants.h>
-#include <coreplugin/icontext.h>
-#include <coreplugin/icore.h>
-#include <coreplugin/actionmanager/actioncontainer.h>
-#include <coreplugin/actionmanager/actionmanager.h>
-#include <coreplugin/actionmanager/command.h>
-#include <cplusplus/LookupContext.h>
-#include <cplusplus/Overview.h>
-#include <cppeditor/cppeditorconstants.h>
-#include <extensionsystem/iplugin.h>
-#include <texteditor/basetexteditor.h>
-#include <utils/qtcassert.h>
-#include <utils/fancymainwindow.h>
-#include <utils/styledbar.h>
-
-#include <valgrind/callgrind/callgrinddatamodel.h>
-#include <valgrind/callgrind/callgrindparsedata.h>
-#include <valgrind/callgrind/callgrindcostitem.h>
-#include <valgrind/callgrind/callgrindproxymodel.h>
-#include <valgrind/callgrind/callgrindfunction.h>
-#include <valgrind/callgrind/callgrindstackbrowser.h>
-
-#include <QtGui/QDockWidget>
-#include <QtGui/QHBoxLayout>
-#include <QtGui/QCheckBox>
-#include <QtGui/QGraphicsItem>
-#include <QtGui/QMenu>
-#include <QtGui/QToolButton>
-#include <QtGui/QAction>
-#include <QtGui/QLineEdit>
-#include <QtGui/QToolBar>
-#include <QtCore/QFile>
-#include <QtCore/QFileInfo>
-
-// shared/cplusplus includes
-#include <Symbols.h>
-
-using namespace Analyzer;
-using namespace Core;
-using namespace Valgrind::Callgrind;
-
-namespace Callgrind {
-namespace Internal {
-
-static QToolButton *createToolButton(QAction *action)
-{
-    QToolButton *button = new QToolButton;
-    button->setDefaultAction(action);
-    button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
-    return button;
-}
-
-CallgrindTool::CallgrindTool(QObject *parent)
-    : Analyzer::IAnalyzerTool(parent)
-    , m_callgrindWidgetHandler(0)
-    , m_dumpAction(0)
-    , m_resetAction(0)
-    , m_pauseAction(0)
-    , m_showCostsOfFunctionAction(0)
-    , m_toolbarWidget(0)
-{
-    Core::ICore *core = Core::ICore::instance();
-
-    // EditorManager
-    QObject *editorManager = core->editorManager();
-    connect(editorManager, SIGNAL(editorOpened(Core::IEditor*)),
-        SLOT(editorOpened(Core::IEditor*)));
-}
-
-CallgrindTool::~CallgrindTool()
-{
-    qDeleteAll(m_textMarks);
-}
-
-QString CallgrindTool::id() const
-{
-    return "Callgrind";
-}
-
-QString CallgrindTool::displayName() const
-{
-    return tr("Profile");
-}
-
-IAnalyzerTool::ToolMode CallgrindTool::mode() const
-{
-    return ReleaseMode;
-}
-
-void CallgrindTool::initialize()
-{
-    AnalyzerManager *am = AnalyzerManager::instance();
-
-    CallgrindWidgetHandler *handler = new CallgrindWidgetHandler(am->mainWindow());
-    m_callgrindWidgetHandler = handler;
-
-    connect(m_callgrindWidgetHandler, SIGNAL(functionSelected(const Valgrind::Callgrind::Function*)),
-            this, SLOT(slotFunctionSelected(const Valgrind::Callgrind::Function*)));
-}
-
-void CallgrindTool::initializeDockWidgets()
-{
-    AnalyzerManager *am = AnalyzerManager::instance();
-
-    //QDockWidget *callersDock =
-        am->createDockWidget(this, tr("Callers"),
-                             m_callgrindWidgetHandler->callersView(),
-                             Qt::BottomDockWidgetArea);
-
-    QDockWidget *flatDock =
-        am->createDockWidget(this, tr("Functions"),
-                             m_callgrindWidgetHandler->flatView(),
-                             Qt::LeftDockWidgetArea);
-
-    QDockWidget *calleesDock =
-        am->createDockWidget(this, tr("Callees"),
-                             m_callgrindWidgetHandler->calleesView(),
-                             Qt::BottomDockWidgetArea);
-
-    //QDockWidget *visDock =
-        am->createDockWidget(this, tr("Visualization"),
-                             m_callgrindWidgetHandler->visualisation(),
-                             Qt::LeftDockWidgetArea);
-
-    am->mainWindow()->splitDockWidget(flatDock, calleesDock, Qt::Vertical);
-    am->mainWindow()->tabifyDockWidget(flatDock, calleesDock);
-
-    m_toolbarWidget = new QWidget;
-    m_toolbarWidget->setObjectName("CallgrindToolBarWidget");
-    QHBoxLayout *layout = new QHBoxLayout;
-    layout->setMargin(0);
-    layout->setSpacing(0);
-    m_toolbarWidget->setLayout(layout);
-
-    m_callgrindWidgetHandler->populateActions(layout);
-
-    CallgrindGlobalSettings *settings = AnalyzerGlobalSettings::instance()->subConfig<CallgrindGlobalSettings>();
-    m_callgrindWidgetHandler->setCostFormat(settings->costFormat());
-    m_callgrindWidgetHandler->enableCycleDetection(settings->detectCycles());
-    connect(m_callgrindWidgetHandler, SIGNAL(costFormatChanged(Callgrind::Internal::CostDelegate::CostFormat)),
-            settings, SLOT(setCostFormat(Callgrind::Internal::CostDelegate::CostFormat)));
-    connect(m_callgrindWidgetHandler, SIGNAL(cycleDetectionEnabled(bool)),
-            settings, SLOT(setDetectCycles(bool)));
-}
-
-void CallgrindTool::extensionsInitialized()
-{
-    Core::ICore *core = Core::ICore::instance();
-    Core::ActionManager *actionManager = core->actionManager();
-
-    Core::Context analyzerContext = Core::Context(Analyzer::Constants::C_ANALYZEMODE);
-
-    // check if there is a CppEditor context menu, if true, add our own context menu actions
-    if (Core::ActionContainer *editorContextMenu =
-            actionManager->actionContainer(CppEditor::Constants::M_CONTEXT)) {
-        QAction *action = 0;
-        Core::Command *cmd = 0;
-
-        action = new QAction(this);
-        action->setSeparator(true);
-        cmd = actionManager->registerAction(action, "Analyzer.Callgrind.ContextMenu.Sep",
-            analyzerContext);
-        editorContextMenu->addAction(cmd);
-
-        action = new QAction(tr("Profile Costs of this Function and its Callees"), this);
-        action->setIcon(QIcon(Analyzer::Constants::ANALYZER_CONTROL_START_ICON));
-        connect(action, SIGNAL(triggered()), SLOT(handleShowCostsOfFunction()));
-        cmd = actionManager->registerAction(action, "Analyzer.Callgrind.ShowCostsOfFunction",
-            analyzerContext);
-        editorContextMenu->addAction(cmd);
-        cmd->setAttribute(Core::Command::CA_Hide);
-        cmd->setAttribute(Core::Command::CA_NonConfigurable);
-        m_showCostsOfFunctionAction = action;
-    }
-}
-
-IAnalyzerEngine *CallgrindTool::createEngine(const AnalyzerStartParameters &sp,
-                                             ProjectExplorer::RunConfiguration *runConfiguration)
-{
-    CallgrindEngine *engine = new CallgrindEngine(sp, runConfiguration);
-
-    connect(engine, SIGNAL(parserDataReady(CallgrindEngine *)),
-            SLOT(takeParserData(CallgrindEngine *)));
-    connect(engine, SIGNAL(starting(const Analyzer::IAnalyzerEngine*)),
-            SLOT(engineStarting(const Analyzer::IAnalyzerEngine*)));
-    connect(engine, SIGNAL(finished()),
-            SLOT(engineFinished()));
-
-    connect(this, SIGNAL(dumpRequested()), engine, SLOT(dump()));
-    connect(this, SIGNAL(resetRequested()), engine, SLOT(reset()));
-    connect(this, SIGNAL(pauseToggled(bool)), engine, SLOT(setPaused(bool)));
-
-    // initialize engine
-    engine->setPaused(m_pauseAction->isChecked());
-
-    // we may want to toggle collect for one function only in this run
-    engine->setToggleCollectFunction(m_toggleCollectFunction);
-    m_toggleCollectFunction.clear();
-
-    AnalyzerManager::instance()->showStatusMessage(AnalyzerManager::msgToolStarted(displayName()));
-
-    // apply project settings
-    AnalyzerProjectSettings *analyzerSettings = runConfiguration->extraAspect<AnalyzerProjectSettings>();
-    CallgrindProjectSettings *settings = analyzerSettings->subConfig<CallgrindProjectSettings>();
-    QTC_ASSERT(settings, return engine)
-
-    m_callgrindWidgetHandler->visualisation()->setMinimumInclusiveCostRatio(settings->visualisationMinimumInclusiveCostRatio() / 100.0);
-    m_callgrindWidgetHandler->proxyModel()->setMinimumInclusiveCostRatio(settings->minimumInclusiveCostRatio() / 100.0);
-    m_callgrindWidgetHandler->dataModel()->setVerboseToolTipsEnabled(settings->enableEventToolTips());
-
-    return engine;
-}
-
-QWidget *CallgrindTool::createControlWidget()
-{
-    QWidget *widget = new QWidget;
-    QHBoxLayout *layout = new QHBoxLayout;
-    layout->setMargin(0);
-    layout->setSpacing(0);
-    widget->setLayout(layout);
-
-    // dump action
-    m_dumpAction = new QAction(this);
-    m_dumpAction->setDisabled(true);
-    m_dumpAction->setIcon(QIcon(QLatin1String(Core::Constants::ICON_REDO)));
-    m_dumpAction->setText(tr("Dump"));
-    m_dumpAction->setToolTip(tr("Request the dumping of profile information. This will update the callgrind visualization."));
-    connect(m_dumpAction, SIGNAL(triggered()), this, SLOT(slotRequestDump()));
-    layout->addWidget(createToolButton(m_dumpAction));
-
-    // reset action
-    m_resetAction = new QAction(this);
-    m_resetAction->setDisabled(true);
-    m_resetAction->setIcon(QIcon(QLatin1String(Core::Constants::ICON_CLEAR)));
-    m_resetAction->setText(tr("Reset"));
-    m_resetAction->setToolTip(tr("Zero all event counters."));
-    connect(m_resetAction, SIGNAL(triggered()), this, SIGNAL(resetRequested()));
-    layout->addWidget(createToolButton(m_resetAction));
-
-    // pause action
-    m_pauseAction = new QAction(this);
-    m_pauseAction->setCheckable(true);
-    m_pauseAction->setIcon(QIcon(QLatin1String(":/qml/images/pause-small.png")));
-    m_pauseAction->setText(tr("Ignore"));
-    m_pauseAction->setToolTip(tr("If enabled, no events are counted which will speed up program execution during profiling."));
-    connect(m_pauseAction, SIGNAL(toggled(bool)), this, SIGNAL(pauseToggled(bool)));
-    layout->addWidget(createToolButton(m_pauseAction));
-
-    layout->addWidget(new Utils::StyledSeparator);
-    layout->addStretch();
-
-    return widget;
-}
-
-void CallgrindTool::clearErrorView()
-{
-    clearTextMarks();
-
-    m_callgrindWidgetHandler->slotClear();
-}
-
-void CallgrindTool::clearTextMarks()
-{
-    qDeleteAll(m_textMarks);
-    m_textMarks.clear();
-}
-
-void CallgrindTool::engineStarting(const Analyzer::IAnalyzerEngine *)
-{
-    // enable/disable actions
-    m_resetAction->setEnabled(true);
-    m_dumpAction->setEnabled(true);
-
-    clearErrorView();
-}
-
-void CallgrindTool::engineFinished()
-{
-    // enable/disable actions
-    m_resetAction->setEnabled(false);
-    m_dumpAction->setEnabled(false);
-
-    const ParseData *data = m_callgrindWidgetHandler->dataModel()->parseData();
-    if (data)
-        showParserResults(data);
-    else
-        AnalyzerManager::instance()->showStatusMessage(tr("Profiling aborted."));
-}
-
-void CallgrindTool::showParserResults(const ParseData *data)
-{
-    QString msg;
-    if (data) {
-        // be careful, the list of events might be empty
-        if (data->events().isEmpty()) {
-            msg = tr("Parsing finished, no data.");
-        }
-        else {
-            const QString costStr = QString("%1 %2").arg(QString::number(data->totalCost(0)), data->events().first());
-            msg = tr("Parsing finished, total cost of %1 reported.").arg(costStr);
-        }
-    } else {
-        msg = tr("Parsing failed.");
-    }
-    AnalyzerManager::instance()->showStatusMessage(msg);
-}
-
-void CallgrindTool::editorOpened(Core::IEditor *editor)
-{
-    TextEditor::ITextEditor *textEditor = qobject_cast<TextEditor::ITextEditor *>(editor);
-    if (!textEditor)
-        return;
-
-    connect(textEditor,
-        SIGNAL(markContextMenuRequested(TextEditor::ITextEditor*,int,QMenu*)),
-        SLOT(requestContextMenu(TextEditor::ITextEditor*,int,QMenu*)));
-}
-
-void CallgrindTool::requestContextMenu(TextEditor::ITextEditor *editor, int line, QMenu *menu)
-{
-    // find callgrind text mark that corresponds to this editor's file and line number
-    const Function *func = 0;
-    foreach (CallgrindTextMark *textMark, m_textMarks) {
-        if (textMark->fileName() == editor->file()->fileName() && textMark->lineNumber() == line) {
-            func = textMark->function();
-            break;
-        }
-    }
-    if (!func)
-        return; // no callgrind text mark under cursor, return
-
-    // add our action to the context menu
-    QAction *action = new QAction(tr("Select this Function in the Analyzer Output"), menu);
-    connect(action, SIGNAL(triggered()), this, SLOT(handleShowCostsAction()));
-    action->setData(QVariant::fromValue<const Function *>(func));
-    menu->addAction(action);
-}
-
-void CallgrindTool::handleShowCostsAction()
-{
-    const QAction *action = qobject_cast<QAction *>(sender());
-    QTC_ASSERT(action, return)
-
-    const Function *func = action->data().value<const Function *>();
-    QTC_ASSERT(func, return)
-
-    m_callgrindWidgetHandler->selectFunction(func);
-}
-
-void CallgrindTool::handleShowCostsOfFunction()
-{
-    CPlusPlus::Symbol *symbol = AnalyzerUtils::findSymbolUnderCursor();
-    if (!symbol)
-        return;
-
-    if (!symbol->isFunction())
-        return;
-
-    CPlusPlus::Overview view;
-    const QString qualifiedFunctionName = view.prettyName(CPlusPlus::LookupContext::fullyQualifiedName(symbol));
-
-    m_toggleCollectFunction = QString("%1()").arg(qualifiedFunctionName);
-
-    AnalyzerManager::instance()->selectTool(this);
-    AnalyzerManager::instance()->startTool();
-}
-
-
-void CallgrindTool::slotRequestDump()
-{
-    m_callgrindWidgetHandler->slotRequestDump();
-    emit dumpRequested();
-}
-
-void CallgrindTool::slotFunctionSelected(const Function *func)
-{
-    if (func && QFile::exists(func->file())) {
-        ///TODO: custom position support?
-        int line = func->lineNumber();
-        TextEditor::BaseTextEditorWidget::openEditorAt(func->file(), qMax(line, 0));
-    }
-}
-
-void CallgrindTool::takeParserData(CallgrindEngine *engine)
-{
-    ParseData *data = engine->takeParserData();
-    showParserResults(data);
-
-    if (!data)
-        return;
-
-    // clear first
-    clearErrorView();
-
-    m_callgrindWidgetHandler->setParseData(data);
-    createTextMarks();
-}
-
-void CallgrindTool::createTextMarks()
-{
-    DataModel *model = m_callgrindWidgetHandler->dataModel();
-    QTC_ASSERT(model, return)
-
-    QList<QString> locations;
-    for (int row = 0; row < model->rowCount(); ++row)
-    {
-        const QModelIndex index = model->index(row, DataModel::InclusiveCostColumn);
-
-        QString fileName = index.data(DataModel::FileNameRole).toString();
-        if (fileName.isEmpty() || fileName == "???")
-            continue;
-
-        bool ok = false;
-        const int lineNumber = index.data(DataModel::LineNumberRole).toInt(&ok);
-        QTC_ASSERT(ok, continue);
-
-        // sanitize filename, text marks need a canonical (i.e. no ".."s) path
-        // BaseTextMark::editorOpened(Core::IEditor *editor) compares file names on string basis
-        QFileInfo info(fileName);
-        fileName = info.canonicalFilePath();
-        if (fileName.isEmpty())
-            continue; // isEmpty == true => file does not exist, continue then
-
-        // create only one text mark per location
-        const QString location = QString("%1:%2").arg(fileName, QString::number(lineNumber));
-        if (locations.contains(location))
-            continue;
-        locations << location;
-
-        CallgrindTextMark *mark = new CallgrindTextMark(index, fileName, lineNumber);
-        m_textMarks << mark;
-    }
-}
-
-bool CallgrindTool::canRunRemotely() const
-{
-    return true;
-}
-
-} // namespace Internal
-} // namespace Callgrind
diff --git a/src/plugins/callgrind/callgrindtool.h b/src/plugins/callgrind/callgrindtool.h
deleted file mode 100644
index d36fdac34f453c018e8cbc41ab9e40107d6c1086..0000000000000000000000000000000000000000
--- a/src/plugins/callgrind/callgrindtool.h
+++ /dev/null
@@ -1,141 +0,0 @@
-/**************************************************************************
-**
-** This file is part of Qt Creator
-**
-** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Nokia Corporation (info@qt.nokia.com)
-**
-**
-** GNU Lesser General Public License Usage
-**
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this file.
-** Please review the following information to ensure the GNU Lesser General
-** Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** Other Usage
-**
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at info@qt.nokia.com.
-**
-**************************************************************************/
-
-#ifndef CALLGRINDTOOL_H
-#define CALLGRINDTOOL_H
-
-#include <analyzerbase/ianalyzertool.h>
-
-#include <QtCore/QVector>
-
-QT_BEGIN_NAMESPACE
-class QAction;
-class QMenu;
-QT_END_NAMESPACE
-
-namespace Valgrind {
-namespace Callgrind {
-class Function;
-class ParseData;
-}
-}
-
-namespace TextEditor {
-class ITextEditor;
-}
-
-namespace Core {
-class IEditor;
-}
-
-namespace Callgrind {
-namespace Internal {
-
-class CallgrindEngine;
-class CallgrindWidgetHandler;
-class CallgrindTextMark;
-
-class CallgrindTool : public Analyzer::IAnalyzerTool
-{
-    Q_OBJECT
-
-public:
-    explicit CallgrindTool(QObject *parent = 0);
-    virtual ~CallgrindTool();
-
-    virtual QString id() const;
-    virtual QString displayName() const;
-    virtual ToolMode mode() const;
-
-    virtual void initialize();
-    virtual void extensionsInitialized();
-    virtual void initializeDockWidgets();
-
-    virtual Analyzer::IAnalyzerEngine *createEngine(const Analyzer::AnalyzerStartParameters &sp,
-                                          ProjectExplorer::RunConfiguration *runConfiguration = 0);
-    virtual QWidget *createControlWidget();
-
-    // For the output pane adapter.
-    void clearErrorView();
-
-    virtual bool canRunRemotely() const;
-    bool needsOutputPane() const { return false; }
-
-signals:
-    void dumpRequested();
-    void resetRequested();
-    void pauseToggled(bool checked);
-
-    void profilingStartRequested(const QString &toggleCollectFunction);
-
-private slots:
-    void showParserResults(const Valgrind::Callgrind::ParseData *data);
-
-    void slotRequestDump();
-    void slotFunctionSelected(const Valgrind::Callgrind::Function *);
-
-    void editorOpened(Core::IEditor *);
-    void requestContextMenu(TextEditor::ITextEditor *editor, int line, QMenu *menu);
-
-    void handleShowCostsAction();
-    void handleShowCostsOfFunction();
-
-    void takeParserData(CallgrindEngine *engine);
-
-    void engineStarting(const Analyzer::IAnalyzerEngine *);
-    void engineFinished();
-
-private:
-    /// This function will add custom text marks to the editor
-    /// \note Call this after the data model has been populated
-    void createTextMarks();
-
-    /// This function will clear all text marks from the editor
-    void clearTextMarks();
-
-    CallgrindWidgetHandler *m_callgrindWidgetHandler;
-    QVector<CallgrindTextMark *> m_textMarks;
-
-    QAction *m_dumpAction;
-    QAction *m_resetAction;
-    QAction *m_pauseAction;
-
-    QAction *m_showCostsOfFunctionAction;
-    QWidget *m_toolbarWidget;
-
-    QString m_toggleCollectFunction;
-};
-
-} // namespace Internal
-} // namespace Callgrind
-
-#endif // CALLGRINDTOOL_H
diff --git a/src/plugins/memcheck/Memcheck.pluginspec.in b/src/plugins/memcheck/Memcheck.pluginspec.in
deleted file mode 100644
index ff4484e23b56d31729617727e681fe4cfdd66454..0000000000000000000000000000000000000000
--- a/src/plugins/memcheck/Memcheck.pluginspec.in
+++ /dev/null
@@ -1,21 +0,0 @@
-<plugin name=\"Memcheck\" version=\"$$QTCREATOR_VERSION\" compatVersion=\"$$QTCREATOR_VERSION\">
-    <vendor>Nokia Corporation</vendor>
-    <copyright>(C) 2011 Nokia Corporation</copyright>
-    <license>
-Commercial Usage
-
-Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.
-
-GNU Lesser General Public License Usage
-
-Alternatively, this plugin may be used under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation.  Please review the following information to ensure the GNU Lesser General Public License version 2.1 requirements will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-    </license>
-    <category>Code Analyzer</category>
-    <description>Valgrind Memcheck Tool Plugin</description>
-    <url>http://qt.nokia.com</url>
-    <dependencyList>
-        <dependency name=\"Core\" version=\"$$QTCREATOR_VERSION\"/>
-        <dependency name=\"AnalyzerBase\" version=\"$$QTCREATOR_VERSION\"/>
-        <dependency name=\"ValgrindToolBase\" version=\"$$QTCREATOR_VERSION\"/>
-    </dependencyList>
-</plugin>
diff --git a/src/plugins/memcheck/memcheck.pri b/src/plugins/memcheck/memcheck.pri
deleted file mode 100644
index 9224189ba273f665382d8e7dfc213388c4ec3584..0000000000000000000000000000000000000000
--- a/src/plugins/memcheck/memcheck.pri
+++ /dev/null
@@ -1,4 +0,0 @@
-include(memcheck_dependencies.pri)
-
-INCLUDEPATH += $$PWD
-LIBS *= -l$$qtLibraryName(Memcheck)
diff --git a/src/plugins/memcheck/memcheck_dependencies.pri b/src/plugins/memcheck/memcheck_dependencies.pri
deleted file mode 100644
index 5f4bbc642e503da808730f039066140daffc4dc7..0000000000000000000000000000000000000000
--- a/src/plugins/memcheck/memcheck_dependencies.pri
+++ /dev/null
@@ -1,3 +0,0 @@
-include(../../plugins/coreplugin/coreplugin.pri)
-include(../../plugins/analyzerbase/analyzerbase.pri)
-include(../../plugins/valgrindtoolbase/valgrindtoolbase.pri)
diff --git a/src/plugins/memcheck/memcheck_global.h b/src/plugins/memcheck/memcheck_global.h
deleted file mode 100644
index ecc73dbef72bfd608b3a591b0f4b9cd611ee8634..0000000000000000000000000000000000000000
--- a/src/plugins/memcheck/memcheck_global.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/**************************************************************************
-**
-** This file is part of Qt Creator
-**
-** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Author: Nicolas Arnaud-Cormos, KDAB (nicolas.arnaud-cormos@kdab.com)
-**
-** Contact: Nokia Corporation (info@qt.nokia.com)
-**
-**
-** GNU Lesser General Public License Usage
-**
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this file.
-** Please review the following information to ensure the GNU Lesser General
-** Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** Other Usage
-**
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at info@qt.nokia.com.
-**
-**************************************************************************/
-
-#ifndef MEMCHECK_GLOBAL_H
-#define MEMCHECK_GLOBAL_H
-
-#include <QtCore/qglobal.h>
-
-#if defined(MEMCHECK_LIBRARY)
-#  define MEMCHECKSHARED_EXPORT Q_DECL_EXPORT
-#else
-#  define MEMCHECKSHARED_EXPORT Q_DECL_IMPORT
-#endif
-
-#endif // MEMCHECK_GLOBAL_H
diff --git a/src/plugins/memcheck/memcheckplugin.h b/src/plugins/memcheck/memcheckplugin.h
deleted file mode 100644
index d310e90672929be989647b92e172ee232f58e5e5..0000000000000000000000000000000000000000
--- a/src/plugins/memcheck/memcheckplugin.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/**************************************************************************
-**
-** This file is part of Qt Creator
-**
-** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Author: Milian Wolff, KDAB (milian.wolff@kdab.com)
-**
-** Contact: Nokia Corporation (info@qt.nokia.com)
-**
-**
-** GNU Lesser General Public License Usage
-**
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this file.
-** Please review the following information to ensure the GNU Lesser General
-** Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** Other Usage
-**
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at info@qt.nokia.com.
-**
-**************************************************************************/
-
-#ifndef MEMCHECKPLUGIN_H
-#define MEMCHECKPLUGIN_H
-
-#include <extensionsystem/iplugin.h>
-
-namespace Memcheck {
-namespace Internal {
-
-class MemcheckPlugin : public ExtensionSystem::IPlugin
-{
-    Q_OBJECT
-
-public:
-    MemcheckPlugin() {}
-
-    virtual bool initialize(const QStringList &arguments, QString *errorString);
-    virtual void extensionsInitialized();
-};
-
-} // namespace Internal
-} // namespace Memcheck
-
-#endif // MEMCHECKPLUGIN_H
diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro
index ff851a7b520dab4d0311d3aea4f64e45dc9bb5d9..aaee326ce176ed2edffba7033946953257919197 100644
--- a/src/plugins/plugins.pro
+++ b/src/plugins/plugins.pro
@@ -44,9 +44,7 @@ SUBDIRS   = plugin_coreplugin \
             plugin_qmlprofiler
 
 !win32 {
-     SUBDIRS += plugin_valgrindtoolbase \
-                plugin_memcheck \
-                plugin_callgrind
+     SUBDIRS += plugin_valgrind
 }
 
 linux-* {
@@ -256,19 +254,9 @@ plugin_analyzerbase.depends = plugin_coreplugin
 plugin_analyzerbase.depends += plugin_projectexplorer
 
 !win32 {
-    plugin_valgrindtoolbase.subdir = valgrindtoolbase
-    plugin_valgrindtoolbase.depends = plugin_coreplugin
-    plugin_valgrindtoolbase.depends += plugin_analyzerbase
-
-    plugin_memcheck.subdir = memcheck
-    plugin_memcheck.depends = plugin_coreplugin
-    plugin_memcheck.depends += plugin_analyzerbase
-    plugin_memcheck.depends += plugin_valgrindtoolbase
-
-    plugin_callgrind.subdir = callgrind
-    plugin_callgrind.depends = plugin_coreplugin
-    plugin_callgrind.depends += plugin_analyzerbase
-    plugin_callgrind.depends += plugin_valgrindtoolbase
+    plugin_valgrind.subdir = valgrind
+    plugin_valgrind.depends = plugin_coreplugin
+    plugin_valgrind.depends += plugin_analyzerbase
 }
 
 plugin_qmlprofiler.subdir = qmlprofiler
diff --git a/src/plugins/valgrindtoolbase/ValgrindToolBase.pluginspec.in b/src/plugins/valgrind/Valgrind.pluginspec.in
similarity index 86%
rename from src/plugins/valgrindtoolbase/ValgrindToolBase.pluginspec.in
rename to src/plugins/valgrind/Valgrind.pluginspec.in
index 2dcd6ed59e9509935dd012b2fccd346147f8f669..31a1de78e7d1e1499337a03f83befe9b25bc0ef1 100644
--- a/src/plugins/valgrindtoolbase/ValgrindToolBase.pluginspec.in
+++ b/src/plugins/valgrind/Valgrind.pluginspec.in
@@ -1,4 +1,4 @@
-<plugin name=\"ValgrindToolBase\" version=\"$$QTCREATOR_VERSION\" compatVersion=\"$$QTCREATOR_VERSION\">
+<plugin name=\"Valgrind\" version=\"$$QTCREATOR_VERSION\" compatVersion=\"$$QTCREATOR_VERSION\">
     <vendor>Nokia Corporation</vendor>
     <copyright>(C) 2011 Nokia Corporation</copyright>
     <license>
@@ -11,7 +11,7 @@ GNU Lesser General Public License Usage
 Alternatively, this plugin may be used under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation.  Please review the following information to ensure the GNU Lesser General Public License version 2.1 requirements will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
     </license>
     <category>Code Analyzer</category>
-    <description>Valgrind Tool Base Plugin</description>
+    <description>Valgrind Plugin</description>
     <url>http://qt.nokia.com</url>
     <dependencyList>
         <dependency name=\"Core\" version=\"$$QTCREATOR_VERSION\"/>
diff --git a/src/plugins/callgrind/callgrindconfigwidget.cpp b/src/plugins/valgrind/callgrindconfigwidget.cpp
similarity index 99%
rename from src/plugins/callgrind/callgrindconfigwidget.cpp
rename to src/plugins/valgrind/callgrindconfigwidget.cpp
index 36235e626c05f6323c5df550415280c073c5c683..280fd4353d47355df8e4994d80b45931e5dbf9ac 100644
--- a/src/plugins/callgrind/callgrindconfigwidget.cpp
+++ b/src/plugins/valgrind/callgrindconfigwidget.cpp
@@ -36,7 +36,7 @@
 
 #include "callgrindsettings.h"
 
-using namespace Callgrind::Internal;
+using namespace Valgrind::Internal;
 
 CallgrindConfigWidget::CallgrindConfigWidget(AbstractCallgrindSettings *settings, QWidget *parent)
     : QWidget(parent)
diff --git a/src/plugins/callgrind/callgrindconfigwidget.h b/src/plugins/valgrind/callgrindconfigwidget.h
similarity index 97%
rename from src/plugins/callgrind/callgrindconfigwidget.h
rename to src/plugins/valgrind/callgrindconfigwidget.h
index 62d39be0cbc3b810fac9db06af908c6b2b841d01..b76495f7f22e4b17878d29b7593676bae0798e01 100644
--- a/src/plugins/callgrind/callgrindconfigwidget.h
+++ b/src/plugins/valgrind/callgrindconfigwidget.h
@@ -35,7 +35,7 @@
 
 #include <QtGui/QWidget>
 
-namespace Callgrind {
+namespace Valgrind {
 namespace Internal {
 
 namespace Ui {
@@ -56,6 +56,6 @@ private:
 };
 
 } // namespace Internal
-} // namespace Callgrind
+} // namespace Valgrind
 
 #endif // ANALYZER_INTERNAL_CALLGRINDCONFIGWIDGET_H
diff --git a/src/plugins/callgrind/callgrindconfigwidget.ui b/src/plugins/valgrind/callgrindconfigwidget.ui
similarity index 98%
rename from src/plugins/callgrind/callgrindconfigwidget.ui
rename to src/plugins/valgrind/callgrindconfigwidget.ui
index 85008142ed9e39f828e139f6c5e02bb1f194ed91..1e4c42614a533f4871d3145f86d833b6dd9c7202 100644
--- a/src/plugins/callgrind/callgrindconfigwidget.ui
+++ b/src/plugins/valgrind/callgrindconfigwidget.ui
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
- <class>Callgrind::Internal::CallgrindConfigWidget</class>
- <widget class="QWidget" name="Callgrind::Internal::CallgrindConfigWidget">
+ <class>Valgrind::Internal::CallgrindConfigWidget</class>
+ <widget class="QWidget" name="Valgrind::Internal::CallgrindConfigWidget">
   <property name="geometry">
    <rect>
     <x>0</x>
diff --git a/src/plugins/callgrind/callgrindcostdelegate.cpp b/src/plugins/valgrind/callgrindcostdelegate.cpp
similarity index 98%
rename from src/plugins/callgrind/callgrindcostdelegate.cpp
rename to src/plugins/valgrind/callgrindcostdelegate.cpp
index 38adf9829c8efbff7631079ce44a8d6127fcc706..b99da1ebc15d17f524df5ff42d6ed7a041997ce5 100644
--- a/src/plugins/callgrind/callgrindcostdelegate.cpp
+++ b/src/plugins/valgrind/callgrindcostdelegate.cpp
@@ -45,7 +45,7 @@
 
 using namespace Valgrind::Callgrind;
 
-namespace Callgrind {
+namespace Valgrind {
 namespace Internal {
 
 class CostDelegate::Private
@@ -177,5 +177,5 @@ QSize CostDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelInd
     return size;
 }
 
-} // Internal
-} // Callgrind
+} // namespace Internal
+} // namespace Valgrind
diff --git a/src/plugins/callgrind/callgrindcostdelegate.h b/src/plugins/valgrind/callgrindcostdelegate.h
similarity index 94%
rename from src/plugins/callgrind/callgrindcostdelegate.h
rename to src/plugins/valgrind/callgrindcostdelegate.h
index a6e0d4def196edca6ffc951ea096e9e5dea9d217..a7c358e67e2540f56e5a9ecf580bf69598574336 100644
--- a/src/plugins/callgrind/callgrindcostdelegate.h
+++ b/src/plugins/valgrind/callgrindcostdelegate.h
@@ -35,7 +35,7 @@
 
 #include <QtGui/QStyledItemDelegate>
 
-namespace Callgrind {
+namespace Valgrind {
 namespace Internal {
 
 class CostDelegate : public QStyledItemDelegate
@@ -67,9 +67,9 @@ private:
     Private *d;
 };
 
-} // Internal
-} // Callgrind
+} // namespace Internal
+} // namespace Valgrind
 
-Q_DECLARE_METATYPE(Callgrind::Internal::CostDelegate::CostFormat)
+Q_DECLARE_METATYPE(Valgrind::Internal::CostDelegate::CostFormat)
 
 #endif // CALLGRINDCOSTDELEGATE_H
diff --git a/src/plugins/callgrind/callgrindcostview.cpp b/src/plugins/valgrind/callgrindcostview.cpp
similarity index 97%
rename from src/plugins/callgrind/callgrindcostview.cpp
rename to src/plugins/valgrind/callgrindcostview.cpp
index b756c829149baba8fd31c7df2afb86f01e530c9f..fb32e3708279abb2cfbad099268046b7a87f3151 100644
--- a/src/plugins/callgrind/callgrindcostview.cpp
+++ b/src/plugins/valgrind/callgrindcostview.cpp
@@ -45,11 +45,9 @@
 
 using namespace Valgrind::Callgrind;
 
-namespace Callgrind {
+namespace Valgrind {
 namespace Internal {
 
-//BEGIN CostView::Private
-
 class CostView::Private
 {
 public:
@@ -64,9 +62,6 @@ CostView::Private::Private(CostView *qq)
     , m_nameDelegate(new NameDelegate(qq))
 {}
 
-//END CostView::Private
-
-//BEGIN CostView
 
 CostView::CostView(QWidget *parent)
     : QTreeView(parent)
@@ -135,7 +130,5 @@ CostDelegate::CostFormat CostView::costFormat() const
     return d->m_costDelegate->format();
 }
 
-//END CostView
-
-} // Internal
-} // Callgrind
+} // namespace Internal
+} // namespace Valgrind
diff --git a/src/plugins/callgrind/callgrindcostview.h b/src/plugins/valgrind/callgrindcostview.h
similarity index 96%
rename from src/plugins/callgrind/callgrindcostview.h
rename to src/plugins/valgrind/callgrindcostview.h
index 19cd4ee5559ea55062d67deefff131f8fc8ff357..3f41d2df74e64226b0df3fad7d67a0bd0d523c36 100644
--- a/src/plugins/callgrind/callgrindcostview.h
+++ b/src/plugins/valgrind/callgrindcostview.h
@@ -37,7 +37,7 @@
 
 #include "callgrindcostdelegate.h"
 
-namespace Callgrind {
+namespace Valgrind {
 namespace Internal {
 
 class CostView : public QTreeView
@@ -65,7 +65,7 @@ private:
     Private *d;
 };
 
-} // Internal
-} // Callgrind
+} // namespace Internal
+} // namespace Valgrind
 
 #endif // CALLGRINDCOSTVIEW_H
diff --git a/src/plugins/callgrind/callgrindengine.cpp b/src/plugins/valgrind/callgrindengine.cpp
similarity index 98%
rename from src/plugins/callgrind/callgrindengine.cpp
rename to src/plugins/valgrind/callgrindengine.cpp
index 9f88d281edb93f27041f38e11f46e1dd31cb8798..ab6d266c61810de2348acb1c688ab1d0373c778b 100644
--- a/src/plugins/callgrind/callgrindengine.cpp
+++ b/src/plugins/valgrind/callgrindengine.cpp
@@ -42,8 +42,8 @@
 #include <utils/qtcassert.h>
 
 using namespace Analyzer;
-using namespace Callgrind;
-using namespace Callgrind::Internal;
+using namespace Valgrind;
+using namespace Valgrind::Internal;
 
 CallgrindEngine::CallgrindEngine(const AnalyzerStartParameters &sp,
                                  ProjectExplorer::RunConfiguration *runConfiguration)
diff --git a/src/plugins/callgrind/callgrindengine.h b/src/plugins/valgrind/callgrindengine.h
similarity index 96%
rename from src/plugins/callgrind/callgrindengine.h
rename to src/plugins/valgrind/callgrindengine.h
index e23fb52658f590878578342fdac5a2027578ffd1..50bc5e9a98bf6f169e02850a8c4d3888ca433439 100644
--- a/src/plugins/callgrind/callgrindengine.h
+++ b/src/plugins/valgrind/callgrindengine.h
@@ -33,12 +33,12 @@
 #ifndef CALLGRINDENGINE_H
 #define CALLGRINDENGINE_H
 
-#include <valgrindtoolbase/valgrindengine.h>
+#include <valgrind/valgrindengine.h>
 
 #include <valgrind/callgrind/callgrindrunner.h>
 #include <valgrind/callgrind/callgrindparsedata.h>
 
-namespace Callgrind {
+namespace Valgrind {
 namespace Internal {
 
 class CallgrindEngine : public Valgrind::Internal::ValgrindEngine
@@ -89,6 +89,6 @@ private slots:
 };
 
 } // namespace Internal
-} // namespace Callgrind
+} // namespace Valgrind
 
 #endif // CALLGRINDENGINE_H
diff --git a/src/plugins/callgrind/callgrindhelper.cpp b/src/plugins/valgrind/callgrindhelper.cpp
similarity index 98%
rename from src/plugins/callgrind/callgrindhelper.cpp
rename to src/plugins/valgrind/callgrindhelper.cpp
index 020c900a21c56f5d746fe12e080815c2be4cee2d..3b362f3d3550fbab0a3f8634b1c83473d3e4e97a 100644
--- a/src/plugins/callgrind/callgrindhelper.cpp
+++ b/src/plugins/valgrind/callgrindhelper.cpp
@@ -38,7 +38,7 @@
 #include <QtCore/QMap>
 #include <QtCore/QString>
 
-namespace Callgrind {
+namespace Valgrind {
 namespace Internal {
 
 QColor CallgrindHelper::colorForString(const QString &text)
@@ -74,4 +74,4 @@ QString CallgrindHelper::toPercent(float costs, const QLocale &locale)
 }
 
 } // namespace Internal
-} // namespace Callgrind
+} // namespace Valgrind
diff --git a/src/plugins/callgrind/callgrindhelper.h b/src/plugins/valgrind/callgrindhelper.h
similarity index 97%
rename from src/plugins/callgrind/callgrindhelper.h
rename to src/plugins/valgrind/callgrindhelper.h
index d013f9be497f2d0fc2da99ed2de633a2021d7345..9431293a5aabee7b1aecb475a6617fee9208b9b7 100644
--- a/src/plugins/callgrind/callgrindhelper.h
+++ b/src/plugins/valgrind/callgrindhelper.h
@@ -40,7 +40,7 @@ class QColor;
 class QString;
 QT_END_NAMESPACE
 
-namespace Callgrind {
+namespace Valgrind {
 namespace Internal {
 
 namespace CallgrindHelper
@@ -63,6 +63,6 @@ namespace CallgrindHelper
 }
 
 } // namespace Internal
-} // namespace Callgrind
+} // namespace Valgrind
 
 #endif // CALLGRINDHELPER_H
diff --git a/src/plugins/callgrind/callgrindnamedelegate.cpp b/src/plugins/valgrind/callgrindnamedelegate.cpp
similarity index 97%
rename from src/plugins/callgrind/callgrindnamedelegate.cpp
rename to src/plugins/valgrind/callgrindnamedelegate.cpp
index 1a81d3f9ba9e3ee077371dceb6f5cc0403bf9cfb..b59bc82c501bec6264c8fd2abac27118884b6345 100644
--- a/src/plugins/callgrind/callgrindnamedelegate.cpp
+++ b/src/plugins/valgrind/callgrindnamedelegate.cpp
@@ -37,7 +37,7 @@
 #include <QtGui/QApplication>
 #include <QtGui/QPainter>
 
-namespace Callgrind {
+namespace Valgrind {
 namespace Internal {
 
 NameDelegate::NameDelegate(QObject *parent)
@@ -91,5 +91,5 @@ void NameDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
     painter->restore();
 }
 
-} // Internal
-} // Callgrind
+} // namespace Internal
+} // namespace Valgrind
diff --git a/src/plugins/callgrind/callgrindnamedelegate.h b/src/plugins/valgrind/callgrindnamedelegate.h
similarity index 96%
rename from src/plugins/callgrind/callgrindnamedelegate.h
rename to src/plugins/valgrind/callgrindnamedelegate.h
index 12c08b151e31fa6d9c8e2b0cbd16648c3a418877..719aa7422b7c6ebe38b69c64d5f986b477d7dca1 100644
--- a/src/plugins/callgrind/callgrindnamedelegate.h
+++ b/src/plugins/valgrind/callgrindnamedelegate.h
@@ -35,7 +35,7 @@
 
 #include <QtGui/QStyledItemDelegate>
 
-namespace Callgrind {
+namespace Valgrind {
 namespace Internal {
 
 class NameDelegate : public QStyledItemDelegate
@@ -50,7 +50,7 @@ public:
                        const QModelIndex &index) const;
 };
 
-} // Internal
-} // Callgrind
+} // namespace Internal
+} // namespace Valgrind
 
 #endif // CALLGRINDNAMEDELEGATE_H
diff --git a/src/plugins/callgrind/callgrindsettings.cpp b/src/plugins/valgrind/callgrindsettings.cpp
similarity index 99%
rename from src/plugins/callgrind/callgrindsettings.cpp
rename to src/plugins/valgrind/callgrindsettings.cpp
index ad0902dc708186e249a646ba7f3633b80769628f..58505cebdb378da1c63ded6201e829db26e7affd 100644
--- a/src/plugins/callgrind/callgrindsettings.cpp
+++ b/src/plugins/valgrind/callgrindsettings.cpp
@@ -49,7 +49,7 @@ static const char callgrindVisualisationMinimumCostRatioC[] = "Analyzer.Valgrind
 static const char callgrindCycleDetectionC[] = "Analyzer.Valgrind.Callgrind.CycleDetection";
 static const char callgrindCostFormatC[] = "Analyzer.Valgrind.Callgrind.CostFormat";
 
-namespace Callgrind {
+namespace Valgrind {
 namespace Internal {
 
 void AbstractCallgrindSettings::setEnableCacheSim(bool enable)
@@ -223,4 +223,4 @@ void CallgrindGlobalSettings::setDetectCycles(bool detect)
 }
 
 } // namespace Internal
-} // namespace Callgrind
+} // namespace Valgrind
diff --git a/src/plugins/callgrind/callgrindsettings.h b/src/plugins/valgrind/callgrindsettings.h
similarity index 97%
rename from src/plugins/callgrind/callgrindsettings.h
rename to src/plugins/valgrind/callgrindsettings.h
index f4892f0c771ecd73b4a56d035e126df371dbe181..1a81bf8712e638074349eae77cd59500ce7522a0 100644
--- a/src/plugins/callgrind/callgrindsettings.h
+++ b/src/plugins/valgrind/callgrindsettings.h
@@ -39,7 +39,7 @@
 
 #include <QtCore/QString>
 
-namespace Callgrind {
+namespace Valgrind {
 namespace Internal {
 
 /**
@@ -125,7 +125,7 @@ public:
     bool detectCycles() const;
 
 public slots:
-    void setCostFormat(Callgrind::Internal::CostDelegate::CostFormat format);
+    void setCostFormat(Valgrind::Internal::CostDelegate::CostFormat format);
     void setDetectCycles(bool detect);
 
 protected:
@@ -148,6 +148,6 @@ public:
 };
 
 } // namespace Internal
-} // namespace Callgrind
+} // namespace Valgrind
 
 #endif // ANALYZER_INTERNAL_CALLGRINDSETTINGS_H
diff --git a/src/plugins/callgrind/callgrindtextmark.cpp b/src/plugins/valgrind/callgrindtextmark.cpp
similarity index 98%
rename from src/plugins/callgrind/callgrindtextmark.cpp
rename to src/plugins/valgrind/callgrindtextmark.cpp
index ca0f15770b1091c21bd44f333dea135296f55c90..fa2c4e8aa60d15b946e6c741041e5c298dfb928c 100644
--- a/src/plugins/callgrind/callgrindtextmark.cpp
+++ b/src/plugins/valgrind/callgrindtextmark.cpp
@@ -42,7 +42,7 @@
 
 #include <utils/qtcassert.h>
 
-using namespace Callgrind::Internal;
+using namespace Valgrind::Internal;
 using namespace Valgrind::Callgrind;
 
 CallgrindTextMark::CallgrindTextMark(const QPersistentModelIndex &index,
diff --git a/src/plugins/callgrind/callgrindtextmark.h b/src/plugins/valgrind/callgrindtextmark.h
similarity index 97%
rename from src/plugins/callgrind/callgrindtextmark.h
rename to src/plugins/valgrind/callgrindtextmark.h
index 02fd51534b1ccd6f65ab2902a276cb108c093f04..d779287340923abcaf9b34d03e41ef9a24c407b9 100644
--- a/src/plugins/callgrind/callgrindtextmark.h
+++ b/src/plugins/valgrind/callgrindtextmark.h
@@ -38,12 +38,11 @@
 #include <QtCore/QPersistentModelIndex>
 
 namespace Valgrind {
+
 namespace Callgrind {
 class Function;
 }
-}
 
-namespace Callgrind {
 namespace Internal {
 
 class CallgrindTextMark : public TextEditor::BaseTextMark
@@ -70,6 +69,6 @@ private:
 };
 
 } // namespace Internal
-} // namespace Callgrind
+} // namespace Valgrind
 
 #endif // CALLGRINDTEXTMARK_H
diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..3378668689b83fe45523fed12270f01928b5e466
--- /dev/null
+++ b/src/plugins/valgrind/callgrindtool.cpp
@@ -0,0 +1,1003 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+**
+** Contact: Nokia Corporation (info@qt.nokia.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this file.
+** Please review the following information to ensure the GNU Lesser General
+** Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "callgrindtool.h"
+
+#include "callgrindcostdelegate.h"
+#include "callgrindcostview.h"
+#include "callgrindengine.h"
+#include "callgrindsettings.h"
+#include "callgrindtextmark.h"
+#include "callgrindvisualisation.h"
+
+#include <valgrind/callgrind/callgrindcallmodel.h>
+#include <valgrind/callgrind/callgrindcostitem.h>
+#include <valgrind/callgrind/callgrinddatamodel.h>
+#include <valgrind/callgrind/callgrindfunction.h>
+#include <valgrind/callgrind/callgrindfunctioncall.h>
+#include <valgrind/callgrind/callgrindparsedata.h>
+#include <valgrind/callgrind/callgrindproxymodel.h>
+#include <valgrind/callgrind/callgrindstackbrowser.h>
+
+#include <analyzerbase/analyzermanager.h>
+#include <analyzerbase/analyzersettings.h>
+#include <analyzerbase/analyzerutils.h>
+#include <analyzerbase/analyzerconstants.h>
+
+#include <coreplugin/actionmanager/actioncontainer.h>
+#include <coreplugin/actionmanager/actionmanager.h>
+#include <coreplugin/actionmanager/command.h>
+#include <coreplugin/coreconstants.h>
+#include <coreplugin/icontext.h>
+#include <coreplugin/icore.h>
+
+#include <cplusplus/LookupContext.h>
+#include <cplusplus/Overview.h>
+#include <cppeditor/cppeditorconstants.h>
+#include <extensionsystem/iplugin.h>
+#include <texteditor/basetexteditor.h>
+
+#include <utils/qtcassert.h>
+#include <utils/fancymainwindow.h>
+#include <utils/styledbar.h>
+
+#include <projectexplorer/project.h>
+#include <projectexplorer/projectexplorer.h>
+
+#include <QtCore/QFile>
+#include <QtCore/QFileInfo>
+#include <QtCore/QTimer>
+
+#include <QtGui/QAction>
+#include <QtGui/QActionGroup>
+#include <QtGui/QCheckBox>
+#include <QtGui/QComboBox>
+#include <QtGui/QDockWidget>
+#include <QtGui/QGraphicsItem>
+#include <QtGui/QHBoxLayout>
+#include <QtGui/QLineEdit>
+#include <QtGui/QMenu>
+#include <QtGui/QSortFilterProxyModel>
+#include <QtGui/QToolBar>
+#include <QtGui/QToolButton>
+#include <QtGui/QVBoxLayout>
+
+// shared/cplusplus includes
+#include <Symbols.h>
+
+using namespace Analyzer;
+using namespace Core;
+using namespace Valgrind::Callgrind;
+
+namespace Valgrind {
+namespace Internal {
+
+class CallgrindToolPrivate : public QObject
+{
+    Q_OBJECT
+
+public:
+    friend class CallgrindTool;
+
+    explicit CallgrindToolPrivate(CallgrindTool *parent);
+    virtual ~CallgrindToolPrivate();
+
+    void setParseData(ParseData *data);
+
+    CostDelegate::CostFormat costFormat() const;
+    QWidget *createControlWidget();
+    void initializeDockWidgets();
+
+    void ensureDockWidgets();
+    void doClear(bool clearParseData);
+    void updateEventCombo();
+
+    IAnalyzerEngine *createEngine(const AnalyzerStartParameters &sp,
+        ProjectExplorer::RunConfiguration *runConfiguration);
+
+signals:
+    void cycleDetectionEnabled(bool enabled);
+    void dumpRequested();
+    void resetRequested();
+    void pauseToggled(bool checked);
+
+public slots:
+    void slotClear();
+    void slotRequestDump();
+
+    void selectFunction(const Valgrind::Callgrind::Function *);
+    void setCostFormat(Valgrind::Internal::CostDelegate::CostFormat format);
+    void enableCycleDetection(bool enabled);
+    void setCostEvent(int index);
+
+    /// This function will add custom text marks to the editor
+    /// \note Call this after the data model has been populated
+    void createTextMarks();
+
+    /// This function will clear all text marks from the editor
+    void clearTextMarks();
+
+    void updateFilterString();
+    void updateCostFormat();
+
+    void handleFilterProjectCosts();
+    void handleShowCostsAction();
+    void handleShowCostsOfFunction();
+
+    void slotGoToOverview();
+    void stackBrowserChanged();
+
+    /// If \param busy is true, all widgets get a busy cursor when hovered
+    void setBusy(bool busy);
+
+    void dataFunctionSelected(const QModelIndex &index);
+    void calleeFunctionSelected(const QModelIndex &index);
+    void callerFunctionSelected(const QModelIndex &index);
+    void visualisationFunctionSelected(const Valgrind::Callgrind::Function *function);
+    void showParserResults(const Valgrind::Callgrind::ParseData *data);
+
+    void takeParserData(CallgrindEngine *engine);
+    void engineStarting(const Analyzer::IAnalyzerEngine *);
+    void engineFinished();
+
+    void editorOpened(Core::IEditor *);
+    void requestContextMenu(TextEditor::ITextEditor *editor, int line, QMenu *menu);
+
+public:
+    CallgrindTool *q;
+
+    DataModel *m_dataModel;
+    DataProxyModel *m_proxyModel;
+    StackBrowser *m_stackBrowser;
+
+    CallModel *m_callersModel;
+    CallModel *m_calleesModel;
+
+    // callgrind widgets
+    CostView *m_flatView;
+    CostView *m_callersView;
+    CostView *m_calleesView;
+    Visualisation *m_visualisation;
+
+    // navigation
+    QAction *m_goToOverview;
+    QAction *m_goBack;
+    QLineEdit *m_searchFilter;
+
+    // cost formatting
+    QAction *m_filterProjectCosts;
+    QAction *m_costAbsolute;
+    QAction *m_costRelative;
+    QAction *m_costRelativeToParent;
+    QAction *m_cycleDetection;
+    QComboBox *m_eventCombo;
+
+    QTimer *m_updateTimer;
+
+    QVector<CallgrindTextMark *> m_textMarks;
+
+    QAction *m_dumpAction;
+    QAction *m_resetAction;
+    QAction *m_pauseAction;
+    QAction *m_showCostsOfFunctionAction;
+
+    QString m_toggleCollectFunction;
+    CallgrindGlobalSettings *m_settings; // Not owned
+};
+
+
+CallgrindToolPrivate::CallgrindToolPrivate(CallgrindTool *parent)
+    : q(parent)
+    , m_dataModel(new DataModel(this))
+    , m_proxyModel(new DataProxyModel(this))
+    , m_stackBrowser(new StackBrowser(this))
+    , m_callersModel(new CallModel(this))
+    , m_calleesModel(new CallModel(this))
+    , m_flatView(0)
+    , m_callersView(0)
+    , m_calleesView(0)
+    , m_visualisation(0)
+    , m_goToOverview(0)
+    , m_goBack(0)
+    , m_searchFilter(0)
+    , m_filterProjectCosts(0)
+    , m_costAbsolute(0)
+    , m_costRelative(0)
+    , m_costRelativeToParent(0)
+    , m_eventCombo(0)
+    , m_updateTimer(new QTimer(this))
+    , m_dumpAction(0)
+    , m_resetAction(0)
+    , m_pauseAction(0)
+    , m_showCostsOfFunctionAction(0)
+    , m_settings(0)
+{
+    connect(m_stackBrowser, SIGNAL(currentChanged()), this, SLOT(stackBrowserChanged()));
+
+    m_updateTimer->setInterval(200);
+    m_updateTimer->setSingleShot(true);
+    connect(m_updateTimer, SIGNAL(timeout()), SLOT(updateFilterString()));
+
+    m_proxyModel->setSourceModel(m_dataModel);
+    m_proxyModel->setDynamicSortFilter(true);
+    m_proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
+    m_proxyModel->setFilterKeyColumn(DataModel::NameColumn);
+    m_proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
+
+    m_settings = AnalyzerGlobalSettings::instance()->subConfig<CallgrindGlobalSettings>();
+}
+
+CallgrindToolPrivate::~CallgrindToolPrivate()
+{
+    qDeleteAll(m_textMarks);
+    doClear(false);
+}
+
+void CallgrindToolPrivate::slotGoToOverview()
+{
+    selectFunction(0);
+}
+
+void CallgrindToolPrivate::slotClear()
+{
+    doClear(true);
+}
+
+void CallgrindToolPrivate::doClear(bool clearParseData)
+{
+    if (clearParseData) // Crashed when done from destructor.
+        setParseData(0);
+
+    // clear filters
+    if (m_filterProjectCosts)
+        m_filterProjectCosts->setChecked(false);
+    m_proxyModel->setFilterBaseDir(QString());
+    if (m_searchFilter)
+        m_searchFilter->setText(QString());
+    m_proxyModel->setFilterFixedString(QString());
+}
+
+void CallgrindToolPrivate::setBusy(bool busy)
+{
+    QCursor cursor(busy ? Qt::BusyCursor : Qt::ArrowCursor);
+    m_flatView->setCursor(cursor);
+    m_calleesView->setCursor(cursor);
+    m_callersView->setCursor(cursor);
+    m_visualisation->setCursor(cursor);
+}
+
+void CallgrindToolPrivate::selectFunction(const Function *func)
+{
+    if (!func) {
+        m_goToOverview->setDisabled(true);
+        m_flatView->clearSelection();
+        m_visualisation->setFunction(0);
+        m_callersModel->clear();
+        m_calleesModel->clear();
+        return;
+    }
+
+    m_goToOverview->setEnabled(true);
+
+    const QModelIndex index = m_dataModel->indexForObject(func);
+    const QModelIndex proxyIndex = m_proxyModel->mapFromSource(index);
+    m_flatView->selectionModel()->clearSelection();
+    m_flatView->selectionModel()->setCurrentIndex(proxyIndex,
+                                                  QItemSelectionModel::ClearAndSelect |
+                                                  QItemSelectionModel::Rows);
+    m_flatView->scrollTo(proxyIndex);
+
+    m_callersModel->setCalls(func->incomingCalls(), func);
+    m_calleesModel->setCalls(func->outgoingCalls(), func);
+    m_visualisation->setFunction(func);
+
+    const Function *item = m_stackBrowser->current();
+    if (!item || item != func)
+        m_stackBrowser->select(func);
+
+    if (QFile::exists(func->file())) {
+        ///TODO: custom position support?
+        int line = func->lineNumber();
+        TextEditor::BaseTextEditorWidget::openEditorAt(func->file(), qMax(line, 0));
+    }
+}
+
+void CallgrindToolPrivate::stackBrowserChanged()
+{
+    const Function *item = m_stackBrowser->current();
+    m_goBack->setEnabled(item != 0);
+    selectFunction(item);
+}
+
+void CallgrindToolPrivate::updateFilterString()
+{
+    m_proxyModel->setFilterFixedString(m_searchFilter->text());
+}
+
+void CallgrindToolPrivate::setCostFormat(CostDelegate::CostFormat format)
+{
+    switch (format) {
+        case CostDelegate::FormatAbsolute:
+            m_costAbsolute->setChecked(true);
+            break;
+        case CostDelegate::FormatRelative:
+            m_costRelative->setChecked(true);
+            break;
+        case CostDelegate::FormatRelativeToParent:
+            m_costRelativeToParent->setChecked(true);
+            break;
+    }
+}
+
+void CallgrindToolPrivate::setCostEvent(int index)
+{
+    // prevent assert in model, don't try to set event to -1
+    // happens when we clear the eventcombo
+    if (index == -1)
+        index = 0;
+
+    m_dataModel->setCostEvent(index);
+    m_calleesModel->setCostEvent(index);
+    m_callersModel->setCostEvent(index);
+}
+
+void CallgrindToolPrivate::enableCycleDetection(bool enabled)
+{
+    m_cycleDetection->setChecked(enabled);
+}
+
+// Following functions can be called with actions=0 or widgets=0
+// depending on initialization sequence (whether callgrind was current).
+CostDelegate::CostFormat CallgrindToolPrivate::costFormat() const
+{
+    if (m_costRelativeToParent && m_costRelativeToParent->isChecked())
+        return CostDelegate::FormatRelativeToParent;
+    if (m_costRelative && m_costRelative->isChecked())
+        return CostDelegate::FormatRelative;
+    return CostDelegate::FormatAbsolute;
+}
+
+void CallgrindToolPrivate::updateCostFormat()
+{
+    const CostDelegate::CostFormat format = costFormat();
+    if (m_flatView)
+        m_flatView->setCostFormat(format);
+    if (m_calleesView) {
+        m_calleesView->setCostFormat(format);
+        m_callersView->setCostFormat(format);
+    }
+    if (m_settings)
+        m_settings->setCostFormat(format);
+}
+
+void CallgrindToolPrivate::handleFilterProjectCosts()
+{
+    ProjectExplorer::ProjectExplorerPlugin *pe = ProjectExplorer::ProjectExplorerPlugin::instance();
+    ProjectExplorer::Project *pro = pe->currentProject();
+    QTC_ASSERT(pro, return)
+
+    if (m_filterProjectCosts->isChecked()) {
+        const QString projectDir = pro->projectDirectory();
+        m_proxyModel->setFilterBaseDir(projectDir);
+    }
+    else {
+        m_proxyModel->setFilterBaseDir(QString());
+    }
+}
+
+void CallgrindToolPrivate::dataFunctionSelected(const QModelIndex &index)
+{
+    const Function *func = index.data(DataModel::FunctionRole).value<const Function *>();
+    QTC_ASSERT(func, return);
+
+    selectFunction(func);
+}
+
+void CallgrindToolPrivate::calleeFunctionSelected(const QModelIndex &index)
+{
+    const FunctionCall *call = index.data(CallModel::FunctionCallRole).value<const FunctionCall *>();
+    QTC_ASSERT(call, return);
+
+    selectFunction(call->callee());
+}
+
+void CallgrindToolPrivate::callerFunctionSelected(const QModelIndex &index)
+{
+    const FunctionCall *call = index.data(CallModel::FunctionCallRole).value<const FunctionCall *>();
+    QTC_ASSERT(call, return);
+
+    selectFunction(call->caller());
+}
+
+void CallgrindToolPrivate::visualisationFunctionSelected(const Function *function)
+{
+    if (function && function == m_visualisation->function())
+        // up-navigation when the initial function was activated
+        m_stackBrowser->goBack();
+    else
+        selectFunction(function);
+}
+
+void CallgrindToolPrivate::setParseData(ParseData *data)
+{
+    // we have new parse data, invalidate filters in the proxy model
+    m_visualisation->setFunction(0);
+
+    // invalidate parse data in the data model
+    delete m_dataModel->parseData();
+
+    if (data && data->events().isEmpty()) {
+        // might happen if the user cancelled the profile run
+        // callgrind then sometimes produces empty callgrind.out.PID files
+        delete data;
+        data = 0;
+    }
+    m_dataModel->setParseData(data);
+    m_calleesModel->setParseData(data);
+    m_callersModel->setParseData(data);
+
+    updateEventCombo();
+
+    // clear history for new data
+    m_stackBrowser->clear();
+
+    // unset busy state
+    setBusy(false);
+}
+
+void CallgrindToolPrivate::updateEventCombo()
+{
+    QTC_ASSERT(m_eventCombo, return)
+
+    m_eventCombo->clear();
+
+    const ParseData *data = m_dataModel->parseData();
+    if (!data || data->events().isEmpty()) {
+        m_eventCombo->hide();
+        return;
+    }
+
+    m_eventCombo->show();
+    foreach (const QString &event, data->events())
+        m_eventCombo->addItem(ParseData::prettyStringForEvent(event));
+}
+
+static QToolButton *createToolButton(QAction *action)
+{
+    QToolButton *button = new QToolButton;
+    button->setDefaultAction(action);
+    button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
+    return button;
+}
+
+CallgrindTool::CallgrindTool(QObject *parent)
+    : Analyzer::IAnalyzerTool(parent)
+{
+    d = new CallgrindToolPrivate(this);
+    Core::ICore *core = Core::ICore::instance();
+
+    // EditorManager
+    QObject *editorManager = core->editorManager();
+    connect(editorManager, SIGNAL(editorOpened(Core::IEditor*)),
+        d, SLOT(editorOpened(Core::IEditor*)));
+}
+
+CallgrindTool::~CallgrindTool()
+{
+    delete d;
+}
+
+QString CallgrindTool::id() const
+{
+    return "Callgrind";
+}
+
+QString CallgrindTool::displayName() const
+{
+    return tr("Profile");
+}
+
+IAnalyzerTool::ToolMode CallgrindTool::mode() const
+{
+    return ReleaseMode;
+}
+
+void CallgrindTool::initialize()
+{
+}
+
+void CallgrindTool::extensionsInitialized()
+{
+    Core::ICore *core = Core::ICore::instance();
+    Core::ActionManager *actionManager = core->actionManager();
+
+    Core::Context analyzerContext = Core::Context(Analyzer::Constants::C_ANALYZEMODE);
+
+    // check if there is a CppEditor context menu, if true, add our own context menu actions
+    if (Core::ActionContainer *editorContextMenu =
+            actionManager->actionContainer(CppEditor::Constants::M_CONTEXT)) {
+        QAction *action = 0;
+        Core::Command *cmd = 0;
+
+        action = new QAction(this);
+        action->setSeparator(true);
+        cmd = actionManager->registerAction(action, "Analyzer.Callgrind.ContextMenu.Sep",
+            analyzerContext);
+        editorContextMenu->addAction(cmd);
+
+        action = new QAction(tr("Profile Costs of this Function and its Callees"), this);
+        action->setIcon(QIcon(Analyzer::Constants::ANALYZER_CONTROL_START_ICON));
+        connect(action, SIGNAL(triggered()), d, SLOT(handleShowCostsOfFunction()));
+        cmd = actionManager->registerAction(action, "Analyzer.Callgrind.ShowCostsOfFunction",
+            analyzerContext);
+        editorContextMenu->addAction(cmd);
+        cmd->setAttribute(Core::Command::CA_Hide);
+        cmd->setAttribute(Core::Command::CA_NonConfigurable);
+        d->m_showCostsOfFunctionAction = action;
+    }
+}
+
+void CallgrindTool::initializeDockWidgets()
+{
+    d->initializeDockWidgets();
+}
+
+void CallgrindToolPrivate::initializeDockWidgets()
+{
+    AnalyzerManager *am = AnalyzerManager::instance();
+    Utils::FancyMainWindow *mw = am->mainWindow();
+    m_visualisation = new Visualisation(mw);
+    m_visualisation->setFrameStyle(QFrame::NoFrame);
+    m_visualisation->setObjectName("Valgrind.CallgrindToolPrivate.Visualisation");
+    m_visualisation->setModel(m_dataModel);
+    connect(m_visualisation, SIGNAL(functionActivated(const Valgrind::Callgrind::Function*)),
+            this, SLOT(visualisationFunctionSelected(const Valgrind::Callgrind::Function*)));
+
+    m_callersView = new CostView(mw);
+    m_callersView->sortByColumn(CallModel::CostColumn);
+    m_callersView->setObjectName("Valgrind.CallgrindToolPrivate.CallersView");
+    m_callersView->setFrameStyle(QFrame::NoFrame);
+    // enable sorting
+    QSortFilterProxyModel *callerProxy = new QSortFilterProxyModel(m_callersModel);
+    callerProxy->setSourceModel(m_callersModel);
+    m_callersView->setModel(callerProxy);
+    m_callersView->hideColumn(CallModel::CalleeColumn);
+    connect(m_callersView, SIGNAL(activated(QModelIndex)),
+            this, SLOT(callerFunctionSelected(QModelIndex)));
+
+    m_calleesView = new CostView(mw);
+    m_calleesView->sortByColumn(CallModel::CostColumn);
+    m_calleesView->setObjectName("Valgrind.CallgrindToolPrivate.CalleesView");
+    m_calleesView->setFrameStyle(QFrame::NoFrame);
+    // enable sorting
+    QSortFilterProxyModel *calleeProxy = new QSortFilterProxyModel(m_calleesModel);
+    calleeProxy->setSourceModel(m_calleesModel);
+    m_calleesView->setModel(calleeProxy);
+    m_calleesView->hideColumn(CallModel::CallerColumn);
+    connect(m_calleesView, SIGNAL(activated(QModelIndex)),
+            this, SLOT(calleeFunctionSelected(QModelIndex)));
+
+    m_flatView = new CostView(mw);
+    m_flatView->sortByColumn(DataModel::SelfCostColumn);
+    m_flatView->setFrameStyle(QFrame::NoFrame);
+    m_flatView->setAttribute(Qt::WA_MacShowFocusRect, false);
+    m_flatView->setModel(m_proxyModel);
+    m_flatView->setObjectName("Valgrind.CallgrindToolPrivate.FlatView");
+    connect(m_flatView, SIGNAL(activated(QModelIndex)),
+            this, SLOT(dataFunctionSelected(QModelIndex)));
+
+    updateCostFormat();
+
+    QDockWidget *callersDock =
+        am->createDockWidget(q, tr("Callers"), m_callersView,
+                             Qt::BottomDockWidgetArea);
+
+    QDockWidget *flatDock =
+        am->createDockWidget(q, tr("Functions"), m_flatView,
+                             Qt::BottomDockWidgetArea);
+
+    QDockWidget *calleesDock =
+        am->createDockWidget(q, tr("Callees"), m_calleesView,
+                             Qt::BottomDockWidgetArea);
+
+    QDockWidget *visualizationDock =
+        am->createDockWidget(q, tr("Visualization"), m_visualisation,
+                             Qt::RightDockWidgetArea);
+    visualizationDock->hide();
+
+    mw->splitDockWidget(mw->toolBarDockWidget(), calleesDock, Qt::Vertical);
+    mw->splitDockWidget(mw->toolBarDockWidget(), callersDock, Qt::Vertical);
+    mw->splitDockWidget(mw->toolBarDockWidget(), flatDock, Qt::Vertical);
+    mw->tabifyDockWidget(callersDock, calleesDock);
+}
+
+IAnalyzerEngine *CallgrindTool::createEngine(const AnalyzerStartParameters &sp,
+    ProjectExplorer::RunConfiguration *runConfiguration)
+{
+    return d->createEngine(sp, runConfiguration);
+}
+
+IAnalyzerEngine *CallgrindToolPrivate::createEngine(const AnalyzerStartParameters &sp,
+    ProjectExplorer::RunConfiguration *runConfiguration)
+{
+    CallgrindEngine *engine = new CallgrindEngine(sp, runConfiguration);
+
+    connect(engine, SIGNAL(parserDataReady(CallgrindEngine *)),
+            SLOT(takeParserData(CallgrindEngine *)));
+    connect(engine, SIGNAL(starting(const Analyzer::IAnalyzerEngine*)),
+            SLOT(engineStarting(const Analyzer::IAnalyzerEngine*)));
+    connect(engine, SIGNAL(finished()),
+            SLOT(engineFinished()));
+
+    connect(this, SIGNAL(dumpRequested()), engine, SLOT(dump()));
+    connect(this, SIGNAL(resetRequested()), engine, SLOT(reset()));
+    connect(this, SIGNAL(pauseToggled(bool)), engine, SLOT(setPaused(bool)));
+
+    // initialize engine
+    engine->setPaused(m_pauseAction->isChecked());
+
+    // we may want to toggle collect for one function only in this run
+    engine->setToggleCollectFunction(m_toggleCollectFunction);
+    m_toggleCollectFunction.clear();
+
+    AnalyzerManager::instance()->showStatusMessage(AnalyzerManager::msgToolStarted(q->displayName()));
+
+    // apply project settings
+    AnalyzerProjectSettings *analyzerSettings = runConfiguration->extraAspect<AnalyzerProjectSettings>();
+    CallgrindProjectSettings *settings = analyzerSettings->subConfig<CallgrindProjectSettings>();
+    QTC_ASSERT(settings, return engine)
+
+    QTC_ASSERT(m_visualisation, return engine);
+    m_visualisation->setMinimumInclusiveCostRatio(settings->visualisationMinimumInclusiveCostRatio() / 100.0);
+    m_proxyModel->setMinimumInclusiveCostRatio(settings->minimumInclusiveCostRatio() / 100.0);
+    m_dataModel->setVerboseToolTipsEnabled(settings->enableEventToolTips());
+
+    return engine;
+}
+
+QWidget *CallgrindTool::createControlWidget()
+{
+    return d->createControlWidget();
+}
+
+QWidget *CallgrindToolPrivate::createControlWidget()
+{
+    QAction *action = 0;
+    QWidget *widget = new QWidget;
+    QHBoxLayout *layout = new QHBoxLayout;
+
+    layout->setMargin(0);
+    layout->setSpacing(0);
+    widget->setLayout(layout);
+
+    // dump action
+    action = new QAction(this);
+    action->setDisabled(true);
+    action->setIcon(QIcon(QLatin1String(Core::Constants::ICON_REDO)));
+    action->setText(tr("Dump"));
+    action->setToolTip(tr("Request the dumping of profile information. This will update the callgrind visualization."));
+    connect(action, SIGNAL(triggered()), this, SLOT(slotRequestDump()));
+    layout->addWidget(createToolButton(action));
+    m_dumpAction = action;
+
+    // reset action
+    action = new QAction(this);
+    action->setDisabled(true);
+    action->setIcon(QIcon(QLatin1String(Core::Constants::ICON_CLEAR)));
+    action->setText(tr("Reset"));
+    action->setToolTip(tr("Zero all event counters."));
+    connect(action, SIGNAL(triggered()), this, SIGNAL(resetRequested()));
+    layout->addWidget(createToolButton(action));
+    m_resetAction = action;
+
+    // pause action
+    action = new QAction(this);
+    action->setCheckable(true);
+    action->setIcon(QIcon(QLatin1String(":/qml/images/pause-small.png")));
+    action->setText(tr("Ignore"));
+    action->setToolTip(tr("If enabled, no events are counted which will speed up program execution during profiling."));
+    connect(action, SIGNAL(toggled(bool)), this, SIGNAL(pauseToggled(bool)));
+    layout->addWidget(createToolButton(action));
+    m_pauseAction = action;
+
+    // navigation
+    // go back
+    action = new QAction(this);
+    action->setDisabled(true);
+    action->setIcon(QIcon::fromTheme("go-previous"));
+    action->setText(tr("Back"));
+    action->setToolTip(tr("Go back one step in history. This will select the previously selected item."));
+    connect(action, SIGNAL(triggered(bool)), m_stackBrowser, SLOT(goBack()));
+    layout->addWidget(createToolButton(action));
+    m_goBack = action;
+
+    // overview
+    action = new QAction(this);
+    action->setDisabled(true);
+    action->setIcon(QIcon::fromTheme("go-up"));
+    action->setText(tr("All Functions"));
+    action->setToolTip(tr("Show the overview of all function calls."));
+    connect(action, SIGNAL(triggered(bool)), this, SLOT(slotGoToOverview()));
+    layout->addWidget(createToolButton(action));
+    m_goToOverview = action;
+
+    layout->addWidget(new Utils::StyledSeparator);
+
+    // event selection
+    m_eventCombo = new QComboBox;
+    m_eventCombo->setToolTip(tr("Selects which events from the profiling data are shown and visualized."));
+    connect(m_eventCombo, SIGNAL(currentIndexChanged(int)),
+            this, SLOT(setCostEvent(int)));
+    updateEventCombo();
+    layout->addWidget(m_eventCombo);
+
+    // cost formatting
+    {
+    QMenu *menu = new QMenu(layout->parentWidget());
+    QActionGroup *group = new QActionGroup(this);
+
+    // show costs as absolute numbers
+    m_costAbsolute = new QAction(tr("Absolute Costs"), this);
+    ///FIXME: icon
+    m_costAbsolute->setToolTip(tr("Show costs as absolute numbers."));
+    m_costAbsolute->setCheckable(true);
+    m_costAbsolute->setChecked(true);
+    connect(m_costAbsolute, SIGNAL(toggled(bool)), SLOT(updateCostFormat()));
+    group->addAction(m_costAbsolute);
+    menu->addAction(m_costAbsolute);
+
+    // show costs in percentages
+    m_costRelative = new QAction(tr("Relative Costs"), this);
+    ///FIXME: icon (percentage sign?)
+    m_costRelative->setToolTip(tr("Show costs relative to total inclusive cost."));
+    m_costRelative->setCheckable(true);
+    connect(m_costRelative, SIGNAL(toggled(bool)), SLOT(updateCostFormat()));
+    group->addAction(m_costRelative);
+    menu->addAction(m_costRelative);
+
+    // show costs relative to parent
+    m_costRelativeToParent = new QAction(tr("Relative Costs to Parent"), this);
+    ///FIXME: icon
+    m_costRelativeToParent->setToolTip(tr("Show costs relative to parent functions inclusive cost."));
+    m_costRelativeToParent->setCheckable(true);
+    connect(m_costRelativeToParent, SIGNAL(toggled(bool)), SLOT(updateCostFormat()));
+    group->addAction(m_costRelativeToParent);
+    menu->addAction(m_costRelativeToParent);
+
+    QToolButton *button = new QToolButton;
+    button->setMenu(menu);
+    button->setPopupMode(QToolButton::InstantPopup);
+    button->setText(tr("Cost Format"));
+    layout->addWidget(button);
+    }
+
+    // cycle detection
+    action = new QAction(tr("Cycle Detection"), this); ///FIXME: icon
+    action->setToolTip(tr("Enable cycle detection to properly handle recursive or circular function calls."));
+    action->setCheckable(true);
+    connect(action, SIGNAL(toggled(bool)), m_dataModel, SLOT(enableCycleDetection(bool)));
+    connect(action, SIGNAL(toggled(bool)), m_settings, SLOT(setDetectCycles(bool)));
+    layout->addWidget(createToolButton(action));
+    m_cycleDetection = action;
+
+    // filtering
+    action = new QAction(tr("Show Project Costs Only"), this);
+    action->setIcon(QIcon(Core::Constants::ICON_FILTER));
+    action->setToolTip(tr("Show only profiling info that originated from this project source."));
+    action->setCheckable(true);
+    connect(action, SIGNAL(toggled(bool)), this, SLOT(handleFilterProjectCosts()));
+    layout->addWidget(createToolButton(action));
+    m_filterProjectCosts = action;
+
+    // filter
+    ///FIXME: find workaround for http://bugreports.qt.nokia.com/browse/QTCREATORBUG-3247
+    QLineEdit *filter = new QLineEdit;
+    filter->setPlaceholderText(tr("Filter..."));
+    connect(filter, SIGNAL(textChanged(QString)), m_updateTimer, SLOT(start()));
+    layout->addWidget(filter);
+    m_searchFilter = filter;
+
+    setCostFormat(m_settings->costFormat());
+    enableCycleDetection(m_settings->detectCycles());
+
+    layout->addWidget(new Utils::StyledSeparator);
+    layout->addStretch();
+
+    return widget;
+}
+
+void CallgrindToolPrivate::clearTextMarks()
+{
+    qDeleteAll(m_textMarks);
+    m_textMarks.clear();
+}
+
+void CallgrindToolPrivate::engineStarting(const Analyzer::IAnalyzerEngine *)
+{
+    // enable/disable actions
+    m_resetAction->setEnabled(true);
+    m_dumpAction->setEnabled(true);
+    clearTextMarks();
+    slotClear();
+}
+
+void CallgrindToolPrivate::engineFinished()
+{
+    // enable/disable actions
+    m_resetAction->setEnabled(false);
+    m_dumpAction->setEnabled(false);
+
+    const ParseData *data = m_dataModel->parseData();
+    if (data)
+        showParserResults(data);
+    else
+        AnalyzerManager::instance()->showStatusMessage(tr("Profiling aborted."));
+}
+
+void CallgrindToolPrivate::showParserResults(const ParseData *data)
+{
+    QString msg;
+    if (data) {
+        // be careful, the list of events might be empty
+        if (data->events().isEmpty()) {
+            msg = tr("Parsing finished, no data.");
+        } else {
+            const QString costStr = QString("%1 %2").arg(QString::number(data->totalCost(0)), data->events().first());
+            msg = tr("Parsing finished, total cost of %1 reported.").arg(costStr);
+        }
+    } else {
+        msg = tr("Parsing failed.");
+    }
+    AnalyzerManager::instance()->showStatusMessage(msg);
+}
+
+void CallgrindToolPrivate::editorOpened(Core::IEditor *editor)
+{
+    TextEditor::ITextEditor *textEditor = qobject_cast<TextEditor::ITextEditor *>(editor);
+    if (!textEditor)
+        return;
+
+    connect(textEditor,
+        SIGNAL(markContextMenuRequested(TextEditor::ITextEditor*,int,QMenu*)),
+        SLOT(requestContextMenu(TextEditor::ITextEditor*,int,QMenu*)));
+}
+
+void CallgrindToolPrivate::requestContextMenu(TextEditor::ITextEditor *editor, int line, QMenu *menu)
+{
+    // find callgrind text mark that corresponds to this editor's file and line number
+    const Function *func = 0;
+    foreach (CallgrindTextMark *textMark, m_textMarks) {
+        if (textMark->fileName() == editor->file()->fileName() && textMark->lineNumber() == line) {
+            func = textMark->function();
+            break;
+        }
+    }
+    if (!func)
+        return; // no callgrind text mark under cursor, return
+
+    // add our action to the context menu
+    QAction *action = new QAction(tr("Select this Function in the Analyzer Output"), menu);
+    connect(action, SIGNAL(triggered()), SLOT(handleShowCostsAction()));
+    action->setData(QVariant::fromValue<const Function *>(func));
+    menu->addAction(action);
+}
+
+void CallgrindToolPrivate::handleShowCostsAction()
+{
+    const QAction *action = qobject_cast<QAction *>(sender());
+    QTC_ASSERT(action, return)
+
+    const Function *func = action->data().value<const Function *>();
+    QTC_ASSERT(func, return)
+
+    selectFunction(func);
+}
+
+void CallgrindToolPrivate::handleShowCostsOfFunction()
+{
+    CPlusPlus::Symbol *symbol = AnalyzerUtils::findSymbolUnderCursor();
+    if (!symbol)
+        return;
+
+    if (!symbol->isFunction())
+        return;
+
+    CPlusPlus::Overview view;
+    const QString qualifiedFunctionName = view.prettyName(CPlusPlus::LookupContext::fullyQualifiedName(symbol));
+
+    m_toggleCollectFunction = QString("%1()").arg(qualifiedFunctionName);
+
+    AnalyzerManager::instance()->selectTool(q);
+    AnalyzerManager::instance()->startTool();
+}
+
+void CallgrindToolPrivate::slotRequestDump()
+{
+    setBusy(true);
+    m_visualisation->setText(tr("Populating..."));
+    dumpRequested();
+}
+
+void CallgrindToolPrivate::takeParserData(CallgrindEngine *engine)
+{
+    ParseData *data = engine->takeParserData();
+    showParserResults(data);
+
+    if (!data)
+        return;
+
+    // clear first
+    clearTextMarks();
+    slotClear();
+
+    setParseData(data);
+    createTextMarks();
+}
+
+void CallgrindToolPrivate::createTextMarks()
+{
+    DataModel *model = m_dataModel;
+    QTC_ASSERT(model, return)
+
+    QList<QString> locations;
+    for (int row = 0; row < model->rowCount(); ++row) {
+        const QModelIndex index = model->index(row, DataModel::InclusiveCostColumn);
+
+        QString fileName = index.data(DataModel::FileNameRole).toString();
+        if (fileName.isEmpty() || fileName == "???")
+            continue;
+
+        bool ok = false;
+        const int lineNumber = index.data(DataModel::LineNumberRole).toInt(&ok);
+        QTC_ASSERT(ok, continue);
+
+        // sanitize filename, text marks need a canonical (i.e. no ".."s) path
+        // BaseTextMark::editorOpened(Core::IEditor *editor) compares file names on string basis
+        QFileInfo info(fileName);
+        fileName = info.canonicalFilePath();
+        if (fileName.isEmpty())
+            continue; // isEmpty == true => file does not exist, continue then
+
+        // create only one text mark per location
+        const QString location = QString("%1:%2").arg(fileName, QString::number(lineNumber));
+        if (locations.contains(location))
+            continue;
+        locations << location;
+
+        m_textMarks.append(new CallgrindTextMark(index, fileName, lineNumber));
+    }
+}
+
+} // namespace Internal
+} // namespace Valgrind
+
+#include "callgrindtool.moc"
diff --git a/src/plugins/callgrind/callgrindplugin.h b/src/plugins/valgrind/callgrindtool.h
similarity index 62%
rename from src/plugins/callgrind/callgrindplugin.h
rename to src/plugins/valgrind/callgrindtool.h
index b56c1ac4aa157a5378ec759c63db46663c0f6025..fcb4f617c40bf36e17da985fd127cd7a6a21aba2 100644
--- a/src/plugins/callgrind/callgrindplugin.h
+++ b/src/plugins/valgrind/callgrindtool.h
@@ -30,26 +30,44 @@
 **
 **************************************************************************/
 
-#ifndef CALLGRINDPLUGIN_H
-#define CALLGRINDPLUGIN_H
+#ifndef CALLGRINDTOOL_H
+#define CALLGRINDTOOL_H
 
-#include <extensionsystem/iplugin.h>
+#include <analyzerbase/ianalyzertool.h>
 
-namespace Callgrind {
+namespace Valgrind {
 namespace Internal {
 
-class CallgrindPlugin : public ExtensionSystem::IPlugin
+class CallgrindToolPrivate;
+
+class CallgrindTool : public Analyzer::IAnalyzerTool
 {
     Q_OBJECT
 
 public:
-    CallgrindPlugin() {}
+    explicit CallgrindTool(QObject *parent = 0);
+    ~CallgrindTool();
+
+    QString id() const;
+    QString displayName() const;
+    ToolMode mode() const;
+
+    void initialize();
+    void extensionsInitialized();
+    void initializeDockWidgets();
+
+    Analyzer::IAnalyzerEngine *createEngine(const Analyzer::AnalyzerStartParameters &sp,
+        ProjectExplorer::RunConfiguration *runConfiguration = 0);
+    QWidget *createControlWidget();
+
+    bool canRunRemotely() const { return true; }
+    bool needsOutputPane() const { return false; }
 
-    virtual bool initialize(const QStringList &arguments, QString *errorString);
-    virtual void extensionsInitialized();
+private:
+    CallgrindToolPrivate *d;
 };
 
 } // namespace Internal
-} // namespace Callgrind
+} // namespace Valgrind
 
-#endif // CALLGRINDPLUGIN_H
+#endif // CALLGRINDTOOL_H
diff --git a/src/plugins/callgrind/callgrindvisualisation.cpp b/src/plugins/valgrind/callgrindvisualisation.cpp
similarity index 99%
rename from src/plugins/callgrind/callgrindvisualisation.cpp
rename to src/plugins/valgrind/callgrindvisualisation.cpp
index 3ff9b6b6eaaaa45d6f2f864f50d416c4825f74f6..adfb7f6f04cf3813a126a7dcd147450312dd502e 100644
--- a/src/plugins/callgrind/callgrindvisualisation.cpp
+++ b/src/plugins/valgrind/callgrindvisualisation.cpp
@@ -61,7 +61,7 @@ static const int FIT_IN_VIEW_MARGIN = 2;
 
 using namespace Valgrind::Callgrind;
 
-namespace Callgrind {
+namespace Valgrind {
 namespace Internal {
 
 class FunctionGraphicsTextItem : public QAbstractGraphicsShapeItem
@@ -461,4 +461,4 @@ void Visualisation::resizeEvent(QResizeEvent *event)
 }
 
 } // namespace Internal
-} // namespace Callgrind
+} // namespace Valgrind
diff --git a/src/plugins/callgrind/callgrindvisualisation.h b/src/plugins/valgrind/callgrindvisualisation.h
similarity index 98%
rename from src/plugins/callgrind/callgrindvisualisation.h
rename to src/plugins/valgrind/callgrindvisualisation.h
index 2694d0c181732ad50627389a1cf1e9a81e658a37..ef3a08925edf19125e69b8cd177485cdaad700d4 100644
--- a/src/plugins/callgrind/callgrindvisualisation.h
+++ b/src/plugins/valgrind/callgrindvisualisation.h
@@ -46,7 +46,7 @@ class Function;
 }
 }
 
-namespace Callgrind {
+namespace Valgrind {
 namespace Internal {
 
 class Visualisation : public QGraphicsView
@@ -89,6 +89,6 @@ private:
 };
 
 } // namespace Internal
-} // namespace Callgrind
+} // namespace Valgrind
 
 #endif // VALGRIND_CALLGRIND_CALLGRINDVISUALISATION_H
diff --git a/src/plugins/memcheck/memcheck.pro b/src/plugins/valgrind/memcheck.pro
similarity index 100%
rename from src/plugins/memcheck/memcheck.pro
rename to src/plugins/valgrind/memcheck.pro
diff --git a/src/plugins/memcheck/memcheckconfigwidget.cpp b/src/plugins/valgrind/memcheckconfigwidget.cpp
similarity index 99%
rename from src/plugins/memcheck/memcheckconfigwidget.cpp
rename to src/plugins/valgrind/memcheckconfigwidget.cpp
index ff2b28206167229ea4c9fde6ff7ecf9ff8ff5053..d573178764ca777de161c372bc23819ba01d7464 100644
--- a/src/plugins/memcheck/memcheckconfigwidget.cpp
+++ b/src/plugins/valgrind/memcheckconfigwidget.cpp
@@ -44,7 +44,7 @@
 #include <QtGui/QFileDialog>
 #include <QtCore/QDebug>
 
-namespace Memcheck {
+namespace Valgrind {
 namespace Internal {
 
 MemcheckConfigWidget::MemcheckConfigWidget(AbstractMemcheckSettings *settings, QWidget *parent)
@@ -179,4 +179,4 @@ void MemcheckConfigWidget::slotSuppressionSelectionChanged()
 }
 
 } // namespace Internal
-} // namespace Memcheck
+} // namespace Valgrind
diff --git a/src/plugins/memcheck/memcheckconfigwidget.h b/src/plugins/valgrind/memcheckconfigwidget.h
similarity index 98%
rename from src/plugins/memcheck/memcheckconfigwidget.h
rename to src/plugins/valgrind/memcheckconfigwidget.h
index 26e54a8f8320767f4453075006b07335f9bd9c1e..e3d806d75ae2caa2929ae3767d4d0c7e14f4b3dd 100644
--- a/src/plugins/memcheck/memcheckconfigwidget.h
+++ b/src/plugins/valgrind/memcheckconfigwidget.h
@@ -41,7 +41,7 @@ QT_BEGIN_NAMESPACE
 class QStandardItemModel;
 QT_END_NAMESPACE
 
-namespace Memcheck {
+namespace Valgrind {
 namespace Internal {
 
 namespace Ui {
@@ -75,6 +75,6 @@ private:
 };
 
 } // namespace Internal
-} // namespace Memcheck
+} // namespace Valgrind
 
 #endif // ANALYZER_INTERNAL_MEMCHECKCONFIGWIDGET_H
diff --git a/src/plugins/memcheck/memcheckconfigwidget.ui b/src/plugins/valgrind/memcheckconfigwidget.ui
similarity index 96%
rename from src/plugins/memcheck/memcheckconfigwidget.ui
rename to src/plugins/valgrind/memcheckconfigwidget.ui
index 8b0ebf6de502ccf0abf89bfe562b76dbe8a7d7c3..1763dbfbfb2bb7155ac20c084483a1024a360e38 100644
--- a/src/plugins/memcheck/memcheckconfigwidget.ui
+++ b/src/plugins/valgrind/memcheckconfigwidget.ui
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
- <class>Memcheck::Internal::MemcheckConfigWidget</class>
- <widget class="QWidget" name="Memcheck::Internal::MemcheckConfigWidget">
+ <class>Valgrind::Internal::MemcheckConfigWidget</class>
+ <widget class="QWidget" name="Valgrind::Internal::MemcheckConfigWidget">
   <property name="geometry">
    <rect>
     <x>0</x>
diff --git a/src/plugins/memcheck/memcheckengine.cpp b/src/plugins/valgrind/memcheckengine.cpp
similarity index 99%
rename from src/plugins/memcheck/memcheckengine.cpp
rename to src/plugins/valgrind/memcheckengine.cpp
index 4e46c2b016e8c2e64ec4a45273192b57c467cc2c..96d6edd32ca33f227378d5e637cea96234074894 100644
--- a/src/plugins/memcheck/memcheckengine.cpp
+++ b/src/plugins/valgrind/memcheckengine.cpp
@@ -46,7 +46,7 @@
 using namespace Analyzer;
 using namespace Valgrind::XmlProtocol;
 
-namespace Memcheck {
+namespace Valgrind {
 namespace Internal {
 
 MemcheckEngine::MemcheckEngine(const Analyzer::AnalyzerStartParameters &sp,
@@ -145,4 +145,4 @@ void MemcheckEngine::receiveLogMessage(const QByteArray &b)
 }
 
 } // namespace Internal
-} // namespace Memcheck
+} // namespace Valgrind
diff --git a/src/plugins/memcheck/memcheckengine.h b/src/plugins/valgrind/memcheckengine.h
similarity index 93%
rename from src/plugins/memcheck/memcheckengine.h
rename to src/plugins/valgrind/memcheckengine.h
index 6851d0a490f6041e6ccc5558a7d4359b785057ed..de21bdf5cd40a29d37f261b643500468b30a4908 100644
--- a/src/plugins/memcheck/memcheckengine.h
+++ b/src/plugins/valgrind/memcheckengine.h
@@ -35,15 +35,15 @@
 #ifndef MEMCHECKENGINE_H
 #define MEMCHECKENGINE_H
 
+#include "valgrindengine.h"
+
 #include <valgrind/memcheck/memcheckrunner.h>
 #include <valgrind/xmlprotocol/threadedparser.h>
 
-#include <valgrindtoolbase/valgrindengine.h>
-
-namespace Memcheck {
+namespace Valgrind {
 namespace Internal {
 
-class MemcheckEngine : public Valgrind::Internal::ValgrindEngine
+class MemcheckEngine : public ValgrindEngine
 {
     Q_OBJECT
 public:
@@ -75,6 +75,6 @@ private:
 };
 
 } // namespace Internal
-} // namespace Memcheck
+} // namespace Valgrind
 
 #endif // MEMCHECKENGINE_H
diff --git a/src/plugins/memcheck/memcheckerrorview.cpp b/src/plugins/valgrind/memcheckerrorview.cpp
similarity index 98%
rename from src/plugins/memcheck/memcheckerrorview.cpp
rename to src/plugins/valgrind/memcheckerrorview.cpp
index ec3ab45215cc307833f2b112811297ed876bc82b..e89595a4fd9c700a31007037146803205234bfc8 100644
--- a/src/plugins/memcheck/memcheckerrorview.cpp
+++ b/src/plugins/valgrind/memcheckerrorview.cpp
@@ -35,6 +35,7 @@
 #include "memcheckerrorview.h"
 
 #include "suppressiondialog.h"
+#include "valgrindsettings.h"
 
 #include <valgrind/xmlprotocol/error.h>
 #include <valgrind/xmlprotocol/errorlistmodel.h>
@@ -43,8 +44,6 @@
 #include <valgrind/xmlprotocol/modelhelpers.h>
 #include <valgrind/xmlprotocol/suppression.h>
 
-#include <valgrindtoolbase/valgrindsettings.h>
-
 #include <texteditor/basetexteditor.h>
 
 #include <projectexplorer/projectexplorer.h>
@@ -69,7 +68,7 @@
 
 using namespace Valgrind::XmlProtocol;
 
-namespace Memcheck {
+namespace Valgrind {
 namespace Internal {
 
 MemcheckErrorDelegate::MemcheckErrorDelegate(QListView *parent)
@@ -148,7 +147,7 @@ static QString makeFrameName(const Frame &frame, const QString &relativeTo,
     }
 
     if (!fn.isEmpty())
-        return QCoreApplication::translate("Memcheck::Internal", "%1 in %2").arg(Qt::escape(fn), path);
+        return QCoreApplication::translate("Valgrind::Internal", "%1 in %2").arg(Qt::escape(fn), path);
     if (!path.isEmpty())
         return path;
     return QString("0x%1").arg(frame.instructionPointer(), 0, 16);
@@ -178,7 +177,7 @@ QString errorLocation(const QModelIndex &index, const Error &error,
     }
     QTC_ASSERT(model, return QString());
 
-    return QCoreApplication::translate("Memcheck::Internal", "in %1").
+    return QCoreApplication::translate("Valgrind::Internal", "in %1").
             arg(makeFrameName(model->findRelevantFrame(error), relativeToPath(),
                               link, linkAttr));
 }
@@ -509,4 +508,4 @@ void MemcheckErrorView::suppressError()
 }
 
 } // namespace Internal
-} // namespace Memcheck
+} // namespace Valgrind
diff --git a/src/plugins/memcheck/memcheckerrorview.h b/src/plugins/valgrind/memcheckerrorview.h
similarity index 98%
rename from src/plugins/memcheck/memcheckerrorview.h
rename to src/plugins/valgrind/memcheckerrorview.h
index 00dfb2318f958a91f56a3011dc6892b95ba8c51c..d36453684afa1fec94c24bd18dbc40411fce6322 100644
--- a/src/plugins/memcheck/memcheckerrorview.h
+++ b/src/plugins/valgrind/memcheckerrorview.h
@@ -47,7 +47,7 @@ namespace ProjectExplorer {
 class Project;
 }
 
-namespace Memcheck {
+namespace Valgrind {
 namespace Internal {
 
 class MemcheckErrorDelegate : public QStyledItemDelegate
@@ -120,6 +120,6 @@ private:
 };
 
 } // namespace Internal
-} // namespace Memcheck
+} // namespace Valgrind
 
 #endif // MEMCHECKERRORVIEW_H
diff --git a/src/plugins/memcheck/memchecksettings.cpp b/src/plugins/valgrind/memchecksettings.cpp
similarity index 99%
rename from src/plugins/memcheck/memchecksettings.cpp
rename to src/plugins/valgrind/memchecksettings.cpp
index 66c609c83ae55d969767d9d64838d7877e05e862..664f59973bbf5d350928b62e999782286d026085 100644
--- a/src/plugins/memcheck/memchecksettings.cpp
+++ b/src/plugins/valgrind/memchecksettings.cpp
@@ -52,7 +52,7 @@ static const char visibleErrorKindsC[] = "Analyzer.Valgrind.VisibleErrorKinds";
 static const char lastSuppressionDirectoryC[] = "Analyzer.Valgrind.LastSuppressionDirectory";
 static const char lastSuppressionHistoryC[] = "Analyzer.Valgrind.LastSuppressionHistory";
 
-namespace Memcheck {
+namespace Valgrind {
 namespace Internal {
 
 QVariantMap AbstractMemcheckSettings::defaults() const
@@ -277,4 +277,4 @@ QStringList MemcheckProjectSettings::suppressionFiles() const
 }
 
 } // namespace Internal
-} // namespace Memcheck
+} // namespace Valgrind
diff --git a/src/plugins/memcheck/memchecksettings.h b/src/plugins/valgrind/memchecksettings.h
similarity index 99%
rename from src/plugins/memcheck/memchecksettings.h
rename to src/plugins/valgrind/memchecksettings.h
index f01883a3b89037ab2f202b3f4fda4b5232c3f7b6..7d4a2f3f79d232104534816bb4fc4bff270e97a8 100644
--- a/src/plugins/memcheck/memchecksettings.h
+++ b/src/plugins/valgrind/memchecksettings.h
@@ -37,7 +37,7 @@
 
 #include <analyzerbase/analyzersettings.h>
 
-namespace Memcheck {
+namespace Valgrind {
 namespace Internal {
 
 /**
@@ -147,6 +147,6 @@ private:
 };
 
 } // namespace Internal
-} // namespace Memcheck
+} // namespace Valgrind
 
 #endif // ANALYZER_INTERNAL_MEMCHECKSETTINGS_H
diff --git a/src/plugins/memcheck/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp
similarity index 99%
rename from src/plugins/memcheck/memchecktool.cpp
rename to src/plugins/valgrind/memchecktool.cpp
index 932584478fda0e4af6ca5d0df5f49982ce980f32..5388662e896525e314b9a6b68913ad41c7c11a7e 100644
--- a/src/plugins/memcheck/memchecktool.cpp
+++ b/src/plugins/valgrind/memchecktool.cpp
@@ -36,6 +36,7 @@
 #include "memcheckengine.h"
 #include "memcheckerrorview.h"
 #include "memchecksettings.h"
+#include "valgrindsettings.h"
 
 #include <analyzerbase/analyzermanager.h>
 #include <analyzerbase/analyzerconstants.h>
@@ -48,8 +49,6 @@
 #include <valgrind/xmlprotocol/stack.h>
 #include <valgrind/xmlprotocol/suppression.h>
 
-#include <valgrindtoolbase/valgrindsettings.h>
-
 #include <extensionsystem/iplugin.h>
 #include <extensionsystem/pluginmanager.h>
 
@@ -94,7 +93,7 @@
 using namespace Analyzer;
 using namespace Valgrind::XmlProtocol;
 
-namespace Memcheck {
+namespace Valgrind {
 namespace Internal {
 
 // Adapter for output pane.
@@ -547,4 +546,4 @@ bool MemcheckTool::canRunRemotely() const
 }
 
 } // namespace Internal
-} // namespace Memcheck
+} // namespace Valgrind
diff --git a/src/plugins/memcheck/memchecktool.h b/src/plugins/valgrind/memchecktool.h
similarity index 98%
rename from src/plugins/memcheck/memchecktool.h
rename to src/plugins/valgrind/memchecktool.h
index 4895898cb188aee42161057f1ab83aaf568db5b3..35262a99939f7a9b426bc2cd7be534f67f99a763 100644
--- a/src/plugins/memcheck/memchecktool.h
+++ b/src/plugins/valgrind/memchecktool.h
@@ -62,7 +62,7 @@ namespace Analyzer
 class AnalyzerSettings;
 }
 
-namespace Memcheck {
+namespace Valgrind {
 namespace Internal {
 
 class MemCheckOutputPaneAdapter;
@@ -144,6 +144,6 @@ private:
 };
 
 } // namespace Internal
-} // namespace Memcheck
+} // namespace Valgrind
 
 #endif // MEMCHECKTOOL_H
diff --git a/src/plugins/memcheck/suppressiondialog.cpp b/src/plugins/valgrind/suppressiondialog.cpp
similarity index 99%
rename from src/plugins/memcheck/suppressiondialog.cpp
rename to src/plugins/valgrind/suppressiondialog.cpp
index 481299416fdeab858cf251cd4854e197aa5ae696..17d315109c36b56cc0a004612f808b906ef38d56 100644
--- a/src/plugins/memcheck/suppressiondialog.cpp
+++ b/src/plugins/valgrind/suppressiondialog.cpp
@@ -126,7 +126,7 @@ bool sortIndizesReverse(const QModelIndex &l, const QModelIndex &r)
 
 } // namespace anoe
 
-namespace Memcheck {
+namespace Valgrind {
 namespace Internal {
 
 SuppressionDialog::SuppressionDialog(MemcheckErrorView *view, QWidget *parent, Qt::WindowFlags f)
@@ -256,4 +256,4 @@ void SuppressionDialog::validate()
 }
 
 } // namespace Internal
-} // namespace Memcheck
+} // namespace Valgrind
diff --git a/src/plugins/memcheck/suppressiondialog.h b/src/plugins/valgrind/suppressiondialog.h
similarity index 98%
rename from src/plugins/memcheck/suppressiondialog.h
rename to src/plugins/valgrind/suppressiondialog.h
index 0dc389e71f485103a9474e5112f2eaf44e70a320..93fce056e6e94f01054b440d0d48b8162e96a067 100644
--- a/src/plugins/memcheck/suppressiondialog.h
+++ b/src/plugins/valgrind/suppressiondialog.h
@@ -43,7 +43,7 @@ namespace Analyzer {
 class AnalyzerSettings;
 }
 
-namespace Memcheck {
+namespace Valgrind {
 namespace Internal {
 
 namespace Ui {
@@ -76,6 +76,6 @@ private:
 };
 
 } // namespace Internal
-} // namespace Memcheck
+} // namespace Valgrind
 
 #endif // ANALYZER_VALGRIND_INTERNAL_SUPPRESSIONDIALOG_H
diff --git a/src/plugins/memcheck/suppressiondialog.ui b/src/plugins/valgrind/suppressiondialog.ui
similarity index 95%
rename from src/plugins/memcheck/suppressiondialog.ui
rename to src/plugins/valgrind/suppressiondialog.ui
index 30302034a0ec0851b32c9294215483b51f523559..30262631922c5a1f84a457d9b79a56363083c7cd 100644
--- a/src/plugins/memcheck/suppressiondialog.ui
+++ b/src/plugins/valgrind/suppressiondialog.ui
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
- <class>Memcheck::Internal::SuppressionDialog</class>
- <widget class="QDialog" name="Memcheck::Internal::SuppressionDialog">
+ <class>Valgrind::Internal::SuppressionDialog</class>
+ <widget class="QDialog" name="Valgrind::Internal::SuppressionDialog">
   <property name="geometry">
    <rect>
     <x>0</x>
diff --git a/src/plugins/valgrind/valgrind.pri b/src/plugins/valgrind/valgrind.pri
new file mode 100644
index 0000000000000000000000000000000000000000..1841a4670f071392aa542c4cf4ab59fabb890ee8
--- /dev/null
+++ b/src/plugins/valgrind/valgrind.pri
@@ -0,0 +1,4 @@
+include(valgrind_dependencies.pri)
+
+INCLUDEPATH += $$PWD
+LIBS *= -l$$qtLibraryName(Valgrind)
diff --git a/src/plugins/valgrind/valgrind.pro b/src/plugins/valgrind/valgrind.pro
new file mode 100644
index 0000000000000000000000000000000000000000..18bdb64441554e919100bf7629620de5c2ccb248
--- /dev/null
+++ b/src/plugins/valgrind/valgrind.pro
@@ -0,0 +1,67 @@
+TEMPLATE = lib
+TARGET = Valgrind
+
+DEFINES += VALGRIND_LIBRARY
+
+include(../../qtcreatorplugin.pri)
+include(valgrind.pri)
+
+QT += network
+
+HEADERS += \
+    valgrindplugin.h \
+    valgrind_global.h \
+    valgrindengine.h \
+    valgrindconfigwidget.h \
+    valgrindsettings.h \
+    \
+    callgrindconfigwidget.h \
+    callgrindcostdelegate.h \
+    callgrindcostview.h \
+    callgrindhelper.h \
+    callgrindnamedelegate.h \
+    callgrindsettings.h \
+    callgrindtool.h \
+    callgrindvisualisation.h \
+    callgrindengine.h \
+    workarounds.h \
+    callgrindtextmark.h \
+    \
+    memchecktool.h \
+    memcheckengine.h \
+    memcheckerrorview.h \
+    memchecksettings.h \
+    memcheckconfigwidget.h \
+    suppressiondialog.h
+
+SOURCES += \
+    valgrindplugin.cpp \
+    valgrindengine.cpp \
+    valgrindconfigwidget.cpp \
+    valgrindsettings.cpp \
+    \
+    callgrindconfigwidget.cpp \
+    callgrindcostdelegate.cpp \
+    callgrindcostview.cpp \
+    callgrindhelper.cpp \
+    callgrindnamedelegate.cpp \
+    callgrindsettings.cpp \
+    callgrindtool.cpp \
+    callgrindvisualisation.cpp \
+    callgrindengine.cpp \
+    workarounds.cpp \
+    callgrindtextmark.cpp \
+    \
+    memchecktool.cpp \
+    memcheckengine.cpp \
+    memcheckerrorview.cpp \
+    memchecksettings.cpp \
+    memcheckconfigwidget.cpp \
+    suppressiondialog.cpp
+
+FORMS += \
+    valgrindconfigwidget.ui \
+    callgrindconfigwidget.ui \
+    suppressiondialog.ui \
+    memcheckconfigwidget.ui
+
diff --git a/src/plugins/callgrind/callgrind_dependencies.pri b/src/plugins/valgrind/valgrind_dependencies.pri
similarity index 76%
rename from src/plugins/callgrind/callgrind_dependencies.pri
rename to src/plugins/valgrind/valgrind_dependencies.pri
index 532881cea96ec2be3174734e0808a0e90fa5c923..04786e9e89c0bdaaa094a6e373a7c44f157792b0 100644
--- a/src/plugins/callgrind/callgrind_dependencies.pri
+++ b/src/plugins/valgrind/valgrind_dependencies.pri
@@ -1,5 +1,4 @@
+include(../../libs/cplusplus/cplusplus.pri)
+include(../../plugins/analyzerbase/analyzerbase.pri)
 include(../../plugins/coreplugin/coreplugin.pri)
 include(../../plugins/texteditor/texteditor.pri)
-include(../../plugins/analyzerbase/analyzerbase.pri)
-include(../../plugins/valgrindtoolbase/valgrindtoolbase.pri)
-include(../../libs/cplusplus/cplusplus.pri)
diff --git a/src/plugins/valgrindtoolbase/valgrindtoolbase_global.h b/src/plugins/valgrind/valgrind_global.h
similarity index 100%
rename from src/plugins/valgrindtoolbase/valgrindtoolbase_global.h
rename to src/plugins/valgrind/valgrind_global.h
diff --git a/src/plugins/valgrindtoolbase/valgrindconfigwidget.cpp b/src/plugins/valgrind/valgrindconfigwidget.cpp
similarity index 100%
rename from src/plugins/valgrindtoolbase/valgrindconfigwidget.cpp
rename to src/plugins/valgrind/valgrindconfigwidget.cpp
diff --git a/src/plugins/valgrindtoolbase/valgrindconfigwidget.h b/src/plugins/valgrind/valgrindconfigwidget.h
similarity index 100%
rename from src/plugins/valgrindtoolbase/valgrindconfigwidget.h
rename to src/plugins/valgrind/valgrindconfigwidget.h
diff --git a/src/plugins/valgrindtoolbase/valgrindconfigwidget.ui b/src/plugins/valgrind/valgrindconfigwidget.ui
similarity index 100%
rename from src/plugins/valgrindtoolbase/valgrindconfigwidget.ui
rename to src/plugins/valgrind/valgrindconfigwidget.ui
diff --git a/src/plugins/valgrindtoolbase/valgrindengine.cpp b/src/plugins/valgrind/valgrindengine.cpp
similarity index 100%
rename from src/plugins/valgrindtoolbase/valgrindengine.cpp
rename to src/plugins/valgrind/valgrindengine.cpp
diff --git a/src/plugins/valgrindtoolbase/valgrindengine.h b/src/plugins/valgrind/valgrindengine.h
similarity index 98%
rename from src/plugins/valgrindtoolbase/valgrindengine.h
rename to src/plugins/valgrind/valgrindengine.h
index 371fe4614513161ff9ac0037eca7cee7954c69fc..a34273d3f07bafc85054d57c0046b91f6231b0ef 100644
--- a/src/plugins/valgrindtoolbase/valgrindengine.h
+++ b/src/plugins/valgrind/valgrindengine.h
@@ -35,10 +35,9 @@
 #ifndef VALGRINDENGINE_H
 #define VALGRINDENGINE_H
 
-#include <analyzerbase/ianalyzerengine.h>
-
-#include "valgrindtoolbase_global.h"
+#include "valgrind_global.h"
 
+#include <analyzerbase/ianalyzerengine.h>
 #include <analyzerbase/ianalyzerengine.h>
 
 #include <utils/environment.h>
diff --git a/src/plugins/memcheck/memcheckplugin.cpp b/src/plugins/valgrind/valgrindplugin.cpp
similarity index 62%
rename from src/plugins/memcheck/memcheckplugin.cpp
rename to src/plugins/valgrind/valgrindplugin.cpp
index d4038ca91f13ae091cca76d32ef2f9bae8606689..e9f13d02654ddb09e79b338c32964efb5f2b946e 100644
--- a/src/plugins/memcheck/memcheckplugin.cpp
+++ b/src/plugins/valgrind/valgrindplugin.cpp
@@ -32,43 +32,62 @@
 **
 **************************************************************************/
 
-#include "memcheckplugin.h"
-
-#include <analyzerbase/analyzermanager.h>
-#include <analyzerbase/analyzersettings.h>
-
+#include "valgrindplugin.h"
+#include "valgrindsettings.h"
+#include "callgrindtool.h"
+#include "callgrindsettings.h"
 #include "memchecktool.h"
 #include "memchecksettings.h"
 
+#include <analyzerbase/analyzersettings.h>
+#include <analyzerbase/analyzermanager.h>
+
 #include <QtCore/QStringList>
 #include <QtCore/QtPlugin>
 
 using namespace Analyzer;
-using namespace Memcheck;
+using namespace Valgrind::Internal;
+
 
-using namespace Memcheck::Internal;
+static AbstractAnalyzerSubConfig *valgrindConfigFactory()
+{
+    return new ValgrindSettings();
+}
+
+static AbstractAnalyzerSubConfig *globalCallgrindFactory()
+{
+    return new CallgrindGlobalSettings();
+}
+
+static AbstractAnalyzerSubConfig *projectCallgrindFactory()
+{
+    return new CallgrindProjectSettings();
+}
 
-static Analyzer::AbstractAnalyzerSubConfig *globalFactory()
+static AbstractAnalyzerSubConfig *globalMemcheckFactory()
 {
     return new MemcheckGlobalSettings();
 }
 
-static Analyzer::AbstractAnalyzerSubConfig *projectFactory()
+static AbstractAnalyzerSubConfig *projectMemcheckFactory()
 {
     return new MemcheckProjectSettings();
 }
 
-bool MemcheckPlugin::initialize(const QStringList &/*arguments*/, QString */*errorString*/)
+bool ValgrindPlugin::initialize(const QStringList &, QString *)
 {
-    AnalyzerGlobalSettings::instance()->registerSubConfigs(&globalFactory, &projectFactory);
+    AnalyzerGlobalSettings::instance()->registerSubConfigs(&valgrindConfigFactory, &valgrindConfigFactory);
+    AnalyzerGlobalSettings::instance()->registerSubConfigs(&globalCallgrindFactory, &projectCallgrindFactory);
+    AnalyzerGlobalSettings::instance()->registerSubConfigs(&globalMemcheckFactory, &projectMemcheckFactory);
 
     AnalyzerManager::instance()->addTool(new MemcheckTool(this));
+    AnalyzerManager::instance()->addTool(new CallgrindTool(this));
     return true;
 }
 
 
-void MemcheckPlugin::extensionsInitialized()
+void ValgrindPlugin::extensionsInitialized()
 {
 }
 
-Q_EXPORT_PLUGIN(MemcheckPlugin)
+Q_EXPORT_PLUGIN(Valgrind::Internal::ValgrindPlugin)
diff --git a/src/plugins/valgrindtoolbase/valgrindtoolbaseplugin.h b/src/plugins/valgrind/valgrindplugin.h
similarity index 94%
rename from src/plugins/valgrindtoolbase/valgrindtoolbaseplugin.h
rename to src/plugins/valgrind/valgrindplugin.h
index ffb872fda4ba0699e78c9ce56f55d83bac93fe6b..6dee7dd5442b4c522e46cf51509bb97d02cd986a 100644
--- a/src/plugins/valgrindtoolbase/valgrindtoolbaseplugin.h
+++ b/src/plugins/valgrind/valgrindplugin.h
@@ -40,12 +40,12 @@
 namespace Valgrind {
 namespace Internal {
 
-class ValgrindToolbasePlugin : public ExtensionSystem::IPlugin
+class ValgrindPlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
 
 public:
-    ValgrindToolbasePlugin() {}
+    ValgrindPlugin() {}
 
     virtual bool initialize(const QStringList &arguments, QString *errorString);
     virtual void extensionsInitialized();
diff --git a/src/plugins/valgrindtoolbase/valgrindsettings.cpp b/src/plugins/valgrind/valgrindsettings.cpp
similarity index 100%
rename from src/plugins/valgrindtoolbase/valgrindsettings.cpp
rename to src/plugins/valgrind/valgrindsettings.cpp
diff --git a/src/plugins/valgrindtoolbase/valgrindsettings.h b/src/plugins/valgrind/valgrindsettings.h
similarity index 98%
rename from src/plugins/valgrindtoolbase/valgrindsettings.h
rename to src/plugins/valgrind/valgrindsettings.h
index 99f596f6258dca5df61daa2821d21c415217fe3e..c01fc74595dbac65c262ab1f3d6295c62abf458c 100644
--- a/src/plugins/valgrindtoolbase/valgrindsettings.h
+++ b/src/plugins/valgrind/valgrindsettings.h
@@ -35,9 +35,9 @@
 #ifndef ANALYZER_INTERNAL_VALGRINDSETTINGS_H
 #define ANALYZER_INTERNAL_VALGRINDSETTINGS_H
 
-#include <analyzerbase/analyzersettings.h>
+#include "valgrind_global.h"
 
-#include "valgrindtoolbase_global.h"
+#include <analyzerbase/analyzersettings.h>
 
 #include <QtCore/QObject>
 #include <QtCore/QVariant>
diff --git a/src/plugins/callgrind/workarounds.cpp b/src/plugins/valgrind/workarounds.cpp
similarity index 100%
rename from src/plugins/callgrind/workarounds.cpp
rename to src/plugins/valgrind/workarounds.cpp
diff --git a/src/plugins/callgrind/workarounds.h b/src/plugins/valgrind/workarounds.h
similarity index 100%
rename from src/plugins/callgrind/workarounds.h
rename to src/plugins/valgrind/workarounds.h
diff --git a/src/plugins/valgrindtoolbase/valgrindtoolbase.pri b/src/plugins/valgrindtoolbase/valgrindtoolbase.pri
deleted file mode 100644
index 0ffb7c37dcb56e8b0bda2159a19006c1d116c65d..0000000000000000000000000000000000000000
--- a/src/plugins/valgrindtoolbase/valgrindtoolbase.pri
+++ /dev/null
@@ -1,4 +0,0 @@
-include(valgrindtoolbase_dependencies.pri)
-
-INCLUDEPATH += $$PWD
-LIBS *= -l$$qtLibraryName(ValgrindToolBase)
diff --git a/src/plugins/valgrindtoolbase/valgrindtoolbase.pro b/src/plugins/valgrindtoolbase/valgrindtoolbase.pro
deleted file mode 100644
index 45ca6d694c843cf0962a122569ae5ea287866588..0000000000000000000000000000000000000000
--- a/src/plugins/valgrindtoolbase/valgrindtoolbase.pro
+++ /dev/null
@@ -1,27 +0,0 @@
-TEMPLATE = lib
-TARGET = ValgrindToolBase
-
-DEFINES += VALGRINDTOOLBASE_LIBRARY
-
-include(../../qtcreatorplugin.pri)
-include(valgrindtoolbase_dependencies.pri)
-
-QT += network
-
-# Valgrind Tool Base files
-
-HEADERS += \
-    valgrindtoolbaseplugin.h \
-    valgrindtoolbase_global.h \
-    valgrindengine.h \
-    valgrindconfigwidget.h \
-    valgrindsettings.h
-
-SOURCES += \
-    valgrindtoolbaseplugin.cpp \
-    valgrindengine.cpp \
-    valgrindconfigwidget.cpp \
-    valgrindsettings.cpp
-
-FORMS += \
-    valgrindconfigwidget.ui
diff --git a/src/plugins/valgrindtoolbase/valgrindtoolbase_dependencies.pri b/src/plugins/valgrindtoolbase/valgrindtoolbase_dependencies.pri
deleted file mode 100644
index 702132b903be529df5b220a607e536ca809ff23a..0000000000000000000000000000000000000000
--- a/src/plugins/valgrindtoolbase/valgrindtoolbase_dependencies.pri
+++ /dev/null
@@ -1,3 +0,0 @@
-include(../../plugins/coreplugin/coreplugin.pri)
-include(../../plugins/analyzerbase/analyzerbase.pri)
-include(../../libs/valgrind/valgrind.pri)
\ No newline at end of file
diff --git a/src/plugins/valgrindtoolbase/valgrindtoolbaseplugin.cpp b/src/plugins/valgrindtoolbase/valgrindtoolbaseplugin.cpp
deleted file mode 100644
index 8804348cfdc9b9aabdfb893a16c1f355d9052ea1..0000000000000000000000000000000000000000
--- a/src/plugins/valgrindtoolbase/valgrindtoolbaseplugin.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/**************************************************************************
-**
-** This file is part of Qt Creator
-**
-** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Author: Milian Wolff, KDAB (milian.wolff@kdab.com)
-**
-** Contact: Nokia Corporation (info@qt.nokia.com)
-**
-**
-** GNU Lesser General Public License Usage
-**
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this file.
-** Please review the following information to ensure the GNU Lesser General
-** Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** Other Usage
-**
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at info@qt.nokia.com.
-**
-**************************************************************************/
-
-#include "valgrindtoolbaseplugin.h"
-
-#include "valgrindsettings.h"
-
-#include <analyzerbase/analyzersettings.h>
-
-#include <QtCore/QStringList>
-#include <QtCore/QtPlugin>
-
-using namespace Analyzer;
-using namespace Valgrind::Internal;
-
-
-static AbstractAnalyzerSubConfig *configFactory()
-{
-    return new ValgrindSettings();
-}
-
-bool ValgrindToolbasePlugin::initialize(const QStringList &/*arguments*/, QString */*errorString*/)
-{
-    AnalyzerGlobalSettings::instance()->registerSubConfigs(&configFactory, &configFactory);
-    return true;
-}
-
-
-void ValgrindToolbasePlugin::extensionsInitialized()
-{
-
-}
-
-Q_EXPORT_PLUGIN(ValgrindToolbasePlugin)