Analyzer func-call-rate

Name

func-call-rate - Function Call Rate

This analyzer profiles the call rate of specific functions across various runtime environments including C libraries, LuaJIT, and application executables. It captures timing data for function calls and generates line chart visualizations showing the call rate over time. When ON-CPU tools find the hot functions, this analyzer can be used to further investigate the call rate of the specific function, helping identify performance bottlenecks and optimize critical code paths.

Resource Category

CPU.

Application Type & Technical Stack

  • All

Command Line Syntax

The analyzer can be invoked directly on the command-line via the orxray utility from the openresty-xray-cli software package.

Alternatively, the analyzer can also be invoked manually or automatically on the web console UI of OpenResty XRay (like on the Advanced web page).

# PID is the target process PID.
orxray analyzer run func-call-rate -p PID

# trace a shell command directly
orxray analyzer run func-call-rate -c SHELL_CMD

# PGID is the process group ID or any process's PID within the target process
# group.
orxray analyzer run func-call-rate -p -PGID

# trace any processes started from the specified executable path.
orxray analyzer run func-call-rate --exe /path/to/exe/file

Tracing Multiple Processes

Supported.

Output Formats

  • Line Charts
  • Plain Texts

Output Example

[
  {
    "categories": [
      "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" ],
    "categoryTitle": "Time (Seconds)",
    "series": [
      {
        "data": [ 0, 10, 0, 0, 3000, 0, 0, 80, 120, 8880 ],
        "name": "Malloc"
      }
    ],
    "subtitle": "",
    "title": "Function Call Rate",
    "type": "line",
    "valueTitle": "Call Count",
    "ver": 1
  }
]

Author

The OpenResty Inc. Team.

Copyright (C) by OpenResty Inc. All rights reserved.