use functional profile method in profiler; fix bug in profiler that thread become null; fix array out of index bug in random shuffle