mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +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++)
|
for (i = 0; i < n_counters; i++)
|
||||||
{
|
{
|
||||||
if (counters[i].id >= self->next_counter_id)
|
/* Has the counter been registered? */
|
||||||
{
|
assert (counters[i].id < self->next_counter_id);
|
||||||
g_warning ("Counter %u has not been registered.", counters[i].id);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
def->counters[i] = counters[i];
|
def->counters[i] = counters[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user