Hi,

while trying bitbake 1.10 devel branch, I see that some of my old event
handlers won't work anymore.  E.g. it is not possible to get value of
${PV} or ${PN} in TaskSucceeded or Failed handlers.

My old event handlers stored information into the local datastore and
relied that event handlers are executed in same context as the executed
task.  E.g. I did

| data.setVar('_PKG_RESOURCES_CHLD', 
resource.getrusage(resource.RUSAGE_CHILDREN), e.data)

on PkgStarted and evaluated this later in TaskSucceeded to calculate the
consumed resources[1].


As events are fired asynchronously in 1.10 and are evaluated in an own
process, this will not work anymore.


I played a little bit around and created a patch[2] which satisfies my
requirements.  But it is very special and situated for my purposes.

I would like to get some kind of synchronous event- (or better: plugin-)
handlers which are executed on top of bb.event.fire().  E.g.


|  def fire(event, d):
|      """Fire off an Event"""
|  
|+     for h in hooks:
|+         ...
|+         h(event, d)
|  
|      if worker_pid != 0:
|          worker_fire(event, d)


These hooks can copy information between 'event' and 'd' and create new
ones..

Is there already planned such a plugin mechanism?  What would be the best
way to implement it?  Adding e.g. a 'addhook' keyword and continuing like
for 'addhandler'?

Or, am I missing the way how it should be done with 1.10?



Enrico

Footnotes: 
[1]  see http://ensc.de/bitbake/metrics.txt for results

[2]  http://ensc.de/bitbake/0011-metrics.patch
     http://ensc.de/bitbake/elito-metrics.bbclass
_______________________________________________
Bitbake-dev mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/bitbake-dev

Reply via email to