J. Richard Barnette | c5fd607 | 2010-08-09 11:39:20 -0700 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
J. Richard Barnette | 0168745 | 2010-08-16 19:33:29 -0700 | [diff] [blame] | 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 | |
Bertrand SIMONNET | b54b6dc | 2014-07-02 12:13:56 -0700 | [diff] [blame] | 10 | #ifndef LIBCHROMEOS_CHROMEOS_BOOTSTAT_BOOTSTAT_H_ |
| 11 | #define LIBCHROMEOS_CHROMEOS_BOOTSTAT_BOOTSTAT_H_ |
J. Richard Barnette | c5fd607 | 2010-08-09 11:39:20 -0700 | [diff] [blame] | 12 | |
| 13 | #if defined(__cplusplus) |
| 14 | extern "C" { |
| 15 | #endif |
| 16 | |
J. Richard Barnette | 0168745 | 2010-08-16 19:33:29 -0700 | [diff] [blame] | 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 | // |
Alex Vakulenko | 05d2904 | 2015-01-13 09:39:25 -0800 | [diff] [blame^] | 27 | #define BOOTSTAT_MAX_EVENT_LEN 64 |
J. Richard Barnette | 0168745 | 2010-08-16 19:33:29 -0700 | [diff] [blame] | 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); |
J. Richard Barnette | c5fd607 | 2010-08-09 11:39:20 -0700 | [diff] [blame] | 38 | |
| 39 | #if defined(__cplusplus) |
| 40 | } |
| 41 | #endif |
Bertrand SIMONNET | b54b6dc | 2014-07-02 12:13:56 -0700 | [diff] [blame] | 42 | #endif // LIBCHROMEOS_CHROMEOS_BOOTSTAT_BOOTSTAT_H_ |