/**
* @file
- * Circular joournal diagnostic mechanism.
+ * Circular journal diagnostic mechanism.
*
* The @c cj thread-safe circular log buffer scheme is occasionally useful
* when chasing bugs. Calls to it should not be checked in.
if (cjm->enable == 0)
return;
- new_tail = __sync_add_and_fetch (&cjm->tail, 1);
+ new_tail = clib_atomic_add_fetch (&cjm->tail, 1);
r = (cj_record_t *) & (cjm->records[new_tail & (cjm->num_records - 1)]);
r->time = vlib_time_now (cjm->vlib_main);
cjm->num_records = max_pow2 (cjm->num_records);
vec_validate (cjm->records, cjm->num_records - 1);
- memset (cjm->records, 0xff, cjm->num_records * sizeof (cj_record_t));
+ clib_memset (cjm->records, 0xff, cjm->num_records * sizeof (cj_record_t));
cjm->tail = ~0;
cjm->enable = enable;
/*?
* Configure the circular journal diagnostic mechanism. This is only useful
- * if you, the deveoper, have written code to make use of the circular
+ * if you, the developer, have written code to make use of the circular
* journal.
*
* @cfgcmd{records, <number>}
}
/* dump from the beginning through the final tail */
r = cjm->records;
- for (i = 0; i <= cjm->tail; i++)
+ for (i = 0; i < index; i++)
{
if (filter0_enable && (r->data[0] != filter0))
goto skip2;
/*?
* Enable, disable the collection of diagnostic data into a
* circular journal or dump the circular journal diagnostic data.
- * This is only useful if you, the deveoper, have written code to make
+ * This is only useful if you, the developer, have written code to make
* use of the circular journal.
*
* When dumping the data it is formatted and sent to @c stderr of the