vc4: Add a few function traces
Sprinkle around a few traces that were useful in locating submit and fence waits. Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31575>
This commit is contained in:

committed by
Marge Bot

parent
cf939334e6
commit
63f0a2f9a0
@@ -23,6 +23,7 @@
|
||||
|
||||
#include "nir/pipe_nir.h"
|
||||
#include "util/format/u_format.h"
|
||||
#include "util/perf/cpu_trace.h"
|
||||
#include "util/u_surface.h"
|
||||
#include "util/u_blitter.h"
|
||||
#include "compiler/nir/nir_builder.h"
|
||||
@@ -544,6 +545,8 @@ vc4_blit(struct pipe_context *pctx, const struct pipe_blit_info *blit_info)
|
||||
{
|
||||
struct pipe_blit_info info = *blit_info;
|
||||
|
||||
MESA_TRACE_FUNC();
|
||||
|
||||
vc4_yuv_blit(pctx, &info);
|
||||
|
||||
vc4_tile_blit(pctx, &info);
|
||||
|
@@ -28,6 +28,7 @@
|
||||
#include <xf86drm.h>
|
||||
#include <xf86drmMode.h>
|
||||
|
||||
#include "util/perf/cpu_trace.h"
|
||||
#include "util/u_hash_table.h"
|
||||
#include "util/u_memory.h"
|
||||
#include "util/u_string.h"
|
||||
@@ -604,6 +605,8 @@ vc4_bo_wait(struct vc4_bo *bo, uint64_t timeout_ns, const char *reason)
|
||||
{
|
||||
struct vc4_screen *screen = bo->screen;
|
||||
|
||||
MESA_TRACE_FUNC();
|
||||
|
||||
if (VC4_DBG(PERF) && timeout_ns && reason) {
|
||||
if (vc4_wait_bo_ioctl(screen->fd, bo->handle, 0) == -ETIME) {
|
||||
fprintf(stderr, "Blocking on %s BO for %s\n",
|
||||
|
@@ -38,6 +38,7 @@
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "util/os_file.h"
|
||||
#include "util/perf/cpu_trace.h"
|
||||
#include "util/u_inlines.h"
|
||||
|
||||
#include "vc4_screen.h"
|
||||
@@ -83,6 +84,8 @@ vc4_fence_finish(struct pipe_screen *pscreen,
|
||||
struct vc4_screen *screen = vc4_screen(pscreen);
|
||||
struct vc4_fence *f = vc4_fence(pf);
|
||||
|
||||
MESA_TRACE_FUNC();
|
||||
|
||||
if (f->fd >= 0)
|
||||
return sync_wait(f->fd, timeout_ns / 1000000) == 0;
|
||||
|
||||
@@ -123,6 +126,8 @@ vc4_fence_server_sync(struct pipe_context *pctx,
|
||||
struct vc4_context *vc4 = vc4_context(pctx);
|
||||
struct vc4_fence *fence = vc4_fence(pfence);
|
||||
|
||||
MESA_TRACE_FUNC();
|
||||
|
||||
if (fence->fd >= 0)
|
||||
sync_accumulate("vc4", &vc4->in_fence_fd, fence->fd);
|
||||
}
|
||||
@@ -132,6 +137,8 @@ vc4_fence_get_fd(struct pipe_screen *screen, struct pipe_fence_handle *pfence)
|
||||
{
|
||||
struct vc4_fence *fence = vc4_fence(pfence);
|
||||
|
||||
MESA_TRACE_FUNC();
|
||||
|
||||
return os_dupfd_cloexec(fence->fd);
|
||||
}
|
||||
|
||||
|
@@ -30,6 +30,7 @@
|
||||
#include "vc4_cl_dump.h"
|
||||
#include "vc4_context.h"
|
||||
#include "util/hash_table.h"
|
||||
#include "util/perf/cpu_trace.h"
|
||||
|
||||
static void
|
||||
vc4_job_free(struct vc4_context *vc4, struct vc4_job *job)
|
||||
@@ -103,6 +104,9 @@ vc4_flush_jobs_writing_resource(struct vc4_context *vc4,
|
||||
prsc);
|
||||
if (entry) {
|
||||
struct vc4_job *job = entry->data;
|
||||
|
||||
MESA_TRACE_FUNC();
|
||||
|
||||
vc4_job_submit(vc4, job);
|
||||
}
|
||||
}
|
||||
@@ -113,6 +117,8 @@ vc4_flush_jobs_reading_resource(struct vc4_context *vc4,
|
||||
{
|
||||
struct vc4_resource *rsc = vc4_resource(prsc);
|
||||
|
||||
MESA_TRACE_FUNC();
|
||||
|
||||
vc4_flush_jobs_writing_resource(vc4, prsc);
|
||||
|
||||
hash_table_foreach(vc4->jobs, entry) {
|
||||
@@ -369,6 +375,8 @@ vc4_submit_setup_rcl_msaa_surface(struct vc4_job *job,
|
||||
void
|
||||
vc4_job_submit(struct vc4_context *vc4, struct vc4_job *job)
|
||||
{
|
||||
MESA_TRACE_FUNC();
|
||||
|
||||
if (!job->needs_flush)
|
||||
goto done;
|
||||
|
||||
|
@@ -25,6 +25,7 @@
|
||||
#include <inttypes.h>
|
||||
#include "util/format/u_format.h"
|
||||
#include "util/crc32.h"
|
||||
#include "util/perf/cpu_trace.h"
|
||||
#include "util/u_helpers.h"
|
||||
#include "util/u_math.h"
|
||||
#include "util/u_memory.h"
|
||||
@@ -2214,6 +2215,8 @@ vc4_shader_ntq(struct vc4_context *vc4, enum qstage stage,
|
||||
{
|
||||
struct vc4_compile *c = qir_compile_init();
|
||||
|
||||
MESA_TRACE_FUNC();
|
||||
|
||||
c->vc4 = vc4;
|
||||
c->stage = stage;
|
||||
c->shader_state = &key->shader_state->base;
|
||||
|
@@ -25,6 +25,7 @@
|
||||
#include "pipe/p_defines.h"
|
||||
#include "util/u_memory.h"
|
||||
#include "util/format/u_format.h"
|
||||
#include "util/perf/cpu_trace.h"
|
||||
#include "util/u_inlines.h"
|
||||
#include "util/u_resource.h"
|
||||
#include "util/u_surface.h"
|
||||
@@ -104,6 +105,8 @@ vc4_map_usage_prep(struct pipe_context *pctx,
|
||||
struct vc4_context *vc4 = vc4_context(pctx);
|
||||
struct vc4_resource *rsc = vc4_resource(prsc);
|
||||
|
||||
MESA_TRACE_FUNC();
|
||||
|
||||
if (usage & PIPE_MAP_DISCARD_WHOLE_RESOURCE) {
|
||||
if (vc4_resource_bo_alloc(rsc)) {
|
||||
/* If it might be bound as one of our vertex buffers,
|
||||
|
@@ -33,6 +33,7 @@
|
||||
#include "util/u_hash_table.h"
|
||||
#include "util/u_screen.h"
|
||||
#include "util/u_transfer_helper.h"
|
||||
#include "util/perf/cpu_trace.h"
|
||||
#include "util/ralloc.h"
|
||||
|
||||
#include <xf86drm.h>
|
||||
@@ -549,6 +550,8 @@ vc4_screen_create(int fd, const struct pipe_screen_config *config,
|
||||
struct pipe_screen *pscreen;
|
||||
int err;
|
||||
|
||||
util_cpu_trace_init();
|
||||
|
||||
pscreen = &screen->base;
|
||||
|
||||
pscreen->destroy = vc4_screen_destroy;
|
||||
|
Reference in New Issue
Block a user