profile: Emit paths only in the callgrind output.
The callgrind information should contain a path to an ELF file, not an identifier. We thus only add the identifer when we don't have something that looks like a path (or is the commpage.) This allows applications that analyze callgrind output to merge images with the same ELF file.
This commit is contained in:
@@ -302,9 +302,17 @@ CallgrindProfileResult::_PrintFunction(FILE* out,
|
|||||||
// need to print the image name
|
// need to print the image name
|
||||||
int32 index = fNextImageOutputIndex++;
|
int32 index = fNextImageOutputIndex++;
|
||||||
image->SetOutputIndex(index);
|
image->SetOutputIndex(index);
|
||||||
fprintf(out,
|
const char* name = image->GetImage()->Name();
|
||||||
"%sob=(%" B_PRId32 ") %s:%" B_PRId32 "\n", called ? "c" : "",
|
if (name[0] == '/' || strcmp(name, "commpage") == 0) {
|
||||||
index, image->GetImage()->Name(), image->ID());
|
fprintf(out,
|
||||||
|
"%sob=(%" B_PRId32 ") %s\n", called ? "c" : "",
|
||||||
|
index, name);
|
||||||
|
} else {
|
||||||
|
// add ID to image name
|
||||||
|
fprintf(out,
|
||||||
|
"%sob=(%" B_PRId32 ") %s:%" B_PRId32 "\n", called ? "c" : "",
|
||||||
|
index, name, image->ID());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// image is already known
|
// image is already known
|
||||||
// TODO: We may not need to print it at all!
|
// TODO: We may not need to print it at all!
|
||||||
|
|||||||
Reference in New Issue
Block a user