OLD | NEW |
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
| 5 // Public API for the C and C++ bindings to the Chromium OS |
| 6 // 'bootstat' facility. The facility is a simple timestamp |
| 7 // mechanism to associate a named event with the time that it |
| 8 // occurred and with other relevant statistics. |
| 9 |
5 #ifndef BOOTSTAT_H_ | 10 #ifndef BOOTSTAT_H_ |
6 #define BOOTSTAT_H_ | 11 #define BOOTSTAT_H_ |
7 | 12 |
8 #if defined(__cplusplus) | 13 #if defined(__cplusplus) |
9 extern "C" { | 14 extern "C" { |
10 #endif | 15 #endif |
11 | 16 |
12 extern void bootstat_log(const char *); | 17 // |
| 18 // Length of the longest valid string naming an event, including the |
| 19 // terminating NUL character. Clients of bootstat_log() can use |
| 20 // this value for the size of buffers to hold event names; names |
| 21 // that exceed this buffer size will be truncated. |
| 22 // |
| 23 // This value is arbitrarily chosen, but see comments in |
| 24 // bootstat_log.c regarding implementation assumptions for this |
| 25 // value. |
| 26 // |
| 27 #define BOOTSTAT_MAX_EVENT_LEN 64 |
| 28 |
| 29 // Log an event. Event names should be composed of characters drawn |
| 30 // from this subset of 7-bit ASCII: Letters (upper- or lower-case), |
| 31 // digits, dot ('.'), dash ('-'), and underscore ('_'). Case is |
| 32 // significant. Behavior in the presence of other characters is |
| 33 // unspecified - Caveat Emptor! |
| 34 // |
| 35 // Applications are responsible for establishing higher-level naming |
| 36 // conventions to prevent name collisions. |
| 37 extern void bootstat_log(const char* event_name); |
13 | 38 |
14 #if defined(__cplusplus) | 39 #if defined(__cplusplus) |
15 } | 40 } |
16 #endif | 41 #endif |
17 #endif // BOOTSTAT_H_ | 42 #endif // BOOTSTAT_H_ |
OLD | NEW |