在 2025/3/24 下午5:37, Bibo Mao 写道:
> Add trace event trace_loongarch_pch_pic_read(), replaces the following
> three events:
> trace_loongarch_pch_pic_low_readw()
> trace_loongarch_pch_pic_high_readw()
> trace_loongarch_pch_pic_readb()
> The similiar with write trace event.
>
> Signed-off-by: Bibo Mao <maobibo@loongson.cn>
> ---
> hw/intc/loongarch_pch_pic.c | 24 ++++++------------------
> hw/intc/trace-events | 8 ++------
> 2 files changed, 8 insertions(+), 24 deletions(-)
Reviewed-by: Song Gao <gaosong@loongson.cn>
Thankss.
Song Gao
> diff --git a/hw/intc/loongarch_pch_pic.c b/hw/intc/loongarch_pch_pic.c
> index bc4dd697d2..ff1e5992bd 100644
> --- a/hw/intc/loongarch_pch_pic.c
> +++ b/hw/intc/loongarch_pch_pic.c
> @@ -200,12 +200,15 @@ static uint64_t loongarch_pch_pic_read(void *opaque, hwaddr addr,
> break;
> }
>
> + trace_loongarch_pch_pic_read(size, addr, val);
> return val;
> }
>
> static void loongarch_pch_pic_write(void *opaque, hwaddr addr,
> uint64_t value, unsigned size)
> {
> + trace_loongarch_pch_pic_write(size, addr, value);
> +
> switch (size) {
> case 1:
> pch_pic_write(opaque, addr, value, 0xFF);
> @@ -230,55 +233,40 @@ static void loongarch_pch_pic_write(void *opaque, hwaddr addr,
> static uint64_t loongarch_pch_pic_low_readw(void *opaque, hwaddr addr,
> unsigned size)
> {
> - uint64_t val;
> -
> - val = loongarch_pch_pic_read(opaque, addr, size);
> - trace_loongarch_pch_pic_low_readw(size, addr, val);
> - return val;
> + return loongarch_pch_pic_read(opaque, addr, size);
> }
>
> static void loongarch_pch_pic_low_writew(void *opaque, hwaddr addr,
> uint64_t value, unsigned size)
> {
> - trace_loongarch_pch_pic_low_writew(size, addr, value);
> loongarch_pch_pic_write(opaque, addr, value, size);
> }
>
> static uint64_t loongarch_pch_pic_high_readw(void *opaque, hwaddr addr,
> unsigned size)
> {
> - uint64_t val;
> -
> addr += PCH_PIC_INT_STATUS;
> - val = loongarch_pch_pic_read(opaque, addr, size);
> - trace_loongarch_pch_pic_high_readw(size, addr, val);
> - return val;
> + return loongarch_pch_pic_read(opaque, addr, size);
> }
>
> static void loongarch_pch_pic_high_writew(void *opaque, hwaddr addr,
> uint64_t value, unsigned size)
> {
> addr += PCH_PIC_INT_STATUS;
> - trace_loongarch_pch_pic_high_writew(size, addr, value);
> loongarch_pch_pic_write(opaque, addr, value, size);
> }
>
> static uint64_t loongarch_pch_pic_readb(void *opaque, hwaddr addr,
> unsigned size)
> {
> - uint64_t val;
> -
> addr += PCH_PIC_ROUTE_ENTRY;
> - val = loongarch_pch_pic_read(opaque, addr, size);
> - trace_loongarch_pch_pic_readb(size, addr, val);
> - return val;
> + return loongarch_pch_pic_read(opaque, addr, size);
> }
>
> static void loongarch_pch_pic_writeb(void *opaque, hwaddr addr,
> uint64_t data, unsigned size)
> {
> addr += PCH_PIC_ROUTE_ENTRY;
> - trace_loongarch_pch_pic_writeb(size, addr, data);
> loongarch_pch_pic_write(opaque, addr, data, size);
> }
>
> diff --git a/hw/intc/trace-events b/hw/intc/trace-events
> index 0ba9a02e73..334aa6a97b 100644
> --- a/hw/intc/trace-events
> +++ b/hw/intc/trace-events
> @@ -314,12 +314,8 @@ loongson_ipi_read(unsigned size, uint64_t addr, uint64_t val) "size: %u addr: 0x
> loongson_ipi_write(unsigned size, uint64_t addr, uint64_t val) "size: %u addr: 0x%"PRIx64 "val: 0x%"PRIx64
> # loongarch_pch_pic.c
> loongarch_pch_pic_irq_handler(int irq, int level) "irq %d level %d"
> -loongarch_pch_pic_low_readw(unsigned size, uint64_t addr, uint64_t val) "size: %u addr: 0x%"PRIx64 "val: 0x%" PRIx64
> -loongarch_pch_pic_low_writew(unsigned size, uint64_t addr, uint64_t val) "size: %u addr: 0x%"PRIx64 "val: 0x%" PRIx64
> -loongarch_pch_pic_high_readw(unsigned size, uint64_t addr, uint64_t val) "size: %u addr: 0x%"PRIx64 "val: 0x%" PRIx64
> -loongarch_pch_pic_high_writew(unsigned size, uint64_t addr, uint64_t val) "size: %u addr: 0x%"PRIx64 "val: 0x%" PRIx64
> -loongarch_pch_pic_readb(unsigned size, uint64_t addr, uint64_t val) "size: %u addr: 0x%"PRIx64 "val: 0x%" PRIx64
> -loongarch_pch_pic_writeb(unsigned size, uint64_t addr, uint64_t val) "size: %u addr: 0x%"PRIx64 "val: 0x%" PRIx64
> +loongarch_pch_pic_read(unsigned size, uint64_t addr, uint64_t val) "size: %u addr: 0x%"PRIx64 "val: 0x%" PRIx64
> +loongarch_pch_pic_write(unsigned size, uint64_t addr, uint64_t val) "size: %u addr: 0x%"PRIx64 "val: 0x%" PRIx64
>
> # loongarch_pch_msi.c
> loongarch_msi_set_irq(int irq_num) "set msi irq %d"