[lttng-dev] ARM syscall problems

Ryan.Kyser at jci.com Ryan.Kyser at jci.com
Wed Apr 11 09:32:02 EDT 2012


As soon as I get everything working, I will submit the patches!

I was more concerned about the size of some of the values. For instance, 
len of sys_arm_fadvise64_64 is 0xF1FF3ED800000000 and offset of 
sys_sync_file_range2  0x100000000007. Both of these values seemed too 
large, but now I realize that it's because of the data type of these 
variables.

Thank you,

Ryan Kyser



From:
Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
To:
Ryan.Kyser at jci.com
Cc:
lttng-dev at lists.lttng.org, Avik Sil <avik.sil at linaro.org>, Nicolas Pitre 
<nicolas.pitre at linaro.org>
Date:
04/10/2012 08:50 PM
Subject:
Re: [lttng-dev] ARM syscall problems



* Ryan.Kyser at jci.com (Ryan.Kyser at jci.com) wrote:
> I have gotten most of the ARM syscall tracing to work, but I have two 
> problems.

You're getting close! I look forward to see those patches when they're
ready.

> 
> 1.) My override syscalls don't look quite right (see babeltrace snippet 
> below). I have overriden these in the file 
> 
instrumentation/syscalls/headers/arm-32-syscalls-2.6.38_integers_override.h 

> (see below for contents of file). I based each of the 
SC_TRACE_EVENTmacros 
> on the function declaration of each respective syscall. These 
declarations 
> can be viewed below the babeltrace snippet. If anyone has any 
suggestions 
> on what I'm doing wrong, I would appreciate it.
> 

See below,

> 
> 2.) I'm seeing a sys_unknown with a suspicious NR ID of 983045. Any 
ideas 
> on how to further debug this problem?
> [19:01:09.009343858] (+0.000020500) sys_unknown: { 0 }, { id = 983045, 
> args = [ [0] = 715846848, [1] = 715848600, [2] = 716677200, [3] = 
> 715846848, [4] = 716677200, [5] = 1 ] }

I'm CCing Avik and Nicolas, they might have a clue about this
high-numbered syscall number.

> 
> // snippet from babeltrace
> [19:01:41.881449470] (+0.000009560) sys_mmap2: { 0 }, { addr = 0x0, len 
= 
> 0xA00000, prot = 0x3, flags = 0x122, fd = 0xFFFFFFFF, pgoff = 0x0 }
> [19:01:41.883759076] (+0.000002848) sys_mmap2: { 0 }, { addr = 0x0, len 
= 
> 0xA00000, prot = 0x3, flags = 0x122, fd = 0xFFFFFFFF, pgoff = 0x0 }
> [19:01:41.885699591] (+0.000002394) sys_mmap2: { 1 }, { addr = 0x0, len 
= 
> 0xA00000, prot = 0x3, flags = 0x122, fd = 0xFFFFFFFF, pgoff = 0x0 }
> [19:01:41.891235228] (+0.000067409) sys_sync_file_range2: { 0 }, { fd = 
> 0x1C, offset = 0x2, nbytes = 0x400000000, flags = 0x0 }
> [19:01:41.891582288] (+0.000002818) sys_sync_file_range2: { 0 }, { fd = 
> 0x1C, offset = 0x100000000002, nbytes = 0x400000000, flags = 0x0 }
> [19:01:41.891618122] (+0.000002319) sys_sync_file_range2: { 0 }, { fd = 
> 0x1C, offset = 0x7, nbytes = 0x400000000, flags = 0x0 }
> [19:01:41.924569379] (+0.000014803) sys_arm_fadvise64_64: { 0 }, { fd = 
> 0x1C, advice = 0x4, offset = 0x400000000, len = 0xF1FF3ED800000000 }
> [19:01:41.924714197] (+0.000003151) sys_sync_file_range2: { 0 }, { fd = 
> 0x1C, offset = 0x200000000002, nbytes = 0x400000000, flags = 0x0 }
> [19:01:41.924758425] (+0.000002137) sys_sync_file_range2: { 0 }, { fd = 
> 0x1C, offset = 0x100000000007, nbytes = 0x400000000, flags = 0x0 }
> [19:01:41.924768591] (+0.000002909) sys_arm_fadvise64_64: { 0 }, { fd = 
> 0x1C, advice = 0x4, offset = 0x400000000, len = 0xF1FF3ED800000000 }
> // end snippet

I guess what you dislike here is the 0x.... formatting ? If this is the
issue, just use "__field" instead of "__field_hex" in the SC_TRACE_EVENT
below.

Best regards,

Mathieu

> 
> 
> 
> // declaration from include/asm-generic/syscalls.h
> asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
>                         unsigned long prot, unsigned long flags,
>                         unsigned long fd, unsigned long pgoff);
> 
> // declaration from arch/arm/kernel/sys_arm.c 
> asmlinkage long sys_arm_fadvise64_64(int fd, int advice,
>                                      loff_t offset, loff_t len)
> {
>         return sys_fadvise64_64(fd, offset, len, advice);
> }
> 
> // declaration from fs/sync.c
> SYSCALL_DEFINE(sync_file_range2)(int fd, unsigned int flags,
>                                  loff_t offset, loff_t nbytes)
> {
>         return sys_sync_file_range(fd, offset, nbytes, flags);
> }
> 
> 
> 
> // arm-32-syscalls-2.6.38_integers_override.h ....
> #define OVERRIDE_TABLE_32_sys_mmap2
> #define OVERRIDE_TABLE_32_sys_arm_fadvise64_64
> #define OVERRIDE_TABLE_32_sys_sync_file_range2
> 
> #ifndef CREATE_SYSCALL_TABLE
> 
> SC_TRACE_EVENT(sys_mmap2,
>         TP_PROTO(unsigned long addr, unsigned long len, unsigned long 
> prot,
>                  unsigned long flags, unsigned long fd, unsigned long 
> pgoff),
>         TP_ARGS(addr, len, prot, flags, fd, pgoff),
>         TP_STRUCT__entry(
>                 __field_hex(unsigned long, addr)
>                 __field_hex(unsigned long, len)
>                 __field_hex(unsigned long, prot)
>                 __field_hex(unsigned long, flags)
>                 __field_hex(unsigned long, fd)
>                 __field_hex(unsigned long, pgoff)),
>         TP_fast_assign(
>                 tp_assign(addr, addr)
>                 tp_assign(len, len)
>                 tp_assign(prot, prot)
>                 tp_assign(flags, flags)
>                 tp_assign(fd, fd)
>                 tp_assign(pgoff, pgoff)),
>         TP_printk()
> )
> 
> SC_TRACE_EVENT(sys_arm_fadvise64_64,
>         TP_PROTO(int fd, int advice, loff_t offset, loff_t len),
>         TP_ARGS(fd, advice, offset, len),
>         TP_STRUCT__entry(
>                 __field_hex(int, fd)
>                 __field_hex(int, advice)
>                 __field_hex(loff_t, offset)
>                 __field_hex(loff_t, len)),
>         TP_fast_assign(
>                 tp_assign(fd, fd)
>                 tp_assign(advice, advice)
>                 tp_assign(offset, offset)
>                 tp_assign(len, len)),
>         TP_printk()
> )
> 
> SC_TRACE_EVENT(sys_sync_file_range2,
>         TP_PROTO(int fd, loff_t offset, loff_t nbytes, unsigned int 
> flags),
>         TP_ARGS(fd, offset, nbytes, flags),
>         TP_STRUCT__entry(
>                 __field_hex(int, fd)
>                 __field_hex(loff_t, offset)
>                 __field_hex(loff_t, nbytes)
>                 __field_hex(unsigned int, flags)),
>         TP_fast_assign(
>                 tp_assign(fd, fd)
>                 tp_assign(offset, offset)
>                 tp_assign(nbytes, nbytes)
>                 tp_assign(flags, flags)),
>         TP_printk()
> )
> 
> 
> #else   /* CREATE_SYSCALL_TABLE */
> 
> #define OVERRIDE_TABLE_32_sys_mmap2
> TRACE_SYSCALL_TABLE(sys_mmap2, sys_mmap2, 192, 6)
> #define OVERRIDE_TABLE_32_sys_arm_fadvise64_64
> TRACE_SYSCALL_TABLE(sys_arm_fadvise64_64, sys_arm_fadvise64_64, 270, 4)
> #define OVERRIDE_TABLE_32_sys_sync_file_range2
> TRACE_SYSCALL_TABLE(sys_sync_file_range2, sys_sync_file_range2, 341, 4)
> 
> #endif /* CREATE_SYSCALL_TABLE */
> 
> 
> 
> Thank you,
> Ryan Kyser
> 
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com






More information about the lttng-dev mailing list