Message ID | 1358344229-18006-2-git-send-email-armbru@redhat.com |
---|---|
State | New |
Headers | show |
Latest git doesn't compile with this patch: hw/fw_cfg.c: In function 'fw_cfg_write': hw/fw_cfg.c:207:5: error: implicit declaration of function 'trace_fw_cfg_write' [-Werror=implicit-function-declaration] hw/fw_cfg.c:207:5: error: nested extern declaration of 'trace_fw_cfg_write' [-Werror=nested-externs] hw/fw_cfg.c: In function 'fw_cfg_select': hw/fw_cfg.c:232:5: error: implicit declaration of function 'trace_fw_cfg_select' [-Werror=implicit-function-declaration] hw/fw_cfg.c:232:5: error: nested extern declaration of 'trace_fw_cfg_select' [-Werror=nested-externs] hw/fw_cfg.c: In function 'fw_cfg_read': hw/fw_cfg.c:247:5: error: implicit declaration of function 'trace_fw_cfg_read' [-Werror=implicit-function-declaration] hw/fw_cfg.c:247:5: error: nested extern declaration of 'trace_fw_cfg_read' [-Werror=nested-externs] hw/fw_cfg.c: In function 'fw_cfg_add_file': hw/fw_cfg.c:460:13: error: implicit declaration of function 'trace_fw_cfg_add_file_dupe' [-Werror=implicit-function-declaration] hw/fw_cfg.c:460:13: error: nested extern declaration of 'trace_fw_cfg_add_file_dupe' [-Werror=nested-externs] hw/fw_cfg.c:467:5: error: implicit declaration of function 'trace_fw_cfg_add_file' [-Werror=implicit-function-declaration] hw/fw_cfg.c:467:5: error: nested extern declaration of 'trace_fw_cfg_add_file' [-Werror=nested-externs] cc1: all warnings being treated as errors make: *** [hw/fw_cfg.o] Error 1 Peter On 16.01.2013 14:50, Markus Armbruster wrote: > Signed-off-by: Markus Armbruster <armbru@redhat.com> > --- > hw/fw_cfg.c | 25 ++++++------------------- > trace-events | 7 +++++++ > 2 files changed, 13 insertions(+), 19 deletions(-) > > diff --git a/hw/fw_cfg.c b/hw/fw_cfg.c > index 7c9480c..2fadf36 100644 > --- a/hw/fw_cfg.c > +++ b/hw/fw_cfg.c > @@ -26,19 +26,10 @@ > #include "isa.h" > #include "fw_cfg.h" > #include "sysbus.h" > +#include "trace.h" > #include "qemu/error-report.h" > #include "qemu/config-file.h" > > -/* debug firmware config */ > -//#define DEBUG_FW_CFG > - > -#ifdef DEBUG_FW_CFG > -#define FW_CFG_DPRINTF(fmt, ...) \ > - do { printf("FW_CFG: " fmt , ## __VA_ARGS__); } while (0) > -#else > -#define FW_CFG_DPRINTF(fmt, ...) > -#endif > - > #define FW_CFG_SIZE 2 > #define FW_CFG_DATA_SIZE 1 > > @@ -213,7 +204,7 @@ static void fw_cfg_write(FWCfgState *s, uint8_t value) > int arch = !!(s->cur_entry & FW_CFG_ARCH_LOCAL); > FWCfgEntry *e = &s->entries[arch][s->cur_entry & FW_CFG_ENTRY_MASK]; > > - FW_CFG_DPRINTF("write %d\n", value); > + trace_fw_cfg_write(s, value); > > if (s->cur_entry & FW_CFG_WRITE_CHANNEL && e->callback && > s->cur_offset < e->len) { > @@ -238,8 +229,7 @@ static int fw_cfg_select(FWCfgState *s, uint16_t key) > ret = 1; > } > > - FW_CFG_DPRINTF("select key %d (%sfound)\n", key, ret ? "" : "not "); > - > + trace_fw_cfg_select(s, key, ret); > return ret; > } > > @@ -254,8 +244,7 @@ static uint8_t fw_cfg_read(FWCfgState *s) > else > ret = e->data[s->cur_offset++]; > > - FW_CFG_DPRINTF("read %d\n", ret); > - > + trace_fw_cfg_read(s, ret); > return ret; > } > > @@ -470,16 +459,14 @@ int fw_cfg_add_file(FWCfgState *s, const char *filename, uint8_t *data, > filename); > for (i = 0; i < index; i++) { > if (strcmp(s->files->f[index].name, s->files->f[i].name) == 0) { > - FW_CFG_DPRINTF("%s: skip duplicate: %s\n", __FUNCTION__, > - s->files->f[index].name); > + trace_fw_cfg_add_file_dupe(s, s->files->f[index].name); > return 1; > } > } > > s->files->f[index].size = cpu_to_be32(len); > s->files->f[index].select = cpu_to_be16(FW_CFG_FILE_FIRST + index); > - FW_CFG_DPRINTF("%s: #%d: %s (%d bytes)\n", __FUNCTION__, > - index, s->files->f[index].name, len); > + trace_fw_cfg_add_file(s, index, s->files->f[index].name, len); > > s->files->count = cpu_to_be32(index+1); > return 1; > diff --git a/trace-events b/trace-events > index 6eabbac..cf76a11 100644 > --- a/trace-events > +++ b/trace-events > @@ -167,6 +167,13 @@ ecc_mem_readl_ecr1(uint32_t ret) "Read event count 2 %08x" > ecc_diag_mem_writeb(uint64_t addr, uint32_t val) "Write diagnostic %"PRId64" = %02x" > ecc_diag_mem_readb(uint64_t addr, uint32_t ret) "Read diagnostic %"PRId64"= %02x" > > +# hw/fw_cfg.c > +fw_cfg_write(void *s, uint8_t value) "%p %d" > +fw_cfg_select(void *s, uint16_t key, int ret) "%p key %d = %d" > +fw_cfg_read(void *s, uint8_t ret) "%p = %d" > +fw_cfg_add_file_dupe(void *s, char *name) "%p %s" > +fw_cfg_add_file(void *s, int index, char *name, uint32_t len) "%p #%d: %s (%d bytes)" > + > # hw/hd-geometry.c > hd_geometry_lchs_guess(void *bs, int cyls, int heads, int secs) "bs %p LCHS %d %d %d" > hd_geometry_guess(void *bs, uint32_t cyls, uint32_t heads, uint32_t secs, int trans) "bs %p CHS %u %u %u trans %d"
Peter Lieven <pl@dlhnet.de> writes: > Latest git doesn't compile with this patch: > > hw/fw_cfg.c: In function 'fw_cfg_write': > hw/fw_cfg.c:207:5: error: implicit declaration of function > trace_fw_cfg_write' [-Werror=implicit-function-declaration] > hw/fw_cfg.c:207:5: error: nested extern declaration of > trace_fw_cfg_write' [-Werror=nested-externs] > hw/fw_cfg.c: In function 'fw_cfg_select': > hw/fw_cfg.c:232:5: error: implicit declaration of function > trace_fw_cfg_select' [-Werror=implicit-function-declaration] > hw/fw_cfg.c:232:5: error: nested extern declaration of > trace_fw_cfg_select' [-Werror=nested-externs] > hw/fw_cfg.c: In function 'fw_cfg_read': > hw/fw_cfg.c:247:5: error: implicit declaration of function > trace_fw_cfg_read' [-Werror=implicit-function-declaration] > hw/fw_cfg.c:247:5: error: nested extern declaration of > trace_fw_cfg_read' [-Werror=nested-externs] > hw/fw_cfg.c: In function 'fw_cfg_add_file': > hw/fw_cfg.c:460:13: error: implicit declaration of function > trace_fw_cfg_add_file_dupe' [-Werror=implicit-function-declaration] > hw/fw_cfg.c:460:13: error: nested extern declaration of > trace_fw_cfg_add_file_dupe' [-Werror=nested-externs] > hw/fw_cfg.c:467:5: error: implicit declaration of function > trace_fw_cfg_add_file' [-Werror=implicit-function-declaration] > hw/fw_cfg.c:467:5: error: nested extern declaration of > trace_fw_cfg_add_file' [-Werror=nested-externs] > cc1: all warnings being treated as errors > make: *** [hw/fw_cfg.o] Error 1 Compiles fine for me. What happens if you blow away your build tree and start over? In my experience, rebuilding of trace-related stuff is rather fragile...
Am 24.01.2013 11:32, schrieb Markus Armbruster: > Peter Lieven <pl@dlhnet.de> writes: > >> Latest git doesn't compile with this patch: >> >> hw/fw_cfg.c: In function 'fw_cfg_write': >> hw/fw_cfg.c:207:5: error: implicit declaration of function >> trace_fw_cfg_write' [-Werror=implicit-function-declaration] >> hw/fw_cfg.c:207:5: error: nested extern declaration of >> trace_fw_cfg_write' [-Werror=nested-externs] >> hw/fw_cfg.c: In function 'fw_cfg_select': >> hw/fw_cfg.c:232:5: error: implicit declaration of function >> trace_fw_cfg_select' [-Werror=implicit-function-declaration] >> hw/fw_cfg.c:232:5: error: nested extern declaration of >> trace_fw_cfg_select' [-Werror=nested-externs] >> hw/fw_cfg.c: In function 'fw_cfg_read': >> hw/fw_cfg.c:247:5: error: implicit declaration of function >> trace_fw_cfg_read' [-Werror=implicit-function-declaration] >> hw/fw_cfg.c:247:5: error: nested extern declaration of >> trace_fw_cfg_read' [-Werror=nested-externs] >> hw/fw_cfg.c: In function 'fw_cfg_add_file': >> hw/fw_cfg.c:460:13: error: implicit declaration of function >> trace_fw_cfg_add_file_dupe' [-Werror=implicit-function-declaration] >> hw/fw_cfg.c:460:13: error: nested extern declaration of >> trace_fw_cfg_add_file_dupe' [-Werror=nested-externs] >> hw/fw_cfg.c:467:5: error: implicit declaration of function >> trace_fw_cfg_add_file' [-Werror=implicit-function-declaration] >> hw/fw_cfg.c:467:5: error: nested extern declaration of >> trace_fw_cfg_add_file' [-Werror=nested-externs] >> cc1: all warnings being treated as errors >> make: *** [hw/fw_cfg.o] Error 1 > > Compiles fine for me. > > What happens if you blow away your build tree and start over? > > In my experience, rebuilding of trace-related stuff is rather fragile... There were some recent changes ... there's probably a stale trace.h and trace.c in the build directory. Would be nice if we could get the build system to automatically remove such known stale files... Andreas
Am 24.01.2013 um 11:32 schrieb Markus Armbruster <armbru@redhat.com>: > Peter Lieven <pl@dlhnet.de> writes: > >> Latest git doesn't compile with this patch: >> >> hw/fw_cfg.c: In function 'fw_cfg_write': >> hw/fw_cfg.c:207:5: error: implicit declaration of function >> trace_fw_cfg_write' [-Werror=implicit-function-declaration] >> hw/fw_cfg.c:207:5: error: nested extern declaration of >> trace_fw_cfg_write' [-Werror=nested-externs] >> hw/fw_cfg.c: In function 'fw_cfg_select': >> hw/fw_cfg.c:232:5: error: implicit declaration of function >> trace_fw_cfg_select' [-Werror=implicit-function-declaration] >> hw/fw_cfg.c:232:5: error: nested extern declaration of >> trace_fw_cfg_select' [-Werror=nested-externs] >> hw/fw_cfg.c: In function 'fw_cfg_read': >> hw/fw_cfg.c:247:5: error: implicit declaration of function >> trace_fw_cfg_read' [-Werror=implicit-function-declaration] >> hw/fw_cfg.c:247:5: error: nested extern declaration of >> trace_fw_cfg_read' [-Werror=nested-externs] >> hw/fw_cfg.c: In function 'fw_cfg_add_file': >> hw/fw_cfg.c:460:13: error: implicit declaration of function >> trace_fw_cfg_add_file_dupe' [-Werror=implicit-function-declaration] >> hw/fw_cfg.c:460:13: error: nested extern declaration of >> trace_fw_cfg_add_file_dupe' [-Werror=nested-externs] >> hw/fw_cfg.c:467:5: error: implicit declaration of function >> trace_fw_cfg_add_file' [-Werror=implicit-function-declaration] >> hw/fw_cfg.c:467:5: error: nested extern declaration of >> trace_fw_cfg_add_file' [-Werror=nested-externs] >> cc1: all warnings being treated as errors >> make: *** [hw/fw_cfg.o] Error 1 > > Compiles fine for me. > > What happens if you blow away your build tree and start over? > > In my experience, rebuilding of trace-related stuff is rather fragile... If I make a fresh clone of the qmu git repository it works. Peter
Am 24.01.2013 um 11:41 schrieb Andreas Färber <afaerber@suse.de>: > Am 24.01.2013 11:32, schrieb Markus Armbruster: >> Peter Lieven <pl@dlhnet.de> writes: >> >>> Latest git doesn't compile with this patch: >>> >>> hw/fw_cfg.c: In function 'fw_cfg_write': >>> hw/fw_cfg.c:207:5: error: implicit declaration of function >>> trace_fw_cfg_write' [-Werror=implicit-function-declaration] >>> hw/fw_cfg.c:207:5: error: nested extern declaration of >>> trace_fw_cfg_write' [-Werror=nested-externs] >>> hw/fw_cfg.c: In function 'fw_cfg_select': >>> hw/fw_cfg.c:232:5: error: implicit declaration of function >>> trace_fw_cfg_select' [-Werror=implicit-function-declaration] >>> hw/fw_cfg.c:232:5: error: nested extern declaration of >>> trace_fw_cfg_select' [-Werror=nested-externs] >>> hw/fw_cfg.c: In function 'fw_cfg_read': >>> hw/fw_cfg.c:247:5: error: implicit declaration of function >>> trace_fw_cfg_read' [-Werror=implicit-function-declaration] >>> hw/fw_cfg.c:247:5: error: nested extern declaration of >>> trace_fw_cfg_read' [-Werror=nested-externs] >>> hw/fw_cfg.c: In function 'fw_cfg_add_file': >>> hw/fw_cfg.c:460:13: error: implicit declaration of function >>> trace_fw_cfg_add_file_dupe' [-Werror=implicit-function-declaration] >>> hw/fw_cfg.c:460:13: error: nested extern declaration of >>> trace_fw_cfg_add_file_dupe' [-Werror=nested-externs] >>> hw/fw_cfg.c:467:5: error: implicit declaration of function >>> trace_fw_cfg_add_file' [-Werror=implicit-function-declaration] >>> hw/fw_cfg.c:467:5: error: nested extern declaration of >>> trace_fw_cfg_add_file' [-Werror=nested-externs] >>> cc1: all warnings being treated as errors >>> make: *** [hw/fw_cfg.o] Error 1 >> >> Compiles fine for me. >> >> What happens if you blow away your build tree and start over? >> >> In my experience, rebuilding of trace-related stuff is rather fragile... > > There were some recent changes ... there's probably a stale trace.h and > trace.c in the build directory. removing trace.c and trace.h is not enough, but a fresh clone of the repository works. are there any more such files? Peter > > Would be nice if we could get the build system to automatically remove > such known stale files... > > Andreas > > -- > SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany > GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
Peter Lieven <pl@dlhnet.de> writes: > Am 24.01.2013 um 11:32 schrieb Markus Armbruster <armbru@redhat.com>: > >> Peter Lieven <pl@dlhnet.de> writes: >> >>> Latest git doesn't compile with this patch: >>> >>> hw/fw_cfg.c: In function 'fw_cfg_write': >>> hw/fw_cfg.c:207:5: error: implicit declaration of function >>> trace_fw_cfg_write' [-Werror=implicit-function-declaration] >>> hw/fw_cfg.c:207:5: error: nested extern declaration of >>> trace_fw_cfg_write' [-Werror=nested-externs] >>> hw/fw_cfg.c: In function 'fw_cfg_select': >>> hw/fw_cfg.c:232:5: error: implicit declaration of function >>> trace_fw_cfg_select' [-Werror=implicit-function-declaration] >>> hw/fw_cfg.c:232:5: error: nested extern declaration of >>> trace_fw_cfg_select' [-Werror=nested-externs] >>> hw/fw_cfg.c: In function 'fw_cfg_read': >>> hw/fw_cfg.c:247:5: error: implicit declaration of function >>> trace_fw_cfg_read' [-Werror=implicit-function-declaration] >>> hw/fw_cfg.c:247:5: error: nested extern declaration of >>> trace_fw_cfg_read' [-Werror=nested-externs] >>> hw/fw_cfg.c: In function 'fw_cfg_add_file': >>> hw/fw_cfg.c:460:13: error: implicit declaration of function >>> trace_fw_cfg_add_file_dupe' [-Werror=implicit-function-declaration] >>> hw/fw_cfg.c:460:13: error: nested extern declaration of >>> trace_fw_cfg_add_file_dupe' [-Werror=nested-externs] >>> hw/fw_cfg.c:467:5: error: implicit declaration of function >>> trace_fw_cfg_add_file' [-Werror=implicit-function-declaration] >>> hw/fw_cfg.c:467:5: error: nested extern declaration of >>> trace_fw_cfg_add_file' [-Werror=nested-externs] >>> cc1: all warnings being treated as errors >>> make: *** [hw/fw_cfg.o] Error 1 >> >> Compiles fine for me. >> >> What happens if you blow away your build tree and start over? >> >> In my experience, rebuilding of trace-related stuff is rather fragile... > > If I make a fresh clone of the qmu git repository it works. I always build in a separate build directory, which I can blow away freely.
On Thu, Jan 24, 2013 at 11:46:28AM +0100, Peter Lieven wrote: > > Am 24.01.2013 um 11:41 schrieb Andreas Färber <afaerber@suse.de>: > > > Am 24.01.2013 11:32, schrieb Markus Armbruster: > >> Peter Lieven <pl@dlhnet.de> writes: > >> > >>> Latest git doesn't compile with this patch: > >>> > >>> hw/fw_cfg.c: In function 'fw_cfg_write': > >>> hw/fw_cfg.c:207:5: error: implicit declaration of function > >>> trace_fw_cfg_write' [-Werror=implicit-function-declaration] > >>> hw/fw_cfg.c:207:5: error: nested extern declaration of > >>> trace_fw_cfg_write' [-Werror=nested-externs] > >>> hw/fw_cfg.c: In function 'fw_cfg_select': > >>> hw/fw_cfg.c:232:5: error: implicit declaration of function > >>> trace_fw_cfg_select' [-Werror=implicit-function-declaration] > >>> hw/fw_cfg.c:232:5: error: nested extern declaration of > >>> trace_fw_cfg_select' [-Werror=nested-externs] > >>> hw/fw_cfg.c: In function 'fw_cfg_read': > >>> hw/fw_cfg.c:247:5: error: implicit declaration of function > >>> trace_fw_cfg_read' [-Werror=implicit-function-declaration] > >>> hw/fw_cfg.c:247:5: error: nested extern declaration of > >>> trace_fw_cfg_read' [-Werror=nested-externs] > >>> hw/fw_cfg.c: In function 'fw_cfg_add_file': > >>> hw/fw_cfg.c:460:13: error: implicit declaration of function > >>> trace_fw_cfg_add_file_dupe' [-Werror=implicit-function-declaration] > >>> hw/fw_cfg.c:460:13: error: nested extern declaration of > >>> trace_fw_cfg_add_file_dupe' [-Werror=nested-externs] > >>> hw/fw_cfg.c:467:5: error: implicit declaration of function > >>> trace_fw_cfg_add_file' [-Werror=implicit-function-declaration] > >>> hw/fw_cfg.c:467:5: error: nested extern declaration of > >>> trace_fw_cfg_add_file' [-Werror=nested-externs] > >>> cc1: all warnings being treated as errors > >>> make: *** [hw/fw_cfg.o] Error 1 > >> > >> Compiles fine for me. > >> > >> What happens if you blow away your build tree and start over? > >> > >> In my experience, rebuilding of trace-related stuff is rather fragile... > > > > There were some recent changes ... there's probably a stale trace.h and > > trace.c in the build directory. > > removing trace.c and trace.h is not enough, but a fresh clone of the > repository works. are there any more such files? If you hit other issues you can avoid them using a build directory: $ mkdir build $ cd build $ path/to/qemu/configure ... $ make It places all generated files and build products into this directory. Simply 'rm -rf build' to start from a clean slate. Stefan
diff --git a/hw/fw_cfg.c b/hw/fw_cfg.c index 7c9480c..2fadf36 100644 --- a/hw/fw_cfg.c +++ b/hw/fw_cfg.c @@ -26,19 +26,10 @@ #include "isa.h" #include "fw_cfg.h" #include "sysbus.h" +#include "trace.h" #include "qemu/error-report.h" #include "qemu/config-file.h" -/* debug firmware config */ -//#define DEBUG_FW_CFG - -#ifdef DEBUG_FW_CFG -#define FW_CFG_DPRINTF(fmt, ...) \ - do { printf("FW_CFG: " fmt , ## __VA_ARGS__); } while (0) -#else -#define FW_CFG_DPRINTF(fmt, ...) -#endif - #define FW_CFG_SIZE 2 #define FW_CFG_DATA_SIZE 1 @@ -213,7 +204,7 @@ static void fw_cfg_write(FWCfgState *s, uint8_t value) int arch = !!(s->cur_entry & FW_CFG_ARCH_LOCAL); FWCfgEntry *e = &s->entries[arch][s->cur_entry & FW_CFG_ENTRY_MASK]; - FW_CFG_DPRINTF("write %d\n", value); + trace_fw_cfg_write(s, value); if (s->cur_entry & FW_CFG_WRITE_CHANNEL && e->callback && s->cur_offset < e->len) { @@ -238,8 +229,7 @@ static int fw_cfg_select(FWCfgState *s, uint16_t key) ret = 1; } - FW_CFG_DPRINTF("select key %d (%sfound)\n", key, ret ? "" : "not "); - + trace_fw_cfg_select(s, key, ret); return ret; } @@ -254,8 +244,7 @@ static uint8_t fw_cfg_read(FWCfgState *s) else ret = e->data[s->cur_offset++]; - FW_CFG_DPRINTF("read %d\n", ret); - + trace_fw_cfg_read(s, ret); return ret; } @@ -470,16 +459,14 @@ int fw_cfg_add_file(FWCfgState *s, const char *filename, uint8_t *data, filename); for (i = 0; i < index; i++) { if (strcmp(s->files->f[index].name, s->files->f[i].name) == 0) { - FW_CFG_DPRINTF("%s: skip duplicate: %s\n", __FUNCTION__, - s->files->f[index].name); + trace_fw_cfg_add_file_dupe(s, s->files->f[index].name); return 1; } } s->files->f[index].size = cpu_to_be32(len); s->files->f[index].select = cpu_to_be16(FW_CFG_FILE_FIRST + index); - FW_CFG_DPRINTF("%s: #%d: %s (%d bytes)\n", __FUNCTION__, - index, s->files->f[index].name, len); + trace_fw_cfg_add_file(s, index, s->files->f[index].name, len); s->files->count = cpu_to_be32(index+1); return 1; diff --git a/trace-events b/trace-events index 6eabbac..cf76a11 100644 --- a/trace-events +++ b/trace-events @@ -167,6 +167,13 @@ ecc_mem_readl_ecr1(uint32_t ret) "Read event count 2 %08x" ecc_diag_mem_writeb(uint64_t addr, uint32_t val) "Write diagnostic %"PRId64" = %02x" ecc_diag_mem_readb(uint64_t addr, uint32_t ret) "Read diagnostic %"PRId64"= %02x" +# hw/fw_cfg.c +fw_cfg_write(void *s, uint8_t value) "%p %d" +fw_cfg_select(void *s, uint16_t key, int ret) "%p key %d = %d" +fw_cfg_read(void *s, uint8_t ret) "%p = %d" +fw_cfg_add_file_dupe(void *s, char *name) "%p %s" +fw_cfg_add_file(void *s, int index, char *name, uint32_t len) "%p #%d: %s (%d bytes)" + # hw/hd-geometry.c hd_geometry_lchs_guess(void *bs, int cyls, int heads, int secs) "bs %p LCHS %d %d %d" hd_geometry_guess(void *bs, uint32_t cyls, uint32_t heads, uint32_t secs, int trans) "bs %p CHS %u %u %u trans %d"
Signed-off-by: Markus Armbruster <armbru@redhat.com> --- hw/fw_cfg.c | 25 ++++++------------------- trace-events | 7 +++++++ 2 files changed, 13 insertions(+), 19 deletions(-)