Skip to content

Commit

Permalink
tools/memleak: Fixes explanations for -Z and -z options
Browse files Browse the repository at this point in the history
These are the description of each options written in memleak.c file
-z option: capture only allocations larger than this size
-Z option: capture only allocations smaller than this size

But actually they work like this
-z option: capture only allocations larger than or equal to this size
-Z option: capture only allocations smaller than or equal to this size

Which means, there was off-by-one errors.
So, fixes the explanation message.
  • Loading branch information
Bojun-Seo committed Nov 25, 2024
1 parent bccb275 commit e3dee0a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/memleak.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ def run_command_get_pid(command):
parser.add_argument("-T", "--top", type=int, default=10,
help="display only this many top allocating stacks (by size)")
parser.add_argument("-z", "--min-size", type=int,
help="capture only allocations larger than this size")
help="capture only allocations larger than or equal to this size")
parser.add_argument("-Z", "--max-size", type=int,
help="capture only allocations smaller than this size")
help="capture only allocations smaller than or equal to this size")
parser.add_argument("-O", "--obj", type=str, default="c",
help="attach to allocator functions in the specified object")
parser.add_argument("--ebpf", action="store_true",
Expand Down

0 comments on commit e3dee0a

Please sign in to comment.