Print stack info using rtems_stack_checker_report_usage_with_plugin()

Fernando Domínguez Pousa fdpousa at gmv.com
Tue Dec 10 14:36:52 UTC 2019


Hi all,

I'm interested in getting stack information via an UDP message with an ASCII log trace inside. Basically, I cannot get the information using a printf. I found the function rtems_stack_checker_report_usage_with_plugin(rtems_printer* printer) in order to get the information and send it using my UDP log function. So first of all I created a function called logPlugin (I used as exampled the plugin at printf_plugin.c):

static int logPlugin(void *context, const char *format, va_list ap)
{
  (void) context;
  return addLog(INFO, STACK,format, ap); /* First two arguments are used to classify message at reception*/
}

Then at rtems_stack_checker_report_usage_with_plugin calling scope:

  rtems_printer printer;

  printer.context = NULL;
  printer.printer = logPlugin;

  rtems_stack_checker_report_usage_with_plugin(&printer);

It is important to say that addLog puts the message in a circular buffer that other task will read and send the content using UDP.

When stack checker report usage is called, only the information header is printed:     "                             STACK USAGE BY THREAD\n"
     "ID         NAME                  LOW        HIGH       CURRENT     AVAIL   USED\n"

Next, stack values are not printed correctly and I can only get a value that is constant and equal to the same memory location (in decimal).  It is a correct guide to implement this? I do not know how to use the printer struct context variable, can this cause my problem?

Thanks in advance,

Regards,


________________________________
[cid:image001.gif at 01D5AF6C.02B3BC40]

Fernando Domínguez Pousa
Ingeniero de Software
Software Engineer

GMV
Isaac Newton, 11
P.T.M. Tres Cantos
E-28760 Madrid
Tel. +34 91 807 21 00
Fax +34 91 807 21 99
www.gmv.com <http://www.gmv.com/>
[cid:image002.png at 01D5AF6C.02B3BC40]<http://www.facebook.com/infoGMV>

[cid:image003.png at 01D5AF6C.02B3BC40]<http://www.twitter.com/infoGMV_es>

[cid:image004.png at 01D5AF6C.02B3BC40]<https://plus.google.com/+Gmvcompany>

[cid:image005.png at 01D5AF6C.02B3BC40]<http://www.youtube.com/infoGMV>

[cid:image006.png at 01D5AF6C.02B3BC40]<https://www.linkedin.com/company/gmv>

[cid:image007.png at 01D5AF6C.02B3BC40]<http://www.gmv.com/en/RSS>


[cid:image008.png at 01D5AF6C.02B3BC40]<http://www.gmv.com/blog_gmv/language/en/>








P Please consider the environment before printing this e-mail.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20191210/87b35c45/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 5711 bytes
Desc: image001.gif
URL: <http://lists.rtems.org/pipermail/users/attachments/20191210/87b35c45/attachment-0001.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 2914 bytes
Desc: image002.png
URL: <http://lists.rtems.org/pipermail/users/attachments/20191210/87b35c45/attachment-0007.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 2946 bytes
Desc: image003.png
URL: <http://lists.rtems.org/pipermail/users/attachments/20191210/87b35c45/attachment-0008.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 3037 bytes
Desc: image004.png
URL: <http://lists.rtems.org/pipermail/users/attachments/20191210/87b35c45/attachment-0009.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.png
Type: image/png
Size: 3026 bytes
Desc: image005.png
URL: <http://lists.rtems.org/pipermail/users/attachments/20191210/87b35c45/attachment-0010.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image006.png
Type: image/png
Size: 2913 bytes
Desc: image006.png
URL: <http://lists.rtems.org/pipermail/users/attachments/20191210/87b35c45/attachment-0011.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image007.png
Type: image/png
Size: 3042 bytes
Desc: image007.png
URL: <http://lists.rtems.org/pipermail/users/attachments/20191210/87b35c45/attachment-0012.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image008.png
Type: image/png
Size: 4932 bytes
Desc: image008.png
URL: <http://lists.rtems.org/pipermail/users/attachments/20191210/87b35c45/attachment-0013.png>


More information about the users mailing list