We have found a capacitance-voltage method to measure the spatial profile of majority carrier trap concentration in and near the depletion region of an abrupt p-n semiconductor junction. The method is analogous to the standard capacitance-voltage method for measuring the doping concentration profile. We develop specific equations for the hole trap concentration profile in the p material adjacent to heavily doped n material. Measurements are made on silicon solar cell samples and compared to deep level transient spectroscopy measurements on the same samples. The method is especially useful for measuring spatial gradients in defect concentration, and is derived for defect concentration not exceeding twice the doping concentration.