Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(697)

Unified Diff: bootstat.h

Issue 3129002: Create a bootstat library for external C and C++ programs (Closed) Base URL: ssh://gitrw.chromium.org/bootstat.git
Patch Set: Fix whitespace issue found by presubmit check Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « README ('k') | bootstat.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bootstat.h
diff --git a/bootstat.h b/bootstat.h
index d198061a93ed3d3dec1ad0ce28124e0554960b44..d6b13d225e61fd0bbcb5f25c4c662281991eaaff 100644
--- a/bootstat.h
+++ b/bootstat.h
@@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// Public API for the C and C++ bindings to the Chromium OS
+// 'bootstat' facility. The facility is a simple timestamp
+// mechanism to associate a named event with the time that it
+// occurred and with other relevant statistics.
+
#ifndef BOOTSTAT_H_
#define BOOTSTAT_H_
@@ -9,9 +14,29 @@
extern "C" {
#endif
-extern void bootstat_log(const char *);
+//
+// Length of the longest valid string naming an event, including the
+// terminating NUL character. Clients of bootstat_log() can use
+// this value for the size of buffers to hold event names; names
+// that exceed this buffer size will be truncated.
+//
+// This value is arbitrarily chosen, but see comments in
+// bootstat_log.c regarding implementation assumptions for this
+// value.
+//
+#define BOOTSTAT_MAX_EVENT_LEN 64
+
+// Log an event. Event names should be composed of characters drawn
+// from this subset of 7-bit ASCII: Letters (upper- or lower-case),
+// digits, dot ('.'), dash ('-'), and underscore ('_'). Case is
+// significant. Behavior in the presence of other characters is
+// unspecified - Caveat Emptor!
+//
+// Applications are responsible for establishing higher-level naming
+// conventions to prevent name collisions.
+extern void bootstat_log(const char* event_name);
#if defined(__cplusplus)
}
#endif
-#endif // BOOTSTAT_H_
+#endif // BOOTSTAT_H_
« no previous file with comments | « README ('k') | bootstat.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698