How the phase margin and gain margin of the switching power supply are measured
1. Requires a dedicated spectrum analyzer. The instrument (such as the Fluke Spectrum Analyzer, HP, etc.) can automatically scan the BODE of the measured power supply.
2. Disconnect the loop at your feedback sampling point and access the signal output channels of the spectrum analyzer (all differential output signals, in order to inject a perturbation signal from the spectrometer to the circuit).