Changeset 2101 for trunk/src/kmk/main.c
- Timestamp:
- Nov 25, 2008, 12:35:56 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/main.c
r2099 r2101 183 183 184 184 int print_stats_flag; 185 #endif 186 187 #ifdef CONFIG_WITH_PRINT_TIME_SWITCH 188 /* Minimum number of seconds to report, -1 if disabled. */ 189 190 int print_time_min = -1; 191 static int default_print_time_min = -1; 192 static int no_val_print_time_min = 0; 193 static big_int make_start_ts = -1; 194 int print_time_width = 5; 185 195 #endif 186 196 … … 491 501 "print-stats" }, 492 502 #endif 503 #ifdef CONFIG_WITH_PRINT_TIME_SWITCH 504 { CHAR_MAX+12, positive_int, (char *) &print_time_min, 1, 1, 0, 505 (char *) &no_val_print_time_min, (char *) &default_print_time_min, 506 "print-time" }, 507 #endif 493 508 #ifdef KMK 494 { CHAR_MAX+1 2, positive_int, (char *) &process_priority, 1, 1, 0,509 { CHAR_MAX+14, positive_int, (char *) &process_priority, 1, 1, 0, 495 510 (char *) &process_priority, (char *) &process_priority, "priority" }, 496 { CHAR_MAX+1 4, positive_int, (char *) &process_affinity, 1, 1, 0,511 { CHAR_MAX+15, positive_int, (char *) &process_affinity, 1, 1, 0, 497 512 (char *) &process_affinity, (char *) &process_affinity, "affinity" }, 498 513 #endif … … 505 520 "no-keep-going" }, 506 521 #if defined (CONFIG_WITH_MAKE_STATS) || defined (CONFIG_WITH_MINIMAL_STATS) 507 { CHAR_MAX+1 5, flag, (char *) &make_expensive_statistics, 1, 1, 1, 0, 0,522 { CHAR_MAX+16, flag, (char *) &make_expensive_statistics, 1, 1, 1, 0, 0, 508 523 "statistics" }, 509 524 #endif … … 1313 1328 SetUnhandledExceptionFilter(handle_runtime_exceptions); 1314 1329 #endif /* !ELECTRIC_HEAP */ 1330 1331 #ifdef CONFIG_WITH_PRINT_TIME_SWITCH 1332 make_start_ts = nano_timestamp (); 1333 #endif 1315 1334 1316 1335 /* start off assuming we have no shell */ … … 3566 3585 make_expensive_statistics ? "1" : "0", o_default, 1); 3567 3586 # endif 3587 #ifdef CONFIG_WITH_PRINT_TIME_SWITCH 3588 sprintf (val, "%u", print_time_min); 3589 define_variable ("KMK_OPTS_PRINT_TIME", sizeof("KMK_OPTS_PRINT_TIME") - 1, 3590 val, o_default, 1); 3591 #endif 3568 3592 } 3569 3593 #endif … … 3811 3835 if (directory_before_chdir != 0) 3812 3836 chdir (directory_before_chdir); 3837 3838 #ifdef CONFIG_WITH_PRINT_TIME_SWITCH 3839 if (print_time_min != -1) 3840 { 3841 big_int elapsed = nano_timestamp () - make_start_ts; 3842 if (elapsed >= print_time_min * BIG_INT_C(1000000000)) 3843 { 3844 char buf[64]; 3845 format_elapsed_nano (buf, sizeof (buf), elapsed); 3846 message (1, _("%*s"), print_time_width, buf); 3847 } 3848 } 3849 #endif 3813 3850 3814 3851 log_working_directory (0);
Note:
See TracChangeset
for help on using the changeset viewer.