b = buf;
- sscanf(b, "%d objects, %ld bytes",
+ sscanf(b, "%lu objects, %lu bytes",
&obj->total_count, &obj->total_bytes);
b = strchr(b, '\n');
- sscanf(b, "%*d [%*d] objects, %ld [%ld] bytes in gtt",
+ sscanf(b, "%*d [%*d] objects, %lu [%lu] bytes in gtt",
&obj->total_gtt, &obj->total_aperture);
ret = 0;
break;
/* Xorg: 35 objects, 16347136 bytes (0 active, 12103680 inactive, 0 unbound) */
- sscanf(++b, "%256s %u objects, %lu bytes",
+ sscanf(++b, "%256s %lu objects, %lu bytes",
comm->name, &comm->count, &comm->bytes);
insert_sorted(obj, comm);
#include <stdint.h>
struct gem_objects {
- uint64_t total_bytes;
- uint32_t total_count;
- uint64_t total_gtt, total_aperture;
- uint64_t max_gtt, max_aperture;
+ long unsigned total_bytes, total_count;
+ long unsigned total_gtt, total_aperture;
+ long unsigned max_gtt, max_aperture;
struct gem_objects_comm {
struct gem_objects_comm *next;
char name[256];
- uint64_t bytes;
- uint32_t count;
+ long unsigned bytes;
+ long unsigned count;
} *comm;
};
cairo_pattern_destroy(linear);
cairo_fill(ctx->cr);
- sprintf(buf, "Total: %ldMB, %d objects",
+ sprintf(buf, "Total: %ldMB, %ld objects",
go->gem_objects.total_bytes >> 20, go->gem_objects.total_count);
cairo_set_source_rgba(ctx->cr, 1, 1, 1, 1);
cairo_move_to(ctx->cr, x, y);
if ((comm->bytes >> 20) == 0)
break;
- sprintf(buf, " %s %ldMB, %d objects",
+ sprintf(buf, " %s %ldMB, %ld objects",
comm->name, comm->bytes >> 20, comm->count);
cairo_set_source_rgba(ctx->cr, 1, 1, 1, 1);
cairo_move_to(ctx->cr, x, y);