Bug 6799 - cpu_usage value 0 for tasks with outcome=0
Summary: cpu_usage value 0 for tasks with outcome=0
Status: VERIFIED NOTABUG
Alias: None
Product: Toaster
Classification: Build System, Metadata & Runtime
Component: toaster (show other bugs)
Version: 1.7
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.8
Assignee: Alexandru Damian
QA Contact: Alexandru Roman
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2014-10-06 09:04 UTC by Ionut Chisanovici
Modified: 2015-12-03 14:08 UTC (History)
5 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
toaster_db (21.01 MB, application/octet-stream)
2014-10-06 09:04 UTC, Ionut Chisanovici
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ionut Chisanovici 2014-10-06 09:04:23 UTC
Created attachment 2166 [details]
toaster_db

Hi,

The cpu_usage for some tasks is 0:

sqlite> select * from orm_task where id=2048;
          build_id = 1
    work_directory = 
         cpu_usage = 0
     task_executed = 1
           disk_io = 2632
       line_number = 0
path_to_sstate_obj = 
   sstate_checksum = d039571f6e3873926e6c8c8e287669c1
        source_url = 
             order = 515
      elapsed_time = 
           logfile = 
         recipe_id = 55
         task_name = do_fetch
           message = 
           outcome = 0
                id = 2048
     sstate_result = 0
       script_type = 0

Commit: 5367855fe56db0c09b8fa7bb423b9de18d11eecc
Attached the toaster db.

Cheers,
Ionut C
Comment 1 Belen Barros Pena 2014-10-20 15:34:23 UTC
I can see instances of executed tasks with CPU time 0, but the buildstats for those tasks seem to have either no CPU usage data, or it is set to 0.0%, so Toaster seems to be reporting the right thing. 

We should probably change this test: if the reported CPU time for the task is 0, but this matches buildstats, Toaster is doing the right thing and there is no problem there. If the reported CPU time for the task is 0 but buildstats reports something different, then there is a problem in Toaster.
Comment 2 Ionut Chisanovici 2014-10-22 08:26:18 UTC
Hi Belen,

The test is implemented exactly like you described.
First it is parsing the buildstat file for that task and get the cpu_usage from there and then it is comparing that value with the one in the database.

Cheers,
Ionut C
Comment 3 Belen Barros Pena 2014-10-22 08:59:40 UTC
(In reply to comment #2)
> Hi Belen,
> 
> The test is implemented exactly like you described.
> First it is parsing the buildstat file for that task and get the cpu_usage
> from there and then it is comparing that value with the one in the database.

So what's the problem reported by this bug? Is it

* Executed - succeeded tasks are reporting CPU usage 0

or 

* Buildstats reports a task CPU usage different to the one reported by Toaster?

Thanks


> 
> Cheers,
> Ionut C
Comment 4 Ionut Chisanovici 2014-10-22 10:48:34 UTC
Belen,

The issue here is the "message" field which is empty.
The test is looking for the message field value and based on the informations from this field it is constructing the task stats file path in order to parse that file and to extract the informations need it (in our case cpu_usage). So, because the task stats file cannot be find the assertion in the test is failing.

I will close this bug as it is not opened as it supposed to be (for the issue in cause).

Cheers,
Ionut C
Comment 5 Alexandru Roman 2015-12-03 14:08:17 UTC
Verified.