Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: init/main.c

Issue 524041: Changes to make upstart log performance stats to a file. (Closed)
Patch Set: More tab/space stuff Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « init/job.c ('k') | init/perf_log.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* upstart 1 /* upstart
2 * 2 *
3 * Copyright © 2009 Canonical Ltd. 3 * Copyright © 2009 Canonical Ltd.
4 * Author: Scott James Remnant <scott@netsplit.com>. 4 * Author: Scott James Remnant <scott@netsplit.com>.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2, as 7 * it under the terms of the GNU General Public License version 2, as
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 * 9 *
10 * This program is distributed in the hope that it will be useful, 10 * This program is distributed in the hope that it will be useful,
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 235
236 /* SIGHUP instructs us to re-load our configuration */ 236 /* SIGHUP instructs us to re-load our configuration */
237 nih_signal_set_handler (SIGHUP, nih_signal_handler); 237 nih_signal_set_handler (SIGHUP, nih_signal_handler);
238 NIH_MUST (nih_signal_add_handler (NULL, SIGHUP, hup_handler, NULL)); 238 NIH_MUST (nih_signal_add_handler (NULL, SIGHUP, hup_handler, NULL));
239 239
240 /* SIGUSR1 instructs us to reconnect to D-Bus */ 240 /* SIGUSR1 instructs us to reconnect to D-Bus */
241 nih_signal_set_handler (SIGUSR1, nih_signal_handler); 241 nih_signal_set_handler (SIGUSR1, nih_signal_handler);
242 NIH_MUST (nih_signal_add_handler (NULL, SIGUSR1, usr1_handler, NULL)); 242 NIH_MUST (nih_signal_add_handler (NULL, SIGUSR1, usr1_handler, NULL));
243 #endif /* DEBUG */ 243 #endif /* DEBUG */
244 244
245 /* Start performance logging using these hardcoded files.
246 * TODO(kmixter): We'll want to make the files and fields
247 * configurable eventually.
248 */
249 perf_log_set_files ("/proc/uptime",
250 "/sys/block/sda/stat",
251 "/var/log/perf.log");
252
245 253
246 /* Watch children for events */ 254 /* Watch children for events */
247 NIH_MUST (nih_child_add_watch (NULL, -1, NIH_CHILD_ALL, 255 NIH_MUST (nih_child_add_watch (NULL, -1, NIH_CHILD_ALL,
248 job_process_handler, NULL)); 256 job_process_handler, NULL));
249 257
250 /* Process the event queue each time through the main loop */ 258 /* Process the event queue each time through the main loop */
251 NIH_MUST (nih_main_loop_add_func (NULL, (NihMainLoopCb)event_poll, 259 NIH_MUST (nih_main_loop_add_func (NULL, (NihMainLoopCb)event_poll,
252 NULL)); 260 NULL));
253 261
254 262
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 NihError *err; 547 NihError *err;
540 548
541 err = nih_error_get (); 549 err = nih_error_get ();
542 nih_warn ("%s: %s", _("Unable to connect to the system b us"), 550 nih_warn ("%s: %s", _("Unable to connect to the system b us"),
543 err->message); 551 err->message);
544 nih_free (err); 552 nih_free (err);
545 } 553 }
546 } 554 }
547 } 555 }
548 #endif /* DEBUG */ 556 #endif /* DEBUG */
OLDNEW
« no previous file with comments | « init/job.c ('k') | init/perf_log.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698