svn commit: r219561 - in head/sys: cddl/dev/systrace modules/dtrace modules/dtrace/dtraceall modules/dtrace/systrace_freebsd32 modules/dtrace/systrace_linux32

Artem Belevich fbsdlist at src.cx
Sun Mar 13 06:35:22 UTC 2011


On Sat, Mar 12, 2011 at 12:14 PM, Alexander Leidinger
<Alexander at leidinger.net> wrote:
>>   syscall::xxx:yyy - work on all system calls that match the
>> specification syscall:freebsd:xxx:yyy - only native system calls
>>   syscall:linux32:xxx:yyy - linux32 compat system calls
>>   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
>> ==============================================================================
>> --- head/sys/cddl/dev/systrace/systrace.c     Sat Mar 12 08:58:19
>> 2011  (r219560) +++
>> head/sys/cddl/dev/systrace/systrace.c Sat Mar 12 09:09:25
>> 2011  (r219561) @@ -59,17 +59,38 @@ #include <sys/dtrace.h>
>>
>>  #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
>>  extern struct sysent linux_sysent[];
>> -#define      DEVNAME         "dtrace/linsystrace"
>> -#define      PROVNAME        "linsyscall"
>> +#define      MODNAME         "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


More information about the svn-src-all mailing list