static int process_mem_print(struct seq_file *s, void *unused) { struct kgsl_mem_entry *entry; struct rb_node *node; struct kgsl_process_private *private = s->private; char flags[4]; char usage[16]; spin_lock(&private->mem_lock); seq_printf(s, "%8s %8s %5s %10s %16s %5s\n", "gpuaddr", "size", "flags", "type", "usage", "sglen"); for (node = rb_first(&private->mem_rb); node; node = rb_next(node)) { struct kgsl_memdesc *m; entry = rb_entry(node, struct kgsl_mem_entry, node); m = &entry->memdesc; flags[0] = m->priv & KGSL_MEMDESC_GLOBAL ? 'g' : '-'; flags[1] = m->flags & KGSL_MEMFLAGS_GPUREADONLY ? 'r' : '-'; flags[2] = get_alignflag(m); flags[3] = '\0'; kgsl_get_memory_usage(usage, sizeof(usage), m->flags); seq_printf(s, "%08x %8d %5s %10s %16s %5d\n", m->gpuaddr, m->size, flags, memtype_str(entry->memtype), usage, m->sglen); } spin_unlock(&private->mem_lock); return 0; }
static void print_mem_entry(struct seq_file *s, struct kgsl_mem_entry *entry) { char flags[6]; char usage[16]; struct kgsl_memdesc *m = &entry->memdesc; flags[0] = kgsl_memdesc_is_global(m) ? 'g' : '-'; flags[1] = m->flags & KGSL_MEMFLAGS_GPUREADONLY ? 'r' : '-'; flags[2] = get_alignflag(m); flags[3] = get_cacheflag(m); flags[4] = kgsl_memdesc_use_cpu_map(m) ? 'p' : '-'; flags[5] = '\0'; kgsl_get_memory_usage(usage, sizeof(usage), m->flags); seq_printf(s, "%08x %08lx %8d %5d %5s %10s %16s %5d\n", m->gpuaddr, m->useraddr, m->size, entry->id, flags, memtype_str(entry->memtype), usage, m->sglen); }