How to check “gperftools” version based on “tcmalloc” library?

strings <path>/libtcmalloc.so | grep -i "gperftools"

or

grep -ao "gperftools [0-9.]*" <path>/libtcmalloc.so

-a: forces it to read the binary as text.
-o: tells it to only print the matching version string instead of dumping a massive wall of corrupted binary text into your terminal.