Re: RTEMS User Level Tracing?

2015-12-21 Thread Isaac Gutekunst



On 12/20/2015 08:02 PM, Chris Johns wrote:

On 19/12/2015 6:36 AM, isaac.gutekunst wrote:


We're interested in trace some application data in our RTEMS project.
Here's a bunch of background and thoughts:

I've read the following pages:
 * https://devel.rtems.org/wiki/Developer/Tracing
 * https://devel.rtems.org/wiki/Developer/Tracing/Trace_Linker

I think I have an understanding of the current system as documented.
Tracing user defined data types seems to be missing. I'm looking for
something more like barectf. Is there any such support available, or any
plans to support it? I don't want to reinvent the wheel.


User defined data is not directly support but can be added if you add a
custom generator. There is not a great deal of documentation about how
to do this. An example generator is:

  https://git.rtems.org/rtems-tools/tree/linkers/rtld-trace-buffer.ini


Cool. I'll take a closer look at this.

You could add anything specific you want. It is not a great solution but
tracing into data being passed by pointers is difficult.

Definitely. You quickly come to the great serialization problem, and are bound to reinvent the 
wheel a few times.

You would need to use the various options to get a copy of the trace
wrapper file and then get the generator to see the headers and various
data you want.


If there isn't support already, maybe some parts of the trace
infrastructure can be reused, notably the backed for storing the data,
and/or sending it out over the network. Are there plans to make the
Trace Linker natively output CTF data?


We would like to support CTF output. Getting this done would need
developer funding.


We would like tracing for at least user defined data, and will be developing that 
functionality. If we could do so in a way that helps the existing RTEMS trace, we'd love to.





Perhaps barectf could be used for this purpose.


I do not know what this. Do you have a reference?


https://github.com/efficios/barectf

It takes in a YAML file, and generates a C file with functions that allow tracing user defined 
structs. It will output those to a custom "backend" in serialized form. The documentation is 
pretty good. I've used in briefly in a bare metal PIC32 project with success.


A potential plan of action:
1) Make a barectf backend for RTEMS. (This could re-use existing features). Probably 
package/make it available via RSB.

2) Update the trace linker to use it (I don't really know what this means just 
yet).
3) Make a mechanism/ document a standard way to integrate trace with a user application. I'd 
imagine this could involve a RSB package, although it's rather simple (yaml file becomes a C 
and H file that needs to be linked against a 'backend').


4) For the ARM architecture, using the ITM to output data could be very useful. This could fit 
somewhere into this picture.


I would be doing most or all of the work here, unless of course anyone wants to 
help.

I'm looking for ideas and suggestions. If there is some functionality of direction you'd like 
us to pursue, let me know.


Thanks,

Isaac


Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH 1/2] cpukit/task{set,get}note.c: Remove obsolete Notepads

2015-12-21 Thread Joel Sherrill
To remove notepads fully, the documentation and testsuites
should also be touched. There should be more in the patch.

--joel

On Mon, Dec 21, 2015 at 1:15 AM, Sebastian Huber <
sebastian.hu...@embedded-brains.de> wrote:

> On 21/12/15 02:13, Aun-Ali Zaidi wrote:
>
>> updates #2493.
>> ---
>>   cpukit/rtems/include/rtems/rtems/tasks.h | 2 +-
>>   cpukit/rtems/src/taskgetnote.c   | 2 --
>>   cpukit/rtems/src/tasksetnote.c   | 2 --
>>   3 files changed, 1 insertion(+), 5 deletions(-)
>>
>> diff --git a/cpukit/rtems/include/rtems/rtems/tasks.h
>> b/cpukit/rtems/include/rtems/rtems/tasks.h
>> index 1ad537d..114624d 100644
>> --- a/cpukit/rtems/include/rtems/rtems/tasks.h
>> +++ b/cpukit/rtems/include/rtems/rtems/tasks.h
>> @@ -678,7 +678,7 @@ typedef struct {
>>  *
>>  *  @note MUST BE LAST ENTRY.
>>  */
>> -  uint32_t Notepads[ RTEMS_ZERO_LENGTH_ARRAY ] RTEMS_DEPRECATED;
>> +  //uint32_t Notepads[ RTEMS_ZERO_LENGTH_ARRAY ] RTEMS_DEPRECATED;
>>
>
> Please don't use comments or #if 0 to remove things.
>
>   }  RTEMS_API_Control;
>> /**
>> diff --git a/cpukit/rtems/src/taskgetnote.c
>> b/cpukit/rtems/src/taskgetnote.c
>> index c097d9c..ba40d2e 100644
>> --- a/cpukit/rtems/src/taskgetnote.c
>> +++ b/cpukit/rtems/src/taskgetnote.c
>> @@ -60,7 +60,6 @@ rtems_status_code rtems_task_get_note(
>> if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ||
>>  _Objects_Are_ids_equal( id, executing->Object.id ) ) {
>> api = executing->API_Extensions[ THREAD_API_RTEMS ];
>> -  *note = api->Notepads[ notepad ];
>> return RTEMS_SUCCESSFUL;
>> }
>>   @@ -69,7 +68,6 @@ rtems_status_code rtems_task_get_note(
>> case OBJECTS_LOCAL:
>> api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
>> -  *note = api->Notepads[ notepad ];
>> _Objects_Put( &the_thread->Object );
>> return RTEMS_SUCCESSFUL;
>>
>>
>
> What is the purpose of this function after your change?
>
> --
> Sebastian Huber, embedded brains GmbH
>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone   : +49 89 189 47 41-16
> Fax : +49 89 189 47 41-09
> E-Mail  : sebastian.hu...@embedded-brains.de
> PGP : Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>
>
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH 1/2] cpukit/task{set,get}note.c: Remove obsolete Notepads

2015-12-21 Thread Sebastian Huber
Do we want to remove the task note functions so that an application gets 
compiler and linker errors or warnings? Or do we make the functions empty and 
return an error status code?

- Am 21. Dez 2015 um 19:32 schrieb Joel Sherrill j...@rtems.org:

> To remove notepads fully, the documentation and testsuites
> should also be touched. There should be more in the patch.
> 
> --joel
> 
> On Mon, Dec 21, 2015 at 1:15 AM, Sebastian Huber <
> sebastian.hu...@embedded-brains.de> wrote:
> 
>> On 21/12/15 02:13, Aun-Ali Zaidi wrote:
>>
>>> updates #2493.
>>> ---
>>>   cpukit/rtems/include/rtems/rtems/tasks.h | 2 +-
>>>   cpukit/rtems/src/taskgetnote.c   | 2 --
>>>   cpukit/rtems/src/tasksetnote.c   | 2 --
>>>   3 files changed, 1 insertion(+), 5 deletions(-)
>>>
>>> diff --git a/cpukit/rtems/include/rtems/rtems/tasks.h
>>> b/cpukit/rtems/include/rtems/rtems/tasks.h
>>> index 1ad537d..114624d 100644
>>> --- a/cpukit/rtems/include/rtems/rtems/tasks.h
>>> +++ b/cpukit/rtems/include/rtems/rtems/tasks.h
>>> @@ -678,7 +678,7 @@ typedef struct {
>>>  *
>>>  *  @note MUST BE LAST ENTRY.
>>>  */
>>> -  uint32_t Notepads[ RTEMS_ZERO_LENGTH_ARRAY ] RTEMS_DEPRECATED;
>>> +  //uint32_t Notepads[ RTEMS_ZERO_LENGTH_ARRAY ] RTEMS_DEPRECATED;
>>>
>>
>> Please don't use comments or #if 0 to remove things.
>>
>>   }  RTEMS_API_Control;
>>> /**
>>> diff --git a/cpukit/rtems/src/taskgetnote.c
>>> b/cpukit/rtems/src/taskgetnote.c
>>> index c097d9c..ba40d2e 100644
>>> --- a/cpukit/rtems/src/taskgetnote.c
>>> +++ b/cpukit/rtems/src/taskgetnote.c
>>> @@ -60,7 +60,6 @@ rtems_status_code rtems_task_get_note(
>>> if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ||
>>>  _Objects_Are_ids_equal( id, executing->Object.id ) ) {
>>> api = executing->API_Extensions[ THREAD_API_RTEMS ];
>>> -  *note = api->Notepads[ notepad ];
>>> return RTEMS_SUCCESSFUL;
>>> }
>>>   @@ -69,7 +68,6 @@ rtems_status_code rtems_task_get_note(
>>> case OBJECTS_LOCAL:
>>> api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
>>> -  *note = api->Notepads[ notepad ];
>>> _Objects_Put( &the_thread->Object );
>>> return RTEMS_SUCCESSFUL;
>>>
>>>
>>
>> What is the purpose of this function after your change?
>>
>> --
>> Sebastian Huber, embedded brains GmbH
>>
>> Address : Dornierstr. 4, D-82178 Puchheim, Germany
>> Phone   : +49 89 189 47 41-16
>> Fax : +49 89 189 47 41-09
>> E-Mail  : sebastian.hu...@embedded-brains.de
>> PGP : Public key available on request.
>>
>> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>>
>>
>> ___
>> devel mailing list
>> devel@rtems.org
>> http://lists.rtems.org/mailman/listinfo/devel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH 1/2] cpukit/task{set,get}note.c: Remove obsolete Notepads

2015-12-21 Thread Joel Sherrill
On Dec 21, 2015 1:07 PM, "Sebastian Huber" <
sebastian.hu...@embedded-brains.de> wrote:
>
> Do we want to remove the task note functions so that an application gets
compiler and linker errors or warnings? Or do we make the functions empty
and return an error status code?

These were really bad APIs long before SMP was a consideration. I would be
happy to see them completely gone.

We need to capture their removal in a 4.12 release notes with transition
info. We weren't good at this for 4.11.  Perhaps the manual can replace the
text section on them with a note they are gone as of 4.12 and you should
use TLS or keys.

>
> - Am 21. Dez 2015 um 19:32 schrieb Joel Sherrill j...@rtems.org:
>
> > To remove notepads fully, the documentation and testsuites
> > should also be touched. There should be more in the patch.
> >
> > --joel
> >
> > On Mon, Dec 21, 2015 at 1:15 AM, Sebastian Huber <
> > sebastian.hu...@embedded-brains.de> wrote:
> >
> >> On 21/12/15 02:13, Aun-Ali Zaidi wrote:
> >>
> >>> updates #2493.
> >>> ---
> >>>   cpukit/rtems/include/rtems/rtems/tasks.h | 2 +-
> >>>   cpukit/rtems/src/taskgetnote.c   | 2 --
> >>>   cpukit/rtems/src/tasksetnote.c   | 2 --
> >>>   3 files changed, 1 insertion(+), 5 deletions(-)
> >>>
> >>> diff --git a/cpukit/rtems/include/rtems/rtems/tasks.h
> >>> b/cpukit/rtems/include/rtems/rtems/tasks.h
> >>> index 1ad537d..114624d 100644
> >>> --- a/cpukit/rtems/include/rtems/rtems/tasks.h
> >>> +++ b/cpukit/rtems/include/rtems/rtems/tasks.h
> >>> @@ -678,7 +678,7 @@ typedef struct {
> >>>  *
> >>>  *  @note MUST BE LAST ENTRY.
> >>>  */
> >>> -  uint32_t Notepads[ RTEMS_ZERO_LENGTH_ARRAY ] RTEMS_DEPRECATED;
> >>> +  //uint32_t Notepads[ RTEMS_ZERO_LENGTH_ARRAY ] RTEMS_DEPRECATED;
> >>>
> >>
> >> Please don't use comments or #if 0 to remove things.
> >>
> >>   }  RTEMS_API_Control;
> >>> /**
> >>> diff --git a/cpukit/rtems/src/taskgetnote.c
> >>> b/cpukit/rtems/src/taskgetnote.c
> >>> index c097d9c..ba40d2e 100644
> >>> --- a/cpukit/rtems/src/taskgetnote.c
> >>> +++ b/cpukit/rtems/src/taskgetnote.c
> >>> @@ -60,7 +60,6 @@ rtems_status_code rtems_task_get_note(
> >>> if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ||
> >>>  _Objects_Are_ids_equal( id, executing->Object.id ) ) {
> >>> api = executing->API_Extensions[ THREAD_API_RTEMS ];
> >>> -  *note = api->Notepads[ notepad ];
> >>> return RTEMS_SUCCESSFUL;
> >>> }
> >>>   @@ -69,7 +68,6 @@ rtems_status_code rtems_task_get_note(
> >>> case OBJECTS_LOCAL:
> >>> api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
> >>> -  *note = api->Notepads[ notepad ];
> >>> _Objects_Put( &the_thread->Object );
> >>> return RTEMS_SUCCESSFUL;
> >>>
> >>>
> >>
> >> What is the purpose of this function after your change?
> >>
> >> --
> >> Sebastian Huber, embedded brains GmbH
> >>
> >> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> >> Phone   : +49 89 189 47 41-16
> >> Fax : +49 89 189 47 41-09
> >> E-Mail  : sebastian.hu...@embedded-brains.de
> >> PGP : Public key available on request.
> >>
> >> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
> >>
> >>
> >> ___
> >> devel mailing list
> >> devel@rtems.org
> >> http://lists.rtems.org/mailman/listinfo/devel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel