writing out profile.d file