| 895 | } |
| 896 | |
| 897 | void HeapProfile() { |
| 898 | char fname[100]; |
| 899 | snprintf(fname, sizeof(fname), "%s/heap-%04d", FLAGS_db, ++heap_counter_); |
| 900 | WritableFile* file; |
| 901 | Status s = g_env->NewWritableFile(fname, &file); |
| 902 | if (!s.ok()) { |
| 903 | fprintf(stderr, "%s\n", s.ToString().c_str()); |
| 904 | return; |
| 905 | } |
| 906 | bool ok = port::GetHeapProfile(WriteToFile, file); |
| 907 | delete file; |
| 908 | if (!ok) { |
| 909 | fprintf(stderr, "heap profiling not supported\n"); |
| 910 | g_env->DeleteFile(fname); |
| 911 | } |
| 912 | } |
| 913 | }; |
| 914 | |
| 915 | } // namespace leveldb |
nothing calls this directly
no test coverage detected