On 12/8/20 12:15 PM, Peter Maydell wrote: > It's common to want to print a human-readable indication of a clock's > frequency. Provide a utility function in the clock API to return a > string which is a displayable representation of the frequency, > and use it in qdev-monitor.c. > > Before: > > (qemu) info qtree > [...] > dev: xilinx,zynq_slcr, id "" > clock-in "ps_clk" freq_hz=3.333333e+07 > mmio 00000000f8000000/0000000000001000 > > After: > > dev: xilinx,zynq_slcr, id "" > clock-in "ps_clk" freq_hz=33.3 MHz > mmio 00000000f8000000/0000000000001000 > > > Signed-off-by: Peter Maydell <peter.mayd...@linaro.org> > --- > This is based on Philippe's patch > "qdev-monitor: Display frequencies scaled to SI unit" > but I have abstracted out the "prettified string" into the clock API. > ---
Reviewed-by: Richard Henderson <richard.hender...@linaro.org> r~