babeltrace2-sink.utils.counter - Linux


The babeltrace2-sink.utils.counter utility is a component of the babeltrace2 toolkit. It’s a sink that counts the number of events received. It can be used for profiling or debugging purposes to determine the rate of events being generated by a system.


babeltrace2-sink.utils.counter [options]


  • -c, –count (number): Count to print after. This is used to limit the number of events counted before printing the summary. Defaults to 0, meaning no limit.
  • -f, –follow (boolean): Keep running and counting (default: false).
  • -i, –interval (number): Interval at which to print the summary (in seconds). Defaults to 1.
  • -s, –summary (string): Summary to print. Defaults to "total".
  • -h, –help: Print help message and exit.


Count the number of events received for 10 seconds:

babeltrace2-sink.utils.counter --follow --interval 10

Count the first 1000 events received:

babeltrace2-sink.utils.counter --count 1000

Common Issues

If the sink is not receiving any events, check that the source is correctly connected to the sink and that the event type is supported by the sink.


The babeltrace2-sink.utils.counter sink can be used with other babeltrace2 components to create complex tracing pipelines. For example, it can be used with the babeltrace2-source.tracefs source to count the number of system calls made by a process.

Related Commands

  • babeltrace2-filter: Filter events based on various criteria.
  • babeltrace2-merge: Merge multiple trace streams into a single stream.
  • babeltrace2-sink.utils.histogram: Sink that generates a histogram of event values.