native profiling support

Only works with Linux for now.

Usage: make -B clean all-profile; make term; make profile

I'll add documentation in the wiki when this gets merged.