Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: Ryan.Kyser@jci.com (Ryan.Kyser@jci.com)
Subject: [lttng-dev] ARM syscall problems
Date: Wed, 11 Apr 2012 09:32:02 -0400	[thread overview]
Message-ID: <OFBEA7B47E.05D6AE60-ON852579DD.0048F4BE-852579DD.004A5873@jci.com> (raw)
In-Reply-To: <20120411005030.GB4690@Krystal>

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






      parent reply	other threads:[~2012-04-11 13:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-10 21:41 Ryan.Kyser
2012-04-11  0:50 ` Mathieu Desnoyers
2012-04-11  1:20   ` Nicolas Pitre
2012-04-11  2:42     ` Mathieu Desnoyers
2012-04-11 19:21     ` Ryan.Kyser
2012-04-11 13:32   ` Ryan.Kyser [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=OFBEA7B47E.05D6AE60-ON852579DD.0048F4BE-852579DD.004A5873@jci.com \
    --to=ryan.kyser@jci.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox