Add __llvm_profile_get_filename interface to get the profile filename,
which can be used for identifying which profile file belongs to an app
when multiple binaries are instrumented and dumping profiles into the
same directory. The filename includes the path.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/profile/InstrProfilingFile.c | ||
---|---|---|
529 ↗ | (On Diff #156206) | Why not directly passing the malloced buffer to getCurFilename? |
lib/profile/InstrProfilingFile.c | ||
---|---|---|
529 ↗ | (On Diff #156206) | getCurFilename doesn't always use the provided FilenameBuf, only if it needs to substitute in a value to the filename pattern. If not, the FilenamePat is returned (note also that this code is modeled after __llvm_profile_get_path_prefix). |
lib/profile/InstrProfilingFile.c | ||
---|---|---|
529 ↗ | (On Diff #156206) | Perhaps add an additional argument to getCurFilename to force copying into the buffer? |
Comment Actions
lgtm
lib/profile/InstrProfiling.h | ||
---|---|---|
177 ↗ | (On Diff #156305) | please also add a comment that if user calls __llvm_profile_set_filename later after this call, the actual file name may differ from what is returned here. |