  A fluctuation relation is derived to extract the order parameter function
$q(x)$ in weakly ergodic systems. The relation is based on measuring and
classifying entropy production fluctuations according to the value of the
overlap $q$ between configurations. For a fixed value of $q$, entropy
production fluctuations are Gaussian distributed allowing us to derive the
quasi-FDT so characteristic of aging systems. The theory is validated by
extracting the $q(x)$ in various types of glassy models. It might be generally
applicable to other nonequilibrium systems and experimental small systems.
