From: Adrian Hunter <adrian.hunter@intel.com>
To: Daniel Dao <dqminh@cloudflare.com>,
acme@kernel.org, linux-perf-users@vger.kernel.org,
kernel-team <kernel-team@cloudflare.com>,
linux-kernel <linux-kernel@vger.kernel.org>,
jolsa@redhat.com, namhyung@kernel.org
Subject: Re: perf record --kcore does not work when /proc/modules changed during copy
Date: Fri, 2 Sep 2022 19:08:38 +0300 [thread overview]
Message-ID: <8ed21b90-07e5-f611-2a7c-ce185c4d2a8c@intel.com> (raw)
In-Reply-To: <CA+wXwBT_fiBrFG-=C=eWGHuJ3XzxDLe-Ba4ybOvuxvu5A1+Tig@mail.gmail.com>
On 2/09/22 18:46, Daniel Dao wrote:
> Hi Perf tools maintainers,
>
> `perf record --kcore` frequently did not work on a somewhat busy system.
> For example:
>
> sudo perf record --kcore -- sleep 1
> ERROR: Failed to copy kcore
>
> Using strace to look at the invocation, the failure looks like:
>
> ...
> openat(AT_FDCWD, "/proc/modules", O_RDONLY) = 56
> openat(AT_FDCWD, "perf.data/kcore_dir/modules", O_RDONLY) = 57
> read(56, "mpls_gso 16384 0 - Live 0xffffff"..., 4096) = 4070
> read(57, "mpls_gso 16384 0 - Live 0xffffff"..., 4070) = 4070
> read(56, "xt_conntrack 24576 22 - Live 0xf"..., 4096) = 3738
> read(57, "xt_conntrack 24576 22 - Live 0xf"..., 3738) = 3738
> close(57) = 0
> close(56) = 0
> close(55) = 0
> unlink("perf.data/kcore_dir/kcore") = 0
> close(54) = 0
> unlink("perf.data/kcore_dir/modules") = 0
> unlink("perf.data/kcore_dir/kallsyms") = 0
> write(2, "ERROR: Failed to copy kcore\n", 28ERROR: Failed to copy kcore
> ...
>
> We can see that the verification of proc/modules failed because /proc/modules
> output changed after we copied kcore. When i looked at it, they are caused by
> changes of module refcount which seems expected on busy systems, such as
>
> < tcp_bbr 40960 12644 - Live 0x0000000000000000
> ---
> > tcp_bbr 40960 12678 - Live 0x0000000000000000
>
> Any suggestions on how to make this work is much appreciated.
At the moment I can't think why the proc/modules file needs to be
compared at all since we also compare proc/kallsyms which should be
enough.
prev parent reply other threads:[~2022-09-02 16:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-02 15:46 perf record --kcore does not work when /proc/modules changed during copy Daniel Dao
2022-09-02 16:08 ` Adrian Hunter [this message]
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=8ed21b90-07e5-f611-2a7c-ce185c4d2a8c@intel.com \
--to=adrian.hunter@intel.com \
--cc=acme@kernel.org \
--cc=dqminh@cloudflare.com \
--cc=jolsa@redhat.com \
--cc=kernel-team@cloudflare.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=namhyung@kernel.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;
as well as URLs for NNTP newsgroup(s).