mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
restore some mistakenly removed code populating missing names as '???'
This commit is contained in:
parent
662d3c1ed5
commit
c30b9e0ecd
@ -816,7 +816,7 @@ static bool WriteBufferToFd(int fd, const void* buf, ssize_t buf_size) {
|
|||||||
|
|
||||||
// Writes buffer contents (given by address `buf` and size `buf_size`) to
|
// Writes buffer contents (given by address `buf` and size `buf_size`) to
|
||||||
// the file given by `filename`. By a "system file", we mean a file that may
|
// the file given by `filename`. By a "system file", we mean a file that may
|
||||||
// ror may not require root permissions to access. If opening the file
|
// or may not require root permissions to access. If opening the file
|
||||||
// in-process fails, this will attempt opening the file in a subprocess as
|
// in-process fails, this will attempt opening the file in a subprocess as
|
||||||
// root (so this allows writing to files requiring more permissions than
|
// root (so this allows writing to files requiring more permissions than
|
||||||
// the calling process has).
|
// the calling process has).
|
||||||
@ -844,7 +844,7 @@ static bool WriteBufferToSystemFile(const char* filename, const char* buf) {
|
|||||||
// Opens the file given by `filename` for read, and passes the resulting file
|
// Opens the file given by `filename` for read, and passes the resulting file
|
||||||
// descriptor to the passed `read_function`, which must return `true` if and only
|
// descriptor to the passed `read_function`, which must return `true` if and only
|
||||||
// if it succeeded. By a "system file", we mean a file that may
|
// if it succeeded. By a "system file", we mean a file that may
|
||||||
// ror may not require root permissions to access. If opening the file in-process
|
// or may not require root permissions to access. If opening the file in-process
|
||||||
// fails, this will attempt opening the file in a subprocess as root (so this
|
// fails, this will attempt opening the file in a subprocess as root (so this
|
||||||
// allows reading files requiring more permissions than the calling process has).
|
// allows reading files requiring more permissions than the calling process has).
|
||||||
// The return value indicates success.
|
// The return value indicates success.
|
||||||
@ -1429,14 +1429,15 @@ void SysTraceSendExternalName( uint64_t thread )
|
|||||||
// This function frequently fails to read files because the /proc/$tid/
|
// This function frequently fails to read files because the /proc/$tid/
|
||||||
// files that it tries to read go away when the thread terminates, and there
|
// files that it tries to read go away when the thread terminates, and there
|
||||||
// is no synchronization to prevent that from happening.
|
// is no synchronization to prevent that from happening.
|
||||||
// To limit logging verbosity, we don't report these failures.
|
// To limit logging verbosity, we don't report these failures on stderr.
|
||||||
// The user may still see stderr messages coming directly from the exec'd
|
// The user may still see stderr messages coming directly from the exec'd
|
||||||
// `dd` command.
|
// `dd` command.
|
||||||
|
GetProfiler().SendString( thread, "???", 3, QueueType::ExternalThreadName );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf( fn, "/proc/%" PRIu64 "/status", thread );
|
sprintf( fn, "/proc/%" PRIu64 "/status", thread );
|
||||||
ReadSystemFileWithFunction(fn, [=](int fd){
|
if (!ReadSystemFileWithFunction(fn, [=](int fd){
|
||||||
FILE* f = fdopen(dup(fd), "rb");
|
FILE* f = fdopen(dup(fd), "rb");
|
||||||
if (!f) {
|
if (!f) {
|
||||||
return false;
|
return false;
|
||||||
@ -1479,7 +1480,9 @@ void SysTraceSendExternalName( uint64_t thread )
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
})) {
|
||||||
|
GetProfiler().SendString( thread, "???", 3, QueueType::ExternalName );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user