Skip to content

Commit

Permalink
Fix garbled java class name problem of uobjnew.py
Browse files Browse the repository at this point in the history
After this fix, the output may look like this:
NAME/TYPE                      # ALLOCS      # BYTES
[B                                    1         1016
[D                                    1         8016
  • Loading branch information
D-D-H authored and yonghong-song committed Nov 12, 2021
1 parent bf49924 commit 039cef6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/lib/uobjnew.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,11 @@
struct key_t key = {};
struct val_t *valp, zero = {};
u64 classptr = 0, size = 0;
u32 length = 0;
bpf_usdt_readarg(2, ctx, &classptr);
bpf_usdt_readarg(3, ctx, &length);
bpf_usdt_readarg(4, ctx, &size);
bpf_probe_read_user(&key.name, sizeof(key.name), (void *)classptr);
bpf_probe_read_user(&key.name, min(sizeof(key.name), (size_t)length), (void *)classptr);
valp = allocs.lookup_or_try_init(&key, &zero);
if (valp) {
valp->total_size += size;
Expand Down

0 comments on commit 039cef6

Please sign in to comment.