Move all trace-events for files in the hw/nvram/ directory to their own file.
Signed-off-by: Daniel P. Berrange <berra...@redhat.com> --- Makefile.objs | 1 + hw/nvram/trace-events | 35 +++++++++++++++++++++++++++++++++++ trace-events | 9 --------- 3 files changed, 36 insertions(+), 9 deletions(-) create mode 100644 hw/nvram/trace-events diff --git a/Makefile.objs b/Makefile.objs index 06fb4af..f299ecf 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -133,3 +133,4 @@ trace-events-y += hw/audio/trace-events trace-events-y += hw/misc/trace-events trace-events-y += hw/usb/trace-events trace-events-y += hw/scsi/trace-events +trace-events-y += hw/nvram/trace-events diff --git a/hw/nvram/trace-events b/hw/nvram/trace-events new file mode 100644 index 0000000..d4583da --- /dev/null +++ b/hw/nvram/trace-events @@ -0,0 +1,35 @@ +# Trace events for debugging and performance instrumentation +# +# This file is processed by the tracetool script during the build. +# +# To add a new trace event: +# +# 1. Choose a name for the trace event. Declare its arguments and format +# string. +# +# 2. Call the trace event from code using trace_##name, e.g. multiwrite_cb() -> +# trace_multiwrite_cb(). The source file must #include "trace.h". +# +# Format of a trace event: +# +# [disable] <name>(<type1> <arg1>[, <type2> <arg2>] ...) "<format-string>" +# +# Example: g_malloc(size_t size) "size %zu" +# +# The "disable" keyword will build without the trace event. +# +# The <name> must be a valid as a C function name. +# +# Types should be standard C types. Use void * for pointers because the trace +# system may not have the necessary headers included. +# +# The <format-string> should be a sprintf()-compatible format string. + +# hw/nvram/ds1225y.c +nvram_read(uint32_t addr, uint32_t ret) "read addr %d: 0x%02x" +nvram_write(uint32_t addr, uint32_t old, uint32_t val) "write addr %d: 0x%02x -> 0x%02x" + +# hw/nvram/fw_cfg.c +fw_cfg_select(void *s, uint16_t key, int ret) "%p key %d = %d" +fw_cfg_read(void *s, uint64_t ret) "%p = %"PRIx64 +fw_cfg_add_file(void *s, int index, char *name, size_t len) "%p #%d: %s (%zd bytes)" diff --git a/trace-events b/trace-events index 99a7fa5..f158fbe 100644 --- a/trace-events +++ b/trace-events @@ -42,15 +42,6 @@ virtio_balloon_get_config(uint32_t num_pages, uint32_t actual) "num_pages: %d ac virtio_balloon_set_config(uint32_t actual, uint32_t oldactual) "actual: %d oldactual: %d" virtio_balloon_to_target(uint64_t target, uint32_t num_pages) "balloon target: %"PRIx64" num_pages: %d" -# hw/nvram/ds1225y.c -nvram_read(uint32_t addr, uint32_t ret) "read addr %d: 0x%02x" -nvram_write(uint32_t addr, uint32_t old, uint32_t val) "write addr %d: 0x%02x -> 0x%02x" - -# hw/nvram/fw_cfg.c -fw_cfg_select(void *s, uint16_t key, int ret) "%p key %d = %d" -fw_cfg_read(void *s, uint64_t ret) "%p = %"PRIx64 -fw_cfg_add_file(void *s, int index, char *name, size_t len) "%p #%d: %s (%zd bytes)" - # hw/display/jazz_led.c jazz_led_read(uint64_t addr, uint8_t val) "read addr=0x%"PRIx64": 0x%x" jazz_led_write(uint64_t addr, uint8_t new) "write addr=0x%"PRIx64": 0x%x" -- 2.5.5