diff options
Diffstat (limited to 'meta/classes-global/buildstats.bbclass')
-rw-r--r-- | meta/classes-global/buildstats.bbclass | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/meta/classes-global/buildstats.bbclass b/meta/classes-global/buildstats.bbclass index f49a67aa4f..fe64789e10 100644 --- a/meta/classes-global/buildstats.bbclass +++ b/meta/classes-global/buildstats.bbclass | |||
@@ -188,14 +188,17 @@ python run_buildstats () { | |||
188 | # bitbake fires HeartbeatEvent even before a build has been | 188 | # bitbake fires HeartbeatEvent even before a build has been |
189 | # triggered, causing BUILDNAME to be None | 189 | # triggered, causing BUILDNAME to be None |
190 | ######################################################################## | 190 | ######################################################################## |
191 | if bn is not None: | 191 | if bn is None: |
192 | bsdir = os.path.join(d.getVar('BUILDSTATS_BASE'), bn) | 192 | return |
193 | taskdir = os.path.join(bsdir, d.getVar('PF')) | 193 | |
194 | if isinstance(e, bb.event.HeartbeatEvent) and bb.utils.to_boolean(d.getVar("BB_LOG_HOST_STAT_ON_INTERVAL")): | 194 | bsdir = os.path.join(d.getVar('BUILDSTATS_BASE'), bn) |
195 | taskdir = os.path.join(bsdir, d.getVar('PF')) | ||
196 | if isinstance(e, bb.event.HeartbeatEvent): | ||
197 | if bb.utils.to_boolean(d.getVar("BB_LOG_HOST_STAT_ON_INTERVAL")): | ||
195 | bb.utils.mkdirhier(bsdir) | 198 | bb.utils.mkdirhier(bsdir) |
196 | write_host_data(os.path.join(bsdir, "host_stats_interval"), e, d, "interval") | 199 | write_host_data(os.path.join(bsdir, "host_stats_interval"), e, d, "interval") |
197 | 200 | ||
198 | if isinstance(e, bb.event.BuildStarted): | 201 | elif isinstance(e, bb.event.BuildStarted): |
199 | ######################################################################## | 202 | ######################################################################## |
200 | # If the kernel was not configured to provide I/O statistics, issue | 203 | # If the kernel was not configured to provide I/O statistics, issue |
201 | # a one time warning. | 204 | # a one time warning. |
@@ -234,7 +237,7 @@ python run_buildstats () { | |||
234 | if cpu: | 237 | if cpu: |
235 | f.write("CPU usage: %0.1f%% \n" % cpu) | 238 | f.write("CPU usage: %0.1f%% \n" % cpu) |
236 | 239 | ||
237 | if isinstance(e, bb.build.TaskStarted): | 240 | elif isinstance(e, bb.build.TaskStarted): |
238 | set_timedata("__timedata_task", d, e.time) | 241 | set_timedata("__timedata_task", d, e.time) |
239 | bb.utils.mkdirhier(taskdir) | 242 | bb.utils.mkdirhier(taskdir) |
240 | # write into the task event file the name and start time | 243 | # write into the task event file the name and start time |
@@ -276,7 +279,7 @@ addhandler run_buildstats | |||
276 | run_buildstats[eventmask] = "bb.event.BuildStarted bb.event.BuildCompleted bb.event.HeartbeatEvent bb.build.TaskStarted bb.build.TaskSucceeded bb.build.TaskFailed" | 279 | run_buildstats[eventmask] = "bb.event.BuildStarted bb.event.BuildCompleted bb.event.HeartbeatEvent bb.build.TaskStarted bb.build.TaskSucceeded bb.build.TaskFailed" |
277 | 280 | ||
278 | python runqueue_stats () { | 281 | python runqueue_stats () { |
279 | import buildstats | 282 | import oe.buildstats |
280 | from bb import event, runqueue | 283 | from bb import event, runqueue |
281 | # We should not record any samples before the first task has started, | 284 | # We should not record any samples before the first task has started, |
282 | # because that's the first activity shown in the process chart. | 285 | # because that's the first activity shown in the process chart. |
@@ -286,7 +289,7 @@ python runqueue_stats () { | |||
286 | # closed when the build is done. | 289 | # closed when the build is done. |
287 | system_stats = d.getVar('_buildstats_system_stats', False) | 290 | system_stats = d.getVar('_buildstats_system_stats', False) |
288 | if not system_stats and isinstance(e, (bb.runqueue.sceneQueueTaskStarted, bb.runqueue.runQueueTaskStarted)): | 291 | if not system_stats and isinstance(e, (bb.runqueue.sceneQueueTaskStarted, bb.runqueue.runQueueTaskStarted)): |
289 | system_stats = buildstats.SystemStats(d) | 292 | system_stats = oe.buildstats.SystemStats(d) |
290 | d.setVar('_buildstats_system_stats', system_stats) | 293 | d.setVar('_buildstats_system_stats', system_stats) |
291 | if system_stats: | 294 | if system_stats: |
292 | # Ensure that we sample at important events. | 295 | # Ensure that we sample at important events. |