Re: [PATCH] tools: Use fputc() calls in some functions

Steven Rostedt <[email protected]>
Newsgroups org.kernel.vger.linux-trace-kernel,dev.linux.lists.acpica-devel,dev.linux.lists.mptcp,dev.linux.lists.virtualization,org.kernel.vger.bpf,org.kernel.vger.kernel-janitors,org.kernel.vger.kvm,org.kernel.vger.linux-acpi,org.kernel.vger.linux-gpio,org.kernel.vger.linux-kernel,org.kernel.vger.linux-kselftest,org.kernel.vger.linux-perf-users,org.kernel.vger.linux-pm,org.kernel.vger.netdev,org.kernel.vger.platform-driver-x86,org.kvack.linux-mm,org.ozlabs.lists.linuxppc-dev
Message-ID <[email protected]>
On Thu, 23 Jul 2026 06:47:00 -0700
Andi Kleen <[email protected]> wrote:

> > The source code was transformed by using the Coccinelle software.  
> 
> gcc already does this transformation automatically.

Yep, I showed this in my talk[1] that looked at what printf("Hello World!")
does. Doing an objdump of:

#include <stdio.h>

int main(void) {
	printf("Hello World!\n");
	return 0;
}

has:

0000000000001139 <main>:
    1139:       55                      push   %rbp
    113a:       48 89 e5                mov    %rsp,%rbp
    113d:       48 8d 05 c0 0e 00 00    lea    0xec0(%rip),%rax        # 2004 <_IO_stdin_used+0x4>
    1144:       48 89 c7                mov    %rax,%rdi
    1147:       e8 e4 fe ff ff          call   1030 <puts@plt>  <<<--- puts and not printf
    114c:       b8 00 00 00 00          mov    $0x0,%eax
    1151:       5d                      pop    %rbp
    1152:       c3                      ret

-- Steve

[1] https://www.youtube.com/watch?v=JRyrhsx-L5Y
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.