summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/mm/bitmap_allocator.c
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2017-11-29 18:48:10 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2018-01-25 17:24:42 -0500
commitb46045f3fe71fad703ee7d689657af16925d78ca (patch)
tree47a1e4231f84c2bb5db3dabf79c7b2b1eeb817be /drivers/gpu/nvgpu/common/mm/bitmap_allocator.c
parent99e808567ca358e0e6d03f4731b81854070266a3 (diff)
gpu: nvgpu: Cleanup '\n' usage in allocator debugging
These '\n' were leftover from the previous debugging macro usage which did no add the '\n' automagically. However, once swapped over to the nvgpu logging system the '\n' is added and no longer needs to be present in the code. This did require one extra modification though to keep things consistent. The __alloc_pstat() macro, used for sending output either to a seq_file or the terminal, needed to add the '\n' for seq_printf() calls and the '\n' had to be deleted in the C files. Change-Id: I4d56317fe2a87bd00033cfe79d06ffc048d91049 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1613641 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/mm/bitmap_allocator.c')
-rw-r--r--drivers/gpu/nvgpu/common/mm/bitmap_allocator.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/drivers/gpu/nvgpu/common/mm/bitmap_allocator.c b/drivers/gpu/nvgpu/common/mm/bitmap_allocator.c
index 6bd654b8..f75f9a1f 100644
--- a/drivers/gpu/nvgpu/common/mm/bitmap_allocator.c
+++ b/drivers/gpu/nvgpu/common/mm/bitmap_allocator.c
@@ -91,13 +91,13 @@ static u64 nvgpu_bitmap_alloc_fixed(struct nvgpu_allocator *__a,
91 a->nr_fixed_allocs++; 91 a->nr_fixed_allocs++;
92 alloc_unlock(__a); 92 alloc_unlock(__a);
93 93
94 alloc_dbg(__a, "Alloc-fixed 0x%-10llx 0x%-5llx [bits=0x%llx (%llu)]\n", 94 alloc_dbg(__a, "Alloc-fixed 0x%-10llx 0x%-5llx [bits=0x%llx (%llu)]",
95 base, len, blks, blks); 95 base, len, blks, blks);
96 return base; 96 return base;
97 97
98fail: 98fail:
99 alloc_unlock(__a); 99 alloc_unlock(__a);
100 alloc_dbg(__a, "Alloc-fixed failed! (0x%llx)\n", base); 100 alloc_dbg(__a, "Alloc-fixed failed! (0x%llx)", base);
101 return 0; 101 return 0;
102} 102}
103 103
@@ -129,7 +129,7 @@ static void nvgpu_bitmap_free_fixed(struct nvgpu_allocator *__a,
129 a->bytes_freed += blks * a->blk_size; 129 a->bytes_freed += blks * a->blk_size;
130 alloc_unlock(__a); 130 alloc_unlock(__a);
131 131
132 alloc_dbg(__a, "Free-fixed 0x%-10llx 0x%-5llx [bits=0x%llx (%llu)]\n", 132 alloc_dbg(__a, "Free-fixed 0x%-10llx 0x%-5llx [bits=0x%llx (%llu)]",
133 base, len, blks, blks); 133 base, len, blks, blks);
134} 134}
135 135
@@ -238,7 +238,7 @@ static u64 nvgpu_bitmap_alloc(struct nvgpu_allocator *__a, u64 len)
238 __nvgpu_bitmap_store_alloc(a, addr, blks * a->blk_size)) 238 __nvgpu_bitmap_store_alloc(a, addr, blks * a->blk_size))
239 goto fail_reset_bitmap; 239 goto fail_reset_bitmap;
240 240
241 alloc_dbg(__a, "Alloc 0x%-10llx 0x%-5llx [bits=0x%llx (%llu)]\n", 241 alloc_dbg(__a, "Alloc 0x%-10llx 0x%-5llx [bits=0x%llx (%llu)]",
242 addr, len, blks, blks); 242 addr, len, blks, blks);
243 243
244 a->nr_allocs++; 244 a->nr_allocs++;
@@ -252,7 +252,7 @@ fail_reset_bitmap:
252fail: 252fail:
253 a->next_blk = 0; 253 a->next_blk = 0;
254 alloc_unlock(__a); 254 alloc_unlock(__a);
255 alloc_dbg(__a, "Alloc failed!\n"); 255 alloc_dbg(__a, "Alloc failed!");
256 return 0; 256 return 0;
257} 257}
258 258
@@ -283,7 +283,7 @@ static void nvgpu_bitmap_free(struct nvgpu_allocator *__a, u64 addr)
283 blks = alloc->length >> a->blk_shift; 283 blks = alloc->length >> a->blk_shift;
284 284
285 bitmap_clear(a->bitmap, offs, blks); 285 bitmap_clear(a->bitmap, offs, blks);
286 alloc_dbg(__a, "Free 0x%-10llx\n", addr); 286 alloc_dbg(__a, "Free 0x%-10llx", addr);
287 287
288 a->bytes_freed += alloc->length; 288 a->bytes_freed += alloc->length;
289 289
@@ -323,18 +323,18 @@ static void nvgpu_bitmap_print_stats(struct nvgpu_allocator *__a,
323{ 323{
324 struct nvgpu_bitmap_allocator *a = bitmap_allocator(__a); 324 struct nvgpu_bitmap_allocator *a = bitmap_allocator(__a);
325 325
326 __alloc_pstat(s, __a, "Bitmap allocator params:\n"); 326 __alloc_pstat(s, __a, "Bitmap allocator params:");
327 __alloc_pstat(s, __a, " start = 0x%llx\n", a->base); 327 __alloc_pstat(s, __a, " start = 0x%llx", a->base);
328 __alloc_pstat(s, __a, " end = 0x%llx\n", a->base + a->length); 328 __alloc_pstat(s, __a, " end = 0x%llx", a->base + a->length);
329 __alloc_pstat(s, __a, " blks = 0x%llx\n", a->num_bits); 329 __alloc_pstat(s, __a, " blks = 0x%llx", a->num_bits);
330 330
331 /* Actual stats. */ 331 /* Actual stats. */
332 __alloc_pstat(s, __a, "Stats:\n"); 332 __alloc_pstat(s, __a, "Stats:");
333 __alloc_pstat(s, __a, " Number allocs = 0x%llx\n", a->nr_allocs); 333 __alloc_pstat(s, __a, " Number allocs = 0x%llx", a->nr_allocs);
334 __alloc_pstat(s, __a, " Number fixed = 0x%llx\n", a->nr_fixed_allocs); 334 __alloc_pstat(s, __a, " Number fixed = 0x%llx", a->nr_fixed_allocs);
335 __alloc_pstat(s, __a, " Bytes alloced = 0x%llx\n", a->bytes_alloced); 335 __alloc_pstat(s, __a, " Bytes alloced = 0x%llx", a->bytes_alloced);
336 __alloc_pstat(s, __a, " Bytes freed = 0x%llx\n", a->bytes_freed); 336 __alloc_pstat(s, __a, " Bytes freed = 0x%llx", a->bytes_freed);
337 __alloc_pstat(s, __a, " Outstanding = 0x%llx\n", 337 __alloc_pstat(s, __a, " Outstanding = 0x%llx",
338 a->bytes_alloced - a->bytes_freed); 338 a->bytes_alloced - a->bytes_freed);
339} 339}
340#endif 340#endif
@@ -421,12 +421,12 @@ int nvgpu_bitmap_allocator_init(struct gk20a *g, struct nvgpu_allocator *__a,
421#ifdef CONFIG_DEBUG_FS 421#ifdef CONFIG_DEBUG_FS
422 nvgpu_init_alloc_debug(g, __a); 422 nvgpu_init_alloc_debug(g, __a);
423#endif 423#endif
424 alloc_dbg(__a, "New allocator: type bitmap\n"); 424 alloc_dbg(__a, "New allocator: type bitmap");
425 alloc_dbg(__a, " base 0x%llx\n", a->base); 425 alloc_dbg(__a, " base 0x%llx", a->base);
426 alloc_dbg(__a, " bit_offs 0x%llx\n", a->bit_offs); 426 alloc_dbg(__a, " bit_offs 0x%llx", a->bit_offs);
427 alloc_dbg(__a, " size 0x%llx\n", a->length); 427 alloc_dbg(__a, " size 0x%llx", a->length);
428 alloc_dbg(__a, " blk_size 0x%llx\n", a->blk_size); 428 alloc_dbg(__a, " blk_size 0x%llx", a->blk_size);
429 alloc_dbg(__a, " flags 0x%llx\n", a->flags); 429 alloc_dbg(__a, " flags 0x%llx", a->flags);
430 430
431 return 0; 431 return 0;
432 432