[Fawkes Git] branch/vmatare/scope-timetracker: add LifetimeTracker that time-tracks a scope

Victor Mataré matare at lih.rwth-aachen.de
Mon Mar 7 13:52:47 CET 2016


Changes have been pushed for the project "Fawkes Robotics Software Framework".

Gitweb: http://git.fawkesrobotics.org/fawkes.git
Trac:   http://trac.fawkesrobotics.org

The branch, vmatare/scope-timetracker has been updated
  discards  82bc23be055fb3bd50b7700ae6f9faee70aeaa2d (commit)
        to  419dcdc4a6d081a18fc652b5b2ed497e3284dc06 (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (82bc23be055fb3bd50b7700ae6f9faee70aeaa2d)
            \
             N -- N -- N (419dcdc4a6d081a18fc652b5b2ed497e3284dc06)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

http://git.fawkesrobotics.org/fawkes.git/vmatare/scope-timetracker

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- *Log* ---------------------------------------------------------------
commit 419dcdc4a6d081a18fc652b5b2ed497e3284dc06
Author:     Victor Mataré <matare at lih.rwth-aachen.de>
AuthorDate: Mon Mar 7 12:58:56 2016 +0100
Commit:     Victor Mataré <matare at lih.rwth-aachen.de>
CommitDate: Mon Mar 7 13:52:37 2016 +0100

    add LifetimeTracker that time-tracks a scope

http://git.fawkesrobotics.org/fawkes.git/commit/419dcdc
http://trac.fawkesrobotics.org/changeset/419dcdc

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


- *Summary* -----------------------------------------------------------
 src/libs/utils/time/tracker_macros.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


- *Diffs* -------------------------------------------------------------

- *commit* 419dcdc4a6d081a18fc652b5b2ed497e3284dc06 - - - - - - - - - -
Author:  Victor Mataré <matare at lih.rwth-aachen.de>
Date:    Mon Mar 7 12:58:56 2016 +0100
Subject: add LifetimeTracker that time-tracks a scope

 src/libs/utils/time/tracker.cpp      |   10 ++++++++++
 src/libs/utils/time/tracker.h        |   11 +++++++++++
 src/libs/utils/time/tracker_macros.h |    4 ++++
 3 files changed, 25 insertions(+), 0 deletions(-)

_Diff for modified files_:
diff --git a/src/libs/utils/time/tracker.cpp b/src/libs/utils/time/tracker.cpp
index a5df85b..0e438dd 100644
--- a/src/libs/utils/time/tracker.cpp
+++ b/src/libs/utils/time/tracker.cpp
@@ -466,5 +466,15 @@ TimeTracker::print_to_file()
   fflush(__timelog);
 }
 
+
+LifetimeTracker::LifetimeTracker(TimeTracker &tt, unsigned int cls)
+: tt_(tt), cls_(cls)
+{ tt_.ping_start(cls_); }
+
+
+LifetimeTracker::~LifetimeTracker()
+{ tt_.ping_end(cls_); }
+
+
 } // end namespace fawkes
 
diff --git a/src/libs/utils/time/tracker.h b/src/libs/utils/time/tracker.h
index c4ac76f..af39c58 100644
--- a/src/libs/utils/time/tracker.h
+++ b/src/libs/utils/time/tracker.h
@@ -77,6 +77,17 @@ class TimeTracker {
   FILE *__timelog;
 };
 
+
+class LifetimeTracker {
+public:
+  LifetimeTracker(TimeTracker &tt, unsigned int cls);
+  ~LifetimeTracker();
+private:
+  TimeTracker &tt_;
+  unsigned int cls_;
+};
+
+
 } // end namespace fawkes
 
 #endif
diff --git a/src/libs/utils/time/tracker_macros.h b/src/libs/utils/time/tracker_macros.h
index 1babd5a..e4efca0 100644
--- a/src/libs/utils/time/tracker_macros.h
+++ b/src/libs/utils/time/tracker_macros.h
@@ -42,11 +42,15 @@
 #  define TIMETRACK_ABORT(c)			\
   TRACKER_VARIABLE->ping_abort(c);
 
+#  define TIMETRACK_SCOPE(c)                    \
+  fawkes::LifetimeTracker __tt_scope_sentry(*TRACKER_VARIABLE, c);
+
 #else
 #  define TIMETRACK_START(c)
 #  define TIMETRACK_INTER(c1, c2)
 #  define TIMETRACK_END(c)
 #  define TIMETRACK_ABORT(c)
+#  define TIMETRACK_SCOPE(c)
 #endif
 
 




-- 
Fawkes Robotics Framework                 http://www.fawkesrobotics.org


More information about the fawkes-commits mailing list