• Frederic Weisbecker's avatar
    tracing: add a new workqueue tracer · e1d8aa9f
    Frederic Weisbecker authored
    Impact: new tracer
    
    The workqueue tracer provides some statistical informations
    about each cpu workqueue thread such as the number of the
    works inserted and executed since their creation. It can help
    to evaluate the amount of work each of them have to perform.
    For example it can help a developer to decide whether he should
    choose a per cpu workqueue instead of a singlethreaded one.
    
    It only traces statistical informations for now but it will probably later
    provide event tracing too.
    
    Such a tracer could help too, and be improved, to help rt priority sorted
    workqueue development.
    
    To have a snapshot of the workqueues state at any time, just do
    
    cat /debugfs/tracing/trace_stat/workqueues
    
    Ie:
    
      1    125        125       reiserfs/1
      1      0          0       scsi_tgtd/1
      1      0          0       aio/1
      1      0          0       ata/1
      1    114        114       kblockd/1
      1      0          0       kintegrityd/1
      1   2147       2147       events/1
    
      0      0          0       kpsmoused
      0    105        105       reiserfs/0
      0      0          0       scsi_tgtd/0
      0      0          0       aio/0
      0      0          0       ata_aux
      0      0          0       ata/0
      0      0          0       cqueue
      0      0          0       kacpi_notify
      0      0          0       kacpid
      0    149        149       kblockd/0
      0      0          0       kintegrityd/0
      0   1000       1000       khelper
      0   2270       2270       events/0
    
    Changes in V2:
    
    _ Drop the static array based on NR_CPU and dynamically allocate the stat array
      with num_possible_cpus() and other cpu mask facilities....
    _ Trace workqueue insertion at a bit lower level (insert_work instead of queue_work) to handle
      even the workqueue barriers.
    Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
    Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    e1d8aa9f
trace_workqueue.c 7.11 KB