Sampled and nonsampled counters

Sampled counters are polled when the PMU counter values are read.

For each sampled custom counter, a function prototype is generated of the following form:

extern bm_bool barman_cc_<chart_name>_<series_name>_sample_now(bm_uint64 * value_out);

For example:

extern bm_bool barman_cc_interrupts_fiq_sample_now(bm_uint64 * value_out);

You must implement this function to set the value of the uint64 at *value_out to the value of the counter, then return BM_TRUE. If the counter value cannot be sampled, for example due to another thread accessing the hardware, the function can return BM_FALSE and be skipped.

You are responsible for writing nonsampled counters to the capture. For each nonsampled series, the following two functions are declared:

bm_bool barman_cc_<chart_name>_<series_name>_update_value(bm_uint64 timestamp, bm_uint32 core, bm_uint64 value);

bm_bool barman_cc_<chart_name>_<series_name>_update_value_now(bm_uint64 value);

For example:

bm_bool barman_cc_interrupts_fiq_update_value(bm_uint64 timestamp, bm_uint32 core, bm_uint64 value);

bm_bool barman_cc_interrupts_fiq_update_value_now(bm_uint64 value);

The second function is a shorthand for the first that passes the current timestamp and core number to the appropriate arguments.

When you call these functions, the value for the counter is stored to the capture.