debugd: write null clock sync record

Write a clock sync record on systrace stop that causes chrome to not
time-shift data.  This used in conjunction with other changes that export
the kernel's trace event clock to user space to align user and kernel
event data.

With this change we no longer need the clock_monotonic helper so delete it.

BUG=chromium-os:27809
TEST=manual:collect trace data; check sync record contents

Change-Id: I2d7edcc9e6b80bee96033ec00b4dddef016f8307
diff --git a/src/helpers/clock_monotonic.cc b/src/helpers/clock_monotonic.cc
deleted file mode 100644
index f52452d..0000000
--- a/src/helpers/clock_monotonic.cc
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-
-int main() {
-  struct timespec ts;
-
-  memset(&ts, 0, sizeof(ts));
-  clock_gettime(CLOCK_MONOTONIC, &ts);
-  printf("%llu.%lu\n", (long long unsigned) ts.tv_sec, ts.tv_nsec / 1000000);
-  return 0;
-}
diff --git a/src/helpers/systrace.sh b/src/helpers/systrace.sh
index 35febae..a794710 100755
--- a/src/helpers/systrace.sh
+++ b/src/helpers/systrace.sh
@@ -133,11 +133,10 @@
     fi
 
     logger -t systrace "stop tracing"
-    # add sync marker for chrome to time-shift system events;
-    # note we need the monotonic time
-    marker=$(printf 'trace_event_clock_sync: parent_ts=%s\n' \
-        $(/usr/libexec/debugd/helpers/clock_monotonic))
-    tracing_write "${marker}" trace_marker
+    # Add null sync marker for chrome so events are 0-time-shifted
+    # (on chrome os user-space events are stamped with the kernel
+    #  trace clock so there is no need to time-shift events).
+    tracing_write 'trace_event_clock_sync: parent_ts=0' trace_marker
     tracing_reset
 
     # NB: debugd attaches stdout to an fd passed in by the client