Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Mar 2011 22:35:21 -0800
From:      Artem Belevich <fbsdlist@src.cx>
To:        Alexander Leidinger <Alexander@leidinger.net>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andriy Gapon <avg@freebsd.org>
Subject:   Re: svn commit: r219561 - in head/sys: cddl/dev/systrace modules/dtrace modules/dtrace/dtraceall modules/dtrace/systrace_freebsd32 modules/dtrace/systrace_linux32
Message-ID:  <AANLkTinC5vF6ax%2BrSEga3BPvCN4L3C_adahHv6ELD9ko@mail.gmail.com>
In-Reply-To: <20110312211423.00000f34@unknown>
References:  <201103120909.p2C99P2j010783@svn.freebsd.org> <20110312211423.00000f34@unknown>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Mar 12, 2011 at 12:14 PM, Alexander Leidinger
<Alexander@leidinger.net> wrote:
>> =A0 syscall::xxx:yyy - work on all system calls that match the
>> specification syscall:freebsd:xxx:yyy - only native system calls
>> =A0 syscall:linux32:xxx:yyy - linux32 compat system calls
>> =A0 syscall:freebsd32:xxx:yyy - freebsd32 compat system calls on amd64
>
> I am working on some SDT probes for the linuxulator. The way I handle it
> there is to use "linuxulator" for the native size, and "linuxulator32"
> for the current 32-bit linux emulation on amd64. When the amd64 arch
> gets a native linux emulation (dchagin@ has patches) this would allow to
> trace both in a sane way.
>
> Is it possible to have "linux" as the modname on i386? Is it easy to
> have both linux syscall types (64 bit and 32 bit) on amd64 in case
> native support arrives in this code?

Sure.

>
>> Modified: head/sys/cddl/dev/systrace/systrace.c
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
>> --- head/sys/cddl/dev/systrace/systrace.c =A0 =A0 Sat Mar 12 08:58:19
>> 2011 =A0(r219560) +++
>> head/sys/cddl/dev/systrace/systrace.c Sat Mar 12 09:09:25
>> 2011 =A0(r219561) @@ -59,17 +59,38 @@ #include <sys/dtrace.h>
>>
>> =A0#ifdef LINUX_SYSTRACE
>> -#include <linux.h>
>> -#include <linux_syscall.h>
>> -#include <linux_proto.h>
>> -#include <linux_syscallnames.c>
>> -#include <linux_systrace.c>
>> +#if defined(__amd64__)
>> +#include <amd64/linux32/linux.h>
>> +#include <amd64/linux32/linux32_proto.h>
>> +#include <amd64/linux32/linux32_syscalls.c>
>> +#include <amd64/linux32/linux32_systrace_args.c>
>> +#elif defined(__i386__)
>> +#include <i386/linux/linux.h>
>> +#include <i386/linux/linux_proto.h>
>> +#include <i386/linux/linux_syscalls.c>
>> +#include <i386/linux/linux_systrace_args.c>
>
> This looks like there is also support for linux syscalls on 386.

It's there, it should work, but I didn't get to test it.

>> +#else
>> +#error Only i386 and amd64 are supported.
>> +#endif
>> =A0extern struct sysent linux_sysent[];
>> -#define =A0 =A0 =A0DEVNAME =A0 =A0 =A0 =A0 "dtrace/linsystrace"
>> -#define =A0 =A0 =A0PROVNAME =A0 =A0 =A0 =A0"linsyscall"
>> +#define =A0 =A0 =A0MODNAME =A0 =A0 =A0 =A0 "linux32"
>
> But this looks like it will be named linux32 in any case. In the short
> term I would prefer:
> ---snip---
> #if defined(__amd64__)
> #define MODNAME "linux32"
> #elif defined(__i386__)
> #define MODNAME "linux"
> #endif
> ---snip---

Makes sense. It's what's done with freebsd syscalls -- 'freebsd' for
native syscalls, freebsd32 for 32-bit compat.

--Artem



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTinC5vF6ax%2BrSEga3BPvCN4L3C_adahHv6ELD9ko>