So far as I know the proto-mammals were earlier than the dinosaurs. The major survivor of the great Permian extinction was Lystrosaurus. Apparently, one key to their survival was the habit of burrowing underground at bed time. Probably protected them from other predators as well as atmospheric flame and ash. Also sleeping underground their lungs would have been protected while sleeping from contaminated atmosphere by filtering itthrough the earth. The link below has several comments and recommendations for other authors writing on the subject of survival.
Thanks gleeaikin. I think the Lystrosaurus also helped end the Peloponnesian War.