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 | // 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 SIMONNET | 211054c | 2014-06-24 16:33:32 -0700 | [diff] [blame^] | 9 | #include <libgen.h> |
J. Richard Barnette | c5fd607 | 2010-08-09 11:39:20 -0700 | [diff] [blame] | 10 | #include <stdio.h> |
| 11 | #include <stdlib.h> |
| 12 | #include <string.h> |
| 13 | |
J. Richard Barnette | c5fd607 | 2010-08-09 11:39:20 -0700 | [diff] [blame] | 14 | #include "bootstat.h" |
| 15 | |
Bertrand SIMONNET | 211054c | 2014-06-24 16:33:32 -0700 | [diff] [blame^] | 16 | static void usage(char* cmd) |
J. Richard Barnette | c5fd607 | 2010-08-09 11:39:20 -0700 | [diff] [blame] | 17 | { |
Mike Frysinger | cc06b10 | 2014-02-03 15:56:13 -0500 | [diff] [blame] | 18 | fprintf(stderr, "usage: %s <event-name>\n", basename(cmd)); |
J. Richard Barnette | c5fd607 | 2010-08-09 11:39:20 -0700 | [diff] [blame] | 19 | exit(EXIT_FAILURE); |
| 20 | } |
| 21 | |
| 22 | |
J. Richard Barnette | 0168745 | 2010-08-16 19:33:29 -0700 | [diff] [blame] | 23 | int main(int argc, char* argv[]) |
J. Richard Barnette | c5fd607 | 2010-08-09 11:39:20 -0700 | [diff] [blame] | 24 | { |
| 25 | if (argc != 2) |
| 26 | usage(argv[0]); |
| 27 | |
| 28 | bootstat_log(argv[1]); |
| 29 | return EXIT_SUCCESS; |
| 30 | } |