Trying to get Idle Task ID

Joel Sherrill joel.sherrill at OARcorp.com
Wed Jan 27 23:01:53 UTC 2010


On 01/27/2010 01:33 PM, Fabrício de Novaes Kucinskis wrote:
> Hi all,
>
> I’m trying to get the total amount of time used by any task (in
> microseconds) as an unsigned long value that I can insert in a telemetry
> packet.
>
> For this purpose, my code is based on "rtems_cpu_usage_report_with_plugin",
> and, AFAICT, it works correctly.
>
> The function receives the task ID, loops through the Objects Information
> Table, identifies the correct task and gets the amount of time.
>
> The problem is that I cannot get the Idle task ID. I tried
> "rtems_task_ident(rtems_build_name('I', 'D', 'L', 'E'))", but I receive an
> "RTEMS_INVALID_NAME" error. I tried with "idle" and "Idle", with no results.
> I also tried a constant from the CPU Usage chapter in the RTEMS C Users
> Manual, "0x0401001", and got the same error.
>
>    
rtems_task_ident only returns the names of Classic API
tasks and the IDLE task is not created via the Classic API.

Why do you need to get the ID this way?  The code you based it
upon just dereferenced the TCB pointer.

>  From an old (2006) post, I discovered that the Idle task name is a string,
> so I tried to cast that string into a rtems_name variable. No way!
>
> So, how can I get the Idle task name or ID? (I'm using RTEMS 4.8.1)
>
>    
The ID is constant so you could just hard code it. :)

In 4.9 and newer, there are some rtems_object_XXX services
which I thought might help but none will return this.  You
can get the name of an arbitrary object.  But a name is only
unique within a given API and Object Class.

--joel
> Thanks in advance,
>
>
> Fabrício de Novaes Kucinskis - DEA / INPE
> -----------------------------------------------
> Onboard Data Handling Group - SUBORD
> Aerospace Electronics Division
> Brazilian National Institute for Space Research
>
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-users
>    


-- 
Joel Sherrill, Ph.D.             Director of Research&  Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
    Support Available             (256) 722-9985





More information about the users mailing list