mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] [GIT PULL] ftrace/recordmcount: Fix hardlink issue with ccache
@ 2015-12-23 15:17 Steven Rostedt
  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
  0 siblings, 2 replies; 3+ messages in thread
From: Steven Rostedt @ 2015-12-23 15:17 UTC (permalink / raw)
  To: linux-kernel; +Cc: Linus Torvalds, Ingo Molnar, Andrew Morton, Russell King


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(-)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-12-23 15:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-23 15:17 [PATCH 0/2] [GIT PULL] ftrace/recordmcount: Fix hardlink issue with ccache Steven Rostedt
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®