[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Get Task (or other Object) name given id or pointer
- Date: Mon, 06 Aug 2007 08:29:27 -0500
- From: joel.sherrill at oarcorp.com (Joel Sherrill)
- Subject: Get Task (or other Object) name given id or pointer
Robert S. Grimes wrote:
> Simple question - what's the best (fastest first, "correct" next) way to
> get the rtems_name, given a rtems_tcb*?
>
I held off answering this hoping someone would pipe up.
I am surprised no one answered it over the week or Monday
morning Europe time.
There are two services:
rtems_status_code rtems_object_id_to_name(
rtems_id id,
rtems_name *name
);
which assumes you are just returning the 32 bit integer name.
This method has been in RTEMS for 4 years.
The other method tries to convert it to a printable string:
char *rtems_object_get_name(
Objects_Id id,
size_t length,
char *name
);
The second method is what is used by the stack checker and
cpu usage reporters. It is quite new having been refactored
from the duplicated code in the reporting routines. It seemed
very generically useful so I made it a service.
--joel
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.com
> http://rtems.rtems.org/mailman/listinfo/rtems-users
>