| 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 // 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 |
| 5 #include <stdio.h> | 9 #include <stdio.h> |
| 6 #include <stdlib.h> | 10 #include <stdlib.h> |
| 7 #include <string.h> | 11 #include <string.h> |
| 8 | 12 |
| 9 #include <libgen.h> | 13 #include <libgen.h> |
| 10 | 14 |
| 11 #include "bootstat.h" | 15 #include "bootstat.h" |
| 12 | 16 |
| 13 static void usage(char *cmd) | 17 static void usage(char* cmd) |
| 14 { | 18 { |
| 15 fprintf(stderr, "usage: %s <event-name>\n", basename(strdup(cmd))); | 19 fprintf(stderr, "usage: %s <event-name>\n", basename(strdup(cmd))); |
| 16 exit(EXIT_FAILURE); | 20 exit(EXIT_FAILURE); |
| 17 } | 21 } |
| 18 | 22 |
| 19 | 23 |
| 20 int main(int argc, char *argv[]) | 24 int main(int argc, char* argv[]) |
| 21 { | 25 { |
| 22 if (argc != 2) | 26 if (argc != 2) |
| 23 usage(argv[0]); | 27 usage(argv[0]); |
| 24 | 28 |
| 25 bootstat_log(argv[1]); | 29 bootstat_log(argv[1]); |
| 26 return EXIT_SUCCESS; | 30 return EXIT_SUCCESS; |
| 27 } | 31 } |
| OLD | NEW |