From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Russell King <rmk+kernel@arm.linux.org.uk>
Subject: [PATCH 0/2] [GIT PULL] ftrace/recordmcount: Fix hardlink issue with ccache
Date: Wed, 23 Dec 2015 10:17:03 -0500 [thread overview]
Message-ID: <20151223151703.225805170@goodmis.org> (raw)
Linus,
[ Well, as you know, my test box was not suffering from a harddrive
failure, but a bug in the block layer. After wasting several days
to figure that out, I got my test box up and running again, and was
able to complete my testing. ]
Russell King was reporting lots of warnings when he compiled his kernel
with ftrace enabled. With some investigation it was discovered that it
was his compile setup. He was using ccache with hard links, which allowed
recordmcount to process the same .o twice. When this happens, recordmcount
will detect that it was already done and give a warning about it.
Russell fixed this by having recordmcount detect that the object file
has more than one hard link, and if it does, it unlinks the object file
after it maps it and processes then. This appears to fix the issue.
As you did not like the fact that recordmcount modified the file in place
and thought that it should do the modifications in memory and then write
it out to disk and move it over the old file to prevent other more subtle
issues like the one above, a second patch is added on top of Russell's to
do just that. Luckily the original code had write and lseek wrappers that
I was able to modify to not do inplace writes, but simply keep track
of the changes made in memory. When a write is made, a "update" flag is
set, and at the end of processing, if the update is set, then it writes
the file with changes out to a new file, and then renames it over the
original one.
The file descriptor is still passed to the write and lseek wrappers because
removing that would cause the change to be more intrusive. That can be
removed in a follow up cleanup patch that can wait till the next merge
window.
Please pull the latest trace-v4.4-rc4-2 tree, which can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
trace-v4.4-rc4-2
Tag SHA1: c8eaa389dd82351cf142d7b5419964dede5e797b
Head SHA1: a50bd43935586420fb75f4558369eb08566fac5e
Russell King (1):
scripts: recordmcount: break hardlinks
Steven Rostedt (Red Hat) (1):
ftrace/scripts: Have recordmcount copy the object file
----
scripts/recordmcount.c | 137 ++++++++++++++++++++++++++++++++++++++++---------
1 file changed, 113 insertions(+), 24 deletions(-)
next reply other threads:[~2015-12-23 15:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-23 15:17 Steven Rostedt [this message]
2015-12-23 15:17 ` [PATCH 1/2] scripts: recordmcount: break hardlinks Steven Rostedt
2015-12-23 15:17 ` [PATCH 2/2] ftrace/scripts: Have recordmcount copy the object file Steven Rostedt
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=20151223151703.225805170@goodmis.org \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=rmk+kernel@arm.linux.org.uk \
--cc=torvalds@linux-foundation.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