Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Jan 2021 13:35:35 +0300
From:      Lev Serebryakov <lev@FreeBSD.org>
To:        freebsd-hackers@freebsd.org
Subject:   Is here good documentation/tutorial about user-level profiling with `pmcstat'
Message-ID:  <602f671d-683d-d291-c8d2-f01526eca34b@FreeBSD.org>

next in thread | raw e-mail | index | archive | help

  I'm trying to use `pmcstat' to profile my userland (single threaded) program.

  And I can not find good instructions about how to use it.

  What event should I use for simple CPU profile? Is it cpu_clk_unhalted.thread or inst_retired.any or anything else?

  How to provide symbols from `/usr/lib/debug' to `pmcstat'? I've tried `pmcstat -R' but it doesn't see any function names outside my program:

# pmcstat -R out-3.pmcstat -z100 -G out-3.stacks
CONVERSION STATISTICS:
  #exec/elf                                1
  #samples/total                           248539181
  #samples/unknown-function                43228216
  #callchain/dubious-frames                132121
#

  How could I filter-our kernel stacks? I don't need them (now) and they take a lot of space on flame graph.

  How could I drill-down to source-line-level (from per-function level) for some functions which take most of time?

  I've tried to Google but could not find any good documentation and `man pmcstat' is very terse.

  Thank you.

-- 
// Lev Serebryakov



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?602f671d-683d-d291-c8d2-f01526eca34b>