blob: d568b381d49f2c3f03ed67c968c1bac02c0fc6d6 [file] [log] [blame]
J. Richard Barnettec5fd6072010-08-09 11:39:20 -07001// 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 Barnette01687452010-08-16 19:33:29 -07005// 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 SIMONNETb54b6dc2014-07-02 12:13:56 -070010#ifndef LIBCHROMEOS_CHROMEOS_BOOTSTAT_BOOTSTAT_H_
11#define LIBCHROMEOS_CHROMEOS_BOOTSTAT_BOOTSTAT_H_
J. Richard Barnettec5fd6072010-08-09 11:39:20 -070012
13#if defined(__cplusplus)
14extern "C" {
15#endif
16
J. Richard Barnette01687452010-08-16 19:33:29 -070017//
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 Vakulenko05d29042015-01-13 09:39:25 -080027#define BOOTSTAT_MAX_EVENT_LEN 64
J. Richard Barnette01687452010-08-16 19:33:29 -070028
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.
37extern void bootstat_log(const char* event_name);
J. Richard Barnettec5fd6072010-08-09 11:39:20 -070038
39#if defined(__cplusplus)
40}
41#endif
Bertrand SIMONNETb54b6dc2014-07-02 12:13:56 -070042#endif // LIBCHROMEOS_CHROMEOS_BOOTSTAT_BOOTSTAT_H_