Weak calculus of variations for functionals of laws of semi-martingales