Set up the profiler in CLI mode.

Change-Id: I7f36786573870b66b4f1e93c2fc2e444f1ae1252
(cherry picked from commit 820de0f13b8921a64bec435024dc0778b0eb1251)