diff options
author | Alex Bennée <alex.bennee@linaro.org> | 2022-10-24 11:20:15 +0200 |
---|---|---|
committer | Cédric Le Goater <clg@kaod.org> | 2022-10-24 11:20:15 +0200 |
commit | db96605a49b334eeb2a5d1cc12981778f7d792aa (patch) | |
tree | dfeee955d24bf90f4cf1e982f5bb3e2d7af7fda6 /include/hw/ssi | |
parent | 7b5093b85b74158efda30798ffff6da973a353c4 (diff) | |
download | qemu-db96605a49b334eeb2a5d1cc12981778f7d792aa.zip qemu-db96605a49b334eeb2a5d1cc12981778f7d792aa.tar.gz qemu-db96605a49b334eeb2a5d1cc12981778f7d792aa.tar.bz2 |
ssi: cache SSIPeripheralClass to avoid GET_CLASS()
Investigating why some BMC models are so slow compared to a plain ARM
virt machines I did some profiling of:
./qemu-system-arm -M romulus-bmc -nic user \
-drive
file=obmc-phosphor-image-romulus.static.mtd,format=raw,if=mtd \
-nographic -serial mon:stdio
And saw that object_class_dynamic_cast_assert was dominating the
profile times. We have a number of cases in this model of the SSI bus.
As the class is static once the object is created we just cache it and
use it instead of the dynamic case macros.
Profiling against:
./tests/venv/bin/avocado run \
tests/avocado/machine_aspeed.py:test_arm_ast2500_romulus_openbmc_v2_9_0
Before: 35.565 s ± 0.087 s
After: 15.713 s ± 0.287 s
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Cc: Cédric Le Goater <clg@kaod.org>
Tested-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20220811151413.3350684-6-alex.bennee@linaro.org>
Message-Id: <20220923084803.498337-6-clg@kaod.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Diffstat (limited to 'include/hw/ssi')
-rw-r--r-- | include/hw/ssi/ssi.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/hw/ssi/ssi.h b/include/hw/ssi/ssi.h index f411858..6950f86 100644 --- a/include/hw/ssi/ssi.h +++ b/include/hw/ssi/ssi.h @@ -59,6 +59,9 @@ struct SSIPeripheralClass { struct SSIPeripheral { DeviceState parent_obj; + /* cache the class */ + SSIPeripheralClass *spc; + /* Chip select state */ bool cs; }; |