[nemiver/profiler: 10/11] WIP



commit fd2a590de72541badaed35e74ef6bed27eb72103
Author: Fabien Parent <parent f gmail com>
Date:   Sun Jun 17 12:43:25 2012 +0200

    WIP

 src/persp/profperspective/Makefile.am              |    4 +-
 src/persp/profperspective/nmv-prof-perspective.cc  |   21 +-
 ...-run-program-dialog.cc => nmv-record-dialog.cc} |   79 +++-
 ...mv-run-program-dialog.h => nmv-record-dialog.h} |   18 +-
 src/persp/profperspective/ui/Makefile.am           |    2 +-
 src/persp/profperspective/ui/recorddialog.ui       |  481 ++++++++++++++++++++
 src/profengine/nmv-i-profiler.h                    |    5 +-
 src/profengine/nmv-perf-engine.cc                  |   19 +-
 src/profengine/nmv-perf-engine.h                   |    5 +-
 9 files changed, 597 insertions(+), 37 deletions(-)
---
diff --git a/src/persp/profperspective/Makefile.am b/src/persp/profperspective/Makefile.am
index f88bea5..fb46e92 100644
--- a/src/persp/profperspective/Makefile.am
+++ b/src/persp/profperspective/Makefile.am
@@ -21,7 +21,9 @@ $(h)/nmv-prof-perspective.h \
 $(h)/nmv-call-list.cc \
 $(h)/nmv-call-list.h \
 $(h)/nmv-load-report-dialog.cc \
-$(h)/nmv-load-report-dialog.h
+$(h)/nmv-load-report-dialog.h \
+$(h)/nmv-record-dialog.cc \
+$(h)/nmv-record-dalog.h
 
 libprofperspectiveplugin_la_SOURCES=$(sources)
 libprofperspectiveplugin_la_LDFLAGS= -module -avoid-version -Wl,--as-needed
diff --git a/src/persp/profperspective/nmv-prof-perspective.cc b/src/persp/profperspective/nmv-prof-perspective.cc
index a353921..b83950c 100644
--- a/src/persp/profperspective/nmv-prof-perspective.cc
+++ b/src/persp/profperspective/nmv-prof-perspective.cc
@@ -28,7 +28,7 @@
 #include "nmv-load-report-dialog.h"
 #include "nmv-call-list.h"
 #include "nmv-spinner-tool-item.h"
-#include "nmv-run-program-dialog.h"
+#include "nmv-record-dialog.h"
 #include "common/nmv-safe-ptr-utils.h"
 #include "common/nmv-str-utils.h"
 
@@ -101,7 +101,10 @@ public:
     void load_report_file (const UString &a_report_file);
     void run_executable ();
     void run_executable (const UString &a_program_name,
-                         const UString &a_arguments);
+                         const UString &a_arguments,
+                         bool a_scale_counter_values,
+                         bool a_do_callgraph,
+                         bool a_child_inherit_counters);
 
     void on_run_executable_action ();
     void on_load_report_file_action ();
@@ -363,26 +366,32 @@ ProfPerspective::edit_workbench_menu ()
 void
 ProfPerspective::run_executable ()
 {
-    RunProgramDialog dialog (plugin_path ());
+    RecordDialog dialog (plugin_path ());
 
     int result = dialog.run ();
     if (result != Gtk::RESPONSE_OK) {
         return;
     }
 
-    run_executable (dialog.program_name (), dialog.arguments ());
+    run_executable (dialog.program_name (), dialog.arguments (),
+                    dialog.scale_counter_values (), dialog.callgraph (),
+                    dialog.child_inherit_counters ());
 }
 
 void
 ProfPerspective::run_executable (const UString &a_program_name,
-                                 const UString &a_arguments)
+                                 const UString &a_arguments,
+                                 bool a_scale_counter_values,
+                                 bool a_do_callgraph,
+                                 bool a_child_inherit_counters)
 {
     std::vector<UString> argv = str_utils::split (a_arguments, " ");
 
     THROW_IF_FAIL (!a_program_name.empty ());
     THROW_IF_FAIL (profiler ());
 
-    profiler ()->record (a_program_name, argv);
+    profiler ()->record (a_program_name, argv, a_scale_counter_values,
+                         a_do_callgraph, a_child_inherit_counters);
 
     THROW_IF_FAIL (throbber);
     throbber->start ();
diff --git a/src/persp/profperspective/nmv-run-program-dialog.cc b/src/persp/profperspective/nmv-record-dialog.cc
similarity index 80%
rename from src/persp/profperspective/nmv-run-program-dialog.cc
rename to src/persp/profperspective/nmv-record-dialog.cc
index 562c330..dcc0d45 100644
--- a/src/persp/profperspective/nmv-run-program-dialog.cc
+++ b/src/persp/profperspective/nmv-record-dialog.cc
@@ -1,4 +1,4 @@
-//Author: Dodji Seketeli
+//Authors: Dodji Seketeli, Fabien Parent
 /*
  *This file is part of the Nemiver project
  *
@@ -35,7 +35,7 @@
 #include "common/nmv-exception.h"
 #include "common/nmv-env.h"
 #include "common/nmv-ustring.h"
-#include "nmv-run-program-dialog.h"
+#include "nmv-record-dialog.h"
 #include "nmv-ui-utils.h"
 
 using namespace std;
@@ -51,7 +51,7 @@ struct EnvVarModelColumns : public Gtk::TreeModel::ColumnRecord
     EnvVarModelColumns() { add (varname); add (value); }
 };
 
-struct RunProgramDialog::Priv {
+struct RecordDialog::Priv {
 private:
     Priv ();
 
@@ -65,7 +65,9 @@ public:
     Glib::RefPtr<Gtk::ListStore> model;
     Gtk::Dialog &dialog;
     Glib::RefPtr<Gtk::Builder> gtkbuilder;
-
+    Gtk::CheckButton *scalecounter_checkbutton;
+    Gtk::CheckButton *callgraph_checkbutton;
+    Gtk::CheckButton *inherit_checkbutton;
 
     Priv (Gtk::Dialog &a_dialog,
         const Glib::RefPtr<Gtk::Builder> &a_gtkbuilder) :
@@ -107,13 +109,13 @@ public:
         THROW_IF_FAIL (add_button);
 
         add_button->signal_clicked().connect(sigc::mem_fun(*this,
-                    &RunProgramDialog::Priv::on_add_new_variable));
+                    &RecordDialog::Priv::on_add_new_variable));
 
         remove_button = ui_utils::get_widget_from_gtkbuilder<Gtk::Button>
                                                 (gtkbuilder, "button_remove_var");
         THROW_IF_FAIL (remove_button);
         remove_button->signal_clicked().connect(sigc::mem_fun(*this,
-                    &RunProgramDialog::Priv::on_remove_variable));
+                    &RecordDialog::Priv::on_remove_variable));
 
         // we need to disable / enable sensitivity of the
         // "Remove variable" button based on whether a
@@ -121,7 +123,7 @@ public:
         treeview_environment->get_selection ()->signal_changed ().connect
             (sigc::mem_fun
                  (*this,
-                  &RunProgramDialog::Priv::on_variable_selection_changed));
+                  &RecordDialog::Priv::on_variable_selection_changed));
 
         fcbutton =
             ui_utils::get_widget_from_gtkbuilder<Gtk::FileChooserButton>
@@ -135,6 +137,21 @@ public:
         // arguments text box
         ui_utils::get_widget_from_gtkbuilder<Gtk::Entry>
                         (gtkbuilder, "argumentsentry")->set_activates_default ();
+
+        scalecounter_checkbutton =
+            ui_utils::get_widget_from_gtkbuilder<Gtk::CheckButton>
+                (gtkbuilder, "scalecheckbutton");
+        THROW_IF_FAIL (scalecounter_checkbutton);
+
+        callgraph_checkbutton =
+            ui_utils::get_widget_from_gtkbuilder<Gtk::CheckButton>
+                (gtkbuilder, "callgraphcheckbutton");
+        THROW_IF_FAIL (callgraph_checkbutton);
+
+        inherit_checkbutton =
+            ui_utils::get_widget_from_gtkbuilder<Gtk::CheckButton>
+                (gtkbuilder, "inheritcheckbutton");
+        THROW_IF_FAIL (inherit_checkbutton);
     }
 
     void on_add_new_variable ()
@@ -186,10 +203,10 @@ public:
             }
         }
     }
-};//end struct RunProgramDialog::Priv
+};//end struct RecordDialog::Priv
 
-RunProgramDialog::RunProgramDialog (const UString &a_root_path) :
-    Dialog (a_root_path, "runprogramdialog.ui", "runprogramdialog")
+RecordDialog::RecordDialog (const UString &a_root_path) :
+    Dialog (a_root_path, "recorddialog.ui", "recorddialog")
 {
     m_priv.reset (new Priv (widget (), gtkbuilder ()));
     THROW_IF_FAIL (m_priv);
@@ -197,13 +214,13 @@ RunProgramDialog::RunProgramDialog (const UString &a_root_path) :
     working_directory (Glib::filename_to_utf8 (Glib::get_current_dir ()));
 }
 
-RunProgramDialog::~RunProgramDialog ()
+RecordDialog::~RecordDialog ()
 {
     LOG_D ("destroyed", "destructor-domain");
 }
 
 UString
-RunProgramDialog::program_name () const
+RecordDialog::program_name () const
 {
     Gtk::FileChooserButton *chooser =
         ui_utils::get_widget_from_gtkbuilder<Gtk::FileChooserButton>
@@ -212,7 +229,7 @@ RunProgramDialog::program_name () const
 }
 
 void
-RunProgramDialog::program_name (const UString &a_name)
+RecordDialog::program_name (const UString &a_name)
 {
     THROW_IF_FAIL (m_priv);
 
@@ -224,7 +241,7 @@ RunProgramDialog::program_name (const UString &a_name)
 }
 
 UString
-RunProgramDialog::arguments () const
+RecordDialog::arguments () const
 {
     Gtk::Entry *entry =
         ui_utils::get_widget_from_gtkbuilder<Gtk::Entry> (gtkbuilder (),
@@ -234,7 +251,7 @@ RunProgramDialog::arguments () const
 }
 
 void
-RunProgramDialog::arguments (const UString &a_args)
+RecordDialog::arguments (const UString &a_args)
 {
     Gtk::Entry *entry =
         ui_utils::get_widget_from_gtkbuilder<Gtk::Entry> (gtkbuilder (),
@@ -244,7 +261,7 @@ RunProgramDialog::arguments (const UString &a_args)
 }
 
 UString
-RunProgramDialog::working_directory () const
+RecordDialog::working_directory () const
 {
     Gtk::FileChooserButton *chooser =
         ui_utils::get_widget_from_gtkbuilder<Gtk::FileChooserButton>
@@ -253,7 +270,7 @@ RunProgramDialog::working_directory () const
 }
 
 void
-RunProgramDialog::working_directory (const UString &a_dir)
+RecordDialog::working_directory (const UString &a_dir)
 {
     Gtk::FileChooserButton *chooser =
         ui_utils::get_widget_from_gtkbuilder<Gtk::FileChooserButton>
@@ -267,7 +284,7 @@ RunProgramDialog::working_directory (const UString &a_dir)
 }
 
 map<UString, UString>
-RunProgramDialog::environment_variables () const
+RecordDialog::environment_variables () const
 {
     THROW_IF_FAIL (m_priv);
     THROW_IF_FAIL (m_priv->model);
@@ -284,7 +301,7 @@ RunProgramDialog::environment_variables () const
 }
 
 void
-RunProgramDialog::environment_variables (const map<UString, UString> &vars)
+RecordDialog::environment_variables (const map<UString, UString> &vars)
 {
     THROW_IF_FAIL (m_priv);
     THROW_IF_FAIL (m_priv->model);
@@ -299,5 +316,29 @@ RunProgramDialog::environment_variables (const map<UString, UString> &vars)
     }
 }
 
+bool
+RecordDialog::callgraph () const
+{
+    THROW_IF_FAIL (m_priv);
+    THROW_IF_FAIL (m_priv->callgraph_checkbutton);
+    return m_priv->callgraph_checkbutton->get_active ();
+}
+
+bool
+RecordDialog::scale_counter_values () const
+{
+    THROW_IF_FAIL (m_priv);
+    THROW_IF_FAIL (m_priv->scalecounter_checkbutton);
+    return m_priv->scalecounter_checkbutton->get_active ();
+}
+
+bool
+RecordDialog::child_inherit_counters () const
+{
+    THROW_IF_FAIL (m_priv);
+    THROW_IF_FAIL (m_priv->inherit_checkbutton);
+    return m_priv->inherit_checkbutton->get_active ();
+}
+
 }//end namespace nemiver
 
diff --git a/src/persp/profperspective/nmv-run-program-dialog.h b/src/persp/profperspective/nmv-record-dialog.h
similarity index 80%
rename from src/persp/profperspective/nmv-run-program-dialog.h
rename to src/persp/profperspective/nmv-record-dialog.h
index a72e001..d87b12e 100644
--- a/src/persp/profperspective/nmv-run-program-dialog.h
+++ b/src/persp/profperspective/nmv-record-dialog.h
@@ -1,4 +1,4 @@
-//Author: Dodji Seketeli
+//Authors: Dodji Seketeli, Fabien Parent
 /*
  *This file is part of the Nemiver project
  *
@@ -22,8 +22,8 @@
  *
  *See COPYRIGHT file copyright information.
  */
-#ifndef __NMV_RUN_PROGRAM_DIALOG_H__
-#define __NMV_RUN_PROGRAM_DIALOG_H__
+#ifndef __NMV_RECORD_DIALOG_H__
+#define __NMV_RECORD_DIALOG_H__
 
 #include <map>
 #include "common/nmv-safe-ptr-utils.h"
@@ -38,16 +38,16 @@ class UString;
 using nemiver::common::UString;
 using nemiver::common::SafePtr;
 
-class RunProgramDialog : public Dialog {
+class RecordDialog : public Dialog {
 
     struct Priv;
     SafePtr<Priv> m_priv;
 
 public:
 
-    RunProgramDialog (const UString &a_resource_root_path);
+    RecordDialog (const UString &a_resource_root_path);
 
-    virtual ~RunProgramDialog ();
+    virtual ~RecordDialog ();
 
     UString program_name () const;
     void program_name (const UString &a_name);
@@ -61,9 +61,13 @@ public:
     std::map<UString, UString> environment_variables () const;
     void environment_variables (const std::map<UString, UString> &);
 
+    bool callgraph () const;
+    bool scale_counter_values () const;
+    bool child_inherit_counters () const;
+
 };//end class nemiver
 
 NEMIVER_END_NAMESPACE (nemiver)
 
-#endif //__NMV_RUN_PROGRAM_DIALOG_H__
+#endif //__NMV_RECORD_DIALOG_H__
 
diff --git a/src/persp/profperspective/ui/Makefile.am b/src/persp/profperspective/ui/Makefile.am
index 09c4985..0904120 100644
--- a/src/persp/profperspective/ui/Makefile.am
+++ b/src/persp/profperspective/ui/Makefile.am
@@ -1,6 +1,6 @@
 PLUGIN_NAME=profperspective
 uifiles = loadreportdialog.ui \
-runprogramdialog.ui
+recorddialog.ui
 
 uidir = @NEMIVER_PLUGINS_DIR@/$(PLUGIN_NAME)/ui
 ui_DATA = $(uifiles)
diff --git a/src/persp/profperspective/ui/recorddialog.ui b/src/persp/profperspective/ui/recorddialog.ui
new file mode 100644
index 0000000..3365bcf
--- /dev/null
+++ b/src/persp/profperspective/ui/recorddialog.ui
@@ -0,0 +1,481 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkDialog" id="recorddialog">
+    <property name="width_request">300</property>
+    <property name="can_focus">False</property>
+    <property name="title" translatable="yes">Choose a Program to Execute</property>
+    <property name="default_width">600</property>
+    <property name="default_height">400</property>
+    <property name="type_hint">dialog</property>
+    <child internal-child="vbox">
+      <object class="GtkBox" id="dialog-vbox1">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="dialog-action_area1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="button2">
+                <property name="label">gtk-cancel</property>
+                <property name="use_action_appearance">False</property>
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="receives_default">False</property>
+                <property name="use_action_appearance">False</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="executebutton">
+                <property name="label">gtk-execute</property>
+                <property name="use_action_appearance">False</property>
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="can_default">True</property>
+                <property name="has_default">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_action_appearance">False</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkBox" id="box1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <child>
+              <object class="GtkVBox" id="vbox1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="border_width">6</property>
+                <property name="spacing">6</property>
+                <child>
+                  <object class="GtkFrame" id="frame_program">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label_xalign">0</property>
+                    <property name="shadow_type">none</property>
+                    <child>
+                      <object class="GtkAlignment" id="alignment2">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="left_padding">12</property>
+                        <child>
+                          <object class="GtkFileChooserButton" id="filechooserbutton">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="title" translatable="yes">Choose an executable</property>
+                          </object>
+                        </child>
+                      </object>
+                    </child>
+                    <child type="label">
+                      <object class="GtkLabel" id="label_program">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">&lt;b&gt;Program:&lt;/b&gt;</property>
+                        <property name="use_markup">True</property>
+                      </object>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkFrame" id="frame_arguments">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label_xalign">0</property>
+                    <property name="shadow_type">none</property>
+                    <child>
+                      <object class="GtkAlignment" id="alignment1">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="left_padding">12</property>
+                        <child>
+                          <object class="GtkEntry" id="argumentsentry">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="invisible_char">â</property>
+                            <property name="invisible_char_set">True</property>
+                          </object>
+                        </child>
+                      </object>
+                    </child>
+                    <child type="label">
+                      <object class="GtkLabel" id="label_arguments">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">&lt;b&gt;Arguments:&lt;/b&gt;</property>
+                        <property name="use_markup">True</property>
+                      </object>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkFrame" id="frame_workingdir">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label_xalign">0</property>
+                    <property name="shadow_type">none</property>
+                    <child>
+                      <object class="GtkAlignment" id="alignment3">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="left_padding">12</property>
+                        <child>
+                          <object class="GtkFileChooserButton" id="filechooserbutton_workingdir">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="action">select-folder</property>
+                            <property name="title" translatable="yes">Choose a working directory</property>
+                          </object>
+                        </child>
+                      </object>
+                    </child>
+                    <child type="label">
+                      <object class="GtkLabel" id="label_workingdir">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">&lt;b&gt;Working Directory:&lt;/b&gt;</property>
+                        <property name="use_markup">True</property>
+                      </object>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkFrame" id="frame_environment">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label_xalign">0</property>
+                    <property name="shadow_type">none</property>
+                    <child>
+                      <object class="GtkAlignment" id="alignment4">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="left_padding">12</property>
+                        <child>
+                          <object class="GtkHBox" id="hbox2">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="spacing">6</property>
+                            <child>
+                              <object class="GtkScrolledWindow" id="scrolledwindow1">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="shadow_type">out</property>
+                                <child>
+                                  <object class="GtkTreeView" id="treeview_environment">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <child internal-child="selection">
+                                      <object class="GtkTreeSelection" id="treeview-selection"/>
+                                    </child>
+                                  </object>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkVButtonBox" id="vbuttonbox1">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="spacing">6</property>
+                                <property name="layout_style">start</property>
+                                <child>
+                                  <object class="GtkButton" id="button_add_var">
+                                    <property name="use_action_appearance">False</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="can_default">True</property>
+                                    <property name="receives_default">True</property>
+                                    <property name="use_action_appearance">False</property>
+                                    <child>
+                                      <object class="GtkAlignment" id="alignment6">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="xscale">0</property>
+                                        <property name="yscale">0</property>
+                                        <child>
+                                          <object class="GtkHBox" id="hbox3">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="spacing">2</property>
+                                            <child>
+                                              <object class="GtkImage" id="image4">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">False</property>
+                                                <property name="stock">gtk-add</property>
+                                              </object>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="fill">False</property>
+                                                <property name="position">0</property>
+                                              </packing>
+                                            </child>
+                                            <child>
+                                              <object class="GtkLabel" id="label4">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">False</property>
+                                                <property name="label" translatable="yes">_Add</property>
+                                                <property name="use_underline">True</property>
+                                              </object>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="fill">False</property>
+                                                <property name="position">1</property>
+                                              </packing>
+                                            </child>
+                                          </object>
+                                        </child>
+                                      </object>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkButton" id="button_remove_var">
+                                    <property name="use_action_appearance">False</property>
+                                    <property name="visible">True</property>
+                                    <property name="sensitive">False</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="can_default">True</property>
+                                    <property name="receives_default">True</property>
+                                    <property name="use_action_appearance">False</property>
+                                    <child>
+                                      <object class="GtkAlignment" id="alignment7">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="xscale">0</property>
+                                        <property name="yscale">0</property>
+                                        <child>
+                                          <object class="GtkHBox" id="hbox4">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="spacing">2</property>
+                                            <child>
+                                              <object class="GtkImage" id="image5">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">False</property>
+                                                <property name="stock">gtk-remove</property>
+                                              </object>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="fill">False</property>
+                                                <property name="position">0</property>
+                                              </packing>
+                                            </child>
+                                            <child>
+                                              <object class="GtkLabel" id="label5">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">False</property>
+                                                <property name="label" translatable="yes">_Remove</property>
+                                                <property name="use_underline">True</property>
+                                              </object>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="fill">False</property>
+                                                <property name="position">1</property>
+                                              </packing>
+                                            </child>
+                                          </object>
+                                        </child>
+                                      </object>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                          </object>
+                        </child>
+                      </object>
+                    </child>
+                    <child type="label">
+                      <object class="GtkLabel" id="label_environment">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">&lt;b&gt;Environment Variables:&lt;/b&gt;</property>
+                        <property name="use_markup">True</property>
+                      </object>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">True</property>
+                    <property name="fill">True</property>
+                    <property name="position">3</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkBox" id="box2">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="orientation">vertical</property>
+                <property name="spacing">6</property>
+                <child>
+                  <object class="GtkFrame" id="frame1">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label_xalign">0</property>
+                    <property name="shadow_type">none</property>
+                    <child>
+                      <object class="GtkAlignment" id="alignment5">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="left_padding">12</property>
+                        <child>
+                          <object class="GtkBox" id="box3">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="orientation">vertical</property>
+                            <property name="spacing">3</property>
+                            <child>
+                              <object class="GtkCheckButton" id="scalecheckbutton">
+                                <property name="label" translatable="yes">Scale counter values</property>
+                                <property name="use_action_appearance">False</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="use_action_appearance">False</property>
+                                <property name="xalign">0</property>
+                                <property name="draw_indicator">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkCheckButton" id="callgraphcheckbutton">
+                                <property name="label" translatable="yes">Do call-graph recording</property>
+                                <property name="use_action_appearance">False</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="use_action_appearance">False</property>
+                                <property name="xalign">0</property>
+                                <property name="draw_indicator">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkCheckButton" id="inheritcheckbutton">
+                                <property name="label" translatable="yes">Child tasks inherit counters</property>
+                                <property name="use_action_appearance">False</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="use_action_appearance">False</property>
+                                <property name="xalign">0</property>
+                                <property name="draw_indicator">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">2</property>
+                              </packing>
+                            </child>
+                          </object>
+                        </child>
+                      </object>
+                    </child>
+                    <child type="label">
+                      <object class="GtkLabel" id="configurationlabel">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">&lt;b&gt;Configuration&lt;/b&gt;</property>
+                        <property name="use_markup">True</property>
+                      </object>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="-6">button2</action-widget>
+      <action-widget response="-5">executebutton</action-widget>
+    </action-widgets>
+  </object>
+</interface>
diff --git a/src/profengine/nmv-i-profiler.h b/src/profengine/nmv-i-profiler.h
index 6e44192..74842e5 100644
--- a/src/profengine/nmv-i-profiler.h
+++ b/src/profengine/nmv-i-profiler.h
@@ -74,7 +74,10 @@ public:
     virtual void report (const UString &a_data_file) = 0;
 
     virtual void record (const UString &a_program_path,
-                         const std::vector<UString> &a_argv) = 0;
+                         const std::vector<UString> &a_argv,
+                         bool a_scale_counter_values,
+                         bool a_do_callgraph,
+                         bool a_child_inherit_counters) = 0;
 
 //    virtual void attach_to_pid () = 0;
 
diff --git a/src/profengine/nmv-perf-engine.cc b/src/profengine/nmv-perf-engine.cc
index 8d79c66..a157e51 100644
--- a/src/profengine/nmv-perf-engine.cc
+++ b/src/profengine/nmv-perf-engine.cc
@@ -251,7 +251,10 @@ PerfEngine::~PerfEngine ()
 
 void
 PerfEngine::record (const UString &a_program_path,
-                    const std::vector<UString> &a_argv)
+                    const std::vector<UString> &a_argv,
+                    bool a_scale_counter_values,
+                    bool a_do_callgraph,
+                    bool a_child_inherit_counters)
 {
     SafePtr<char, DefaultRef, FreeUnref> tmp_filepath (tempnam(0, 0));
     THROW_IF_FAIL (tmp_filepath);
@@ -262,7 +265,21 @@ PerfEngine::record (const UString &a_program_path,
     std::vector<UString> argv;
     argv.push_back ("perf");
     argv.push_back ("record");
+
+    if (a_scale_counter_values) {
+        argv.push_back ("-l");
+    }
+
+    if (a_do_callgraph) {
+        argv.push_back ("--call-graph");
+    }
+
+    if (a_child_inherit_counters) {
+        argv.push_back ("--inherit");
+    }
+
     argv.push_back ("--output");
+    argv.push_back ("--");
     argv.push_back (m_priv->record_filepath);
     argv.push_back (a_program_path);
     argv.insert (argv.end (), a_argv.begin (), a_argv.end ());
diff --git a/src/profengine/nmv-perf-engine.h b/src/profengine/nmv-perf-engine.h
index 69a1eb0..9b00ea9 100644
--- a/src/profengine/nmv-perf-engine.h
+++ b/src/profengine/nmv-perf-engine.h
@@ -45,7 +45,10 @@ public:
     void report (const UString &a_data_file);
 
     void record (const UString &a_program_path,
-                 const std::vector<UString> &a_argv);
+                 const std::vector<UString> &a_argv,
+                 bool a_scale_counter_values,
+                 bool a_do_callgraph,
+                 bool a_child_inherit_counters);
 
     sigc::signal<void, CallGraphSafePtr> report_done_signal () const;
     sigc::signal<void> program_exited_signal () const;



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