mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
libsysprof-capture: Assert rather than calling g_warning()
Calling this function without having registered the counter beforehand seems reasonable to call a programmer error. Signed-off-by: Philip Withnall <withnall@endlessm.com> Helps: #40
This commit is contained in:
@ -1224,12 +1224,8 @@ sysprof_capture_writer_define_counters (SysprofCaptureWriter *self,
|
||||
|
||||
for (i = 0; i < n_counters; i++)
|
||||
{
|
||||
if (counters[i].id >= self->next_counter_id)
|
||||
{
|
||||
g_warning ("Counter %u has not been registered.", counters[i].id);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Has the counter been registered? */
|
||||
assert (counters[i].id < self->next_counter_id);
|
||||
def->counters[i] = counters[i];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user