We show, through a refinement of the work theorem, that the average dissipation, upon perturbing a Hamiltonian system arbitrarily far out of equilibrium in a transition between two canonical equilibrium states, is exactly given by Wdiss=W-F=kTD(||)=kTln(/), where and are the phase-space density of the system measured at the same intermediate but otherwise arbitrary point in time, for the forward and backward process. D(||) is the relative entropy of versus . This result also implies general inequalities, which are significantly more accurate than the second law and include, as a special case, the celebrated Landauer principle on the dissipation involved in irreversible computations.