misc: Add trailing '\n' to qemu_log() calls
cover misc: Add trailing '\n' to qemu_log() calls
Nothing very exciting here.
I sometimes miss to notice some trace events, running with -d unimp,trace... then using 'grep ^...'. This is only due to a missing '\n' :)
Philippe Mathieu-Daudé (11):
hw/sd/milkymist-memcard: Add trailing '\n' to qemu_log() call hw/digic: Add trailing '\n' to qemu_log() calls
xilinx-dp: Add trailing '\n' to qemu_log() call ppc/pnv: Add trailing '\n' to qemu_log() calls hw/core/register: Add trailing '\n' to qemu_log() call hw/mips/boston: Add trailing '\n' to qemu_log() calls
stellaris: Add trailing '\n' to qemu_log() calls target/arm: Add trailing '\n' to qemu_log() calls target/m68k: Add trailing '\n' to qemu_log() call
RISC-V: Add trailing '\n' to qemu_log() calls
RFC target/xtensa: Add trailing '\n' to qemu_log() calls
hw/arm/stellaris.c | 11 ++++++----- hw/char/digic-uart.c | 4 ++-- hw/core/register.c | 2 +- hw/display/xlnx_dp.c | 4 +++- hw/mips/boston.c | 8 ++++---- hw/ppc/pnv_core.c | 4 ++-- hw/sd/milkymist-memcard.c | 2 +- hw/timer/digic-timer.c | 4 ++-- target/arm/helper.c | 4 ++-- target/m68k/translate.c | 2 +- target/riscv/op_helper.c | 6 ++++-- target/xtensa/translate.c | 6 +++--- 12 files changed, 31 insertions(+), 26 deletions(-)
Signature · 1 line
2.17.1
PATCH 1/11 hw/sd/milkymist-memcard: Add trailing '\n' to qemu_log() call
--- hw/sd/milkymist-memcard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/sd/milkymist-memcard.c +1 -1
@@ -140,7 +140,7 @@ static uint64_t memcard_read(void *opaque, hwaddr addr, r = s->response[s->response_read_ptr++];if (s->response_read_ptr > s->response_len) {qemu_log_mask (LOG_GUEST_ERROR ,"milkymist_memcard: " -"read more cmd bytes than available. Clipping." ); +"read more cmd bytes than available: clipping\n" ); s->response_read_ptr =0 ; } }
Signature · 1 line
2.17.1
PATCH 2/11 hw/digic: Add trailing '\n' to qemu_log() calls
In reply to Philippe Mathieu-Daudé--- hw/char/digic-uart.c | 4 ++-- hw/timer/digic-timer.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
hw/char/digic-uart.c +2 -2
@@ -60,7 +60,7 @@ static uint64_t digic_uart_read(void *opaque, hwaddr addr,default :qemu_log_mask (LOG_UNIMP ,"digic-uart: read access to unknown register 0x" - TARGET_FMT_plx, addr <<2 ); + TARGET_FMT_plx"\n" , addr <<2 ); }return ret;
@@ -98,7 +98,7 @@ static void digic_uart_write(void *opaque, hwaddr addr, uint64_t value,default :qemu_log_mask (LOG_UNIMP ,"digic-uart: write access to unknown register 0x" - TARGET_FMT_plx, addr <<2 ); + TARGET_FMT_plx"\n" , addr <<2 ); } }
hw/timer/digic-timer.c +2 -2
@@ -73,7 +73,7 @@ static uint64_t digic_timer_read(void *opaque, hwaddr offset, unsigned size)default :qemu_log_mask (LOG_UNIMP ,"digic-timer: read access to unknown register 0x" - TARGET_FMT_plx, offset); + TARGET_FMT_plx"\n" , offset); }return ret;
@@ -109,7 +109,7 @@ static void digic_timer_write(void *opaque, hwaddr offset,default :qemu_log_mask (LOG_UNIMP ,"digic-timer: read access to unknown register 0x" - TARGET_FMT_plx, offset); + TARGET_FMT_plx"\n" , offset); } }
Signature · 1 line
2.17.1
PATCH 3/11 xilinx-dp: Add trailing '\n' to qemu_log() call
In reply to Philippe Mathieu-Daudé--- hw/display/xlnx_dp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
hw/display/xlnx_dp.c +3 -1
@@ -1074,7 +1074,9 @@ static void xlnx_dp_avbufm_write(void *opaque, hwaddr offset, uint64_t value,case AV_BUF_STC_SNAPSHOT1 :case AV_BUF_HCOUNT_VCOUNT_INT0 :case AV_BUF_HCOUNT_VCOUNT_INT1 : -qemu_log_mask (LOG_UNIMP ,"avbufm: unimplmented" ); +qemu_log_mask (LOG_UNIMP ,"avbufm: unimplemented register 0x%04" + PRIx64"\n" , + offset <<2 );break ;default : s->avbufm_registers[offset] = value;
Signature · 1 line
2.17.1
Re: [Qemu-arm] [Qemu-devel] [PATCH 03/11] xilinx-dp: Add trailing '\n' to qemu_log() call
Quoted 1 line · Philippe Mathieu-Daudé
Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Alistair
Quoted 23 lines
--- hw/display/xlnx_dp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)hw/display/xlnx_dp.c +3
-2@@ -1074,7 +1074,9 @@ static void xlnx_dp_avbufm_write(void *opaque, hwaddr offset, uint64_t value,case AV_BUF_STC_SNAPSHOT1 :case AV_BUF_HCOUNT_VCOUNT_INT0 :case AV_BUF_HCOUNT_VCOUNT_INT1 : -qemu_log_mask (LOG_UNIMP ,"avbufm: unimplmented" ); +qemu_log_mask (LOG_UNIMP ,"avbufm: unimplemented register 0x%04" + PRIx64"\n" , + offset <<2 );break ;default : s->avbufm_registers[offset] = value; --2.17.1
PATCH 4/11 ppc/pnv: Add trailing '\n' to qemu_log() calls
In reply to Philippe Mathieu-Daudé--- hw/ppc/pnv_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/ppc/pnv_core.c +2 -2
@@ -97,7 +97,7 @@ static uint64_t pnv_core_xscom_read(void *opaque, hwaddr addr, val =0x24f000000000000ull ;break ;default : -qemu_log_mask (LOG_UNIMP ,"Warning: reading reg=0x%" HWADDR_PRIx, +qemu_log_mask (LOG_UNIMP ,"Warning: reading reg=0x%" HWADDR_PRIx"\n" , addr); }
@@ -107,7 +107,7 @@ static uint64_t pnv_core_xscom_read(void *opaque, hwaddr addr,static void pnv_core_xscom_write (void *opaque,hwaddr addr,uint64_t val,unsigned int width) { -qemu_log_mask (LOG_UNIMP ,"Warning: writing to reg=0x%" HWADDR_PRIx, +qemu_log_mask (LOG_UNIMP ,"Warning: writing to reg=0x%" HWADDR_PRIx"\n" , addr); }
Signature · 1 line
2.17.1
Re: [Qemu-devel] [PATCH 04/11] ppc/pnv: Add trailing '\n' to qemu_log() calls
Quoted 1 line · Philippe Mathieu-Daudé
Signed-off-by Philippe Mathieu-Daudé <[email protected]>
I'm not really sure what series this was part of, but I've applied it to ppc-for-3.0 anyway.
Quoted 26 lines
--- hw/ppc/pnv_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)hw/ppc/pnv_core.c +2
-2@@ -97,7 +97,7 @@ static uint64_t pnv_core_xscom_read(void *opaque, hwaddr addr, val =0x24f000000000000ull ;break ;default : -qemu_log_mask (LOG_UNIMP ,"Warning: reading reg=0x%" HWADDR_PRIx, +qemu_log_mask (LOG_UNIMP ,"Warning: reading reg=0x%" HWADDR_PRIx"\n" , addr); }@@ -107,7 +107,7 @@ static uint64_t pnv_core_xscom_read(void *opaque, hwaddr addr,static void pnv_core_xscom_write (void *opaque,hwaddr addr,uint64_t val,unsigned int width) { -qemu_log_mask (LOG_UNIMP ,"Warning: writing to reg=0x%" HWADDR_PRIx, +qemu_log_mask (LOG_UNIMP ,"Warning: writing to reg=0x%" HWADDR_PRIx"\n" , addr); }
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Re: [Qemu-devel] [PATCH 04/11] ppc/pnv: Add trailing '\n' to qemu_log() calls
Quoted 5 lines · David Gibson
Quoted 1 line · Philippe Mathieu-Daudé
Signed-off-by Philippe Mathieu-Daudé <[email protected]>I'm not really sure what series this was part of, but I've applied it to ppc-for-3.0 anyway.
I did an effort to split the series, then add all the recipients to the cover but I missed your mail indeed, sorry!
here is the cover:
http://lists.nongnu.org/archive/html/qemu-devel/2018-06/msg01266.html
Thanks!
Quoted 30 lines
Acked-by David Gibson <[email protected]>Quoted 26 lines
--- hw/ppc/pnv_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)hw/ppc/pnv_core.c +2
-2@@ -97,7 +97,7 @@ static uint64_t pnv_core_xscom_read(void *opaque, hwaddr addr, val =0x24f000000000000ull ;break ;default : -qemu_log_mask (LOG_UNIMP ,"Warning: reading reg=0x%" HWADDR_PRIx, +qemu_log_mask (LOG_UNIMP ,"Warning: reading reg=0x%" HWADDR_PRIx"\n" , addr); }@@ -107,7 +107,7 @@ static uint64_t pnv_core_xscom_read(void *opaque, hwaddr addr,static void pnv_core_xscom_write (void *opaque,hwaddr addr,uint64_t val,unsigned int width) { -qemu_log_mask (LOG_UNIMP ,"Warning: writing to reg=0x%" HWADDR_PRIx, +qemu_log_mask (LOG_UNIMP ,"Warning: writing to reg=0x%" HWADDR_PRIx"\n" , addr); }
PATCH 5/11 hw/core/register: Add trailing '\n' to qemu_log() call
In reply to Philippe Mathieu-Daudé--- hw/core/register.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/core/register.c +1 -1
@@ -96,7 +96,7 @@ void register_write(RegisterInfo *reg, uint64_t val, uint64_t we,if (test) {qemu_log_mask (LOG_UNIMP ,"%s:%s writing %#" PRIx64" to unimplemented bits:" \ -" %#" PRIx64"" , +" %#" PRIx64"\n" , prefix, reg->access->name, val, ac->unimp); }
Signature · 1 line
2.17.1
Re: [Qemu-devel] [PATCH 05/11] hw/core/register: Add trailing '\n' to qemu_log() call
Quoted 1 line · Philippe Mathieu-Daudé
Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Alistair
Quoted 21 lines
--- hw/core/register.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/core/register.c +1
-2@@ -96,7 +96,7 @@ void register_write(RegisterInfo *reg, uint64_t val, uint64_t we,if (test) {qemu_log_mask (LOG_UNIMP ,"%s:%s writing %#" PRIx64" to unimplemented bits:" \ -" %#" PRIx64"" , +" %#" PRIx64"\n" , prefix, reg->access->name, val, ac->unimp); } --2.17.1
PATCH 6/11 hw/mips/boston: Add trailing '\n' to qemu_log() calls
In reply to Philippe Mathieu-Daudé--- hw/mips/boston.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
hw/mips/boston.c +4 -4
@@ -176,7 +176,7 @@ static uint64_t boston_platreg_read(void *opaque, hwaddr addr,uint32_t gic_freq, val;if (size !=4 ) { -qemu_log_mask (LOG_UNIMP ,"%uB platform register read" , size); +qemu_log_mask (LOG_UNIMP ,"%uB platform register read\n" , size);return 0 ; }
@@ -205,7 +205,7 @@ static uint64_t boston_platreg_read(void *opaque, hwaddr addr, val |=PLAT_DDR_CFG_MHZ ;return val;default : -qemu_log_mask (LOG_UNIMP ,"Read platform register 0x%" HWADDR_PRIx, +qemu_log_mask (LOG_UNIMP ,"Read platform register 0x%" HWADDR_PRIx"\n" , addr &0xffff );return 0 ; }
@@ -215,7 +215,7 @@ static void boston_platreg_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) {if (size !=4 ) { -qemu_log_mask (LOG_UNIMP ,"%uB platform register write" , size); +qemu_log_mask (LOG_UNIMP ,"%uB platform register write\n" , size);return ; }
@@ -237,7 +237,7 @@ static void boston_platreg_write(void *opaque, hwaddr addr,break ;default :qemu_log_mask (LOG_UNIMP ,"Write platform register 0x%" HWADDR_PRIx -" = 0x%" PRIx64, addr &0xffff , val); +" = 0x%" PRIx64"\n" , addr &0xffff , val);break ; } }
Signature · 1 line
2.17.1
PATCH 7/11 stellaris: Add trailing '\n' to qemu_log() calls
In reply to Philippe Mathieu-Daudé--- hw/arm/stellaris.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
hw/arm/stellaris.c +6 -5
@@ -203,11 +203,11 @@ static uint64_t gptm_read(void *opaque, hwaddr offset,return s->rtc; }qemu_log_mask (LOG_UNIMP , -"GPTM: read of TAR but timer read not supported" ); +"GPTM: read of TAR but timer read not supported\n" );return 0 ;case 0x4c :/* TBR */ qemu_log_mask (LOG_UNIMP , -"GPTM: read of TBR but timer read not supported" ); +"GPTM: read of TBR but timer read not supported\n" );return 0 ;default : qemu_log_mask(LOG_GUEST_ERROR,
@@ -836,11 +836,12 @@ static void stellaris_i2c_write(void *opaque, hwaddr offset,break ;case 0x20 :/* MCR */ if (value &1 ) { -qemu_log_mask (LOG_UNIMP ,"stellaris_i2c: Loopback not implemented" ); +qemu_log_mask (LOG_UNIMP , +"stellaris_i2c: Loopback not implemented\n" ); }if (value &0x20 ) {qemu_log_mask (LOG_UNIMP , -"stellaris_i2c: Slave mode not implemented" ); +"stellaris_i2c: Slave mode not implemented\n" ); } s->mcr = value &0x31 ;break ;
@@ -1124,7 +1125,7 @@ static void stellaris_adc_write(void *opaque, hwaddr offset, s->sspri = value;break ;case 0x28 :/* PSSI */ -qemu_log_mask (LOG_UNIMP ,"ADC: sample initiate unimplemented" ); +qemu_log_mask (LOG_UNIMP ,"ADC: sample initiate unimplemented\n" );break ;case 0x30 :/* SAC */ s->sac = value;
Signature · 1 line
2.17.1
PATCH 8/11 target/arm: Add trailing '\n' to qemu_log() calls
In reply to Philippe Mathieu-Daudé--- target/arm/helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
target/arm/helper.c +2 -2
@@ -4570,7 +4570,7 @@ void hw_breakpoint_update(ARMCPU *cpu, int n)case 4 :/* unlinked address mismatch (reserved if AArch64) */ case 5 :/* linked address mismatch (reserved if AArch64) */ qemu_log_mask (LOG_UNIMP , -"arm: address mismatch breakpoint types not implemented" ); +"arm: address mismatch breakpoint types not implemented\n" );return ;case 0 :/* unlinked address match */ case 1 :/* linked address match */
@@ -4604,7 +4604,7 @@ void hw_breakpoint_update(ARMCPU *cpu, int n)case 8 :/* unlinked VMID match (reserved if no EL2) */ case 10 :/* unlinked context ID and VMID match (reserved if no EL2) */ qemu_log_mask (LOG_UNIMP , -"arm: unlinked context breakpoint types not implemented" ); +"arm: unlinked context breakpoint types not implemented\n" );return ;case 9 :/* linked VMID match (reserved if no EL2) */ case 11 :/* linked context ID and VMID match (reserved if no EL2) */
Signature · 1 line
2.17.1
PATCH 9/11 target/m68k: Add trailing '\n' to qemu_log() call
In reply to Philippe Mathieu-Daudé--- target/m68k/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/m68k/translate.c +1 -1
@@ -1556,7 +1556,7 @@ DISAS_INSN(undef)/* ??? This is both instructions that are as yet unimplemented for the 680x0 series, as well as those that are implemented but actually illegal for CPU32 or pre-68020. */ -qemu_log_mask (LOG_UNIMP ,"Illegal instruction: %04x @ %08x" , +qemu_log_mask (LOG_UNIMP ,"Illegal instruction: %04x @ %08x\n" , insn, s->insn_pc);gen_exception (s, s->insn_pc,EXCP_UNSUPPORTED ); }
Signature · 1 line
2.17.1
Re: [Qemu-devel] [PATCH 09/11] target/m68k: Add trailing '\n' to qemu_log() call
Le 06/06/2018 à 17:21, Philippe Mathieu-Daudé a écrit :
Quoted 11 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/m68k/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)target/m68k/translate.c +0
-0
target/m68k/translate.c DISAS_INSN(undef) · line 1562
Quoted 8 lines
target/m68k/translate.c +1
-1@@ -1556,7 +1556,7 @@ DISAS_INSN(undef)/* ??? This is both instructions that are as yet unimplemented for the 680x0 series, as well as those that are implemented but actually illegal for CPU32 or pre-68020. */ -qemu_log_mask (LOG_UNIMP ,"Illegal instruction: %04x @ %08x" , +qemu_log_mask (LOG_UNIMP ,"Illegal instruction: %04x @ %08x\n" , insn, s->insn_pc);gen_exception (s, s->insn_pc,EXCP_UNSUPPORTED ); }
PATCH 10/11 RISC-V: Add trailing '\n' to qemu_log() calls
In reply to Philippe Mathieu-Daudé--- target/riscv/op_helper.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
target/riscv/op_helper.c +4 -2
@@ -293,7 +293,8 @@ void csr_write_helper(CPURISCVState *env, target_ulong val_to_write,if ((val_to_write &3 ) ==0 ) { env->stvec = val_to_write >>2 <<2 ; }else { -qemu_log_mask (LOG_UNIMP ,"CSR_STVEC: vectored traps not supported" ); +qemu_log_mask (LOG_UNIMP , +"CSR_STVEC: vectored traps not supported\n" ); }break ;case CSR_SCOUNTEREN :
@@ -320,7 +321,8 @@ void csr_write_helper(CPURISCVState *env, target_ulong val_to_write,if ((val_to_write &3 ) ==0 ) { env->mtvec = val_to_write >>2 <<2 ; }else { -qemu_log_mask (LOG_UNIMP ,"CSR_MTVEC: vectored traps not supported" ); +qemu_log_mask (LOG_UNIMP , +"CSR_MTVEC: vectored traps not supported\n" ); }break ;case CSR_MCOUNTEREN :
Signature · 1 line
2.17.1
RFC PATCH 11/11 target/xtensa: Add trailing '\n' to qemu_log() calls
In reply to Philippe Mathieu-Daudé---
RFC because I think the qemu_log_mask() was previously intended to concatenate output to stderr... (multiple registers described on a single line).
target/xtensa/translate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
target/xtensa/translate.c +3 -3
@@ -2234,7 +2234,7 @@ static void translate_rur(DisasContext *dc, const uint32_t arg[],if (uregnames[par[0 ]].name) {tcg_gen_mov_i32 (cpu_R[arg[0 ]], cpu_UR[par[0 ]]); }else { -qemu_log_mask (LOG_UNIMP ,"RUR %d not implemented, " , par[0 ]); +qemu_log_mask (LOG_UNIMP ,"RUR %d not implemented\n" , par[0 ]); } } }
@@ -2375,7 +2375,7 @@ static void translate_slli(DisasContext *dc, const uint32_t arg[], {if (gen_window_check2 (dc, arg[0 ], arg[1 ])) {if (arg[2 ] ==32 ) { -qemu_log_mask (LOG_GUEST_ERROR ,"slli a%d, a%d, 32 is undefined" , +qemu_log_mask (LOG_GUEST_ERROR ,"slli a%d, a%d, 32 is undefined\n" , arg[0 ], arg[1 ]); }tcg_gen_shli_i32 (cpu_R[arg[0 ]], cpu_R[arg[1 ]], arg[2 ] &0x1f );
@@ -2571,7 +2571,7 @@ static void translate_wur(DisasContext *dc, const uint32_t arg[],if (uregnames[par[0 ]].name) {gen_wur (par[0 ], cpu_R[arg[0 ]]); }else { -qemu_log_mask (LOG_UNIMP ,"WUR %d not implemented, " , par[0 ]); +qemu_log_mask (LOG_UNIMP ,"WUR %d not implemented\n" , par[0 ]); } } }
Signature · 1 line
2.17.1
Re: [Qemu-devel] [RFC PATCH 11/11] target/xtensa: Add trailing '\n' to qemu_log() calls
Quoted 4 lines · Philippe Mathieu-Daudé
Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
RFC because I think theqemu_log_mask()was previously intended to concatenate output to stderr... (multiple registers described on a single line).
No, there were no such intent.
Quoted 2 lines
target/xtensa/translate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Signature · 2 lines
Thanks. -- Max
Quoted 4 lines · Philippe Mathieu-Daudé
Nothing very exciting here.
I sometimes miss to notice some trace events, running with -d unimp,trace... then using 'grep ^...'. This is only due to a missing '\n' :)
so error_setg must be used WITHOUT \n and logging must happen with \n?
If we're sure that's the way we want to have things laid out, we really ought to augment checkpatch to catch this -- because there's 0% chance that we'll keep it straight on our own otherwise.
--js
Quoted 27 lines
Philippe Mathieu-Daudé (11):
hw/sd/milkymist-memcard: Add trailing '\n' toqemu_log()call hw/digic: Add trailing '\n' toqemu_log()calls
xilinx-dp: Add trailing '\n' toqemu_log()call ppc/pnv: Add trailing '\n' toqemu_log()calls hw/core/register: Add trailing '\n' toqemu_log()call hw/mips/boston: Add trailing '\n' toqemu_log()calls
stellaris: Add trailing '\n' toqemu_log()calls target/arm: Add trailing '\n' toqemu_log()calls target/m68k: Add trailing '\n' toqemu_log()call
RISC-V: Add trailing '\n' toqemu_log()calls
RFC target/xtensa: Add trailing '\n' toqemu_log()callshw/arm/stellaris.c | 11 ++++++----- hw/char/digic-uart.c | 4 ++-- hw/core/register.c | 2 +- hw/display/xlnx_dp.c | 4 +++- hw/mips/boston.c | 8 ++++---- hw/ppc/pnv_core.c | 4 ++-- hw/sd/milkymist-memcard.c | 2 +- hw/timer/digic-timer.c | 4 ++-- target/arm/helper.c | 4 ++-- target/m68k/translate.c | 2 +- target/riscv/op_helper.c | 6 ++++-- target/xtensa/translate.c | 6 +++--- 12 files changed, 31 insertions(+), 26 deletions(-)
Quoted 5 lines · John Snow
so
error_setgmust be used WITHOUT \n and logging must happen with \n?If we're sure that's the way we want to have things laid out, we really ought to augment checkpatch to catch this -- because there's 0% chance that we'll keep it straight on our own otherwise.
It's a historical side effect of them being basically separately designed APIs. error_setg() takes the "give it the entire error message" approach. logging is printf-style and gives the caller flexibility to compose more complicated lines of logging with multiple calls. Consistency between the two might be nice but there are an awful lot of qemu_log calls in the codebase to check and change to the other convention...
thanks
-- PMM
Quoted 7 lines · Peter Maydell
Quoted 5 lines · John Snow
so
error_setgmust be used WITHOUT \n and logging must happen with \n?If we're sure that's the way we want to have things laid out, we really ought to augment checkpatch to catch this -- because there's 0% chance that we'll keep it straight on our own otherwise.
Quoted 8 lines
It's a historical side effect of them being basically separately designed APIs.
error_setg()takes the "give it the entire error message" approach. logging is printf-style and gives the caller flexibility to compose more complicated lines of logging with multiple calls. Consistency between the two might be nice but there are an awful lot ofqemu_logcalls in the codebase to check and change to the other convention...
Well, there's a pragmatic reason against having it be uniform.
If logging lets you build more complicated statements, perhaps a checkpatch /warning/ that you've omitted the newline might be nice.
--js
Peter Maydell
AppliedQuoted 17 lines · Philippe Mathieu-Daudé
Nothing very exciting here.
I sometimes miss to notice some trace events, running with -d unimp,trace... then using 'grep ^...'. This is only due to a missing '\n' :)Philippe Mathieu-Daudé (11):
hw/sd/milkymist-memcard: Add trailing '\n' toqemu_log()call hw/digic: Add trailing '\n' toqemu_log()calls
xilinx-dp: Add trailing '\n' toqemu_log()call ppc/pnv: Add trailing '\n' toqemu_log()calls hw/core/register: Add trailing '\n' toqemu_log()call hw/mips/boston: Add trailing '\n' toqemu_log()calls
stellaris: Add trailing '\n' toqemu_log()calls target/arm: Add trailing '\n' toqemu_log()calls target/m68k: Add trailing '\n' toqemu_log()call
RISC-V: Add trailing '\n' toqemu_log()calls
RFC target/xtensa: Add trailing '\n' toqemu_log()calls
Quoted 13 lines
hw/arm/stellaris.c | 11 ++++++----- hw/char/digic-uart.c | 4 ++-- hw/core/register.c | 2 +- hw/display/xlnx_dp.c | 4 +++- hw/mips/boston.c | 8 ++++---- hw/ppc/pnv_core.c | 4 ++-- hw/sd/milkymist-memcard.c | 2 +- hw/timer/digic-timer.c | 4 ++-- target/arm/helper.c | 4 ++-- target/m68k/translate.c | 2 +- target/riscv/op_helper.c | 6 ++++-- target/xtensa/translate.c | 6 +++--- 12 files changed, 31 insertions(+), 26 deletions(-)
Applied to target-arm.next, since about half of these are arm and the rest are trivial and have got ack/review by the relevant maintainers.
thanks
-- PMM