~sircmpwn/public-inbox

2 2

syscall in hare hello world

George Rose <george@1w1g.com>
Details
Message ID
<18460d4924e.b8b2a22a176811.6722753582555582543@1w1g.com>
DKIM signature
fail
Download raw message
DKIM signature: fail
I was reading your old post https://drewdevault.com/2020/01/04/Slow.html
and decide to check number of syscall in hare hello world:

I think it's 2, like assembly, I'don't know how did you measure syscalls but I used gdb like this:
main.ha:

use fmt;

export fn main() void = {
	fmt::printfln("Hi")!;
};

gdb syscall

(gdb) catch syscall
Catchpoint 1 (any syscall)
(gdb) start
Temporary breakpoint 2 at 0x80000db: file /tmp/f6cc74bf84492123/temp..21.s, line 22.
Starting program: /home/geo/Projects/hare/syscall/syscall 

Temporary breakpoint 2, main () at /tmp/f6cc74bf84492123/temp..21.s:22
22	/tmp/f6cc74bf84492123/temp..21.s: No such file or directory.
(gdb) continue 
Continuing.

Catchpoint 1 (call to syscall write), rt.syscall3 () at /usr/local/src/hare/stdlib/rt/+linux/syscall+x86_64.s:33
33		ret
(gdb) continue 
Continuing.
Hi

Catchpoint 1 (returned from syscall write), rt.syscall3 () at /usr/local/src/hare/stdlib/rt/+linux/syscall+x86_64.s:33
33		ret
(gdb) continue 
Continuing.

Catchpoint 1 (call to syscall exit), rt.syscall1 () at /usr/local/src/hare/stdlib/rt/+linux/syscall+x86_64.s:14
14		ret
(gdb) continue 
Continuing.
[Inferior 1 (process 12053) exited normally]


and It seems there is only 2 syscalls, is this correct?
Details
Message ID
<CO8I86CB4PFW.1U09JB1W2VDXJ@taiga>
In-Reply-To
<18460d4924e.b8b2a22a176811.6722753582555582543@1w1g.com> (view parent)
DKIM signature
pass
Download raw message
On Thu Nov 10, 2022 at 10:17 AM CET, George Rose wrote:
> I was reading your old post https://drewdevault.com/2020/01/04/Slow.html
> and decide to check number of syscall in hare hello world:
>
> I think it's 2, like assembly, I'don't know how did you measure
> syscalls but I used gdb like this:

It is two. It's easiest to measure with strace.
George Rose <george@1w1g.com>
Details
Message ID
<18460e00a35.bef59dfb178622.9003298126656014336@1w1g.com>
In-Reply-To
<CO8I86CB4PFW.1U09JB1W2VDXJ@taiga> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
Thanks,
Great job.



---- On Thu, 10 Nov 2022 12:52:29 +0330 Drew DeVault  wrote ---

 > On Thu Nov 10, 2022 at 10:17 AM CET, George Rose wrote: 
 > > I was reading your old post https://drewdevault.com/2020/01/04/Slow.html 
 > > and decide to check number of syscall in hare hello world: 
 > > 
 > > I think it's 2, like assembly, I'don't know how did you measure 
 > > syscalls but I used gdb like this: 
 >  
 > It is two. It's easiest to measure with strace. 
 >
Reply to thread Export thread (mbox)