<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="ES" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hi all,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-GB">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):<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">static int logPlugin(void *context, const char *format, va_list ap)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">{<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"> (void) context;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"> return addLog(INFO, STACK,format, ap); /* First two arguments are used to classify message at reception*/<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Then at rtems_stack_checker_report_usage_with_plugin calling scope:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"> rtems_printer printer;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"> printer.context = NULL;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"> printer.printer = logPlugin;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"> rtems_stack_checker_report_usage_with_plugin(&printer);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">When stack checker report usage is called, only the information header is printed: " STACK USAGE BY THREAD\n"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"> "ID NAME LOW HIGH CURRENT AVAIL USED\n"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">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?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Thanks in advance,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<div>
<div class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:ES">
<hr size="2" width="100%" noshade="" style="color:silver" align="left">
</span></div>
</div>
<table class="Tablanormal" border="0" cellspacing="0" cellpadding="0" width="100%" style="width:100.0%">
<tbody>
<tr>
<td style="padding:0cm 0cm 0cm 0cm">
<table class="Tablanormal" border="0" cellspacing="10" cellpadding="0" width="100%" style="width:100.0%">
<tbody>
<tr>
<td width="213" valign="top" style="width:150.0pt;padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:ES"><img width="185" height="68" id="Picture_x0020_2" src="cid:image001.gif@01D5AF6C.02B3BC40"><o:p></o:p></span></p>
</td>
<td width="260" valign="top" style="width:210.0pt;padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black;mso-fareast-language:ES">Fernando Domínguez Pousa<br>
</span></b><span style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:black;mso-fareast-language:ES">Ingeniero de Software</span><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:ES"><br>
</span><span style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:black;mso-fareast-language:ES">Software Engineer</span><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:ES"><o:p></o:p></span></p>
</td>
<td width="235" valign="top" style="width:165.0pt;padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:black;mso-fareast-language:ES">GMV
<br>
Isaac Newton, 11<br>
P.T.M. Tres Cantos<br>
E-28760 Madrid<br>
Tel. +34 91 807 21 00<br>
Fax +34 91 807 21 99 <br>
</span><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:ES"><a href="http://www.gmv.com/"><span style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:#999999;text-decoration:none">www.gmv.com
</span></a><o:p></o:p></span></p>
<table class="Tablanormal" border="0" cellspacing="0" cellpadding="0" width="0" style="width:165.0pt">
<tbody>
<tr>
<td width="15" style="width:11.25pt;padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span style="mso-fareast-language:ES"><a href="http://www.facebook.com/infoGMV" target="_blank"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;color:blue;text-decoration:none"><img border="0" width="15" height="30" id="Picture_x0020_3" src="cid:image002.png@01D5AF6C.02B3BC40"></span></a></span><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:ES"><o:p></o:p></span></p>
</td>
<td width="24" style="width:18.0pt;padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span style="mso-fareast-language:ES"><a href="http://www.twitter.com/infoGMV_es" target="_blank"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;color:blue;text-decoration:none"><img border="0" width="24" height="30" id="Picture_x0020_4" src="cid:image003.png@01D5AF6C.02B3BC40"></span></a></span><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:ES"><o:p></o:p></span></p>
</td>
<td width="24" style="width:18.0pt;padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span style="mso-fareast-language:ES"><a href="https://plus.google.com/+Gmvcompany" target="_blank"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;color:blue;text-decoration:none"><img border="0" width="24" height="30" id="Picture_x0020_5" src="cid:image004.png@01D5AF6C.02B3BC40"></span></a></span><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:ES"><o:p></o:p></span></p>
</td>
<td width="24" style="width:18.0pt;padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span style="mso-fareast-language:ES"><a href="http://www.youtube.com/infoGMV" target="_blank"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;color:blue;text-decoration:none"><img border="0" width="24" height="30" id="Picture_x0020_6" src="cid:image005.png@01D5AF6C.02B3BC40"></span></a></span><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:ES"><o:p></o:p></span></p>
</td>
<td width="24" style="width:18.0pt;padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span style="mso-fareast-language:ES"><a href="https://www.linkedin.com/company/gmv" target="_blank"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;color:blue;text-decoration:none"><img border="0" width="24" height="30" id="Picture_x0020_7" src="cid:image006.png@01D5AF6C.02B3BC40"></span></a></span><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:ES"><o:p></o:p></span></p>
</td>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span style="mso-fareast-language:ES"><a href="http://www.gmv.com/en/RSS" target="_blank"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;color:blue;text-decoration:none"><img border="0" width="24" height="30" id="Picture_x0020_8" src="cid:image007.png@01D5AF6C.02B3BC40"></span></a></span><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:ES"><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;display:none;mso-fareast-language:ES"><o:p> </o:p></span></p>
<table class="Tablanormal" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span style="mso-fareast-language:ES"><a href="http://www.gmv.com/blog_gmv/language/en/" target="_blank"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;color:blue;text-decoration:none"><img border="0" width="96" height="24" id="Picture_x0020_9" src="cid:image008.png@01D5AF6C.02B3BC40"></span></a></span><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:ES"><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span style="mso-fareast-language:ES"><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span style="mso-fareast-language:ES"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:ES"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:ES"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:ES"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:ES"><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<span style=""><br>
</span><span style="font-size:18.0pt; line-height:125%; font-family:Webdings; color:green">P<span style=""></span>
<span style="font-size:7.0pt; line-height:125%; font-family:"Arial","sans-serif"; color:green">
Please consider the environment before printing this e-mail.</span></span><span style=""></span>
</body>
</html>