Dwarves Archive on lore.kernel.org
 help / color / Atom feed
* Re: codiff misses changes if inline -> not inlined?
       [not found] ` <Pine.LNX.4.64.0801031528400.14949-Y/UOj9v5BLQhZigby9b+C6cUovnZ0M2TMR2xtNvyitY@public.gmane.org>
@ 2008-01-03 15:10   ` Arnaldo Carvalho de Melo
       [not found]     ` <20080103151044.GD29523-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
  0 siblings, 1 reply; 10+ messages in thread
From: Arnaldo Carvalho de Melo @ 2008-01-03 15:10 UTC (permalink / raw)
  To: Ilpo Järvinen; +Cc: dwarves-u79uwXL29TY76Z2rM5mHXA

CCing dwarves-u79uwXL29TY76Z2rM5mHXA@public.gmane.org so that people know about this fix.

Em Thu, Jan 03, 2008 at 03:40:16PM +0200, Ilpo Järvinen escreveu:
> Hi,
> 
> I've had a problem with codiff when playing around with inlines. It seems 
> to miss completely the resizement of inlined function from zero to 
> something. Here's one example (relevant patch attached):
> 
> $ codiff tcp_input.o.old tcp_input.o
> net/ipv4/tcp_input.c:
>   tcp_dsack_extend |  -73
>   tcp_data_queue   |  -17
>  2 functions changed, 90 bytes removed
> 
> $ pfunct -s tcp_input.o.old | grep "tcp_sack_extend"
> $ pfunct -s tcp_input.o | grep "tcp_sack_extend"
> tcp_sack_extend: 66
> 
> Isn't that tcp_sack_extend | +66 missing from codiff's output???
> 
> 
> There's nothing special in the tcp_sack_extend(), any inline (at least in 
> .c files) will do.

Fixed:

[acme@doppio pahole]$ codiff /tmp/tcp_input.o.before /tmp/tcp_input.o.after
/home/acme/git/net-2.6.25/net/ipv4/tcp_input.c:
  tcp_dsack_extend |  -29
  tcp_data_queue   |  -49
 2 functions changed, 78 bytes removed

/home/acme/git/net-2.6.25/net/ipv4/tcp_input.c:
  tcp_sack_extend |  +34
 1 function changed, 34 bytes added

/tmp/tcp_input.o.after:
 3 functions changed, 34 bytes added, 78 bytes removed, diff: -44
[acme@doppio pahole]$

And if you use --verbose it'll tell you that in fact it was
"(uninlined)":

[acme@doppio pahole]$ codiff -V /tmp/tcp_input.o.before /tmp/tcp_input.o.after
/home/acme/git/net-2.6.25/net/ipv4/tcp_input.c:
  tcp_dsack_extend |  -29 # 55 -> 26, # inlines: 1 -> 0, size inlines: 34 -> 0
  tcp_data_queue   |  -49 # 2892 -> 2843, size inlines: 1247 -> 1240
 2 functions changed, 78 bytes removed

/home/acme/git/net-2.6.25/net/ipv4/tcp_input.c:
  tcp_sack_extend |  +34 (uninlined)
 1 function changed, 34 bytes added

/tmp/tcp_input.o.after:
 3 functions changed, 34 bytes added, 78 bytes removed, diff: -44
[acme@doppio pahole]$

> From d9cd8eb51562d2d3e36fb61765b24401f97e76be Mon Sep 17 00:00:00 2001
> From: =?ISO-8859-1?q?Ilpo_J=E4rvinen?= <ilpo.jarvinen@helsinki.fi>
> Date: Sat, 29 Dec 2007 13:51:54 +0200
> Subject: [PATCH] [TCP]: Remove inline from tcp_sack_extend()
> Content-Type: text/plain; charset=ISO-8859-1
> Content-Transfer-Encoding: 8bit
> 
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen-pxSi+dnQzZMxHbG02/KK1g@public.gmane.org>
> ---
> net/ipv4/tcp_input.c |    3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
>diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
>index d5b6adf..48f52cb 100644
>--- a/net/ipv4/tcp_input.c
>+++ b/net/ipv4/tcp_input.c
>@@ -3581,8 +3581,7 @@ static void tcp_fin(struct sk_buff *skb, struct sock *sk, struct tcphdr *th)
> 	}
> }
> 
>-static inline int tcp_sack_extend(struct tcp_sack_block *sp, u32 seq,
>-				  u32 end_seq)
>+static int tcp_sack_extend(struct tcp_sack_block *sp, u32 seq, u32 end_seq)
> {
> 	if (!after(seq, sp->end_seq) && !after(sp->start_seq, end_seq)) {
> 		if (before(seq, sp->start_seq))
>-- 

- Arnaldo
-
To unsubscribe from this list: send the line "unsubscribe dwarves" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: codiff misses changes if inline -> not inlined?
       [not found]     ` <20080103151044.GD29523-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
@ 2008-01-03 16:45       ` Ilpo Järvinen
       [not found]         ` <Pine.LNX.4.64.0801031728330.14949-Y/UOj9v5BLQhZigby9b+C6cUovnZ0M2TMR2xtNvyitY@public.gmane.org>
  0 siblings, 1 reply; 10+ messages in thread
From: Ilpo Järvinen @ 2008-01-03 16:45 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: dwarves-u79uwXL29TY76Z2rM5mHXA


[-- Attachment #1: Type: TEXT/PLAIN, Size: 2872 bytes --]

On Thu, 3 Jan 2008, Arnaldo Carvalho de Melo wrote:

> CCing dwarves-u79uwXL29TY76Z2rM5mHXA@public.gmane.org so that people know about this fix.
> 
> Em Thu, Jan 03, 2008 at 03:40:16PM +0200, Ilpo Järvinen escreveu:
> > Hi,
> > 
> > I've had a problem with codiff when playing around with inlines. It seems 
> > to miss completely the resizement of inlined function from zero to 
> > something. Here's one example (relevant patch attached):
> > 
> > $ codiff tcp_input.o.old tcp_input.o
> > net/ipv4/tcp_input.c:
> >   tcp_dsack_extend |  -73
> >   tcp_data_queue   |  -17
> >  2 functions changed, 90 bytes removed
> > 
> > $ pfunct -s tcp_input.o.old | grep "tcp_sack_extend"
> > $ pfunct -s tcp_input.o | grep "tcp_sack_extend"
> > tcp_sack_extend: 66
> > 
> > Isn't that tcp_sack_extend | +66 missing from codiff's output???
> > 
> > 
> > There's nothing special in the tcp_sack_extend(), any inline (at least in 
> > .c files) will do.
> 
> Fixed:
> 
> [acme@doppio pahole]$ codiff /tmp/tcp_input.o.before /tmp/tcp_input.o.after
> /home/acme/git/net-2.6.25/net/ipv4/tcp_input.c:
>   tcp_dsack_extend |  -29
>   tcp_data_queue   |  -49
>  2 functions changed, 78 bytes removed
> 
> /home/acme/git/net-2.6.25/net/ipv4/tcp_input.c:
>   tcp_sack_extend |  +34
>  1 function changed, 34 bytes added
> 
> /tmp/tcp_input.o.after:
>  3 functions changed, 34 bytes added, 78 bytes removed, diff: -44
> [acme@doppio pahole]$
> 
> And if you use --verbose it'll tell you that in fact it was
> "(uninlined)":
> 
> [acme@doppio pahole]$ codiff -V /tmp/tcp_input.o.before /tmp/tcp_input.o.after
> /home/acme/git/net-2.6.25/net/ipv4/tcp_input.c:
>   tcp_dsack_extend |  -29 # 55 -> 26, # inlines: 1 -> 0, size inlines: 34 -> 0
>   tcp_data_queue   |  -49 # 2892 -> 2843, size inlines: 1247 -> 1240
>  2 functions changed, 78 bytes removed
> 
> /home/acme/git/net-2.6.25/net/ipv4/tcp_input.c:
>   tcp_sack_extend |  +34 (uninlined)
>  1 function changed, 34 bytes added
> 
> /tmp/tcp_input.o.after:
>  3 functions changed, 34 bytes added, 78 bytes removed, diff: -44
> [acme@doppio pahole]$

Thanks...

Now that I automated it for inlines per file, one thing that annoys me a 
bit is that it does not keep identical formatting on the last line (it's 
fixable of course by some simple sed trickery):

static inline int tcp_may_raise_cwnd(const struct sock *sk, const int 
flag)
net/ipv4/tcp_input.c:
  tcp_prune_queue |  -16
 1 function changed, 16 bytes removed

...versus...

static inline int tcp_may_update_window(const struct tcp_sock *tp,
net/ipv4/tcp_input.c:
  tcp_disordered_ack |  -18
  tcp_ack            |  -76
 2 functions changed, 94 bytes removed

net/ipv4/tcp_input.c:
  tcp_may_update_window |  +56
 1 function changed, 56 bytes added

net/ipv4/tcp_input.o:
 3 functions changed, 56 bytes added, 94 bytes removed, diff: -38


diff: xx is not always present.


-- 
 i.

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

* Re: codiff misses changes if inline -> not inlined?
       [not found]         ` <Pine.LNX.4.64.0801031728330.14949-Y/UOj9v5BLQhZigby9b+C6cUovnZ0M2TMR2xtNvyitY@public.gmane.org>
@ 2008-01-03 16:56           ` Arnaldo Carvalho de Melo
       [not found]             ` <20080103165605.GF29523-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
  0 siblings, 1 reply; 10+ messages in thread
From: Arnaldo Carvalho de Melo @ 2008-01-03 16:56 UTC (permalink / raw)
  To: Ilpo Järvinen; +Cc: dwarves-u79uwXL29TY76Z2rM5mHXA

Em Thu, Jan 03, 2008 at 06:45:32PM +0200, Ilpo Järvinen escreveu:
> On Thu, 3 Jan 2008, Arnaldo Carvalho de Melo wrote:
> 
> Now that I automated it for inlines per file, one thing that annoys me a 
> bit is that it does not keep identical formatting on the last line (it's 
> fixable of course by some simple sed trickery):
> 
> static inline int tcp_may_raise_cwnd(const struct sock *sk, const int 
> flag)
> net/ipv4/tcp_input.c:
>   tcp_prune_queue |  -16
>  1 function changed, 16 bytes removed
> 
> ...versus...
> 
> static inline int tcp_may_update_window(const struct tcp_sock *tp,
> net/ipv4/tcp_input.c:
>   tcp_disordered_ack |  -18
>   tcp_ack            |  -76
>  2 functions changed, 94 bytes removed
> 
> net/ipv4/tcp_input.c:
>   tcp_may_update_window |  +56
>  1 function changed, 56 bytes added
> 
> net/ipv4/tcp_input.o:
>  3 functions changed, 56 bytes added, 94 bytes removed, diff: -38
> 
> 
> diff: xx is not always present.

Fixed, please do a git-pull.

- Arnaldo
-
To unsubscribe from this list: send the line "unsubscribe dwarves" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: codiff misses changes if inline -> not inlined?
       [not found]             ` <20080103165605.GF29523-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
@ 2008-01-03 22:41               ` Ilpo Järvinen
       [not found]                 ` <Pine.LNX.4.64.0801040038510.20866-Y/UOj9v5BLQhZigby9b+C6cUovnZ0M2TMR2xtNvyitY@public.gmane.org>
  0 siblings, 1 reply; 10+ messages in thread
From: Ilpo Järvinen @ 2008-01-03 22:41 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: dwarves-u79uwXL29TY76Z2rM5mHXA


[-- Attachment #1: Type: TEXT/PLAIN, Size: 2598 bytes --]

On Thu, 3 Jan 2008, Arnaldo Carvalho de Melo wrote:

> Em Thu, Jan 03, 2008 at 06:45:32PM +0200, Ilpo Järvinen escreveu:
> > On Thu, 3 Jan 2008, Arnaldo Carvalho de Melo wrote:
> > 
> > Now that I automated it for inlines per file, one thing that annoys me a 
> > bit is that it does not keep identical formatting on the last line (it's 
> > fixable of course by some simple sed trickery):
> > 
> > static inline int tcp_may_raise_cwnd(const struct sock *sk, const int 
> > flag)
> > net/ipv4/tcp_input.c:
> >   tcp_prune_queue |  -16
> >  1 function changed, 16 bytes removed
> > 
> > ...versus...
> > 
> > static inline int tcp_may_update_window(const struct tcp_sock *tp,
> > net/ipv4/tcp_input.c:
> >   tcp_disordered_ack |  -18
> >   tcp_ack            |  -76
> >  2 functions changed, 94 bytes removed
> > 
> > net/ipv4/tcp_input.c:
> >   tcp_may_update_window |  +56
> >  1 function changed, 56 bytes added
> > 
> > net/ipv4/tcp_input.o:
> >  3 functions changed, 56 bytes added, 94 bytes removed, diff: -38
> > 
> > 
> > diff: xx is not always present.
> 
> Fixed, please do a git-pull.

...much better with piped sort now (only added lines seemed to show up 
still without diff and they're not that interesting after all :-)), but
I think this is needed as well to complete the change...

-- 
 i.

--
[PATCH] [CODIFF]: Be even more consistent on the summary lines

Forgotten change similar to the previous patch.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen-pxSi+dnQzZMxHbG02/KK1g@public.gmane.org>
---
 codiff.c |   17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/codiff.c b/codiff.c
index 0eada19..3e59e95 100644
--- a/codiff.c
+++ b/codiff.c
@@ -568,27 +568,20 @@ static int cu_show_diffs_iterator(struct cu *cu, void *cookie)
 
 static void print_total_function_diff(const char *filename)
 {
-	int kind = 0;
-
 	printf("\n%s:\n", filename);
 
 	printf(" %u function%s changed", total_nr_functions_changed,
 	       total_nr_functions_changed > 1 ? "s" : "");
 
-	if (total_function_bytes_added != 0) {
-		++kind;
+	if (total_function_bytes_added != 0)
 		printf(", %u bytes added", total_function_bytes_added);
-	}
 
-	if (total_function_bytes_removed != 0) {
-		++kind;
+	if (total_function_bytes_removed != 0)
 		printf(", %u bytes removed", total_function_bytes_removed);
-	}
   
-	if (kind == 2)
-		printf(", diff: %+d",
-		       (total_function_bytes_added -
-		        total_function_bytes_removed));
+	printf(", diff: %+d",
+	       (total_function_bytes_added -
+	        total_function_bytes_removed));
 	putchar('\n');
 }
 
-- 
1.5.0.6

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

* Re: codiff misses changes if inline -> not inlined?
       [not found]   ` <20080103143139.GC29523-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
@ 2008-01-03 23:24     ` Ilpo Järvinen
       [not found]       ` <Pine.LNX.4.64.0801040111530.16761-Y/UOj9v5BLQhZigby9b+C6cUovnZ0M2TMR2xtNvyitY@public.gmane.org>
  0 siblings, 1 reply; 10+ messages in thread
From: Ilpo Järvinen @ 2008-01-03 23:24 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: dwarves-u79uwXL29TY76Z2rM5mHXA


[-- Attachment #1: Type: TEXT/PLAIN, Size: 1594 bytes --]

On Thu, 3 Jan 2008, Arnaldo Carvalho de Melo wrote:

> Em Thu, Jan 03, 2008 at 03:40:16PM +0200, Ilpo Järvinen escreveu:
> > Hi,
> > 
> > I've had a problem with codiff when playing around with inlines. It seems 
> > to miss completely the resizement of inlined function from zero to 
> > something. Here's one example (relevant patch attached):
> > 
> > $ codiff tcp_input.o.old tcp_input.o
> > net/ipv4/tcp_input.c:
> >   tcp_dsack_extend |  -73
> >   tcp_data_queue   |  -17
> >  2 functions changed, 90 bytes removed
> > 
> > $ pfunct -s tcp_input.o.old | grep "tcp_sack_extend"
> > $ pfunct -s tcp_input.o | grep "tcp_sack_extend"
> > tcp_sack_extend: 66
> > 
> > Isn't that tcp_sack_extend | +66 missing from codiff's output???
> > 
> > 
> > There's nothing special in the tcp_sack_extend(), any inline (at least in 
> > .c files) will do.
> 
> From codiff's point of view its a "new" function... I'm checking this right now, just a sec :)

More very interesting cases found... :-/ The tool removed inline from 
ip_ufo_append_data and got this result:

$ codiff -V net/ipv4/ip_output.o.old net/ipv4/ip_output.o
net/ipv4/ip_output.c:
  dst_output        |  +11 (uninlined)
  ip_send_check     |  +69 (uninlined)
  ip_finish_output2 | +594 (uninlined)
 3 functions changed, 674 bytes added, diff: +674

...It may well be right due to some strange inlining heurestics 
interaction but I'm a bit suspicious because of the large numbers and 
pfunct -i tells a different story for at least ip_finish_output2 and 
ip_send_check (in both cases the sizes are constant 0 in -i output!?!).


-- 
 i.

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

* Re: codiff misses changes if inline -> not inlined?
       [not found]                 ` <Pine.LNX.4.64.0801040038510.20866-Y/UOj9v5BLQhZigby9b+C6cUovnZ0M2TMR2xtNvyitY@public.gmane.org>
@ 2008-01-03 23:29                   ` Arnaldo Carvalho de Melo
  2008-01-03 23:30                   ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 10+ messages in thread
From: Arnaldo Carvalho de Melo @ 2008-01-03 23:29 UTC (permalink / raw)
  To: Ilpo Järvinen; +Cc: dwarves-u79uwXL29TY76Z2rM5mHXA

Em Fri, Jan 04, 2008 at 12:41:40AM +0200, Ilpo Järvinen escreveu:
> On Thu, 3 Jan 2008, Arnaldo Carvalho de Melo wrote:
> 
> > Em Thu, Jan 03, 2008 at 06:45:32PM +0200, Ilpo Järvinen escreveu:
> > > On Thu, 3 Jan 2008, Arnaldo Carvalho de Melo wrote:
> > > 
> > > Now that I automated it for inlines per file, one thing that annoys me a 
> > > bit is that it does not keep identical formatting on the last line (it's 
> > > fixable of course by some simple sed trickery):
> > > 
> > > static inline int tcp_may_raise_cwnd(const struct sock *sk, const int 
> > > flag)
> > > net/ipv4/tcp_input.c:
> > >   tcp_prune_queue |  -16
> > >  1 function changed, 16 bytes removed
> > > 
> > > ...versus...
> > > 
> > > static inline int tcp_may_update_window(const struct tcp_sock *tp,
> > > net/ipv4/tcp_input.c:
> > >   tcp_disordered_ack |  -18
> > >   tcp_ack            |  -76
> > >  2 functions changed, 94 bytes removed
> > > 
> > > net/ipv4/tcp_input.c:
> > >   tcp_may_update_window |  +56
> > >  1 function changed, 56 bytes added
> > > 
> > > net/ipv4/tcp_input.o:
> > >  3 functions changed, 56 bytes added, 94 bytes removed, diff: -38
> > > 
> > > 
> > > diff: xx is not always present.
> > 
> > Fixed, please do a git-pull.
> 
> ...much better with piped sort now (only added lines seemed to show up 
> still without diff and they're not that interesting after all :-)), but
> I think this is needed as well to complete the change...

Will check that, thanks for reporting! :-)

- Arnaldo
-
To unsubscribe from this list: send the line "unsubscribe dwarves" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: codiff misses changes if inline -> not inlined?
       [not found]                 ` <Pine.LNX.4.64.0801040038510.20866-Y/UOj9v5BLQhZigby9b+C6cUovnZ0M2TMR2xtNvyitY@public.gmane.org>
  2008-01-03 23:29                   ` Arnaldo Carvalho de Melo
@ 2008-01-03 23:30                   ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 10+ messages in thread
From: Arnaldo Carvalho de Melo @ 2008-01-03 23:30 UTC (permalink / raw)
  To: Ilpo Järvinen; +Cc: dwarves-u79uwXL29TY76Z2rM5mHXA

Em Fri, Jan 04, 2008 at 12:41:40AM +0200, Ilpo Järvinen escreveu:
> On Thu, 3 Jan 2008, Arnaldo Carvalho de Melo wrote:
> 
> > Em Thu, Jan 03, 2008 at 06:45:32PM +0200, Ilpo Järvinen escreveu:
> > > On Thu, 3 Jan 2008, Arnaldo Carvalho de Melo wrote:
> > > 
> > > Now that I automated it for inlines per file, one thing that annoys me a 
> > > bit is that it does not keep identical formatting on the last line (it's 
> > > fixable of course by some simple sed trickery):
> > > 
> > > static inline int tcp_may_raise_cwnd(const struct sock *sk, const int 
> > > flag)
> > > net/ipv4/tcp_input.c:
> > >   tcp_prune_queue |  -16
> > >  1 function changed, 16 bytes removed
> > > 
> > > ...versus...
> > > 
> > > static inline int tcp_may_update_window(const struct tcp_sock *tp,
> > > net/ipv4/tcp_input.c:
> > >   tcp_disordered_ack |  -18
> > >   tcp_ack            |  -76
> > >  2 functions changed, 94 bytes removed
> > > 
> > > net/ipv4/tcp_input.c:
> > >   tcp_may_update_window |  +56
> > >  1 function changed, 56 bytes added
> > > 
> > > net/ipv4/tcp_input.o:
> > >  3 functions changed, 56 bytes added, 94 bytes removed, diff: -38
> > > 
> > > 
> > > diff: xx is not always present.
> > 
> > Fixed, please do a git-pull.
> 
> ...much better with piped sort now (only added lines seemed to show up 
> still without diff and they're not that interesting after all :-)), but
> I think this is needed as well to complete the change...
> 
> -- 
>  i.
> 
> --
> [PATCH] [CODIFF]: Be even more consistent on the summary lines
> 
> Forgotten change similar to the previous patch.
> 
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen-pxSi+dnQzZMxHbG02/KK1g@public.gmane.org>

Hey, I answered too quickly, didn't noticed the patch, thanks a lot!

Applied.

- Arnaldo
-
To unsubscribe from this list: send the line "unsubscribe dwarves" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: codiff misses changes if inline -> not inlined?
       [not found]       ` <Pine.LNX.4.64.0801040111530.16761-Y/UOj9v5BLQhZigby9b+C6cUovnZ0M2TMR2xtNvyitY@public.gmane.org>
@ 2008-01-03 23:35         ` Arnaldo Carvalho de Melo
  2008-01-04  0:27         ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 10+ messages in thread
From: Arnaldo Carvalho de Melo @ 2008-01-03 23:35 UTC (permalink / raw)
  To: Ilpo Järvinen; +Cc: dwarves-u79uwXL29TY76Z2rM5mHXA

Em Fri, Jan 04, 2008 at 01:24:02AM +0200, Ilpo Järvinen escreveu:
> On Thu, 3 Jan 2008, Arnaldo Carvalho de Melo wrote:
> 
> > Em Thu, Jan 03, 2008 at 03:40:16PM +0200, Ilpo Järvinen escreveu:
> > > Hi,
> > > 
> > > I've had a problem with codiff when playing around with inlines. It seems 
> > > to miss completely the resizement of inlined function from zero to 
> > > something. Here's one example (relevant patch attached):
> > > 
> > > $ codiff tcp_input.o.old tcp_input.o
> > > net/ipv4/tcp_input.c:
> > >   tcp_dsack_extend |  -73
> > >   tcp_data_queue   |  -17
> > >  2 functions changed, 90 bytes removed
> > > 
> > > $ pfunct -s tcp_input.o.old | grep "tcp_sack_extend"
> > > $ pfunct -s tcp_input.o | grep "tcp_sack_extend"
> > > tcp_sack_extend: 66
> > > 
> > > Isn't that tcp_sack_extend | +66 missing from codiff's output???
> > > 
> > > 
> > > There's nothing special in the tcp_sack_extend(), any inline (at least in 
> > > .c files) will do.
> > 
> > From codiff's point of view its a "new" function... I'm checking this right now, just a sec :)
> 
> More very interesting cases found... :-/ The tool removed inline from 
> ip_ufo_append_data and got this result:
> 
> $ codiff -V net/ipv4/ip_output.o.old net/ipv4/ip_output.o
> net/ipv4/ip_output.c:
>   dst_output        |  +11 (uninlined)
>   ip_send_check     |  +69 (uninlined)
>   ip_finish_output2 | +594 (uninlined)
>  3 functions changed, 674 bytes added, diff: +674
> 
> ...It may well be right due to some strange inlining heurestics 
> interaction but I'm a bit suspicious because of the large numbers and 
> pfunct -i tells a different story for at least ip_finish_output2 and 
> ip_send_check (in both cases the sizes are constant 0 in -i output!?!).

I'll check that, perhaps the compiler decided to uninline the functions
because they were too big?

- Arnaldo
-
To unsubscribe from this list: send the line "unsubscribe dwarves" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: codiff misses changes if inline -> not inlined?
       [not found]       ` <Pine.LNX.4.64.0801040111530.16761-Y/UOj9v5BLQhZigby9b+C6cUovnZ0M2TMR2xtNvyitY@public.gmane.org>
  2008-01-03 23:35         ` Arnaldo Carvalho de Melo
@ 2008-01-04  0:27         ` Arnaldo Carvalho de Melo
       [not found]           ` <20080104002746.GR29523-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
  1 sibling, 1 reply; 10+ messages in thread
From: Arnaldo Carvalho de Melo @ 2008-01-04  0:27 UTC (permalink / raw)
  To: Ilpo Järvinen; +Cc: dwarves-u79uwXL29TY76Z2rM5mHXA

Em Fri, Jan 04, 2008 at 01:24:02AM +0200, Ilpo Järvinen escreveu:
> On Thu, 3 Jan 2008, Arnaldo Carvalho de Melo wrote:
> 
> > Em Thu, Jan 03, 2008 at 03:40:16PM +0200, Ilpo Järvinen escreveu:
> > > Hi,
> > > 
> > > I've had a problem with codiff when playing around with inlines. It seems 
> > > to miss completely the resizement of inlined function from zero to 
> > > something. Here's one example (relevant patch attached):
> > > 
> > > $ codiff tcp_input.o.old tcp_input.o
> > > net/ipv4/tcp_input.c:
> > >   tcp_dsack_extend |  -73
> > >   tcp_data_queue   |  -17
> > >  2 functions changed, 90 bytes removed
> > > 
> > > $ pfunct -s tcp_input.o.old | grep "tcp_sack_extend"
> > > $ pfunct -s tcp_input.o | grep "tcp_sack_extend"
> > > tcp_sack_extend: 66
> > > 
> > > Isn't that tcp_sack_extend | +66 missing from codiff's output???
> > > 
> > > 
> > > There's nothing special in the tcp_sack_extend(), any inline (at least in 
> > > .c files) will do.
> > 
> > From codiff's point of view its a "new" function... I'm checking this right now, just a sec :)
> 
> More very interesting cases found... :-/ The tool removed inline from 
> ip_ufo_append_data and got this result:
> 
> $ codiff -V net/ipv4/ip_output.o.old net/ipv4/ip_output.o
> net/ipv4/ip_output.c:
>   dst_output        |  +11 (uninlined)
>   ip_send_check     |  +69 (uninlined)
>   ip_finish_output2 | +594 (uninlined)
>  3 functions changed, 674 bytes added, diff: +674
> 
> ...It may well be right due to some strange inlining heurestics 
> interaction but I'm a bit suspicious because of the large numbers and 
> pfunct -i tells a different story for at least ip_finish_output2 and 
> ip_send_check (in both cases the sizes are constant 0 in -i output!?!).

Before manually removing inline from the function:

[acme@doppio net-2.6.25]$ pfunct -f ip_ufo_append_data /tmp/ip_output.o.old
inline int ip_ufo_append_data(struct sock * sk, int (*getfrag)(void *, char *, int, int, int, struct sk_buff *), void * from, int length, int hh_len, int fragheaderlen, int transhdrlen, int mtu, unsigned int flags);
[acme@doppio net-2.6.25]$

And the compiler is not, at least in my kernel configuration, trying to
do (un)inlining differently from what is in the source code:

[acme@doppio net-2.6.25]$ pfunct --cc_uninlined /tmp/ip_output.o.old
[acme@doppio net-2.6.25]$ pfunct --cc_inlined /tmp/ip_output.o.old
[acme@doppio net-2.6.25]$

[acme@doppio net-2.6.25]$ grep INLIN ../build/net-2.6.25/doppio/.config
# CONFIG_FORCED_INLINING is not set

[acme@doppio net-2.6.25]$ pfunct -T -f ip_append_data /tmp/ip_output.o.old

Shows that ip_ufo_append_data is being inlined in ip_append_data, taking
336 bytes in my config (x86_64).

Then I remove the inline and...

[acme@doppio net-2.6.25]$ codiff /tmp/ip_output.o.old
/tmp/ip_output.o.new
/home/acme/git/net-2.6.25/net/ipv4/ip_output.c:
  dst_output        |  +14
  ip_send_check     |  +65
  ip_finish_output2 | +499
 3 functions changed, 578 bytes added, diff: +578
[acme@doppio net-2.6.25]$

Which should have shown ip_ufo_append_data as being uninlined... ah!

[acme@doppio pahole]$ pfunct --cc_inlined /tmp/ip_output.o.new
ip_ufo_append_data

The compiler decided that even if we remove the 'inline' keyword the
function is only called from ip_append_data, so it inlines it anyway.

But why we end up using 578 bytes more? Lemme see...

It is a bug:

[acme@doppio pahole]$ size /tmp/ip_output.o.old /tmp/ip_output.o.new
   text    data     bss     dec     hex filename
  12262       4       0   12266    2fea /tmp/ip_output.o.old
  12262       4       0   12266    2fea /tmp/ip_output.o.new
[acme@doppio pahole]$

Investigating...

- Arnaldo
-
To unsubscribe from this list: send the line "unsubscribe dwarves" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: codiff misses changes if inline -> not inlined?
       [not found]           ` <20080104002746.GR29523-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
@ 2008-01-04  1:39             ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 10+ messages in thread
From: Arnaldo Carvalho de Melo @ 2008-01-04  1:39 UTC (permalink / raw)
  To: Ilpo Järvinen; +Cc: dwarves-u79uwXL29TY76Z2rM5mHXA

Em Thu, Jan 03, 2008 at 10:27:46PM -0200, Arnaldo Carvalho de Melo escreveu:
> Em Fri, Jan 04, 2008 at 01:24:02AM +0200, Ilpo Järvinen escreveu:
> > On Thu, 3 Jan 2008, Arnaldo Carvalho de Melo wrote:
> > 
> > > Em Thu, Jan 03, 2008 at 03:40:16PM +0200, Ilpo Järvinen escreveu:
> > > > Hi,
> > > > 
> > > > I've had a problem with codiff when playing around with inlines. It seems 
> > > > to miss completely the resizement of inlined function from zero to 
> > > > something. Here's one example (relevant patch attached):
> > > > 
> > > > $ codiff tcp_input.o.old tcp_input.o
> > > > net/ipv4/tcp_input.c:
> > > >   tcp_dsack_extend |  -73
> > > >   tcp_data_queue   |  -17
> > > >  2 functions changed, 90 bytes removed
> > > > 
> > > > $ pfunct -s tcp_input.o.old | grep "tcp_sack_extend"
> > > > $ pfunct -s tcp_input.o | grep "tcp_sack_extend"
> > > > tcp_sack_extend: 66
> > > > 
> > > > Isn't that tcp_sack_extend | +66 missing from codiff's output???
> > > > 
> > > > 
> > > > There's nothing special in the tcp_sack_extend(), any inline (at least in 
> > > > .c files) will do.
> > > 
> > > From codiff's point of view its a "new" function... I'm checking this right now, just a sec :)
> > 
> > More very interesting cases found... :-/ The tool removed inline from 
> > ip_ufo_append_data and got this result:
> > 
> > $ codiff -V net/ipv4/ip_output.o.old net/ipv4/ip_output.o
> > net/ipv4/ip_output.c:
> >   dst_output        |  +11 (uninlined)
> >   ip_send_check     |  +69 (uninlined)
> >   ip_finish_output2 | +594 (uninlined)
> >  3 functions changed, 674 bytes added, diff: +674
> > 
> > ...It may well be right due to some strange inlining heurestics 
> > interaction but I'm a bit suspicious because of the large numbers and 
> > pfunct -i tells a different story for at least ip_finish_output2 and 
> > ip_send_check (in both cases the sizes are constant 0 in -i output!?!).
> 
> Before manually removing inline from the function:
> 
> [acme@doppio net-2.6.25]$ pfunct -f ip_ufo_append_data /tmp/ip_output.o.old
> inline int ip_ufo_append_data(struct sock * sk, int (*getfrag)(void *, char *, int, int, int, struct sk_buff *), void * from, int length, int hh_len, int fragheaderlen, int transhdrlen, int mtu, unsigned int flags);
> [acme@doppio net-2.6.25]$
> 
> And the compiler is not, at least in my kernel configuration, trying to
> do (un)inlining differently from what is in the source code:
> 
> [acme@doppio net-2.6.25]$ pfunct --cc_uninlined /tmp/ip_output.o.old
> [acme@doppio net-2.6.25]$ pfunct --cc_inlined /tmp/ip_output.o.old
> [acme@doppio net-2.6.25]$
> 
> [acme@doppio net-2.6.25]$ grep INLIN ../build/net-2.6.25/doppio/.config
> # CONFIG_FORCED_INLINING is not set
> 
> [acme@doppio net-2.6.25]$ pfunct -T -f ip_append_data /tmp/ip_output.o.old
> 
> Shows that ip_ufo_append_data is being inlined in ip_append_data, taking
> 336 bytes in my config (x86_64).
> 
> Then I remove the inline and...
> 
> [acme@doppio net-2.6.25]$ codiff /tmp/ip_output.o.old
> /tmp/ip_output.o.new
> /home/acme/git/net-2.6.25/net/ipv4/ip_output.c:
>   dst_output        |  +14
>   ip_send_check     |  +65
>   ip_finish_output2 | +499
>  3 functions changed, 578 bytes added, diff: +578
> [acme@doppio net-2.6.25]$
> 
> Which should have shown ip_ufo_append_data as being uninlined... ah!
> 
> [acme@doppio pahole]$ pfunct --cc_inlined /tmp/ip_output.o.new
> ip_ufo_append_data
> 
> The compiler decided that even if we remove the 'inline' keyword the
> function is only called from ip_append_data, so it inlines it anyway.
> 
> But why we end up using 578 bytes more? Lemme see...
> 
> It is a bug:
> 
> [acme@doppio pahole]$ size /tmp/ip_output.o.old /tmp/ip_output.o.new
>    text    data     bss     dec     hex filename
>   12262       4       0   12266    2fea /tmp/ip_output.o.old
>   12262       4       0   12266    2fea /tmp/ip_output.o.new
> [acme@doppio pahole]$
> 
> Investigating...

Fixed, it is yet another DWARF detail: DW_TAG_subprogram entries with
DW_AT_abstract_origin, that point to another DW_TAG_subprogram where we
have the DW_AT_inline attribute, we're interested in codiff just in the
DW_TAG_subprogram entries that have a DW_AT_name, and those are the ones
without DW_TAG_abstract_origin.

Now the output is:

[acme@doppio pahole]$ codiff /tmp/ip_output.o.old /tmp/ip_output.o.new
[acme@doppio pahole]$

That matches 'size', i.e. no changes, in the resulting binary, with the
only difference being in the DWARF info, the first has
DW_AT_declared_inlined (declared inline, inlined), and the second has
DW_AT_inlined (NOT declared inline, _inlined_ by the compiler).

Probably its a good idea to show this in the codiff output, as it is
confusing, will do that tomorrow.

- Arnaldo
-
To unsubscribe from this list: send the line "unsubscribe dwarves" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, back to index

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <Pine.LNX.4.64.0801031528400.14949@kivilampi-30.cs.helsinki.fi>
     [not found] ` <Pine.LNX.4.64.0801031528400.14949-Y/UOj9v5BLQhZigby9b+C6cUovnZ0M2TMR2xtNvyitY@public.gmane.org>
2008-01-03 15:10   ` codiff misses changes if inline -> not inlined? Arnaldo Carvalho de Melo
     [not found]     ` <20080103151044.GD29523-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
2008-01-03 16:45       ` Ilpo Järvinen
     [not found]         ` <Pine.LNX.4.64.0801031728330.14949-Y/UOj9v5BLQhZigby9b+C6cUovnZ0M2TMR2xtNvyitY@public.gmane.org>
2008-01-03 16:56           ` Arnaldo Carvalho de Melo
     [not found]             ` <20080103165605.GF29523-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
2008-01-03 22:41               ` Ilpo Järvinen
     [not found]                 ` <Pine.LNX.4.64.0801040038510.20866-Y/UOj9v5BLQhZigby9b+C6cUovnZ0M2TMR2xtNvyitY@public.gmane.org>
2008-01-03 23:29                   ` Arnaldo Carvalho de Melo
2008-01-03 23:30                   ` Arnaldo Carvalho de Melo
     [not found] ` <20080103143139.GC29523@ghostprotocols.net>
     [not found]   ` <20080103143139.GC29523-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
2008-01-03 23:24     ` Ilpo Järvinen
     [not found]       ` <Pine.LNX.4.64.0801040111530.16761-Y/UOj9v5BLQhZigby9b+C6cUovnZ0M2TMR2xtNvyitY@public.gmane.org>
2008-01-03 23:35         ` Arnaldo Carvalho de Melo
2008-01-04  0:27         ` Arnaldo Carvalho de Melo
     [not found]           ` <20080104002746.GR29523-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
2008-01-04  1:39             ` Arnaldo Carvalho de Melo

Dwarves Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dwarves/0 dwarves/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dwarves dwarves/ https://lore.kernel.org/dwarves \
		dwarves@vger.kernel.org
	public-inbox-index dwarves

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.dwarves


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git