systemtap_with_examples
  • Introduction
  • Installation
    • Build systap from source
    • Build package from source
  • Systemtap Language
    • Syntax
    • Variables
    • Control Flow
    • Function & Macro
    • TypeCase
    • Guru Mode
    • Probe Point
    • Predefined Functions
  • Examples
    • Call Graph
    • Dump Stack Trace
    • Duration
    • CPU Performance
    • Network DEV Analysis
    • KVM MMU
  • Reference
Powered by GitBook
On this page

Was this helpful?

  1. Examples

Network DEV Analysis

Here is an example to evaluate the time elapsed on a net_dev handler and on which cpu it runs.

global value
global netpstats
global cpustats
global init_time
probe begin
{
    init_time = gettimeofday_ms()
}
probe module("e1000").function("e1000_xmit_frame")
{
    value = gettimeofday_ns()
    cpustats <<< cpu()
}
probe module("e1000").function("e1000_xmit_frame").return
{
    diff = gettimeofday_ns() - value
    netpstats <<< diff
}
probe timer.s(5)
{
    exit();
}
probe end
{
    print(@hist_linear(netpstats,0, 15000, 500))
    print(@hist_log(cpustats))
    printf("Total time: %d miliseconds\n", gettimeofday_ms() - init_time)
}
PreviousCPU PerformanceNextKVM MMU

Last updated 6 years ago

Was this helpful?