AFAICT, nothing like this exists for Linux. Is it at all possible to do?

Clearly the Phoronix Test Suite measures FPS of various games, but I'm not a programmer and wouldn't be able to make nor heads nor tails from it.

Basically, I'm looking for even a quick-and-dirty solution which would show the FPS of an app (game) and dump it into a file for further processing. If possible, both for Linux and OS X.

Any ideas?