Re: [GIT PULL] scripts: recordmcount: break hardlinks

2015-12-16 Thread Steven Rostedt
On Wed, 16 Dec 2015 01:54:14 -0500 Steven Rostedt wrote: > On Tue, 15 Dec 2015 22:44:14 -0500 > Steven Rostedt wrote: > > > > Here's v2. > > > > Here's v3. My tests found a bug in the code where I used snprintf() > when I should have used sprintf(). > And luck would have it that my test b

Re: [GIT PULL] scripts: recordmcount: break hardlinks

2015-12-16 Thread Steven Rostedt
On Wed, 16 Dec 2015 01:54:14 -0500 Steven Rostedt wrote: > On Tue, 15 Dec 2015 22:44:14 -0500 > Steven Rostedt wrote: > > > > Here's v2. > > > > Here's v3. My tests found a bug in the code where I used snprintf() > when I should have used sprintf(). > > + if (cnt) > + memc

Re: [GIT PULL] scripts: recordmcount: break hardlinks

2015-12-15 Thread Steven Rostedt
On Tue, 15 Dec 2015 22:44:14 -0500 Steven Rostedt wrote: > > Here's v2. > Here's v3. My tests found a bug in the code where I used snprintf() when I should have used sprintf(). -- Steve diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c index 91705ef30402..80be4ce4ad9f 100644 --- a

Re: [GIT PULL] scripts: recordmcount: break hardlinks

2015-12-15 Thread Steven Rostedt
On Tue, 15 Dec 2015 17:10:57 -0800 Linus Torvalds wrote: > On Tue, Dec 15, 2015 at 1:11 PM, Steven Rostedt wrote: > > > > Hold off. I reread what Linus wrote, and it should only do the copy if > > it actually changed something. Here's v2. > > Right. Please just write the new copy out at the

Re: [GIT PULL] scripts: recordmcount: break hardlinks

2015-12-15 Thread Linus Torvalds
On Tue, Dec 15, 2015 at 1:11 PM, Steven Rostedt wrote: > > Hold off. I reread what Linus wrote, and it should only do the copy if > it actually changed something. Right. Please just write the new copy out at the end, and make the original file open be read-only. Also, the "good" way to rewrite f

Re: [GIT PULL] scripts: recordmcount: break hardlinks

2015-12-15 Thread Steven Rostedt
On Tue, 15 Dec 2015 16:05:26 -0500 Steven Rostedt wrote: > Russell, > > Can you apply this on top of your patch and make sure everything still > works. I built and booted it, and now I'm going to run it through my > tests. > Hold off. I reread what Linus wrote, and it should only do the copy i

Re: [GIT PULL] scripts: recordmcount: break hardlinks

2015-12-15 Thread Steven Rostedt
On Tue, 15 Dec 2015 15:10:04 -0500 Steven Rostedt wrote: > I can write a patch on top of this one that does just that. I'll have > to run it through all my tests before I push it to you. Expect > something by tomorrow. Russell, Can you apply this on top of your patch and make sure everything st

Re: [GIT PULL] scripts: recordmcount: break hardlinks

2015-12-15 Thread Steven Rostedt
On Tue, 15 Dec 2015 12:00:46 -0800 Linus Torvalds wrote: > On Tue, Dec 15, 2015 at 11:50 AM, Steven Rostedt wrote: > > > > 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 pr

Re: [GIT PULL] scripts: recordmcount: break hardlinks

2015-12-15 Thread Linus Torvalds
On Tue, Dec 15, 2015 at 11:50 AM, Steven Rostedt wrote: > > 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. Ugh. Can we please fix

[GIT PULL] scripts: recordmcount: break hardlinks

2015-12-15 Thread Steven Rostedt
Linus, 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, recordmcoun