A method is proposed to analyze the mutual coherence function of a general x-ray beam. The mutual coherence function is shown to be the Fourier pair of the wavevector distribution of the beam inside a finite volume. A rocking-curve profile to be measured with a perfect-crystal plate is calculated as a kind of one-dimensional projection of the wavevector distribution of the incident beam. Collecting rocking-curve profiles measured with several reciprocal lattice vectors, we can construct the wavevector distribution with a computed-tomography technique, and then calculate the mutual coherence function. The mutual coherence function of a synchrotron x-ray beam was analyzed with a high spatial resolution and a wide dynamic range.