[lttng-dev] ARM syscall problems

Ryan.Kyser at jci.com Ryan.Kyser at jci.com
Tue Apr 10 17:41:19 EDT 2012


I have gotten most of the ARM syscall tracing to work, but I have two 
problems.


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.


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 ] }



// 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



// 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




More information about the lttng-dev mailing list