From: Alexey Budankov <alexey.budankov@linux.intel.com>
To: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>, Andi Kleen <ak@linux.intel.com>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v5] perf record: collect user registers set jointly with dwarf stacks
Date: Fri, 31 May 2019 09:27:38 +0300 [thread overview]
Message-ID: <3dc0c67e-9ea3-b9f5-1aa2-e87603b29c37@linux.intel.com> (raw)
In-Reply-To: <20190530194111.GA6540@kernel.org>
On 30.05.2019 22:41, Arnaldo Carvalho de Melo wrote:
> Em Thu, May 30, 2019 at 10:03:36PM +0300, Alexey Budankov escreveu:
>>
>> When dwarf stacks are collected jointly with user specified register
>> set using --user-regs option like below the full register context is
>> captured on a sample:
>>
>> $ perf record -g --call-graph dwarf,1024 --user-regs=IP,SP,BP -- stack_test2.g.O3
>>
>> 188143843893585 0x6b48 [0x4f8]: PERF_RECORD_SAMPLE(IP, 0x4002): 23828/23828: 0x401236 period: 1363819 addr: 0x7ffedbdd51ac
>> ... FP chain: nr:0
>> ... user regs: mask 0xff0fff ABI 64-bit
>> .... AX 0x53b
>> .... BX 0x7ffedbdd3cc0
>> .... CX 0xffffffff
>> .... DX 0x33d3a
>> .... SI 0x7f09b74c38d0
>> .... DI 0x0
>> .... BP 0x401260
>> .... SP 0x7ffedbdd3cc0
>> .... IP 0x401236
>> .... FLAGS 0x20a
>> .... CS 0x33
>> .... SS 0x2b
>> .... R8 0x7f09b74c3800
>> .... R9 0x7f09b74c2da0
>> .... R10 0xfffffffffffff3ce
>> .... R11 0x246
>> .... R12 0x401070
>> .... R13 0x7ffedbdd5db0
>> .... R14 0x0
>> .... R15 0x0
>> ... ustack: size 1024, offset 0xe0
>> . data_src: 0x5080021
>> ... thread: stack_test2.g.O:23828
>> ...... dso: /root/abudanko/stacks/stack_test2.g.O3
>>
>> After applying the change suggested in the patch the sample data contain
>> only user specified register values. IP and SP registers (DWARF_MINIMAL_REGS)
>> are collected anyways regardless of the --user-regs value provided from
>> the command line:
>
> Applied, changed the subject and description to:
>
> perf record: Allow mixing --user-regs with --call-graph=dwarf
>
> When DWARF stacks were requested and at the same time that the user
> specifies a register set using the --user-regs option the full register
> context was being captured on samples:
>
> $ perf record -g --call-graph dwarf,1024 --user-regs=IP,SP,BP -- stack_test2.g.O3
>
> 188143843893585 0x6b48 [0x4f8]: PERF_RECORD_SAMPLE(IP, 0x4002): 23828/23828: 0x401236 period: 1363819 addr: 0x7ffedbdd51ac
> ... FP chain: nr:0
> ... user regs: mask 0xff0fff ABI 64-bit
> .... AX 0x53b
> .... BX 0x7ffedbdd3cc0
> .... CX 0xffffffff
> .... DX 0x33d3a
> .... SI 0x7f09b74c38d0
> .... DI 0x0
> .... BP 0x401260
> .... SP 0x7ffedbdd3cc0
> .... IP 0x401236
> .... FLAGS 0x20a
> .... CS 0x33
> .... SS 0x2b
> .... R8 0x7f09b74c3800
> .... R9 0x7f09b74c2da0
> .... R10 0xfffffffffffff3ce
> .... R11 0x246
> .... R12 0x401070
> .... R13 0x7ffedbdd5db0
> .... R14 0x0
> .... R15 0x0
> ... ustack: size 1024, offset 0xe0
> . data_src: 0x5080021
> ... thread: stack_test2.g.O:23828
> ...... dso: /root/abudanko/stacks/stack_test2.g.O3
>
> I.e. the --user-regs=IP,SP,BP was being ignored, being overridden by the
> needs of --call-graph=dwarf.
>
> After applying the change in this patch the sample data contains the
> user specified register, but making sure that at least the minimal set
> of register needed for DWARF unwinding (DWARF_MINIMAL_REGS) is
> requested.
>
> The user is warned that DWARF unwinding may not work if extra registers
> end up being needed.
>
> -g call-graph dwarf,K full_regs
> --user-regs=user_regs user_regs
> -g call-graph dwarf,K --user-regs=user_regs user_regs + DWARF_MINIMAL_REGS
> <REST remains the same>
>
Sounds better. Thanks!
~Alexey
next prev parent reply other threads:[~2019-05-31 6:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-30 19:03 Alexey Budankov
2019-05-30 19:41 ` Arnaldo Carvalho de Melo
2019-05-31 6:27 ` Alexey Budankov [this message]
2019-06-04 14:12 ` Arnaldo Carvalho de Melo
2019-06-04 14:56 ` Alexey Budankov
2019-06-04 15:42 ` Arnaldo Carvalho de Melo
2019-06-17 18:58 ` [tip:perf/core] perf record: Allow mixing --user-regs with --call-graph=dwarf tip-bot for Alexey Budankov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3dc0c67e-9ea3-b9f5-1aa2-e87603b29c37@linux.intel.com \
--to=alexey.budankov@linux.intel.com \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=arnaldo.melo@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome