struct list_head node;
size_t size;
void *addr;
+ char *fname;
+ int line;
};
struct stack_frame {
unsigned long return_address;
};
-void *ceph_kmalloc(size_t size, gfp_t flags)
+void *ceph_kmalloc(char *fname, int line, size_t size, gfp_t flags)
{
struct alloc_data *p=kmalloc(size+sizeof(struct alloc_data), flags);
p->magic = CEPH_BK_MAGIC;
p->size = size;
+ p->fname = fname;
+ p->line = line;
spin_lock(&_bk_lock);
_total_alloc += size;
list_for_each(p, &_bk_allocs) {
entry = list_entry(p, struct alloc_data, node);
- printk("[%p]", entry->addr);
+ printk("[%p] %s(%d): ", entry->addr, entry->fname, entry->line);
print_symbol(" %s: ", (unsigned long)entry->addr);
- printk("p=%p (%zu bytes)\n", entry, entry->size);
+ printk("p=%p (%zu bytes)\n", ((void *)entry)+sizeof(struct alloc_data), entry->size);
}
}
#ifdef CEPH_BOOKKEEPER
extern void ceph_bookkeeper_init(void);
extern void ceph_bookkeeper_finalize(void);
-extern void *ceph_kmalloc(size_t size, gfp_t flags);
+extern void *ceph_kmalloc(char *fname, int line, size_t size, gfp_t flags);
extern void ceph_kfree(void *ptr);
#ifndef CEPH_OVERRIDE_BOOKKEEPER
-#define kmalloc ceph_kmalloc
+#define kmalloc(size,flags) ceph_kmalloc(__FILE__, __LINE__, size, flags)
#define kfree ceph_kfree
#endif
if (snapc)
size += sizeof(u64) * snapc->num_snaps;
req = ceph_msg_new(CEPH_MSG_OSD_OP, size, 0, 0, NULL);
+ dout(1, "new_request_msg %p\n", req);
if (IS_ERR(req))
return req;
memset(req->front.iov_base, 0, req->front.iov_len);