Changeset 2101 in kBuild for trunk/src/kmk/job.c
- Timestamp:
- Nov 24, 2008 11:35:56 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/job.c
r2056 r2101 209 209 static int job_next_command (struct child *); 210 210 static int start_waiting_job (struct child *); 211 #ifdef CONFIG_WITH_PRINT_TIME_SWITCH 212 static void print_job_time (struct child *); 213 #endif 211 214 212 215 … … 901 904 free_child (struct child *child) 902 905 { 906 #ifdef CONFIG_WITH_PRINT_TIME_SWITCH 907 print_job_time (child); 908 #endif 903 909 if (!jobserver_tokens) 904 910 fatal (NILF, "INTERNAL: Freeing child 0x%08lx (%s) but no tokens left!\n", … … 1064 1070 if (!child->command_ptr) 1065 1071 goto next_command; 1072 1073 #ifdef CONFIG_WITH_PRINT_TIME_SWITCH 1074 if (child->start_ts == -1) 1075 child->start_ts = nano_timestamp (); 1076 #endif 1066 1077 1067 1078 /* Combine the flags parsed for the line itself with … … 1821 1832 c->command_lines = lines; 1822 1833 c->sh_batch_file = NULL; 1834 #ifdef CONFIG_WITH_PRINT_TIME_SWITCH 1835 c->start_ts = -1; 1836 #endif 1823 1837 1824 1838 /* Cache dontcare flag because file->dontcare can be changed once we … … 3422 3436 #endif /* !HAPE_DUP2 && !_AMIGA */ 3423 3437 3438 #ifdef CONFIG_WITH_PRINT_TIME_SWITCH 3439 /* Prints the time elapsed while executing the commands for the given job. */ 3440 void print_job_time (struct child *c) 3441 { 3442 if ( !handling_fatal_signal 3443 && print_time_min != -1 3444 && c->start_ts != -1) 3445 { 3446 big_int elapsed = nano_timestamp () - c->start_ts; 3447 if (elapsed >= print_time_min * BIG_INT_C(1000000000)) 3448 { 3449 char buf[64]; 3450 int len = format_elapsed_nano (buf, sizeof (buf), elapsed); 3451 if (len > print_time_width) 3452 print_time_width = len; 3453 message (1, _("%*s - %s"), print_time_width, buf, c ->file->name); 3454 } 3455 } 3456 } 3457 #endif 3458 3424 3459 /* On VMS systems, include special VMS functions. */ 3425 3460
Note:
See TracChangeset
for help on using the changeset viewer.