Change-Id: I9c18dfa4c0ba91b98e50ff5f43f111baa332680b
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
assert(logs);
assert(filter);
assert(entry_out);
assert(logs);
assert(filter);
assert(entry_out);
dlogutil_entry_s *temp = fdi->ops->extract_entry(fdi);
if (!temp)
dlogutil_entry_s *temp = fdi->ops->extract_entry(fdi);
if (!temp)
assert(logs);
assert(filter);
assert(entry_out);
assert(logs);
assert(filter);
assert(entry_out);
struct fd_info *best_fdi;
do {
best_fdi = find_earliest_log(data_fds, fd_count, logs->sort_by);
struct fd_info *best_fdi;
do {
best_fdi = find_earliest_log(data_fds, fd_count, logs->sort_by);
static bool flush_single_log(dlogutil_state_s *state, dlogutil_entry_s **out)
{
static bool flush_single_log(dlogutil_state_s *state, dlogutil_entry_s **out)
{
if (state->flush_target >= LONG_MAX
|| sort_vector_empty(&state->logs))
return false;
if (state->flush_target >= LONG_MAX
|| sort_vector_empty(&state->logs))
return false;
static bool handle_flush(dlogutil_state_s *state, dlogutil_entry_s **out)
{
static bool handle_flush(dlogutil_state_s *state, dlogutil_entry_s **out)
{
bool const r = flush_single_log(state, out);
if (!r)
state->flush_target = LONG_MAX;
bool const r = flush_single_log(state, out);
if (!r)
state->flush_target = LONG_MAX;
*/
int do_print_once(dlogutil_state_s *state, int timeout, dlogutil_entry_s **out)
{
*/
int do_print_once(dlogutil_state_s *state, int timeout, dlogutil_entry_s **out)
{
while (state->epoll_cnt > 0) {
if (handle_flush(state, out))
return 0;
while (state->epoll_cnt > 0) {
if (handle_flush(state, out))
return 0;
int do_print(dlogutil_state_s *state, dlogutil_entry_cb callback, void *userdata)
{
while (true) {
int do_print(dlogutil_state_s *state, dlogutil_entry_cb callback, void *userdata)
{
while (true) {
+ dlogutil_entry_s *out = NULL;
int r;
do
r = do_print_once(state, DEFAULT_EPOLL_TIMEOUT, &out);
int r;
do
r = do_print_once(state, DEFAULT_EPOLL_TIMEOUT, &out);
while (!sort_vector_empty(&sv))
sort_vector_pop(&sv);
while (!sort_vector_empty(&sv))
sort_vector_pop(&sv);
- dlogutil_entry_s *vector_overflown;
+ dlogutil_entry_s *vector_overflown = NULL;
assert(put_logs_into_vector(fds, 0, &sv, (dlogutil_filter_options_s *)0xEEE, &vector_overflown) == 1);
assert(!vector_overflown);
assert(put_logs_into_vector(fds, 0, &sv, (dlogutil_filter_options_s *)0xEEE, &vector_overflown) == 1);
assert(!vector_overflown);