All Garmin devices I've seen have the ability of constantly writing GPS track in background. I suppose, every touristic GPS has such functionality. Since GPS device is constantly tracking GPS signal, writing track is a low-cost operation.
I'm using my Garmin to navigate to the geocaches, and I'm always registering GPS track in the same time. It's a standard function nowadays.
From what I know, there are clocks with GPS that can be used only for GPS tracking because they don't display maps, but such devices are quite a niche, practical only for speed runners who want to save a bit on weight.
Smartphones, on the other side, are relatively good for GPS navigation, but not for tracking, because GPS drains power from them very quickly. It's practicable to activate GPS only to see how to go further and then shut up the maps app.
But with tourist GPS, it's not the case. They are designed to be turned on constantly, and they can work on one battery set quite a long (my Etrex - over 24 hours). Consider buying the device that can work with rechargeable batteries like AA, you can take extra supplies, and in "emergency" case, buy some unrechargeable AAs in any newspaper shop.