We study the behaviour of functions of dissipative operators under relatively bounded and relatively trace class perturbations. We introduce and study the class of analytic relatively operator Lipschitz functions. An essential role is played by double operator integrals with respect to semispectral measures. We also study the class of analytic resolvent Lipschitz functions. Then we obtain a trace formula in the case of relatively trace class perturbations and show that the maximal class of functions for which the trace formula holds in the case of relatively trace class perturbations coincides with the class of analytic relatively operator Lipschitz functions. We also establish the inequality integral |xi(t)| (1 + |t|) (- 1) dt < infinity for the spectral shift function xi in the case of relatively trace class perturbations.