From: Julia Lawall <julia.lawall@lip6.fr>
To: Joe Perches <joe@perches.com>
Cc: SF Markus Elfring <elfring@users.sourceforge.net>,
Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>,
Paul Mackerras <paulus@samba.org>,
linux-ppp@vger.kernel.org, netdev@vger.kernel.org,
Eric Dumazet <eric.dumazet@gmail.com>,
LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH v2 1/6] net-PPP: Replacement of a printk() call by pr_warn() in mppe_rekey()
Date: Sun, 07 Dec 2014 12:36:08 +0000 [thread overview]
Message-ID: <alpine.DEB.2.02.1412071335140.2030@localhost6.localdomain6> (raw)
In-Reply-To: <1417955413.31745.25.camel@perches.com>
On Sun, 7 Dec 2014, Joe Perches wrote:
> On Sun, 2014-12-07 at 11:44 +0100, Julia Lawall wrote:
> > > A negative to that approach is inlined functions would
> > > take the function name of the parent not keep the
> > > inlined function name.
> >
> > I tried the following:
> >
> > #include <stdio.h>
> >
> > inline int foo() {
> > printf("%s %x\n",__func__,0x12345);
> > }
> >
> > int main () {
> > foo();
> > }
> >
> > The assembly code generated for main is:
> >
> > 0000000000400470 <main>:
> > 400470: b9 45 23 01 00 mov $0x12345,%ecx
> > 400475: ba 4b 06 40 00 mov $0x40064b,%edx
> > 40047a: be 44 06 40 00 mov $0x400644,%esi
> > 40047f: bf 01 00 00 00 mov $0x1,%edi
> > 400484: 31 c0 xor %eax,%eax
> > 400486: e9 d5 ff ff ff jmpq 400460 <__printf_chk@plt>
> >
> > That is, the call to foo seems tom be inlined.
> >
> > But the output is:
> >
> > foo 12345
> >
> > So it seems that __func__ is determined before inlining.
>
> True, and that's what I intended to describe.
>
> If you did that with a kernel module and replaced
> "%s, __func__" with "%pf, __builtin_return_address(0)"
> when built with kallsyms you should get:
>
> "modname 12345" when most would expect "foo 12345"
>
> when built without kallsyms, that output should be
> "<address> 12345"
>
> but the object code should be smaller.
OK. But the semantic patch is only using __func__ and only in cases where
the string wanted is similar to the name of the current function, so I
think it should be OK?
julia
next prev parent reply other threads:[~2014-12-07 12:36 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <5307CAA2.8060406@users.sourceforge.net>
[not found] ` <alpine.DEB.2.02.1402212321410.2043@localhost6.localdomain6>
[not found] ` <530A086E.8010901@users.sourceforge.net>
[not found] ` <alpine.DEB.2.02.1402231635510.1985@localhost6.localdomain6>
[not found] ` <530A72AA.3000601@users.sourceforge.net>
[not found] ` <alpine.DEB.2.02.1402240658210.2090@localhost6.localdomain6>
[not found] ` <530B5FB6.6010207@users.sourceforge.net>
[not found] ` <alpine.DEB.2.10.1402241710370.2074@hadrien>
[not found] ` <530C5E18.1020800@users.sourceforge.net>
[not found] ` <alpine.DEB.2.10.1402251014170.2080@hadrien>
[not found] ` <530CD2C4.4050903@users.sourceforge.net>
[not found] ` <alpine.DEB.2.10.1402251840450.7035@hadrien>
[not found] ` <530CF8FF.8080600@users.sourceforge.net>
[not found] ` <alpine.DEB.2.02.1402252117150.2047@localhost6.localdomain6>
[not found] ` <530DD06F.4090703@users.sourceforge.net>
[not found] ` <alpine.DEB.2.02.1402262129250.2221@localhost6.localdomain6>
[not found] ` <5317A59D.4@users.sourceforge.net>
2014-11-30 16:40 ` [PATCH 0/3] net-PPP: Deletion of a few unnecessary checks SF Markus Elfring
2014-11-30 16:44 ` [PATCH 1/3] net-PPP: Deletion of unnecessary checks before the function call "kfree" SF Markus Elfring
2014-12-01 12:19 ` Sergei Shtylyov
2014-12-01 15:00 ` SF Markus Elfring
2014-12-01 17:11 ` Sergei Shtylyov
2014-12-04 22:03 ` [PATCH v2 0/6] net-PPP: Deletion of a few unnecessary checks SF Markus Elfring
2014-12-04 22:10 ` [PATCH v2 1/6] net-PPP: Replacement of a printk() call by pr_warn() in mppe_rekey() SF Markus Elfring
2014-12-04 22:23 ` Joe Perches
2014-12-04 22:27 ` SF Markus Elfring
2014-12-04 22:45 ` Joe Perches
2014-12-05 6:26 ` Julia Lawall
2014-12-05 8:04 ` SF Markus Elfring
2014-12-05 8:40 ` Julia Lawall
2014-12-05 7:18 ` SF Markus Elfring
2014-12-05 7:57 ` Joe Perches
2014-12-05 8:49 ` SF Markus Elfring
2014-12-05 22:35 ` terry white
2014-12-05 7:21 ` Julia Lawall
2014-12-05 7:41 ` Joe Perches
2014-12-07 10:44 ` Julia Lawall
2014-12-07 12:30 ` Joe Perches
2014-12-07 12:36 ` Julia Lawall [this message]
2014-12-07 12:42 ` Joe Perches
2014-12-04 22:13 ` [PATCH v2 2/6] net-PPP: Fix indentation SF Markus Elfring
2014-12-04 22:15 ` [PATCH v2 3/6] net-PPP: Deletion of unnecessary checks before the function call "kfree" SF Markus Elfring
2014-12-04 22:16 ` [PATCH v2 4/6] net-PPP: Less function calls in mppe_alloc() after error detection SF Markus Elfring
2014-12-04 22:18 ` [PATCH v2 5/6] net-PPP: Delete an unnecessary assignment in mppe_alloc() SF Markus Elfring
2014-12-05 12:22 ` Dan Carpenter
2014-12-05 12:44 ` SF Markus Elfring
2014-12-05 13:57 ` Dan Carpenter
2014-12-05 21:00 ` SF Markus Elfring
2014-12-04 22:20 ` [PATCH v2 6/6] net-PPP: Delete another " SF Markus Elfring
2014-12-05 12:23 ` Dan Carpenter
2014-12-05 12:50 ` SF Markus Elfring
2014-12-05 13:58 ` Dan Carpenter
2014-12-09 19:54 ` [PATCH v2 0/6] net-PPP: Deletion of a few unnecessary checks David Miller
2014-12-12 7:01 ` SF Markus Elfring
2014-12-12 14:29 ` David Miller
2014-12-12 15:30 ` SF Markus Elfring
2014-12-12 15:51 ` David Miller
2014-12-12 16:56 ` SF Markus Elfring
2014-12-12 16:59 ` David Miller
2014-12-12 17:22 ` SF Markus Elfring
2014-12-12 19:08 ` Eric Dumazet
2014-12-13 6:05 ` SF Markus Elfring
2014-12-12 20:07 ` David Miller
2014-12-13 6:17 ` SF Markus Elfring
2014-12-18 17:23 ` SF Markus Elfring
2014-12-18 17:25 ` David Miller
2014-12-18 17:44 ` SF Markus Elfring
2014-12-20 14:45 ` SF Markus Elfring
2014-12-20 15:48 ` Lino Sanfilippo
2014-12-20 16:17 ` SF Markus Elfring
2014-12-20 19:30 ` David Miller
2014-12-12 18:46 ` Julia Lawall
2014-12-13 8:12 ` terry white
2014-11-30 16:45 ` [PATCH 2/3] net-PPP: Less function calls in mppe_alloc() after error detection SF Markus Elfring
2014-11-30 16:47 ` [PATCH 3/3] net-PPP: Delete an unnecessary assignment SF Markus Elfring
2014-11-30 19:59 ` Eric Dumazet
2014-11-30 21:16 ` SF Markus Elfring
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=alpine.DEB.2.02.1412071335140.2030@localhost6.localdomain6 \
--to=julia.lawall@lip6.fr \
--cc=elfring@users.sourceforge.net \
--cc=eric.dumazet@gmail.com \
--cc=joe@perches.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-ppp@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=paulus@samba.org \
--cc=sergei.shtylyov@cogentembedded.com \
/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