Skip to Content
marmot
Commands

Break an executable down by section, by package and by function, and show what calls a function (-why). Function names and sizes come from marmot's pc table, or from the symbol table for other binaries.

Usage
marmot size BINARY [flags]

Examples

marmot size ./app
marmot size -pkg fmt ./app
marmot size -why fmt.Sprintf ./app

marmot size app lists the sections of the executable, the code of each package and the largest functions. -pkg fmt lists one package's functions; -why fmt.Sprintf prints a chain of direct calls from main to the function, which says why it is linked in. It also reads binaries built by other compilers, through their symbol table.

-json writes one size object with sections, packages and functions; with -why it has why with chain.

Flags

Flags take one dash or two: -release and --release are the same.

FlagMeaning
-color stringcolor in human output: auto, always or never (NO_COLOR turns auto off) (default "auto")
-jsonmachine readable output: JSON Lines on stderr (also $MARMOT_OUTPUT=json, and the default under coding agents)
-n stringhow many packages and functions to list (default "15")
-pkg stringlist the functions of this package only
-why stringshow a chain of direct calls from main to this function

Full help

marmot size --help
Break an executable down by section, by package and by function, and show what calls a function (-why). Function names and sizes come from marmot's pc table, or from the symbol table for other binaries.

Usage:
  marmot size BINARY [flags]

Examples:
marmot size ./app
marmot size -pkg fmt ./app
marmot size -why fmt.Sprintf ./app

Flags:
      --color string   color in human output: auto, always or never (NO_COLOR turns auto off) (default "auto")
  -h, --help           help for size
      --json           machine readable output: JSON Lines on stderr (also $MARMOT_OUTPUT=json, and the default under coding agents)
      --n string       how many packages and functions to list (default "15")
      --pkg string     list the functions of this package only
      --why string     show a chain of direct calls from main to this function

On this page

Was this page helpful?

Report an issueOpen issues