Spawning a task in VxWorks shell - VxWorks

This is a discussion on Spawning a task in VxWorks shell - VxWorks ; Hi, I am spawning a task in VxWorks 5.5 shell using taskSpwan "task1",50,0,2000,funcT While the task is running I want to see the CPU usage, How do I do this? I thought of using spy, but the problem is, after ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Spawning a task in VxWorks shell

  1. Spawning a task in VxWorks shell

    Hi,
    I am spawning a task in VxWorks 5.5 shell using
    taskSpwan "task1",50,0,2000,funcT

    While the task is running I want to see the CPU usage, How do I do
    this?
    I thought of using spy, but the problem is, after taskSpawn the shell
    hangs for the time "task1" executs and I could get the command prompt
    only after the execution complets.

    I tried the same in VxWorks6.1 but there I got the command prompt
    immediately and could run spy while the task1 was running in
    background.

    Please do tell me if anybody knows about the problem, also any
    alternate way for this.

    Thanks in advance


  2. Re: Spawning a task in VxWorks shell

    Not sure what's going on here. You've spawned your task at priority
    50, and the shell runs at 1, so the shell should return as soon as your
    task is spawned.

    funcT must be doing something preventing the shell from doing I/O or
    something. Are you doing taskLock or intLocks in there somewhere?

    Try bypassing most of the code in funcT - maybe just put a tight while
    loop in it and see how things behave.

    lc


  3. Re: Spawning a task in VxWorks shell

    Hi Larry,

    Yes its something to do with the proiroty, When I ran it at PRI=200 I
    got the shell prompt, but not when PRI<100

    tShell is running @ PRI=2

    For PRI<100 I have to restart the card to login again, as it got hung
    becasue of the while(1);

    My other question:- How to measure CPU usage?


  4. Re: Spawning a task in VxWorks shell

    You can use spy to measure the CPU usage.

    The shell is normally started at 2, which should work for most systems.


    It's not clear what app you are running (just the while 1), but if
    nothing else is running on your system other than the regular system
    tasks, running at 200 or 100 shouldn't make much of a difference.

    You may be inheriting a priority when to take a semaphore - do an i to
    see if your task is really running at the priority you think.

    Try "i", or windview if your have it, or maybe some taskHooks to
    examing the priorities to see if you get any inheritied priorities.

    Good luck,
    lc


  5. Re: Spawning a task in VxWorks shell


    > Hi Larry,
    >
    > Yes its something to do with the proiroty, When I ran it at PRI 0 I
    > got the shell prompt, but not when PRI<100
    >
    > tShell is running @ PRI=2
    >
    > For PRI<100 I have to restart the card to login again, as it got hung
    > becasue of the while(1);
    >
    > My other question:- How to measure CPU usage?


    Remember that your netTask runs at prio 50. So, if you do network
    logins (rlogin/telnet) on your target, task with prio less than 50
    might distrub your (networked) login session. Use a serial tty-
    connection instead.

    --


+ Reply to Thread