Commit f193c7979c2f7e4e021453689b5dd9c8abdcbbc4

Authored by bellard
1 parent 3035f7ff

do not depend on thunk.h - more log items


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@675 c046a42c-6fe2-441c-8c8c-71466251a162
@@ -43,14 +43,6 @@ @@ -43,14 +43,6 @@
43 43
44 #endif /* !HAVE_BYTESWAP_H */ 44 #endif /* !HAVE_BYTESWAP_H */
45 45
46 -#if defined(__alpha__) || defined (__ia64__) || defined(__x86_64__)  
47 -#define HOST_LONG_BITS 64  
48 -#else  
49 -#define HOST_LONG_BITS 32  
50 -#endif  
51 -  
52 -#define HOST_LONG_SIZE (HOST_LONG_BITS / 8)  
53 -  
54 static inline uint16_t bswap16(uint16_t x) 46 static inline uint16_t bswap16(uint16_t x)
55 { 47 {
56 return bswap_16(x); 48 return bswap_16(x);
cpu-all.h
@@ -37,6 +37,83 @@ @@ -37,6 +37,83 @@
37 * TARGET_WORDS_BIGENDIAN : same for target cpu 37 * TARGET_WORDS_BIGENDIAN : same for target cpu
38 */ 38 */
39 39
  40 +#include "bswap.h"
  41 +
  42 +#if defined(WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN)
  43 +#define BSWAP_NEEDED
  44 +#endif
  45 +
  46 +#ifdef BSWAP_NEEDED
  47 +
  48 +static inline uint16_t tswap16(uint16_t s)
  49 +{
  50 + return bswap16(s);
  51 +}
  52 +
  53 +static inline uint32_t tswap32(uint32_t s)
  54 +{
  55 + return bswap32(s);
  56 +}
  57 +
  58 +static inline uint64_t tswap64(uint64_t s)
  59 +{
  60 + return bswap64(s);
  61 +}
  62 +
  63 +static inline void tswap16s(uint16_t *s)
  64 +{
  65 + *s = bswap16(*s);
  66 +}
  67 +
  68 +static inline void tswap32s(uint32_t *s)
  69 +{
  70 + *s = bswap32(*s);
  71 +}
  72 +
  73 +static inline void tswap64s(uint64_t *s)
  74 +{
  75 + *s = bswap64(*s);
  76 +}
  77 +
  78 +#else
  79 +
  80 +static inline uint16_t tswap16(uint16_t s)
  81 +{
  82 + return s;
  83 +}
  84 +
  85 +static inline uint32_t tswap32(uint32_t s)
  86 +{
  87 + return s;
  88 +}
  89 +
  90 +static inline uint64_t tswap64(uint64_t s)
  91 +{
  92 + return s;
  93 +}
  94 +
  95 +static inline void tswap16s(uint16_t *s)
  96 +{
  97 +}
  98 +
  99 +static inline void tswap32s(uint32_t *s)
  100 +{
  101 +}
  102 +
  103 +static inline void tswap64s(uint64_t *s)
  104 +{
  105 +}
  106 +
  107 +#endif
  108 +
  109 +#if TARGET_LONG_SIZE == 4
  110 +#define tswapl(s) tswap32(s)
  111 +#define tswapls(s) tswap32s((uint32_t *)(s))
  112 +#else
  113 +#define tswapl(s) tswap64(s)
  114 +#define tswapls(s) tswap64s((uint64_t *)(s))
  115 +#endif
  116 +
40 /* NOTE: arm is horrible as double 32 bit words are stored in big endian ! */ 117 /* NOTE: arm is horrible as double 32 bit words are stored in big endian ! */
41 typedef union { 118 typedef union {
42 double d; 119 double d;
@@ -554,9 +631,26 @@ void cpu_single_step(CPUState *env, int enabled); @@ -554,9 +631,26 @@ void cpu_single_step(CPUState *env, int enabled);
554 if no page found. */ 631 if no page found. */
555 target_ulong cpu_get_phys_page_debug(CPUState *env, target_ulong addr); 632 target_ulong cpu_get_phys_page_debug(CPUState *env, target_ulong addr);
556 633
557 -#define CPU_LOG_ALL 1 634 +#define CPU_LOG_TB_OUT_ASM (1 << 0)
  635 +#define CPU_LOG_TB_IN_ASM (1 << 1)
  636 +#define CPU_LOG_TB_OP (1 << 2)
  637 +#define CPU_LOG_TB_OP_OPT (1 << 3)
  638 +#define CPU_LOG_INT (1 << 4)
  639 +#define CPU_LOG_EXEC (1 << 5)
  640 +#define CPU_LOG_PCALL (1 << 6)
  641 +
  642 +/* define log items */
  643 +typedef struct CPULogItem {
  644 + int mask;
  645 + const char *name;
  646 + const char *help;
  647 +} CPULogItem;
  648 +
  649 +extern CPULogItem cpu_log_items[];
  650 +
558 void cpu_set_log(int log_flags); 651 void cpu_set_log(int log_flags);
559 void cpu_set_log_filename(const char *filename); 652 void cpu_set_log_filename(const char *filename);
  653 +int cpu_str_to_log_mask(const char *str);
560 654
561 /* IO ports API */ 655 /* IO ports API */
562 656
cpu-defs.h
@@ -41,6 +41,14 @@ typedef uint64_t target_ulong; @@ -41,6 +41,14 @@ typedef uint64_t target_ulong;
41 #error TARGET_LONG_SIZE undefined 41 #error TARGET_LONG_SIZE undefined
42 #endif 42 #endif
43 43
  44 +#if defined(__alpha__) || defined (__ia64__) || defined(__x86_64__)
  45 +#define HOST_LONG_BITS 64
  46 +#else
  47 +#define HOST_LONG_BITS 32
  48 +#endif
  49 +
  50 +#define HOST_LONG_SIZE (HOST_LONG_BITS / 8)
  51 +
44 #define EXCP_INTERRUPT 256 /* async interruption */ 52 #define EXCP_INTERRUPT 256 /* async interruption */
45 #define EXCP_HLT 257 /* hlt instruction reached */ 53 #define EXCP_HLT 257 /* hlt instruction reached */
46 #define EXCP_DEBUG 258 /* cpu stopped after a breakpoint or singlestep */ 54 #define EXCP_DEBUG 258 /* cpu stopped after a breakpoint or singlestep */
cpu-exec.c
@@ -191,7 +191,7 @@ int cpu_exec(CPUState *env1) @@ -191,7 +191,7 @@ int cpu_exec(CPUState *env1)
191 !(env->hflags & HF_INHIBIT_IRQ_MASK)) { 191 !(env->hflags & HF_INHIBIT_IRQ_MASK)) {
192 int intno; 192 int intno;
193 intno = cpu_x86_get_pic_interrupt(env); 193 intno = cpu_x86_get_pic_interrupt(env);
194 - if (loglevel) { 194 + if (loglevel & CPU_LOG_TB_IN_ASM) {
195 fprintf(logfile, "Servicing hardware INT=0x%02x\n", intno); 195 fprintf(logfile, "Servicing hardware INT=0x%02x\n", intno);
196 } 196 }
197 do_interrupt(intno, 0, 0, 0, 1); 197 do_interrupt(intno, 0, 0, 0, 1);
@@ -229,7 +229,7 @@ int cpu_exec(CPUState *env1) @@ -229,7 +229,7 @@ int cpu_exec(CPUState *env1)
229 } 229 }
230 } 230 }
231 #ifdef DEBUG_EXEC 231 #ifdef DEBUG_EXEC
232 - if (loglevel) { 232 + if (loglevel & CPU_LOG_EXEC) {
233 #if defined(TARGET_I386) 233 #if defined(TARGET_I386)
234 /* restore flags in standard format */ 234 /* restore flags in standard format */
235 env->regs[R_EAX] = EAX; 235 env->regs[R_EAX] = EAX;
@@ -362,7 +362,7 @@ int cpu_exec(CPUState *env1) @@ -362,7 +362,7 @@ int cpu_exec(CPUState *env1)
362 spin_unlock(&tb_lock); 362 spin_unlock(&tb_lock);
363 } 363 }
364 #ifdef DEBUG_EXEC 364 #ifdef DEBUG_EXEC
365 - if (loglevel) { 365 + if (loglevel & CPU_LOG_EXEC) {
366 fprintf(logfile, "Trace 0x%08lx [0x%08lx] %s\n", 366 fprintf(logfile, "Trace 0x%08lx [0x%08lx] %s\n",
367 (long)tb->tc_ptr, (long)tb->pc, 367 (long)tb->tc_ptr, (long)tb->pc,
368 lookup_symbol((void *)tb->pc)); 368 lookup_symbol((void *)tb->pc));
dyngen-exec.h
@@ -45,16 +45,6 @@ typedef signed long long int64_t; @@ -45,16 +45,6 @@ typedef signed long long int64_t;
45 #define UINT32_MAX (4294967295U) 45 #define UINT32_MAX (4294967295U)
46 #define UINT64_MAX ((uint64_t)(18446744073709551615)) 46 #define UINT64_MAX ((uint64_t)(18446744073709551615))
47 47
48 -#define bswap32(x) \  
49 -({ \  
50 - uint32_t __x = (x); \  
51 - ((uint32_t)( \  
52 - (((uint32_t)(__x) & (uint32_t)0x000000ffUL) << 24) | \  
53 - (((uint32_t)(__x) & (uint32_t)0x0000ff00UL) << 8) | \  
54 - (((uint32_t)(__x) & (uint32_t)0x00ff0000UL) >> 8) | \  
55 - (((uint32_t)(__x) & (uint32_t)0xff000000UL) >> 24) )); \  
56 -})  
57 -  
58 typedef struct FILE FILE; 48 typedef struct FILE FILE;
59 extern int fprintf(FILE *, const char *, ...); 49 extern int fprintf(FILE *, const char *, ...);
60 extern int printf(const char *, ...); 50 extern int printf(const char *, ...);
@@ -1005,6 +1005,61 @@ void cpu_interrupt(CPUState *env, int mask) @@ -1005,6 +1005,61 @@ void cpu_interrupt(CPUState *env, int mask)
1005 } 1005 }
1006 } 1006 }
1007 1007
  1008 +CPULogItem cpu_log_items[] = {
  1009 + { CPU_LOG_TB_OUT_ASM, "out_asm",
  1010 + "show generated host assembly code for each compiled TB" },
  1011 + { CPU_LOG_TB_IN_ASM, "in_asm",
  1012 + "show target assembly code for each compiled TB" },
  1013 + { CPU_LOG_TB_OP, "op",
  1014 + "show micro ops for each compiled TB (only usable if 'in_asm' used)" },
  1015 +#ifdef TARGET_I386
  1016 + { CPU_LOG_TB_OP_OPT, "op_opt",
  1017 + "show micro ops after optimization for each compiled TB" },
  1018 +#endif
  1019 + { CPU_LOG_INT, "int",
  1020 + "show interrupts/exceptions in short format" },
  1021 + { CPU_LOG_EXEC, "exec",
  1022 + "show trace before each executed TB (lots of logs)" },
  1023 +#ifdef TARGET_I386
  1024 + { CPU_LOG_PCALL, "pcall",
  1025 + "show protected mode far calls/returns/exceptions" },
  1026 +#endif
  1027 + { 0, NULL, NULL },
  1028 +};
  1029 +
  1030 +static int cmp1(const char *s1, int n, const char *s2)
  1031 +{
  1032 + if (strlen(s2) != n)
  1033 + return 0;
  1034 + return memcmp(s1, s2, n) == 0;
  1035 +}
  1036 +
  1037 +/* takes a comma separated list of log masks. Return 0 if error. */
  1038 +int cpu_str_to_log_mask(const char *str)
  1039 +{
  1040 + CPULogItem *item;
  1041 + int mask;
  1042 + const char *p, *p1;
  1043 +
  1044 + p = str;
  1045 + mask = 0;
  1046 + for(;;) {
  1047 + p1 = strchr(p, ',');
  1048 + if (!p1)
  1049 + p1 = p + strlen(p);
  1050 + for(item = cpu_log_items; item->mask != 0; item++) {
  1051 + if (cmp1(p, p1 - p, item->name))
  1052 + goto found;
  1053 + }
  1054 + return 0;
  1055 + found:
  1056 + mask |= item->mask;
  1057 + if (*p1 != ',')
  1058 + break;
  1059 + p = p1 + 1;
  1060 + }
  1061 + return mask;
  1062 +}
1008 1063
1009 void cpu_abort(CPUState *env, const char *fmt, ...) 1064 void cpu_abort(CPUState *env, const char *fmt, ...)
1010 { 1065 {
gdbstub.c
@@ -27,9 +27,7 @@ @@ -27,9 +27,7 @@
27 #include <netinet/tcp.h> 27 #include <netinet/tcp.h>
28 #include <signal.h> 28 #include <signal.h>
29 29
30 -#include "config.h"  
31 #include "cpu.h" 30 #include "cpu.h"
32 -#include "thunk.h"  
33 #include "exec-all.h" 31 #include "exec-all.h"
34 32
35 //#define DEBUG_GDB 33 //#define DEBUG_GDB
@@ -525,26 +523,8 @@ int cpu_gdbstub(void *opaque, int (*main_loop)(void *opaque), int port) @@ -525,26 +523,8 @@ int cpu_gdbstub(void *opaque, int (*main_loop)(void *opaque), int port)
525 goto breakpoint_error; 523 goto breakpoint_error;
526 } 524 }
527 break; 525 break;
528 - case 'Q':  
529 - if (!strncmp(p, "Tinit", 5)) {  
530 - /* init traces */  
531 - put_packet("OK");  
532 - } else if (!strncmp(p, "TStart", 6)) {  
533 - /* start log (gdb 'tstart' command) */  
534 - env = cpu_gdbstub_get_env(opaque);  
535 - tb_flush(env);  
536 - cpu_set_log(CPU_LOG_ALL);  
537 - put_packet("OK");  
538 - } else if (!strncmp(p, "TStop", 5)) {  
539 - /* stop log (gdb 'tstop' command) */  
540 - cpu_set_log(0);  
541 - put_packet("OK");  
542 - } else {  
543 - goto unknown_command;  
544 - }  
545 - break;  
546 default: 526 default:
547 - unknown_command: 527 + // unknown_command:
548 /* put empty packet */ 528 /* put empty packet */
549 buf[0] = '\0'; 529 buf[0] = '\0';
550 put_packet(buf); 530 put_packet(buf);
monitor.c
@@ -118,6 +118,14 @@ static void help_cmd(const char *name) @@ -118,6 +118,14 @@ static void help_cmd(const char *name)
118 help_cmd1(info_cmds, "info ", NULL); 118 help_cmd1(info_cmds, "info ", NULL);
119 } else { 119 } else {
120 help_cmd1(term_cmds, "", name); 120 help_cmd1(term_cmds, "", name);
  121 + if (name && !strcmp(name, "log")) {
  122 + CPULogItem *item;
  123 + term_printf("Log items (comma separated):\n");
  124 + term_printf("%-10s %s\n", "none", "remove all logs");
  125 + for(item = cpu_log_items; item->mask != 0; item++) {
  126 + term_printf("%-10s %s\n", item->name, item->help);
  127 + }
  128 + }
121 } 129 }
122 } 130 }
123 131
@@ -254,6 +262,25 @@ static void do_screen_dump(int argc, const char **argv) @@ -254,6 +262,25 @@ static void do_screen_dump(int argc, const char **argv)
254 vga_screen_dump(argv[1]); 262 vga_screen_dump(argv[1]);
255 } 263 }
256 264
  265 +static void do_log(int argc, const char **argv)
  266 +{
  267 + int mask;
  268 +
  269 + if (argc != 2)
  270 + goto help;
  271 + if (!strcmp(argv[1], "none")) {
  272 + mask = 0;
  273 + } else {
  274 + mask = cpu_str_to_log_mask(argv[1]);
  275 + if (!mask) {
  276 + help:
  277 + help_cmd(argv[0]);
  278 + return;
  279 + }
  280 + }
  281 + cpu_set_log(mask);
  282 +}
  283 +
257 static term_cmd_t term_cmds[] = { 284 static term_cmd_t term_cmds[] = {
258 { "help|?", do_help, 285 { "help|?", do_help,
259 "[cmd]", "show the help" }, 286 "[cmd]", "show the help" },
@@ -269,7 +296,9 @@ static term_cmd_t term_cmds[] = { @@ -269,7 +296,9 @@ static term_cmd_t term_cmds[] = {
269 "device filename", "change a removable media" }, 296 "device filename", "change a removable media" },
270 { "screendump", do_screen_dump, 297 { "screendump", do_screen_dump,
271 "filename", "save screen into PPM image 'filename'" }, 298 "filename", "save screen into PPM image 'filename'" },
272 - { NULL, NULL, }, 299 + { "log", do_log,
  300 + "item1[,...]", "activate logging of the specified items to '/tmp/qemu.log'" },
  301 + { NULL, NULL, },
273 }; 302 };
274 303
275 static term_cmd_t info_cmds[] = { 304 static term_cmd_t info_cmds[] = {
@@ -488,7 +517,6 @@ void term_print_help(void) @@ -488,7 +517,6 @@ void term_print_help(void)
488 term_printf("\n" 517 term_printf("\n"
489 "C-a h print this help\n" 518 "C-a h print this help\n"
490 "C-a x exit emulatior\n" 519 "C-a x exit emulatior\n"
491 - "C-a d switch on/off debug log\n"  
492 "C-a s save disk data back to file (if -snapshot)\n" 520 "C-a s save disk data back to file (if -snapshot)\n"
493 "C-a b send break (magic sysrq)\n" 521 "C-a b send break (magic sysrq)\n"
494 "C-a c switch between console and monitor\n" 522 "C-a c switch between console and monitor\n"
@@ -533,9 +561,6 @@ static void term_received_byte(int ch) @@ -533,9 +561,6 @@ static void term_received_byte(int ch)
533 term_command = 0; 561 term_command = 0;
534 } 562 }
535 break; 563 break;
536 - case 'd':  
537 - cpu_set_log(CPU_LOG_ALL);  
538 - break;  
539 case TERM_ESCAPE: 564 case TERM_ESCAPE:
540 goto send_char; 565 goto send_char;
541 } 566 }
@@ -558,7 +583,7 @@ static int term_can_read(void *opaque) @@ -558,7 +583,7 @@ static int term_can_read(void *opaque)
558 if (serial_console) { 583 if (serial_console) {
559 return serial_can_receive(serial_console); 584 return serial_can_receive(serial_console);
560 } else { 585 } else {
561 - return 1; 586 + return 128;
562 } 587 }
563 } 588 }
564 589
@@ -23,83 +23,6 @@ @@ -23,83 +23,6 @@
23 #include <inttypes.h> 23 #include <inttypes.h>
24 #include "cpu.h" 24 #include "cpu.h"
25 25
26 -#include "bswap.h"  
27 -  
28 -#if defined(WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN)  
29 -#define BSWAP_NEEDED  
30 -#endif  
31 -  
32 -#ifdef BSWAP_NEEDED  
33 -  
34 -static inline uint16_t tswap16(uint16_t s)  
35 -{  
36 - return bswap16(s);  
37 -}  
38 -  
39 -static inline uint32_t tswap32(uint32_t s)  
40 -{  
41 - return bswap32(s);  
42 -}  
43 -  
44 -static inline uint64_t tswap64(uint64_t s)  
45 -{  
46 - return bswap64(s);  
47 -}  
48 -  
49 -static inline void tswap16s(uint16_t *s)  
50 -{  
51 - *s = bswap16(*s);  
52 -}  
53 -  
54 -static inline void tswap32s(uint32_t *s)  
55 -{  
56 - *s = bswap32(*s);  
57 -}  
58 -  
59 -static inline void tswap64s(uint64_t *s)  
60 -{  
61 - *s = bswap64(*s);  
62 -}  
63 -  
64 -#else  
65 -  
66 -static inline uint16_t tswap16(uint16_t s)  
67 -{  
68 - return s;  
69 -}  
70 -  
71 -static inline uint32_t tswap32(uint32_t s)  
72 -{  
73 - return s;  
74 -}  
75 -  
76 -static inline uint64_t tswap64(uint64_t s)  
77 -{  
78 - return s;  
79 -}  
80 -  
81 -static inline void tswap16s(uint16_t *s)  
82 -{  
83 -}  
84 -  
85 -static inline void tswap32s(uint32_t *s)  
86 -{  
87 -}  
88 -  
89 -static inline void tswap64s(uint64_t *s)  
90 -{  
91 -}  
92 -  
93 -#endif  
94 -  
95 -#if TARGET_LONG_SIZE == 4  
96 -#define tswapl(s) tswap32(s)  
97 -#define tswapls(s) tswap32s((uint32_t *)(s))  
98 -#else  
99 -#define tswapl(s) tswap64(s)  
100 -#define tswapls(s) tswap64s((uint64_t *)(s))  
101 -#endif  
102 -  
103 /* types enums definitions */ 26 /* types enums definitions */
104 27
105 typedef enum argtype { 28 typedef enum argtype {
translate-all.c
@@ -129,7 +129,7 @@ int cpu_gen_code(CPUState *env, TranslationBlock *tb, @@ -129,7 +129,7 @@ int cpu_gen_code(CPUState *env, TranslationBlock *tb,
129 } 129 }
130 *gen_code_size_ptr = gen_code_size; 130 *gen_code_size_ptr = gen_code_size;
131 #ifdef DEBUG_DISAS 131 #ifdef DEBUG_DISAS
132 - if (loglevel) { 132 + if (loglevel & CPU_LOG_TB_OUT_ASM) {
133 fprintf(logfile, "OUT: [size=%d]\n", *gen_code_size_ptr); 133 fprintf(logfile, "OUT: [size=%d]\n", *gen_code_size_ptr);
134 disas(logfile, tb->tc_ptr, *gen_code_size_ptr, 1, 0); 134 disas(logfile, tb->tc_ptr, *gen_code_size_ptr, 1, 0);
135 fprintf(logfile, "\n"); 135 fprintf(logfile, "\n");
@@ -186,7 +186,7 @@ int cpu_restore_state(TranslationBlock *tb, @@ -186,7 +186,7 @@ int cpu_restore_state(TranslationBlock *tb,
186 { 186 {
187 int cc_op; 187 int cc_op;
188 #ifdef DEBUG_DISAS 188 #ifdef DEBUG_DISAS
189 - if (loglevel) { 189 + if (loglevel & CPU_LOG_TB_OP) {
190 int i; 190 int i;
191 fprintf(logfile, "RESTORE:\n"); 191 fprintf(logfile, "RESTORE:\n");
192 for(i=0;i<=j; i++) { 192 for(i=0;i<=j; i++) {
@@ -47,7 +47,6 @@ @@ -47,7 +47,6 @@
47 #include <linux/if_tun.h> 47 #include <linux/if_tun.h>
48 48
49 #include "disas.h" 49 #include "disas.h"
50 -#include "thunk.h"  
51 50
52 #include "vl.h" 51 #include "vl.h"
53 52
@@ -801,7 +800,7 @@ void help(void) @@ -801,7 +800,7 @@ void help(void)
801 "Debug/Expert options:\n" 800 "Debug/Expert options:\n"
802 "-s wait gdb connection to port %d\n" 801 "-s wait gdb connection to port %d\n"
803 "-p port change gdb connection port\n" 802 "-p port change gdb connection port\n"
804 - "-d output log to %s\n" 803 + "-d item1,... output log to %s (use -d ? for a list of log items)\n"
805 "-hdachs c,h,s force hard disk 0 geometry (usually qemu can guess it)\n" 804 "-hdachs c,h,s force hard disk 0 geometry (usually qemu can guess it)\n"
806 "-L path set the directory for the BIOS and VGA BIOS\n" 805 "-L path set the directory for the BIOS and VGA BIOS\n"
807 #ifdef USE_CODE_COPY 806 #ifdef USE_CODE_COPY
@@ -916,7 +915,7 @@ int main(int argc, char **argv) @@ -916,7 +915,7 @@ int main(int argc, char **argv)
916 } 915 }
917 916
918 for(;;) { 917 for(;;) {
919 - c = getopt_long_only(argc, argv, "hm:dn:sp:L:", long_options, &long_index); 918 + c = getopt_long_only(argc, argv, "hm:d:n:sp:L:", long_options, &long_index);
920 if (c == -1) 919 if (c == -1)
921 break; 920 break;
922 switch(c) { 921 switch(c) {
@@ -1037,7 +1036,20 @@ int main(int argc, char **argv) @@ -1037,7 +1036,20 @@ int main(int argc, char **argv)
1037 } 1036 }
1038 break; 1037 break;
1039 case 'd': 1038 case 'd':
1040 - cpu_set_log(CPU_LOG_ALL); 1039 + {
  1040 + int mask;
  1041 + CPULogItem *item;
  1042 +
  1043 + mask = cpu_str_to_log_mask(optarg);
  1044 + if (!mask) {
  1045 + printf("Log items (comma separated):\n");
  1046 + for(item = cpu_log_items; item->mask != 0; item++) {
  1047 + printf("%-10s %s\n", item->name, item->help);
  1048 + }
  1049 + exit(1);
  1050 + }
  1051 + cpu_set_log(mask);
  1052 + }
1041 break; 1053 break;
1042 case 'n': 1054 case 'n':
1043 pstrcpy(network_script, sizeof(network_script), optarg); 1055 pstrcpy(network_script, sizeof(network_script), optarg);