[nemiver/profiler: 4/8] Introduction of the perf engine



commit 99821d920dad8d96d0c02c9f25d66fc81d85762b
Author: Fabien Parent <parent f gmail com>
Date:   Sat Jun 2 16:31:45 2012 +0200

    Introduction of the perf engine

 configure.ac                          |    2 +
 src/Makefile.am                       |    3 +-
 src/profengine/Makefile.am            |   38 ++++
 src/profengine/nmv-call-graph-node.cc |  150 ++++++++++++++++
 src/profengine/nmv-call-graph-node.h  |   82 +++++++++
 src/profengine/nmv-i-profiler.h       |   78 ++++++++
 src/profengine/nmv-perf-engine.cc     |  318 +++++++++++++++++++++++++++++++++
 src/profengine/nmv-perf-engine.h      |   55 ++++++
 8 files changed, 725 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index bc25b27..8579045 100644
--- a/configure.ac
+++ b/configure.ac
@@ -482,6 +482,8 @@ src/Makefile
   src/dbgengine/varwalker.conf
   src/dbgengine/varobjwalker.conf
   src/dbgengine/varlistwalker.conf
+  src/profengine/Makefile
+  src/profengine/perfengine.conf
   src/confmgr/Makefile
   src/confmgr/gconfmgr.conf
   src/confmgr/gsettingsmgr.conf
diff --git a/src/Makefile.am b/src/Makefile.am
index 902ec53..e13ea12 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,4 +1,5 @@
-SUBDIRS=common dbdimpl langs dbgengine confmgr uicommon workbench persp
+SUBDIRS=common dbdimpl langs dbgengine confmgr uicommon workbench persp \
+profengine
 
 h=$(abs_srcdir)
 
diff --git a/src/profengine/Makefile.am b/src/profengine/Makefile.am
new file mode 100644
index 0000000..d59cc4b
--- /dev/null
+++ b/src/profengine/Makefile.am
@@ -0,0 +1,38 @@
+perfmod_LTLIBRARIES=libperfmod.la
+perfmoddir= NEMIVER_MODULES_DIR@
+
+noinst_LTLIBRARIES=\
+libperfengine.la
+
+h=$(abs_srcdir)
+
+iprofilerheaders= \
+$(h)/nmv-i-profiler.h
+
+dynmodheaders = \
+$(iprofilerheaders)
+
+libperfmod_la_SOURCES= \
+$(iprofilerheaders)
+
+libperfengine_la_SOURCES= \
+$(h)/nmv-perf-engine.cc \
+$(h)/nmv-perf-engine.h \
+$(h)/nmv-call-graph-node.cc \
+$(h)/nmv-call-graph-node.h
+
+libperfengine_la_CFLAGS=-fPIC -DPIC
+
+publicheaders_DATA=$(dynmodheaders)
+publicheadersdir=$(NEMIVER_INCLUDE_DIR)/dynmods
+
+libperfmod_la_LDFLAGS=-module -avoid-version -Wl,--as-needed
+libperfmod_la_LIBADD=libperfengine.la @NEMIVERCOMMON_LIBS@ \
+$(abs_top_builddir)/src/common/libnemivercommon.la
+
+
+config_DATA=perfengine.conf
+configdir= NEMIVER_SYSTEM_CONFIG_DIR@
+
+INCLUDES= NEMIVERCOMMON_CFLAGS@ -DENABLE_NLS=1 -DDATADIR=\"${datadir}\" \
+-I$(top_srcdir)/src -I$(top_srcdir)/src/confmgr
diff --git a/src/profengine/nmv-call-graph-node.cc b/src/profengine/nmv-call-graph-node.cc
new file mode 100644
index 0000000..b2ac0aa
--- /dev/null
+++ b/src/profengine/nmv-call-graph-node.cc
@@ -0,0 +1,150 @@
+// Author: Fabien Parent
+/*
+ *This file is part of the Nemiver project
+ *
+ *Nemiver is free software; you can redistribute
+ *it and/or modify it under the terms of
+ *the GNU General Public License as published by the
+ *Free Software Foundation; either version 2,
+ *or (at your option) any later version.
+ *
+ *Nemiver is distributed in the hope that it will
+ *be useful, but WITHOUT ANY WARRANTY;
+ *without even the implied warranty of
+ *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *See the GNU General Public License for more details.
+ *
+ *You should have received a copy of the
+ *GNU General Public License along with Nemiver;
+ *see the file COPYING.
+ *If not, write to the Free Software Foundation,
+ *Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *See COPYRIGHT file copyright information.
+ */
+
+#include "nmv-call-graph-node.h"
+#include "common/nmv-exception.h"
+
+NEMIVER_BEGIN_NAMESPACE (nemiver)
+
+struct CallGraphNode::Priv {
+    std::list<CallGraphNodeSafePtr> children;
+    CallGraphNodeSafePtr parent;
+    unsigned cost;
+    UString filepath;
+    UString function;
+    float percentage;
+
+    Priv () :
+        parent (0)
+    {
+    }
+
+    Priv (CallGraphNodeSafePtr &a_parent) :
+        parent (a_parent)
+    {
+    }
+};
+
+CallGraphNode::CallGraphNode () :
+    m_priv (new Priv)
+{
+}
+
+CallGraphNode::CallGraphNode (CallGraphNodeSafePtr &a_parent) :
+    m_priv (new Priv (a_parent))
+{
+}
+
+CallGraphNode::~CallGraphNode ()
+{
+}
+
+bool
+CallGraphNode::root () const
+{
+    THROW_IF_FAIL (m_priv);
+    return !m_priv->parent;
+}
+
+const CallGraphNode&
+CallGraphNode::parent () const
+{
+    THROW_IF_FAIL (m_priv);
+    THROW_IF_FAIL (m_priv->parent);
+    return *m_priv->parent;
+}
+
+const std::list<CallGraphNodeSafePtr>&
+CallGraphNode::children () const
+{
+    THROW_IF_FAIL (m_priv);
+    return m_priv->children;
+}
+
+void
+CallGraphNode::add_child (const CallGraphNodeSafePtr &a_node)
+{
+    THROW_IF_FAIL (m_priv);
+    m_priv->children.push_back (a_node);
+}
+
+float
+CallGraphNode::percentage () const
+{
+    THROW_IF_FAIL (m_priv);
+    return m_priv->percentage;
+}
+
+void
+CallGraphNode::percentage (const float &a_percentage)
+{
+    THROW_IF_FAIL (m_priv);
+    m_priv->percentage = a_percentage;
+}
+
+unsigned
+CallGraphNode::cost () const
+{
+    THROW_IF_FAIL (m_priv);
+    return m_priv->cost;
+}
+
+void
+CallGraphNode::cost (unsigned a_cost)
+{
+    THROW_IF_FAIL (m_priv);
+    m_priv->cost = a_cost;
+}
+
+UString&
+CallGraphNode::filepath () const
+{
+    THROW_IF_FAIL (m_priv);
+    return m_priv->filepath;
+}
+
+void
+CallGraphNode::filepath (const UString &a_filepath)
+{
+    THROW_IF_FAIL (m_priv);
+    m_priv->filepath = a_filepath;
+}
+
+UString&
+CallGraphNode::function () const
+{
+    THROW_IF_FAIL (m_priv);
+    return m_priv->function;
+}
+
+void
+CallGraphNode::function (const UString &a_function)
+{
+    THROW_IF_FAIL (m_priv);
+    m_priv->function = a_function;
+}
+
+NEMIVER_END_NAMESPACE (nemiver)
+
diff --git a/src/profengine/nmv-call-graph-node.h b/src/profengine/nmv-call-graph-node.h
new file mode 100644
index 0000000..14587d0
--- /dev/null
+++ b/src/profengine/nmv-call-graph-node.h
@@ -0,0 +1,82 @@
+//Author: Fabien Parent
+/*
+ *This file is part of the Nemiver project
+ *
+ *Nemiver is free software; you can redistribute
+ *it and/or modify it under the terms of
+ *the GNU General Public License as published by the
+ *Free Software Foundation; either version 2,
+ *or (at your option) any later version.
+ *
+ *Nemiver is distributed in the hope that it will
+ *be useful, but WITHOUT ANY WARRANTY;
+ *without even the implied warranty of
+ *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *See the GNU General Public License for more details.
+ *
+ *You should have received a copy of the
+ *GNU General Public License along with Nemiver;
+ *see the file COPYING.
+ *If not, write to the Free Software Foundation,
+ *Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *See COPYRIGHT file copyright information.
+ */
+#ifndef __NMV_CALL_GRAPH_NODE_H__
+#define __NMV_CALL_GRAPH_NODE_H__
+
+#include "common/nmv-safe-ptr-utils.h"
+#include "common/nmv-namespace.h"
+#include "common/nmv-ustring.h"
+#include "common/nmv-object.h"
+#include <list>
+
+using nemiver::common::SafePtr;
+using nemiver::common::UString;
+using nemiver::common::Object;
+using nemiver::common::ObjectRef;
+using nemiver::common::ObjectUnref;
+
+NEMIVER_BEGIN_NAMESPACE (nemiver)
+
+class CallGraphNode;
+typedef SafePtr<CallGraphNode, ObjectRef, ObjectUnref> CallGraphNodeSafePtr;
+typedef CallGraphNode CallGraph;
+typedef SafePtr<CallGraph, ObjectRef, ObjectUnref> CallGraphSafePtr;
+
+class CallGraphNode : public Object {
+    CallGraphNode (const CallGraphNode&);
+    CallGraphNode& operator= (const CallGraphNode&);
+
+    struct Priv;
+    SafePtr<Priv> m_priv;
+
+public:
+    CallGraphNode ();
+    CallGraphNode (CallGraphNodeSafePtr&);
+    virtual ~CallGraphNode ();
+
+    bool root () const;
+    const CallGraphNode& parent () const;
+    const std::list<CallGraphNodeSafePtr>& children () const;
+    void add_child (const CallGraphNodeSafePtr&);
+
+    float percentage () const;
+    void percentage (const float&);
+
+    unsigned cost () const;
+    void cost (unsigned);
+
+    UString& filepath () const;
+    void filepath (const UString &a_filepath);
+
+    UString& function () const;
+    void function (const UString &a_function);
+
+    
+}; // end namespace CallGraphNode
+
+NEMIVER_END_NAMESPACE (nemiver)
+
+#endif /* __NMV_CALL_GRAPH_NODE_H__ */
+
diff --git a/src/profengine/nmv-i-profiler.h b/src/profengine/nmv-i-profiler.h
new file mode 100644
index 0000000..50d215b
--- /dev/null
+++ b/src/profengine/nmv-i-profiler.h
@@ -0,0 +1,78 @@
+//Author: Fabien Parent
+/*
+ *This file is part of the Nemiver project
+ *
+ *Nemiver is free software; you can redistribute
+ *it and/or modify it under the terms of
+ *the GNU General Public License as published by the
+ *Free Software Foundation; either version 2,
+ *or (at your option) any later version.
+ *
+ *Nemiver is distributed in the hope that it will
+ *be useful, but WITHOUT ANY WARRANTY;
+ *without even the implied warranty of
+ *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *See the GNU General Public License for more details.
+ *
+ *You should have received a copy of the
+ *GNU General Public License along with Nemiver;
+ *see the file COPYING.
+ *If not, write to the Free Software Foundation,
+ *Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *See COPYRIGHT file copyright information.
+ */
+#ifndef __NMV_I_PROFILER_H__
+#define __NMV_I_PROFILER_H__
+
+#include "common/nmv-api-macros.h"
+#include "common/nmv-ustring.h"
+#include "common/nmv-dynamic-module.h"
+#include "common/nmv-safe-ptr-utils.h"
+#include "nmv-i-conf-mgr.h"
+#include "nmv-i-profiler.h"
+#include "nmv-call-graph-node.h"
+
+using nemiver::common::SafePtr;
+using nemiver::common::DynamicModule;
+using nemiver::common::DynamicModuleSafePtr;
+using nemiver::common::DynModIface;
+using nemiver::common::ObjectRef;
+using nemiver::common::ObjectUnref;
+using nemiver::common::UString;
+using nemiver::common::Object;
+
+NEMIVER_BEGIN_NAMESPACE (nemiver)
+
+class IProfiler;
+typedef SafePtr<IProfiler, ObjectRef, ObjectUnref> IProfilerSafePtr;
+
+class NEMIVER_API IProfiler : public DynModIface {
+
+    IProfiler (const IProfiler&);
+    IProfiler& operator= (const IProfiler&);
+
+protected:
+
+    IProfiler (DynamicModule *a_dynmod) : DynModIface (a_dynmod)
+    {
+    }
+
+public:
+
+    virtual ~IProfiler () {}
+
+    /// \name events you can connect to.
+
+    /// @{
+    virtual sigc::signal<void, CallGraphSafePtr>
+        report_done_signal () const = 0;
+    /// @}
+
+    virtual void report (const UString &a_data_file) = 0;
+
+};//end IProfiler
+
+NEMIVER_END_NAMESPACE (nemiver)
+
+#endif //__NMV_I_PROFILER_H__
diff --git a/src/profengine/nmv-perf-engine.cc b/src/profengine/nmv-perf-engine.cc
new file mode 100644
index 0000000..66cff03
--- /dev/null
+++ b/src/profengine/nmv-perf-engine.cc
@@ -0,0 +1,318 @@
+// Author: Fabien Parent
+/*
+ *This file is part of the Nemiver project
+ *
+ *Nemiver is free software; you can redistribute
+ *it and/or modify it under the terms of
+ *the GNU General Public License as published by the
+ *Free Software Foundation; either version 2,
+ *or (at your option) any later version.
+ *
+ *Nemiver is distributed in the hope that it will
+ *be useful, but WITHOUT ANY WARRANTY;
+ *without even the implied warranty of
+ *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *See the GNU General Public License for more details.
+ *
+ *You should have received a copy of the
+ *GNU General Public License along with Nemiver;
+ *see the file COPYING.
+ *If not, write to the Free Software Foundation,
+ *Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *See COPYRIGHT file copyright information.
+ */
+
+#include "nmv-perf-engine.h"
+#include "nmv-call-graph-node.h"
+#include "common/nmv-proc-utils.h"
+#include "common/nmv-str-utils.h"
+#include <istream>
+#include <stack>
+#include <sys/wait.h>
+
+NEMIVER_BEGIN_NAMESPACE (nemiver)
+
+const char *const PERF_REPORT_PARSING_DOMAIN = "perf-report-parsing-domain";
+
+using common::DynModIfaceSafePtr;
+
+struct PerfEngine::Priv {
+    int perf_pid;
+    int master_pty_fd;
+    int perf_stdout_fd;
+    int perf_stderr_fd;
+    Glib::RefPtr<Glib::IOChannel> perf_stdout_channel;
+
+    std::stack<CallGraphNodeSafePtr> call_stack;
+    CallGraphSafePtr call_graph;
+
+    sigc::signal<void, CallGraphSafePtr> report_done_signal;
+
+/*
+    Glib::RefPtr<Glib::MainContext> event_context;
+    sigc::signal<void> program_exited_signal;
+    sigc::signal<void, const AnnotatedSourceFile&> annotation_done_signal;
+*/
+    Priv () :
+        perf_pid (0),
+        master_pty_fd (0),
+        perf_stdout_fd (0),
+        perf_stderr_fd (0),
+        perf_stdout_channel (0),
+        call_graph (0)
+    {
+    }
+
+    bool
+    on_wait_for_report_to_exit ()
+    {
+        NEMIVER_TRY
+
+        THROW_IF_FAIL (perf_stdout_channel);
+
+        int status = 0;
+        pid_t pid = waitpid (perf_pid, &status, WNOHANG);
+        if (pid == perf_pid && WIFEXITED (status)) {
+            perf_stdout_channel->close ();
+            perf_stdout_channel.reset ();
+            g_spawn_close_pid (perf_pid);
+            perf_pid = 0;
+            master_pty_fd = 0;
+            perf_stdout_fd = 0;
+            perf_stderr_fd = 0;
+
+            report_done_signal.emit (call_graph);
+
+            return false;
+        }
+
+        NEMIVER_CATCH_NOX
+
+        return true;
+    }
+
+    void
+    parse_top_level_symbol (std::vector<UString> &a_tokens)
+    {
+        THROW_IF_FAIL (a_tokens.size ());
+        THROW_IF_FAIL (a_tokens[0].size ());
+    
+        float percentage = 0.0;
+        std::istringstream is (a_tokens[0].substr(0, a_tokens[0].size () - 1));
+        is >> percentage;
+
+        CallGraphNodeSafePtr node (new CallGraphNode);
+        THROW_IF_FAIL (node);
+        node->percentage (percentage);
+        node->function (a_tokens[a_tokens.size () - 1]);
+        call_graph->add_child (node);
+
+        while (call_stack.size ()) {
+            call_stack.pop ();
+        }
+        call_stack.push (node);
+    }
+
+    void
+    parse_child_symbol (std::vector<UString> &a_tokens)
+    {
+        THROW_IF_FAIL (a_tokens.size ());
+        if (a_tokens[a_tokens.size () - 1] == "|") {
+            return;
+        } else if (a_tokens[0] == "---") {
+            return;
+        }
+
+        size_t i = 0;
+        for (; i < a_tokens.size ()
+               && a_tokens[i].size ()
+               && (a_tokens[i][0] == '|' || a_tokens[i][0] == '-')
+             ; i++) {
+        }
+
+        while (call_stack.size () > i) {
+            call_stack.pop ();
+        }
+
+        if (!call_stack.size ()) {
+            return;
+        }
+
+        THROW_IF_FAIL (call_stack.size ());
+        if (a_tokens.size () < 2) {
+            for (size_t i = 0; i < a_tokens[0].size (); i++) {
+                std::cout << std::hex << a_tokens[0][i] << " " << std::endl;
+            }
+            std::cout << std::endl;
+        }
+
+        THROW_IF_FAIL (a_tokens.size () >= 2);
+        if (a_tokens[a_tokens.size () - 2].find ("--") == std::string::npos) {
+            return;
+        }
+
+        float percentage = 0.0;
+        std::istringstream is (a_tokens[a_tokens.size () - 2].substr (3));
+        is >> percentage;
+
+        CallGraphNodeSafePtr node (new CallGraphNode);
+        THROW_IF_FAIL (node);
+        node->percentage (percentage);
+        node->function (a_tokens[a_tokens.size () - 1]);
+
+        THROW_IF_FAIL (call_stack.top ());
+        call_stack.top ()->add_child (node);
+
+        THROW_IF_FAIL (i - 1 < a_tokens.size ());
+        if (a_tokens[i - 1][0] == '-') {
+            call_stack.pop ();
+        }
+        call_stack.push (node);
+    }
+
+    void
+    build_call_graph (UString &a_line)
+    {
+        if (!a_line.size () || a_line.empty () || a_line[0] == '#') {
+            return;
+        }
+
+        a_line = a_line.substr(0, a_line.size () - 1);
+        std::vector<UString> split = str_utils::split (a_line, " ");
+        if (!split.size ()) {
+            return;
+        }
+
+        UString token = split[0];
+        if (token.size () && token[token.size () - 1] == '%') {
+            parse_top_level_symbol (split);
+        } else {
+            parse_child_symbol (split);
+        }
+    }
+
+    bool
+    read_report (Glib::IOCondition)
+    {
+        NEMIVER_TRY
+
+        THROW_IF_FAIL (perf_stdout_channel);
+
+        UString line;
+        Glib::IOStatus status;
+
+        do {
+            status = perf_stdout_channel->read_line (line);
+            LOG_D (line, PERF_REPORT_PARSING_DOMAIN);
+            build_call_graph (line);
+        } while (status == Glib::IO_STATUS_NORMAL);
+
+        NEMIVER_CATCH_NOX
+
+        return false;
+    }
+
+    ~Priv ()
+    {
+        LOG_D ("delete", "destructor-domain");
+    }
+}; // end sturct PerfEngine::Priv
+
+PerfEngine::PerfEngine (DynamicModule *a_dynmod) :
+    IProfiler (a_dynmod),
+    m_priv (new Priv)
+{
+}
+
+PerfEngine::~PerfEngine ()
+{
+    LOG_D ("delete", "destructor-domain");
+}
+
+void
+PerfEngine::report (const UString &a_data_file)
+{
+    std::vector<UString> argv;
+    argv.push_back ("perf");
+    argv.push_back ("report");
+    argv.push_back ("--stdio");
+    argv.push_back ("-i");
+    argv.push_back (a_data_file);
+
+    THROW_IF_FAIL (m_priv);
+    bool is_launched = common::launch_program (argv,
+                                               m_priv->perf_pid,
+                                               m_priv->master_pty_fd,
+                                               m_priv->perf_stdout_fd,
+                                               m_priv->perf_stderr_fd);
+    THROW_IF_FAIL (is_launched);
+
+    m_priv->call_graph.reset (new CallGraph);
+
+    m_priv->perf_stdout_channel =
+        Glib::IOChannel::create_from_fd (m_priv->perf_stdout_fd);
+
+    Glib::RefPtr<Glib::IOSource> io_source =
+        m_priv->perf_stdout_channel->create_watch (Glib::IO_IN);
+    io_source->connect (sigc::mem_fun
+        (m_priv.get (), &PerfEngine::Priv::read_report));
+    io_source->attach ();
+
+    Glib::RefPtr<Glib::MainContext> context = Glib::MainContext::get_default ();
+    context->signal_idle ().connect (sigc::mem_fun
+        (m_priv.get (), &PerfEngine::Priv::on_wait_for_report_to_exit));
+}
+
+sigc::signal<void, CallGraphSafePtr>
+PerfEngine::report_done_signal () const
+{
+    THROW_IF_FAIL (m_priv);
+    return m_priv->report_done_signal;
+}
+
+//****************************
+//</GDBEngine methods>
+//****************************
+
+class ProfilerEngineModule : public DynamicModule {
+
+public:
+
+    void get_info (Info &a_info) const
+    {
+        const static Info s_info ("profilerengine",
+                                  "The perf profiler engine backend. "
+                                  "Implements the IProfiler interface",
+                                  "1.0");
+        a_info = s_info;
+    }
+
+    void do_init ()
+    {
+    }
+
+    bool lookup_interface (const std::string &a_iface_name,
+                           DynModIfaceSafePtr &a_iface)
+    {
+        if (a_iface_name == "IProfiler") {
+            a_iface.reset (new PerfEngine (this));
+        } else {
+            return false;
+        }
+        return true;
+    }
+};//end class ProfilerEngineModule
+
+NEMIVER_END_NAMESPACE (nemiver)
+
+//the dynmod initial factory.
+extern "C" {
+bool
+NEMIVER_API nemiver_common_create_dynamic_module_instance (void **a_new_instance)
+{
+    *a_new_instance = new nemiver::ProfilerEngineModule ();
+    return (*a_new_instance != 0);
+}
+
+}//end extern C
diff --git a/src/profengine/nmv-perf-engine.h b/src/profengine/nmv-perf-engine.h
new file mode 100644
index 0000000..7076ab7
--- /dev/null
+++ b/src/profengine/nmv-perf-engine.h
@@ -0,0 +1,55 @@
+//Author: Fabien Parent
+/*
+ *This file is part of the Nemiver project
+ *
+ *Nemiver is free software; you can redistribute
+ *it and/or modify it under the terms of
+ *the GNU General Public License as published by the
+ *Free Software Foundation; either version 2,
+ *or (at your option) any later version.
+ *
+ *Nemiver is distributed in the hope that it will
+ *be useful, but WITHOUT ANY WARRANTY;
+ *without even the implied warranty of
+ *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *See the GNU General Public License for more details.
+ *
+ *You should have received a copy of the
+ *GNU General Public License along with Nemiver;
+ *see the file COPYING.
+ *If not, write to the Free Software Foundation,
+ *Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *See COPYRIGHT file copyright information.
+ */
+#ifndef __NMV_PERF_ENGINE_H__
+#define __NMV_PERF_ENGINE_H__
+
+#include "nmv-i-profiler.h"
+
+NEMIVER_BEGIN_NAMESPACE (nemiver)
+
+class PerfEngine : public IProfiler {
+
+    PerfEngine (const PerfEngine &);
+    PerfEngine& operator= (const PerfEngine &);
+
+    struct Priv;
+    SafePtr<Priv> m_priv;
+
+public:
+
+    PerfEngine (DynamicModule *a_dynmod);
+    virtual ~PerfEngine ();
+
+    void report (const UString &a_data_file);
+
+    sigc::signal<void, CallGraphSafePtr> report_done_signal () const;
+
+}; // end namespace PerfEngine
+
+NEMIVER_END_NAMESPACE (nemiver)
+
+#endif /* __NMV_PERF_ENGINE_H__ */
+
+



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]