Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting user-space stack information from perf
    primarykey
    data
    text
    <p>I'm currently trying to track down some phantom I/O in a PostgreSQL build I'm testing. It's a multi-process server and it isn't simple to associate disk I/O back to a particular back-end and query.</p> <p>I thought Linux's <code>perf</code> tool would be ideal for this, but I'm struggling to capture block I/O performance counter metrics and associate them with user-space activity.</p> <p>It's easy to record block I/O requests and completions with, eg:</p> <pre><code>sudo perf record -g -T -u postgres -e 'block:block_rq_*' </code></pre> <p>and the user-space pid is recorded, but there's no kernel or user-space stack captured, or ability to snapshot bits of the user-space process's heap (say, query text) etc. So while you have the pid, you don't know what the process was doing at that point. Just <code>perf script</code> output like:</p> <pre><code>postgres 7462 [002] 301125.113632: block:block_rq_issue: 8,0 W 0 () 208078848 + 1024 [postgres] </code></pre> <p>If I add the <code>-g</code> flag to <code>perf record</code> it'll take snapshots of the <em>kernel</em> stack, but doesn't capture user-space state for perf events captured in the kernel. The user-space stack only goes up to the entry-point from userspace, like <code>LWLockRelease</code>, <code>LWLockAcquire</code>, <code>memcpy</code> (mmap'd IO), <code>__GI___libc_write</code>, etc.</p> <p>So. Any tips? Being able to capture a snapshot of the <em>user-space</em> stack in response to <em>kernel</em> events would be ideal.</p> <p>I'm on Fedora 19, 3.11.3-201.fc19.x86_64, Schrödinger’s Cat, with perf version 3.10.9-200.fc19.x86_64.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload