Additive tree functionals allow to represent the cost of many divide-and-conquer algorithms. We give an invariance principle for such tree functionals for the Catalan model (random tree uniformly distributed among the full binary ordered trees with given number of internal nodes) and for simply generated trees (including random tree uniformly distributed among the ordered trees with given number of nodes). In the Catalan model, this relies on the natural embedding of binary trees into the Brownian excursion and then on elementary second moment computations. We recover results first given by Fill and Kapur (2004) and then by Fill and Janson (2009). In the simply generated case, this relies on the convergence of conditioned Galton-Watson towards stable Lévy trees. We recover results first given by Janson (2003 and 2016) in the quadratic case and give a generalization to the stable case.