radv: append a time string to the hang report dump directory
Using the PID only isn't really informative. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7706>
This commit is contained in:
@@ -557,8 +557,8 @@ RADV driver environment variables
|
|||||||
Enables DCC,FMASK,CMASK,HTILE in situations where the driver supports it
|
Enables DCC,FMASK,CMASK,HTILE in situations where the driver supports it
|
||||||
but normally does not deem it beneficial.
|
but normally does not deem it beneficial.
|
||||||
``hang``
|
``hang``
|
||||||
enable GPU hangs detection and dump a report to $HOME/radv_dumps_<pid>
|
enable GPU hangs detection and dump a report to
|
||||||
if a GPU hang is detected
|
$HOME/radv_dumps_<pid>_<time> if a GPU hang is detected
|
||||||
``img``
|
``img``
|
||||||
Print image info
|
Print image info
|
||||||
``info``
|
``info``
|
||||||
|
@@ -616,11 +616,19 @@ radv_check_gpu_hangs(struct radv_queue *queue, struct radeon_cmdbuf *cs)
|
|||||||
|
|
||||||
fprintf(stderr, "radv: GPU hang detected...\n");
|
fprintf(stderr, "radv: GPU hang detected...\n");
|
||||||
|
|
||||||
/* Create a directory into $HOME/radv_dumps_<pid> to save various
|
/* Create a directory into $HOME/radv_dumps_<pid>_<time> to save
|
||||||
* debugging info about that GPU hang.
|
* various debugging info about that GPU hang.
|
||||||
*/
|
*/
|
||||||
snprintf(dump_dir, sizeof(dump_dir), "%s/"RADV_DUMP_DIR"_%d",
|
struct tm *timep, result;
|
||||||
debug_get_option("HOME", "."), getpid());
|
time_t raw_time;
|
||||||
|
char buf_time[128];
|
||||||
|
|
||||||
|
time(&raw_time);
|
||||||
|
timep = localtime_r(&raw_time, &result);
|
||||||
|
strftime(buf_time, sizeof(buf_time), "%Y.%m.%d_%H.%M.%S", timep);
|
||||||
|
|
||||||
|
snprintf(dump_dir, sizeof(dump_dir), "%s/"RADV_DUMP_DIR"_%d_%s",
|
||||||
|
debug_get_option("HOME", "."), getpid(), buf_time);
|
||||||
if (mkdir(dump_dir, 0774) && errno != EEXIST) {
|
if (mkdir(dump_dir, 0774) && errno != EEXIST) {
|
||||||
fprintf(stderr, "radv: can't create directory '%s' (%i).\n",
|
fprintf(stderr, "radv: can't create directory '%s' (%i).\n",
|
||||||
dump_dir, errno);
|
dump_dir, errno);
|
||||||
|
Reference in New Issue
Block a user