If (M,g) is a compact real analytic Riemannian manifold, we give a necessary and sufficient condition for there to be a sequence of quasimodes of order o(\lambda) saturating sup-norm estimates. In particular, it gives optimal conditions for existence of eigenfunctions satisfying maximal sup norm bounds. The condition is that there exists a self-focal point x_0 \in M for the geodesic flow at which the associated Perron–Frobenius operator U_{x_0}\colon L^2(S_{x_0}^*M) \to L^2(S_{x_0}^*M) has a nontrivial invariant L^2 function. The proof is based on an explicit Duistermaat–Guillemin–Safarov pre-trace formula and von Neumann's ergodic theorem.