Browse code

core: new command line option (debugging)

- new command line option controlling the script optimization
level: -O (e.g. -O0 - no optimizations). By default the
optimization level is set to maximum (2 for now).
- renamed sctp max process number command line option from -O to -Q

Andrei Pelinescu-Onciul authored on 10/12/2008 13:52:12
Showing 1 changed files
... ...
@@ -222,7 +222,7 @@ Options:\n\
222 222
 #endif
223 223
 #ifdef USE_SCTP
224 224
 "    -S           disable sctp\n\
225
-    -O            Number of sctp child processes (default: equal to `-n')\n"
225
+    -Q            Number of sctp child processes (default: equal to `-n')\n"
226 226
 #endif /* USE_SCTP */
227 227
 "    -V           Version number\n\
228 228
     -h           This help message\n\
... ...
@@ -234,7 +234,8 @@ Options:\n\
234 234
     -u uid       Change uid \n\
235 235
     -g gid       Change gid \n\
236 236
     -P file      Create a pid file\n\
237
-    -G file      Create a pgid file\n"
237
+    -G file      Create a pgid file\n\
238
+    -O nr        Script optimization level (debugging option)\n"
238 239
 #ifdef STATS
239 240
 "    -s file     File to which statistics is dumped (disabled otherwise)\n"
240 241
 #endif
... ...
@@ -1502,7 +1503,7 @@ int main(int argc, char** argv)
1502 1502
 		"DBG_MSG_QA enabled, ser may exit abruptly\n");
1503 1503
 #endif
1504 1504
 
1505
-	options=  ":f:cm:dVhEb:l:L:n:vrRDTN:W:w:t:u:g:P:G:SO:"
1505
+	options=  ":f:cm:dVhEb:l:L:n:vrRDTN:W:w:t:u:g:P:G:SQ:O:"
1506 1506
 #ifdef STATS
1507 1507
 		"s:"
1508 1508
 #endif
... ...
@@ -1572,6 +1573,14 @@ int main(int argc, char** argv)
1572 1572
 			case 'E':
1573 1573
 					log_stderr=1;
1574 1574
 					break;
1575
+			case 'O':
1576
+					scr_opt_lev=strtol(optarg, &tmp, 10);
1577
+					if (tmp &&(*tmp)){
1578
+						fprintf(stderr, "bad optimization level: -O %s\n",
1579
+										optarg);
1580
+						goto error;
1581
+					};
1582
+					break;
1575 1583
 			case 'b':
1576 1584
 			case 'l':
1577 1585
 			case 'n':
... ...
@@ -1589,7 +1598,7 @@ int main(int argc, char** argv)
1589 1589
 			case 'P':
1590 1590
 			case 'G':
1591 1591
 			case 'S':
1592
-			case 'O':
1592
+			case 'Q':
1593 1593
 			case 's':
1594 1594
 					break;
1595 1595
 			case '?':
... ...
@@ -1676,6 +1685,7 @@ try_again:
1676 1676
 			case 'd':
1677 1677
 			case 'V':
1678 1678
 			case 'h':
1679
+			case 'O':
1679 1680
 					break;
1680 1681
 			case 'E':
1681 1682
 					log_stderr=1;	// use in both getopt switches
... ...
@@ -1762,7 +1772,7 @@ try_again:
1762 1762
 					fprintf(stderr,"WARNING: sctp support not compiled in\n");
1763 1763
 				#endif
1764 1764
 					break;
1765
-			case 'O':
1765
+			case 'Q':
1766 1766
 				#ifdef USE_SCTP
1767 1767
 					sctp_children_no=strtol(optarg, &tmp, 10);
1768 1768
 					if ((tmp==0) ||(*tmp)){