Trace formulas applied to the Riemann $\zeta$-function