summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>2021-06-03 08:41:21 +0200
committerMarge Bot <eric+marge@anholt.net>2021-06-03 15:39:34 +0000
commitea3f72c9d9e102a7fcc2d984ca296b635a5d8139 (patch)
tree35222715645f2019674af22f17f04f9109ea49b4
parentb3225be1e983e1b984b3d507f9c26fc71aff5543 (diff)
ac: rename ac_dump_thread_trace() to ac_dump_rgp_capture()
RGP captures can contain both SQTT and SPM data. While we are at it, move it to ac_rgp.h and adjust a message. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11156>
-rw-r--r--src/amd/common/ac_rgp.c8
-rw-r--r--src/amd/common/ac_rgp.h6
-rw-r--r--src/amd/common/ac_sqtt.h5
-rw-r--r--src/amd/vulkan/layers/radv_sqtt_layer.c4
-rw-r--r--src/gallium/drivers/radeonsi/si_sqtt.c2
5 files changed, 13 insertions, 12 deletions
diff --git a/src/amd/common/ac_rgp.c b/src/amd/common/ac_rgp.c
index a8e4729b5c3..790ae789fe3 100644
--- a/src/amd/common/ac_rgp.c
+++ b/src/amd/common/ac_rgp.c
@@ -947,9 +947,9 @@ static void ac_sqtt_dump_data(struct radeon_info *rad_info,
}
}
-int ac_dump_thread_trace(struct radeon_info *info,
- const struct ac_thread_trace *thread_trace,
- struct ac_thread_trace_data *thread_trace_data)
+int ac_dump_rgp_capture(struct radeon_info *info,
+ const struct ac_thread_trace *thread_trace,
+ struct ac_thread_trace_data *thread_trace_data)
{
char filename[2048];
struct tm now;
@@ -969,7 +969,7 @@ int ac_dump_thread_trace(struct radeon_info *info,
ac_sqtt_dump_data(info, thread_trace, thread_trace_data, f);
- fprintf(stderr, "Thread trace capture saved to '%s'\n", filename);
+ fprintf(stderr, "RGP capture saved to '%s'\n", filename);
fclose(f);
return 0;
diff --git a/src/amd/common/ac_rgp.h b/src/amd/common/ac_rgp.h
index bb7407b77d5..f704e5ddd3f 100644
--- a/src/amd/common/ac_rgp.h
+++ b/src/amd/common/ac_rgp.h
@@ -33,6 +33,7 @@
struct radeon_info;
struct ac_thread_trace;
+struct ac_thread_trace_data;
enum rgp_hardware_stages {
RGP_HW_STAGE_VS = 0,
@@ -105,6 +106,11 @@ struct rgp_pso_correlation {
simple_mtx_t lock;
};
+int
+ac_dump_rgp_capture(struct radeon_info *info,
+ const struct ac_thread_trace *thread_trace,
+ struct ac_thread_trace_data *thread_trace_data);
+
void
ac_rgp_file_write_elf_object(FILE *output, size_t file_elf_start,
struct rgp_code_object_record *record,
diff --git a/src/amd/common/ac_sqtt.h b/src/amd/common/ac_sqtt.h
index 7c77f9f95e0..459c5da593a 100644
--- a/src/amd/common/ac_sqtt.h
+++ b/src/amd/common/ac_sqtt.h
@@ -96,11 +96,6 @@ uint32_t
ac_get_expected_buffer_size(struct radeon_info *rad_info,
const struct ac_thread_trace_info *info);
-int
-ac_dump_thread_trace(struct radeon_info *info,
- const struct ac_thread_trace *thread_trace,
- struct ac_thread_trace_data *thread_trace_data);
-
/**
* Identifiers for RGP SQ thread-tracing markers (Table 1)
*/
diff --git a/src/amd/vulkan/layers/radv_sqtt_layer.c b/src/amd/vulkan/layers/radv_sqtt_layer.c
index fc68d188dab..9cbd1354705 100644
--- a/src/amd/vulkan/layers/radv_sqtt_layer.c
+++ b/src/amd/vulkan/layers/radv_sqtt_layer.c
@@ -363,8 +363,8 @@ radv_handle_thread_trace(VkQueue _queue)
radv_QueueWaitIdle(_queue);
if (radv_get_thread_trace(queue, &thread_trace)) {
- ac_dump_thread_trace(&queue->device->physical_device->rad_info, &thread_trace,
- &queue->device->thread_trace);
+ ac_dump_rgp_capture(&queue->device->physical_device->rad_info, &thread_trace,
+ &queue->device->thread_trace);
} else {
/* Trigger a new capture if the driver failed to get
* the trace because the buffer was too small.
diff --git a/src/gallium/drivers/radeonsi/si_sqtt.c b/src/gallium/drivers/radeonsi/si_sqtt.c
index 293903b1abf..b01bf2c3753 100644
--- a/src/gallium/drivers/radeonsi/si_sqtt.c
+++ b/src/gallium/drivers/radeonsi/si_sqtt.c
@@ -696,7 +696,7 @@ si_handle_thread_trace(struct si_context *sctx, struct radeon_cmdbuf *rcs)
/* Wait for SQTT to finish and read back the bo */
if (sctx->ws->fence_wait(sctx->ws, sctx->last_sqtt_fence, PIPE_TIMEOUT_INFINITE) &&
si_get_thread_trace(sctx, &thread_trace)) {
- ac_dump_thread_trace(&sctx->screen->info, &thread_trace, sctx->thread_trace);
+ ac_dump_rgp_capture(&sctx->screen->info, &thread_trace, sctx->thread_trace);
} else {
fprintf(stderr, "Failed to read the trace\n");
}