* [PATCH v3 10/11] target/arm/helper: make it clear the EC field is also in hex [not found] <20170307155054.5833-1-alex.bennee@linaro.org> @ 2017-03-07 15:50 ` Alex Bennée 2017-03-07 17:49 ` [Qemu-arm] " Philippe Mathieu-Daudé 2017-03-07 15:50 ` [PATCH v3 11/11] hw/intc/arm_gic: modernise the DPRINTF Alex Bennée 1 sibling, 1 reply; 4+ messages in thread From: Alex Bennée @ 2017-03-07 15:50 UTC (permalink / raw) To: peter.maydell, rth, pbonzini Cc: qemu-devel, mttcg, fred.konrad, a.rigo, cota, bobby.prani, nikunj, Alex Bennée, open list:ARM ..just like the rest of the displayed ESR register. Otherwise people might scratch their heads if a not obviously hex number is displayed for the EC field. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: KONRAD Frederic <fred.konrad@greensocs.com> --- target/arm/helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index 3f4211b572..76b608f0ba 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -6857,7 +6857,7 @@ void arm_cpu_do_interrupt(CPUState *cs) new_el); if (qemu_loglevel_mask(CPU_LOG_INT) && !excp_is_internal(cs->exception_index)) { - qemu_log_mask(CPU_LOG_INT, "...with ESR %x/0x%" PRIx32 "\n", + qemu_log_mask(CPU_LOG_INT, "...with ESR 0x%x/0x%" PRIx32 "\n", env->exception.syndrome >> ARM_EL_EC_SHIFT, env->exception.syndrome); } -- 2.11.0 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-arm] [PATCH v3 10/11] target/arm/helper: make it clear the EC field is also in hex 2017-03-07 15:50 ` [PATCH v3 10/11] target/arm/helper: make it clear the EC field is also in hex Alex Bennée @ 2017-03-07 17:49 ` Philippe Mathieu-Daudé 0 siblings, 0 replies; 4+ messages in thread From: Philippe Mathieu-Daudé @ 2017-03-07 17:49 UTC (permalink / raw) To: Alex Bennée, peter.maydell, rth, pbonzini Cc: mttcg, nikunj, a.rigo, qemu-devel, cota, open list:ARM, bobby.prani, fred.konrad On 03/07/2017 12:50 PM, Alex Bennée wrote: > ..just like the rest of the displayed ESR register. Otherwise people > might scratch their heads if a not obviously hex number is displayed > for the EC field. > > Signed-off-by: Alex Bennée <alex.bennee@linaro.org> > Reviewed-by: Peter Maydell <peter.maydell@linaro.org> > Reviewed-by: KONRAD Frederic <fred.konrad@greensocs.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> > --- > target/arm/helper.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/target/arm/helper.c b/target/arm/helper.c > index 3f4211b572..76b608f0ba 100644 > --- a/target/arm/helper.c > +++ b/target/arm/helper.c > @@ -6857,7 +6857,7 @@ void arm_cpu_do_interrupt(CPUState *cs) > new_el); > if (qemu_loglevel_mask(CPU_LOG_INT) > && !excp_is_internal(cs->exception_index)) { > - qemu_log_mask(CPU_LOG_INT, "...with ESR %x/0x%" PRIx32 "\n", > + qemu_log_mask(CPU_LOG_INT, "...with ESR 0x%x/0x%" PRIx32 "\n", > env->exception.syndrome >> ARM_EL_EC_SHIFT, > env->exception.syndrome); > } > ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v3 11/11] hw/intc/arm_gic: modernise the DPRINTF [not found] <20170307155054.5833-1-alex.bennee@linaro.org> 2017-03-07 15:50 ` [PATCH v3 10/11] target/arm/helper: make it clear the EC field is also in hex Alex Bennée @ 2017-03-07 15:50 ` Alex Bennée 2017-03-07 17:53 ` [Qemu-arm] " Philippe Mathieu-Daudé 1 sibling, 1 reply; 4+ messages in thread From: Alex Bennée @ 2017-03-07 15:50 UTC (permalink / raw) To: peter.maydell, rth, pbonzini Cc: qemu-devel, mttcg, fred.konrad, a.rigo, cota, bobby.prani, nikunj, Alex Bennée, open list:ARM cores While I was debugging the icount issues I realised a bunch of the messages look quite similar. I've fixed this by including __func__ in the debug print. At the same time I move the a modern if (GATE) style printf which ensures the compiler can check for format string errors even if the code gets optimised away in the non-DEBUG_GIC case. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> --- hw/intc/arm_gic.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c index 8e5a9d8a3e..b305d9032a 100644 --- a/hw/intc/arm_gic.c +++ b/hw/intc/arm_gic.c @@ -26,15 +26,20 @@ #include "qemu/log.h" #include "trace.h" -//#define DEBUG_GIC +/* #define DEBUG_GIC */ #ifdef DEBUG_GIC -#define DPRINTF(fmt, ...) \ -do { fprintf(stderr, "arm_gic: " fmt , ## __VA_ARGS__); } while (0) +#define DEBUG_GIC_GATE 1 #else -#define DPRINTF(fmt, ...) do {} while(0) +#define DEBUG_GIC_GATE 0 #endif +#define DPRINTF(fmt, ...) do { \ + if (DEBUG_GIC_GATE) { \ + fprintf(stderr, "%s: " fmt, __func__, ## __VA_ARGS__); \ + } \ + } while (0) + static const uint8_t gic_id_11mpcore[] = { 0x00, 0x00, 0x00, 0x00, 0x90, 0x13, 0x04, 0x00, 0x0d, 0xf0, 0x05, 0xb1 }; -- 2.11.0 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-arm] [PATCH v3 11/11] hw/intc/arm_gic: modernise the DPRINTF 2017-03-07 15:50 ` [PATCH v3 11/11] hw/intc/arm_gic: modernise the DPRINTF Alex Bennée @ 2017-03-07 17:53 ` Philippe Mathieu-Daudé 0 siblings, 0 replies; 4+ messages in thread From: Philippe Mathieu-Daudé @ 2017-03-07 17:53 UTC (permalink / raw) To: Alex Bennée, peter.maydell, rth, pbonzini Cc: mttcg, nikunj, a.rigo, qemu-devel, cota, open list:ARM cores, bobby.prani, fred.konrad On 03/07/2017 12:50 PM, Alex Bennée wrote: > While I was debugging the icount issues I realised a bunch of the > messages look quite similar. I've fixed this by including __func__ in > the debug print. At the same time I move the a modern if (GATE) style > printf which ensures the compiler can check for format string errors > even if the code gets optimised away in the non-DEBUG_GIC case. > > Signed-off-by: Alex Bennée <alex.bennee@linaro.org> > Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> > --- > hw/intc/arm_gic.c | 13 +++++++++---- > 1 file changed, 9 insertions(+), 4 deletions(-) > > diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c > index 8e5a9d8a3e..b305d9032a 100644 > --- a/hw/intc/arm_gic.c > +++ b/hw/intc/arm_gic.c > @@ -26,15 +26,20 @@ > #include "qemu/log.h" > #include "trace.h" > > -//#define DEBUG_GIC > +/* #define DEBUG_GIC */ > > #ifdef DEBUG_GIC > -#define DPRINTF(fmt, ...) \ > -do { fprintf(stderr, "arm_gic: " fmt , ## __VA_ARGS__); } while (0) > +#define DEBUG_GIC_GATE 1 > #else > -#define DPRINTF(fmt, ...) do {} while(0) > +#define DEBUG_GIC_GATE 0 > #endif > > +#define DPRINTF(fmt, ...) do { \ > + if (DEBUG_GIC_GATE) { \ > + fprintf(stderr, "%s: " fmt, __func__, ## __VA_ARGS__); \ > + } \ > + } while (0) > + > static const uint8_t gic_id_11mpcore[] = { > 0x00, 0x00, 0x00, 0x00, 0x90, 0x13, 0x04, 0x00, 0x0d, 0xf0, 0x05, 0xb1 > }; > ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-03-07 17:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20170307155054.5833-1-alex.bennee@linaro.org>
2017-03-07 15:50 ` [PATCH v3 10/11] target/arm/helper: make it clear the EC field is also in hex Alex Bennée
2017-03-07 17:49 ` [Qemu-arm] " Philippe Mathieu-Daudé
2017-03-07 15:50 ` [PATCH v3 11/11] hw/intc/arm_gic: modernise the DPRINTF Alex Bennée
2017-03-07 17:53 ` [Qemu-arm] " Philippe Mathieu-Daudé
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).