We use 118 strong gravitational lenses observed by the SLACS, BELLS, LSD and SL2S surveys to constrain the total mass profile and the profile of luminosity density of stars (light-tracers) in elliptical galaxies up to redshift $z \sim 1$. Assuming power-law density profiles for the total mass density, $\rho=\rho_0(r/r_0)^{-\alpha}$, and luminosity density, $\nu=\nu_0(r/r_0)^{-\delta}$, we investigate the power law index and its first derivative with respect to the redshift. Using Monte Carlo simulations of the posterior likelihood taking the Planck's best-fitted cosmology as a prior, we find $\gamma= 2.132\pm0.055$ with a mild trend $\partial \gamma/\partial z_l= -0.067\pm0.119$ when $\alpha=\delta=\gamma$, suggesting that the total density profile of massive galaxies could have become slightly steeper over cosmic time. Furthermore, similar analyses performed on sub-samples defined by different lens redshifts and velocity dispersions, indicate the need of treating low, intermediate and high-mass galaxies separately. Allowing $\delta$ to be a free parameter, we obtain $\alpha=2.070\pm0.031$, $\partial \alpha/\partial z_l= -0.121\pm0.078$, and $\delta= 2.710\pm0.143$. The model in which mass traces light is rejected at $>95\%$ confidence and our analysis robustly indicates the presence of dark matter in the form of a mass component that is differently spatially extended than the light. In this case, intermediate-mass elliptical galaxies ($200$ km/s $ < \sigma_{ap} \leq 300$ km/s) show the best consistency with the singular isothermal sphere as an effective model of galactic lenses.