blob: 23c6e0d2d0d1bfa26dd8f4a3fbcb2c357783d610 [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// Implementation of the 'bootstat' command, part of the Chromium OS
6// 'bootstat' facility. The command provides a command line wrapper
7// around the key functionality declared in "bootstat.h"
8
Bertrand SIMONNET211054c2014-06-24 16:33:32 -07009#include <libgen.h>
J. Richard Barnettec5fd6072010-08-09 11:39:20 -070010#include <stdio.h>
11#include <stdlib.h>
12#include <string.h>
13
J. Richard Barnettec5fd6072010-08-09 11:39:20 -070014#include "bootstat.h"
15
Bertrand SIMONNET211054c2014-06-24 16:33:32 -070016static void usage(char* cmd)
J. Richard Barnettec5fd6072010-08-09 11:39:20 -070017{
Mike Frysingercc06b102014-02-03 15:56:13 -050018 fprintf(stderr, "usage: %s <event-name>\n", basename(cmd));
J. Richard Barnettec5fd6072010-08-09 11:39:20 -070019 exit(EXIT_FAILURE);
20}
21
22
J. Richard Barnette01687452010-08-16 19:33:29 -070023int main(int argc, char* argv[])
J. Richard Barnettec5fd6072010-08-09 11:39:20 -070024{
25 if (argc != 2)
26 usage(argv[0]);
27
28 bootstat_log(argv[1]);
29 return EXIT_SUCCESS;
30}