[Mesa-dev] [PATCH 2/4] radeon: Add bo statistics dumping support
Erik Faye-Lund
kusmabite at gmail.com
Thu Jan 2 18:54:01 PST 2014
On Wed, Jan 1, 2014 at 3:57 PM, Lauri Kasanen <cand at gmx.com> wrote:
> diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c
> index 28921be..2c33ddf 100644
> --- a/src/gallium/drivers/radeon/r600_pipe_common.c
> +++ b/src/gallium/drivers/radeon/r600_pipe_common.c
> @@ -209,6 +216,24 @@ bool r600_common_screen_init(struct r600_common_screen *rscreen,
> return false;
> }
>
> + if (rscreen->debug_flags & DBG_BO_STATS) {
> + char statsfile[80];
> + const pid_t pid = getpid();
> +
> +#ifdef __GLIBC__
> + snprintf(statsfile, 80, "/tmp/bostats.%u.%s", pid, program_invocation_short_name);
> +#else
> + snprintf(statsfile, 80, "/tmp/bostats.%u", pid);
> +#endif
> +
> + rscreen->ws->bo_stats_file = fopen(statsfile, "w");
> + if (!rscreen->ws->bo_stats_file)
> + fprintf(stderr, "Failed to open bo stats file %s\n", statsfile);
> + else
> + fprintf(rscreen->ws->bo_stats_file, "Started at %llu\n",
> + (unsigned long long) os_time_get_nano() / 1000000);
stats_time_get()?
More information about the mesa-dev
mailing list