log: do not unnecessarily include qom/cpu.h

Split the bits that require it to exec/log.h.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Message-id: 1452174932-28657-8-git-send-email-den@openvz.org
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
Paolo Bonzini 2016-01-07 16:55:28 +03:00 committed by Stefan Hajnoczi
parent e9527dd399
commit 508127e243
41 changed files with 99 additions and 59 deletions

View File

@ -33,6 +33,7 @@
#include "tcg.h"
#include "qemu/timer.h"
#include "qemu/envlist.h"
#include "exec/log.h"
int singlestep;
unsigned long mmap_min_addr;

View File

@ -27,6 +27,7 @@
#include "exec/address-spaces.h"
#include "qemu/rcu.h"
#include "exec/tb-hash.h"
#include "exec/log.h"
#if defined(TARGET_I386) && !defined(CONFIG_USER_ONLY)
#include "hw/i386/apic.h"
#endif

1
exec.c
View File

@ -52,6 +52,7 @@
#include "exec/memory-internal.h"
#include "exec/ram_addr.h"
#include "exec/log.h"
#include "qemu/range.h"
#ifndef _WIN32

View File

@ -12,6 +12,7 @@
#include "qemu/osdep.h"
#include "hw/hw.h"
#include "hw/acpi/cpu_hotplug.h"
#include "qom/cpu.h"
static uint64_t cpu_status_read(void *opaque, hwaddr addr, unsigned int size)
{

View File

@ -25,6 +25,7 @@
#include "qemu/timer.h"
#include "qemu/bitops.h"
#include "qemu/log.h"
#include "qom/cpu.h"
#ifndef A9_GTIMER_ERR_DEBUG
#define A9_GTIMER_ERR_DEBUG 0

60
include/exec/log.h Normal file
View File

@ -0,0 +1,60 @@
#ifndef QEMU_EXEC_LOG_H
#define QEMU_EXEC_LOG_H
#include "qemu/log.h"
#include "qom/cpu.h"
#include "disas/disas.h"
/* cpu_dump_state() logging functions: */
/**
* log_cpu_state:
* @cpu: The CPU whose state is to be logged.
* @flags: Flags what to log.
*
* Logs the output of cpu_dump_state().
*/
static inline void log_cpu_state(CPUState *cpu, int flags)
{
if (qemu_log_enabled()) {
cpu_dump_state(cpu, qemu_logfile, fprintf, flags);
}
}
/**
* log_cpu_state_mask:
* @mask: Mask when to log.
* @cpu: The CPU whose state is to be logged.
* @flags: Flags what to log.
*
* Logs the output of cpu_dump_state() if loglevel includes @mask.
*/
static inline void log_cpu_state_mask(int mask, CPUState *cpu, int flags)
{
if (qemu_loglevel & mask) {
log_cpu_state(cpu, flags);
}
}
#ifdef NEED_CPU_H
/* disas() and target_disas() to qemu_logfile: */
static inline void log_target_disas(CPUState *cpu, target_ulong start,
target_ulong len, int flags)
{
target_disas(qemu_logfile, cpu, start, len, flags);
}
static inline void log_disas(void *code, unsigned long size)
{
disas(qemu_logfile, code, size);
}
#if defined(CONFIG_USER_ONLY)
/* page_dump() output to the log file: */
static inline void log_page_dump(void)
{
page_dump(qemu_logfile);
}
#endif
#endif
#endif

View File

@ -5,10 +5,6 @@
#include <stdbool.h>
#include <stdio.h>
#include "qemu/compiler.h"
#include "qom/cpu.h"
#ifdef NEED_CPU_H
#include "disas/disas.h"
#endif
/* Private global variables, don't use */
extern FILE *qemu_logfile;
@ -78,61 +74,6 @@ qemu_log_vprintf(const char *fmt, va_list va)
void GCC_FMT_ATTR(2, 3) qemu_log_mask(int mask, const char *fmt, ...);
/* Special cases: */
/* cpu_dump_state() logging functions: */
/**
* log_cpu_state:
* @cpu: The CPU whose state is to be logged.
* @flags: Flags what to log.
*
* Logs the output of cpu_dump_state().
*/
static inline void log_cpu_state(CPUState *cpu, int flags)
{
if (qemu_log_enabled()) {
cpu_dump_state(cpu, qemu_logfile, fprintf, flags);
}
}
/**
* log_cpu_state_mask:
* @mask: Mask when to log.
* @cpu: The CPU whose state is to be logged.
* @flags: Flags what to log.
*
* Logs the output of cpu_dump_state() if loglevel includes @mask.
*/
static inline void log_cpu_state_mask(int mask, CPUState *cpu, int flags)
{
if (qemu_loglevel & mask) {
log_cpu_state(cpu, flags);
}
}
#ifdef NEED_CPU_H
/* disas() and target_disas() to qemu_logfile: */
static inline void log_target_disas(CPUState *cpu, target_ulong start,
target_ulong len, int flags)
{
target_disas(qemu_logfile, cpu, start, len, flags);
}
static inline void log_disas(void *code, unsigned long size)
{
disas(qemu_logfile, code, size);
}
#if defined(CONFIG_USER_ONLY)
/* page_dump() output to the log file: */
static inline void log_page_dump(void)
{
page_dump(qemu_logfile);
}
#endif
#endif
/* Maintenance: */
/* fflush() the log file */

View File

@ -28,6 +28,7 @@
#include "qemu/timer.h"
#include "qemu/envlist.h"
#include "elf.h"
#include "exec/log.h"
char *exec_path;

View File

@ -23,6 +23,7 @@
#include "sysemu/kvm.h"
#include "qemu/notify.h"
#include "qemu/log.h"
#include "exec/log.h"
#include "qemu/error-report.h"
#include "sysemu/sysemu.h"

View File

@ -28,6 +28,7 @@
#include "exec/helper-gen.h"
#include "trace-tcg.h"
#include "exec/log.h"
#undef ALPHA_DEBUG_DISAS

View File

@ -31,6 +31,7 @@
#include "exec/helper-proto.h"
#include "exec/helper-gen.h"
#include "exec/log.h"
#include "trace-tcg.h"

View File

@ -32,6 +32,7 @@
#include "exec/helper-gen.h"
#include "trace-tcg.h"
#include "exec/log.h"
#define ENABLE_ARCH_4T arm_dc_feature(s, ARM_FEATURE_V4T)

View File

@ -35,6 +35,7 @@
#include "exec/helper-gen.h"
#include "trace-tcg.h"
#include "exec/log.h"
#define DISAS_CRIS 0

View File

@ -23,6 +23,7 @@
#include "qemu/log.h"
#include "exec/helper-proto.h"
#include "exec/cpu_ldst.h"
#include "exec/log.h"
//#define DEBUG_PCALL

View File

@ -20,6 +20,7 @@
#include "qemu/osdep.h"
#include "cpu.h"
#include "exec/helper-proto.h"
#include "exec/log.h"
/* SMM support */

View File

@ -28,6 +28,7 @@
#include "exec/helper-gen.h"
#include "trace-tcg.h"
#include "exec/log.h"
#define PREFIX_REPZ 0x01

View File

@ -22,6 +22,7 @@
#include "qemu/host-utils.h"
#include "sysemu/sysemu.h"
#include "exec/semihost.h"
#include "exec/log.h"
int lm32_cpu_handle_mmu_fault(CPUState *cs, vaddr address, int rw,
int mmu_idx)

View File

@ -29,6 +29,7 @@
#include "exec/helper-gen.h"
#include "trace-tcg.h"
#include "exec/log.h"
#define DISAS_LM32 1

View File

@ -29,6 +29,7 @@
#include "exec/helper-gen.h"
#include "trace-tcg.h"
#include "exec/log.h"
//#define DEBUG_DISPATCH 1

View File

@ -21,6 +21,7 @@
#include "qemu/osdep.h"
#include "cpu.h"
#include "qemu/host-utils.h"
#include "exec/log.h"
#define D(x)

View File

@ -28,6 +28,7 @@
#include "exec/helper-gen.h"
#include "trace-tcg.h"
#include "exec/log.h"
#define SIM_COMPAT 0

View File

@ -21,6 +21,7 @@
#include "cpu.h"
#include "sysemu/kvm.h"
#include "exec/cpu_ldst.h"
#include "exec/log.h"
enum {
TLBRET_XI = -6,

View File

@ -33,6 +33,7 @@
#include "exec/semihost.h"
#include "trace-tcg.h"
#include "exec/log.h"
#define MIPS_DEBUG_DISAS 0

View File

@ -31,6 +31,7 @@
#include "exec/helper-proto.h"
#include "exec/helper-gen.h"
#include "exec/log.h"
/* This is the state at translation time. */
typedef struct DisasContext {

View File

@ -32,6 +32,7 @@
#include "exec/helper-gen.h"
#include "trace-tcg.h"
#include "exec/log.h"
#define OPENRISC_DISAS

View File

@ -24,6 +24,7 @@
#include "sysemu/kvm.h"
#include "kvm_ppc.h"
#include "mmu-hash32.h"
#include "exec/log.h"
//#define DEBUG_BAT

View File

@ -25,6 +25,7 @@
#include "qemu/error-report.h"
#include "kvm_ppc.h"
#include "mmu-hash64.h"
#include "exec/log.h"
//#define DEBUG_SLB

View File

@ -24,6 +24,7 @@
#include "mmu-hash64.h"
#include "mmu-hash32.h"
#include "exec/cpu_ldst.h"
#include "exec/log.h"
//#define DEBUG_MMU
//#define DEBUG_BATS

View File

@ -29,6 +29,7 @@
#include "exec/helper-gen.h"
#include "trace-tcg.h"
#include "exec/log.h"
#define CPU_SINGLE_STEP 0x1

View File

@ -44,6 +44,7 @@ static TCGv_ptr cpu_env;
#include "exec/helper-gen.h"
#include "trace-tcg.h"
#include "exec/log.h"
/* Information that (most) every instruction needs to manipulate. */

View File

@ -19,6 +19,7 @@
#include "qemu/osdep.h"
#include "cpu.h"
#include "exec/log.h"
#if !defined(CONFIG_USER_ONLY)
#include "hw/sh4/sh_intc.h"

View File

@ -29,6 +29,7 @@
#include "exec/helper-gen.h"
#include "trace-tcg.h"
#include "exec/log.h"
typedef struct DisasContext {

View File

@ -21,6 +21,7 @@
#include "cpu.h"
#include "trace.h"
#include "sysemu/sysemu.h"
#include "exec/log.h"
#define DEBUG_PCALL

View File

@ -20,6 +20,7 @@
#include "qemu/osdep.h"
#include "cpu.h"
#include "exec/helper-proto.h"
#include "exec/log.h"
#include "trace.h"
#define DEBUG_PCALL

View File

@ -29,6 +29,7 @@
#include "exec/helper-gen.h"
#include "trace-tcg.h"
#include "exec/log.h"
#define DEBUG_DISAS

View File

@ -21,6 +21,7 @@
#include "qemu/osdep.h"
#include "cpu.h"
#include "qemu/log.h"
#include "exec/log.h"
#include "disas/disas.h"
#include "tcg-op.h"
#include "exec/cpu_ldst.h"

View File

@ -28,6 +28,7 @@
#include "exec/helper-gen.h"
#include "tricore-opcodes.h"
#include "exec/log.h"
/*
* TCG registers

View File

@ -20,6 +20,7 @@
#include "exec/helper-gen.h"
#include "trace-tcg.h"
#include "exec/log.h"
/* internal defines */

View File

@ -43,6 +43,7 @@
#include "exec/helper-gen.h"
#include "trace-tcg.h"
#include "exec/log.h"
typedef struct DisasContext {

View File

@ -60,6 +60,7 @@
#endif
#include "elf.h"
#include "exec/log.h"
/* Forward declarations for functions declared in tcg-target.c and used here. */
static void tcg_target_init(TCGContext *s);

View File

@ -55,6 +55,7 @@
#include "translate-all.h"
#include "qemu/bitmap.h"
#include "qemu/timer.h"
#include "exec/log.h"
//#define DEBUG_TB_INVALIDATE
//#define DEBUG_FLUSH