mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
qemu-log: move logging to qemu-log.c
Move logging functions from exec.c to qemu-log.c, compile it only once. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
7798a8828a
commit
5726c27fa9
5 changed files with 170 additions and 151 deletions
28
qemu-log.h
28
qemu-log.h
|
@ -5,7 +5,6 @@
|
|||
extern FILE *logfile;
|
||||
extern int loglevel;
|
||||
|
||||
|
||||
/*
|
||||
* The new API:
|
||||
*
|
||||
|
@ -17,11 +16,21 @@ extern int loglevel;
|
|||
*/
|
||||
#define qemu_log_enabled() (logfile != NULL)
|
||||
|
||||
#define CPU_LOG_TB_OUT_ASM (1 << 0)
|
||||
#define CPU_LOG_TB_IN_ASM (1 << 1)
|
||||
#define CPU_LOG_TB_OP (1 << 2)
|
||||
#define CPU_LOG_TB_OP_OPT (1 << 3)
|
||||
#define CPU_LOG_INT (1 << 4)
|
||||
#define CPU_LOG_EXEC (1 << 5)
|
||||
#define CPU_LOG_PCALL (1 << 6)
|
||||
#define CPU_LOG_IOPORT (1 << 7)
|
||||
#define CPU_LOG_TB_CPU (1 << 8)
|
||||
#define CPU_LOG_RESET (1 << 9)
|
||||
|
||||
/* Returns true if a bit is set in the current loglevel mask
|
||||
*/
|
||||
#define qemu_loglevel_mask(b) ((loglevel & (b)) != 0)
|
||||
|
||||
|
||||
/* Logging functions: */
|
||||
|
||||
/* main logging function
|
||||
|
@ -46,8 +55,6 @@ extern int loglevel;
|
|||
} while (0)
|
||||
|
||||
|
||||
|
||||
|
||||
/* Special cases: */
|
||||
|
||||
#ifdef NEED_CPU_H
|
||||
|
@ -68,7 +75,6 @@ extern int loglevel;
|
|||
#endif
|
||||
|
||||
|
||||
|
||||
/* Maintenance: */
|
||||
|
||||
/* fflush() the log file */
|
||||
|
@ -91,5 +97,17 @@ extern int loglevel;
|
|||
logfile = (f); \
|
||||
} while (0)
|
||||
|
||||
/* define log items */
|
||||
typedef struct CPULogItem {
|
||||
int mask;
|
||||
const char *name;
|
||||
const char *help;
|
||||
} CPULogItem;
|
||||
|
||||
extern const CPULogItem cpu_log_items[];
|
||||
|
||||
void cpu_set_log(int log_flags);
|
||||
void cpu_set_log_filename(const char *filename);
|
||||
int cpu_str_to_log_mask(const char *str);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue