{
    "content": [
        {
            "type": "text",
            "text": "# readprofile(8) (man)\n\n**Summary:** readprofile - read kernel profiling information\n\n**Synopsis:** readprofile [options]\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| -a | --all | — | Print all symbols in the mapfile. By default the procedures with reported ticks are not printed. |\n| -b | --histbin | — | Print individual histogram-bin counts. |\n| -i | --info | — | Info. This makes readprofile only print the profiling step used by the kernel. The profiling step is the resolution of t |\n| -m | --mapfile | — | Specify a mapfile, which by default is /usr/src/linux/System.map. You should specify the map file on cmdline if your cur |\n| -M | --multiplier | — | On some architectures it is possible to alter the frequency at which the kernel delivers profiling interrupts to each CP |\n| -p | --profile | — | Specify a different profiling buffer, which by default is /proc/profile. Using a different pro-file is useful if you wan |\n| -r | --reset | — | Reset the profiling buffer. This can only be invoked by root, because /proc/profile is readable by everybody but writabl |\n| -s | --counters | — | Print individual counters within functions. |\n| -v | --verbose | — | Verbose. The output is organized in four columns and filled with blanks. The first column is the RAM address of a kernel |\n| -V | --version | — | Display version information and exit. |\n| -h | --help | — | Display help text and exit. |\n\n## Examples\n\n- `Browse the profiling buffer ordering by clock ticks:`\n- `readprofile | sort -nr | less`\n- `Print the 20 most loaded procedures:`\n- `readprofile | sort -nr +2 | head -20`\n- `Print only filesystem profile:`\n- `readprofile | grep ext2`\n- `Look at all the kernel information, with ram addresses:`\n- `readprofile -av | less`\n- `Browse a 'frozen' profile buffer for a non current kernel:`\n- `readprofile -p ~/profile.freeze -m /zImage.map.gz`\n- `Request profiling at 2kHz per CPU, and reset the profiling buffer:`\n- `sudo readprofile -M 20`\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (2 lines)\n- **VERSION** (2 lines)\n- **DESCRIPTION** (6 lines)\n- **OPTIONS** (1 lines) — 11 subsections\n  - -a --all (3 lines)\n  - -b --histbin (2 lines)\n  - -i --info (5 lines)\n  - -m --mapfile (5 lines)\n  - -M --multiplier (6 lines)\n  - -p --profile (6 lines)\n  - -r --reset (4 lines)\n  - -s, --counters (2 lines)\n  - -v --verbose (4 lines)\n  - -V --version (2 lines)\n  - -h --help (2 lines)\n- **FILES** (9 lines)\n- **BUGS** (14 lines)\n- **EXAMPLE** (24 lines)\n- **REPORTING BUGS** (2 lines)\n- **AVAILABILITY** (6 lines)\n\n## Full Content\n\n### NAME\n\nreadprofile - read kernel profiling information\n\n### SYNOPSIS\n\nreadprofile [options]\n\n### VERSION\n\nThis manpage documents version 2.0 of the program.\n\n### DESCRIPTION\n\nThe readprofile command uses the /proc/profile information to print ascii data on standard\noutput. The output is organized in three columns: the first is the number of clock ticks, the\nsecond is the name of the C function in the kernel where those many ticks occurred, and the\nthird is the normalized `load' of the procedure, calculated as a ratio between the number of\nticks and the length of the procedure. The output is filled with blanks to ease readability.\n\n### OPTIONS\n\n#### -a --all\n\nPrint all symbols in the mapfile. By default the procedures with reported ticks are not\nprinted.\n\n#### -b --histbin\n\nPrint individual histogram-bin counts.\n\n#### -i --info\n\nInfo. This makes readprofile only print the profiling step used by the kernel. The\nprofiling step is the resolution of the profiling buffer, and is chosen during kernel\nconfiguration (through make config), or in the kernel’s command line. If the -t (terse)\nswitch is used together with -i only the decimal number is printed.\n\n#### -m --mapfile\n\nSpecify a mapfile, which by default is /usr/src/linux/System.map. You should specify the\nmap file on cmdline if your current kernel isn’t the last one you compiled, or if you\nkeep System.map elsewhere. If the name of the map file ends with .gz it is decompressed\non the fly.\n\n#### -M --multiplier\n\nOn some architectures it is possible to alter the frequency at which the kernel delivers\nprofiling interrupts to each CPU. This option allows you to set the frequency, as a\nmultiplier of the system clock frequency, HZ. Linux 2.6.16 dropped multiplier support for\nmost systems. This option also resets the profiling buffer, and requires superuser\nprivileges.\n\n#### -p --profile\n\nSpecify a different profiling buffer, which by default is /proc/profile. Using a\ndifferent pro-file is useful if you want to `freeze' the kernel profiling at some time\nand read it later. The /proc/profile file can be copied using cat(1) or cp(1). There is\nno more support for compressed profile buffers, like in readprofile-1.1, because the\nprogram needs to know the size of the buffer in advance.\n\n#### -r --reset\n\nReset the profiling buffer. This can only be invoked by root, because /proc/profile is\nreadable by everybody but writable only by the superuser. However, you can make\nreadprofile set-user-ID 0, in order to reset the buffer without gaining privileges.\n\n#### -s, --counters\n\nPrint individual counters within functions.\n\n#### -v --verbose\n\nVerbose. The output is organized in four columns and filled with blanks. The first column\nis the RAM address of a kernel function, the second is the name of the function, the\nthird is the number of clock ticks and the last is the normalized load.\n\n#### -V --version\n\nDisplay version information and exit.\n\n#### -h --help\n\nDisplay help text and exit.\n\n### FILES\n\n/proc/profile\nA binary snapshot of the profiling buffer.\n\n/usr/src/linux/System.map\nThe symbol table for the kernel.\n\n/usr/src/linux/*\nThe program being profiled :-)\n\n### BUGS\n\nreadprofile only works with a 1.3.x or newer kernel, because /proc/profile changed in the\nstep from 1.2 to 1.3.\n\nThis program only works with ELF kernels. The change for a.out kernels is trivial, and left\nas an exercise to the a.out user.\n\nTo enable profiling, the kernel must be rebooted, because no profiling module is available,\nand it wouldn’t be easy to build. To enable profiling, you can specify profile=2 (or another\nnumber) on the kernel commandline. The number you specify is the two-exponent used as\nprofiling step.\n\nProfiling is disabled when interrupts are inhibited. This means that many profiling ticks\nhappen when interrupts are re-enabled. Watch out for misleading information.\n\n### EXAMPLE\n\nBrowse the profiling buffer ordering by clock ticks:\n\nreadprofile | sort -nr | less\n\nPrint the 20 most loaded procedures:\n\nreadprofile | sort -nr +2 | head -20\n\nPrint only filesystem profile:\n\nreadprofile | grep ext2\n\nLook at all the kernel information, with ram addresses:\n\nreadprofile -av | less\n\nBrowse a 'frozen' profile buffer for a non current kernel:\n\nreadprofile -p ~/profile.freeze -m /zImage.map.gz\n\nRequest profiling at 2kHz per CPU, and reset the profiling buffer:\n\nsudo readprofile -M 20\n\n### REPORTING BUGS\n\nFor bug reports, use the issue tracker at https://github.com/karelzak/util-linux/issues.\n\n### AVAILABILITY\n\nThe readprofile command is part of the util-linux package which can be downloaded from Linux\nKernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.\n\n\n\nutil-linux 2.37.2                            2021-06-02                               READPROFILE(8)\n\n"
        }
    ],
    "structuredContent": {
        "command": "readprofile",
        "section": "8",
        "mode": "man",
        "summary": "readprofile - read kernel profiling information",
        "synopsis": "readprofile [options]",
        "flags": [
            {
                "flag": "-a",
                "long": "--all",
                "arg": null,
                "description": "Print all symbols in the mapfile. By default the procedures with reported ticks are not printed."
            },
            {
                "flag": "-b",
                "long": "--histbin",
                "arg": null,
                "description": "Print individual histogram-bin counts."
            },
            {
                "flag": "-i",
                "long": "--info",
                "arg": null,
                "description": "Info. This makes readprofile only print the profiling step used by the kernel. The profiling step is the resolution of the profiling buffer, and is chosen during kernel configuration (through make config), or in the kernel’s command line. If the -t (terse) switch is used together with -i only the decimal number is printed."
            },
            {
                "flag": "-m",
                "long": "--mapfile",
                "arg": null,
                "description": "Specify a mapfile, which by default is /usr/src/linux/System.map. You should specify the map file on cmdline if your current kernel isn’t the last one you compiled, or if you keep System.map elsewhere. If the name of the map file ends with .gz it is decompressed on the fly."
            },
            {
                "flag": "-M",
                "long": "--multiplier",
                "arg": null,
                "description": "On some architectures it is possible to alter the frequency at which the kernel delivers profiling interrupts to each CPU. This option allows you to set the frequency, as a multiplier of the system clock frequency, HZ. Linux 2.6.16 dropped multiplier support for most systems. This option also resets the profiling buffer, and requires superuser privileges."
            },
            {
                "flag": "-p",
                "long": "--profile",
                "arg": null,
                "description": "Specify a different profiling buffer, which by default is /proc/profile. Using a different pro-file is useful if you want to `freeze' the kernel profiling at some time and read it later. The /proc/profile file can be copied using cat(1) or cp(1). There is no more support for compressed profile buffers, like in readprofile-1.1, because the program needs to know the size of the buffer in advance."
            },
            {
                "flag": "-r",
                "long": "--reset",
                "arg": null,
                "description": "Reset the profiling buffer. This can only be invoked by root, because /proc/profile is readable by everybody but writable only by the superuser. However, you can make readprofile set-user-ID 0, in order to reset the buffer without gaining privileges."
            },
            {
                "flag": "-s",
                "long": "--counters",
                "arg": null,
                "description": "Print individual counters within functions."
            },
            {
                "flag": "-v",
                "long": "--verbose",
                "arg": null,
                "description": "Verbose. The output is organized in four columns and filled with blanks. The first column is the RAM address of a kernel function, the second is the name of the function, the third is the number of clock ticks and the last is the normalized load."
            },
            {
                "flag": "-V",
                "long": "--version",
                "arg": null,
                "description": "Display version information and exit."
            },
            {
                "flag": "-h",
                "long": "--help",
                "arg": null,
                "description": "Display help text and exit."
            }
        ],
        "examples": [
            "Browse the profiling buffer ordering by clock ticks:",
            "readprofile | sort -nr | less",
            "Print the 20 most loaded procedures:",
            "readprofile | sort -nr +2 | head -20",
            "Print only filesystem profile:",
            "readprofile | grep ext2",
            "Look at all the kernel information, with ram addresses:",
            "readprofile -av | less",
            "Browse a 'frozen' profile buffer for a non current kernel:",
            "readprofile -p ~/profile.freeze -m /zImage.map.gz",
            "Request profiling at 2kHz per CPU, and reset the profiling buffer:",
            "sudo readprofile -M 20"
        ],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "VERSION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-a --all",
                        "lines": 3,
                        "flag": "-a",
                        "long": "--all"
                    },
                    {
                        "name": "-b --histbin",
                        "lines": 2,
                        "flag": "-b",
                        "long": "--histbin"
                    },
                    {
                        "name": "-i --info",
                        "lines": 5,
                        "flag": "-i",
                        "long": "--info"
                    },
                    {
                        "name": "-m --mapfile",
                        "lines": 5,
                        "flag": "-m",
                        "long": "--mapfile"
                    },
                    {
                        "name": "-M --multiplier",
                        "lines": 6,
                        "flag": "-M",
                        "long": "--multiplier"
                    },
                    {
                        "name": "-p --profile",
                        "lines": 6,
                        "flag": "-p",
                        "long": "--profile"
                    },
                    {
                        "name": "-r --reset",
                        "lines": 4,
                        "flag": "-r",
                        "long": "--reset"
                    },
                    {
                        "name": "-s, --counters",
                        "lines": 2,
                        "flag": "-s",
                        "long": "--counters"
                    },
                    {
                        "name": "-v --verbose",
                        "lines": 4,
                        "flag": "-v",
                        "long": "--verbose"
                    },
                    {
                        "name": "-V --version",
                        "lines": 2,
                        "flag": "-V",
                        "long": "--version"
                    },
                    {
                        "name": "-h --help",
                        "lines": 2,
                        "flag": "-h",
                        "long": "--help"
                    }
                ]
            },
            {
                "name": "FILES",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 14,
                "subsections": []
            },
            {
                "name": "EXAMPLE",
                "lines": 24,
                "subsections": []
            },
            {
                "name": "REPORTING BUGS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AVAILABILITY",
                "lines": 6,
                "subsections": []
            }
        ]
    }
}