All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Russell Johnson <russell.johnson@kratosdefense.com>
Cc: "xenomai@lists.linux.dev" <xenomai@lists.linux.dev>
Subject: Re: More details on health monitoring notifications
Date: Wed, 06 Jul 2022 16:57:42 +0200	[thread overview]
Message-ID: <87o7y2s1p9.fsf@xenomai.org> (raw)
In-Reply-To: <PH1P110MB10506DDF3B33330889D67BE6E2819@PH1P110MB1050.NAMP110.PROD.OUTLOOK.COM>


Russell Johnson <russell.johnson@kratosdefense.com> writes:

> [[S/MIME Signed Part:Undecided]]
> I also notice these lines in “dmesg” output from the EVL core. Can I use the excpt or user_pc to get any more information about what is causing these in-band switches?
>

Yes. Exception #14 on x86 is 'page fault' event, which seems to be the
architecture this code is running on. User_pc is the PC value in the
virtual address space of the process when it causes the trap in this
case. This is a - possibly legit - memory access which requires a
so-called 'major fault' to be taken.

GDB may help figuring out the location of this code, in two ways:

- switching the HM notifier to 'signal' mode for your threads, using
  T_HMSIG, you only need to run the app over GDB: the core will send it
  a SIGDEBUG event, which GDB will trap. Using the GDB 'backtrace/bt'
  command once the app is in break state after receipt should display a
  backtrace to the offending code (IOW the EVL core makes sure that your
  app receives SIGDEBUG immediately on top of the code causing the
  trap).

- using the GDB 'list' command to list the code at the PC value reported
  by the kernel should work. You just need to start the application
  first: unless you have a complex dlopen-based scheme for running code
  plugins, running until a breakpoint is taken in main() should be
  enough before you can issue 'list *<PC_value>'.

>  
>
> [ 7301.352255] EVL: thread_1 switching in-band [pid=6319, excpt=14, user_pc=0x7f54a7877fa6]
>
> [ 7301.352689] EVL: thread_2 switching in-band [pid=6285, excpt=14, user_pc=0x7f54a7877fa6]
>
>  
>
> From: Russell Johnson 
> Sent: Friday, July 1, 2022 11:19 AM
> To: xenomai@lists.linux.dev
> Subject: More details on health monitoring notifications
>
>  
>
> Hello,
>
>  
>
> I have gotten a health monitoring thread going that tracks all the EVL threads running in my app. The goal was to try and figure out what is causing occasional in-band switches in some of my EVL threads. I am seeing the notifications now that give me a little more insight, and the two diagnostic codes I am seeing are 2 (switched inband due to syscall) and 3 (switched inband due to fault). I am finding these to be quite hard to pinpoint
> specifically throughout my code. Is there any way to get more information into what exactly is causing these notifications from the EVL core? It would be great to have a callstack of some kind, but I am not sure if that is possible. Any insight would be helpful.
>
>  
>
> Thanks,
>
>  
>
> Russell
>
> [[End of S/MIME Signed Part]]


-- 
Philippe.

  reply	other threads:[~2022-07-06 15:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-01 17:19 More details on health monitoring notifications Russell Johnson
2022-07-05 22:25 ` Russell Johnson
2022-07-06 14:57   ` Philippe Gerum [this message]
2022-07-06 19:05     ` Leonid Gasheev via Xenomai
2022-07-07 19:25     ` [External] - " Russell Johnson
  -- strict thread matches above, loose matches on Subject: below --
2022-07-07 20:02 Russell Johnson
2022-07-14  8:19 ` Philippe Gerum

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=87o7y2s1p9.fsf@xenomai.org \
    --to=rpm@xenomai.org \
    --cc=russell.johnson@kratosdefense.com \
    --cc=xenomai@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.