[PATCH 1/2] pdbtool: match with supplied message did not perform processing
From: Balint Kovacs <blint@blint.hu> Under some circumstances pdbtool match did not process the message if it was provided on the command line due to a regression introduced as part of a LogProto refactoring (2d0fb042) Signed-off-by: Balint Kovacs <blint@blint.hu> --- modules/dbparser/pdbtool/pdbtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/dbparser/pdbtool/pdbtool.c b/modules/dbparser/pdbtool/pdbtool.c index deab84d..25014fe 100644 --- a/modules/dbparser/pdbtool/pdbtool.c +++ b/modules/dbparser/pdbtool/pdbtool.c @@ -503,7 +503,7 @@ pdbtool_match(int argc, char *argv[]) { dbg_list = g_array_new(FALSE, FALSE, sizeof(RDebugInfo)); } - while (!eof && buf) + while (!eof && (buf || match_message)) { invalidate_cached_time(); if (G_LIKELY(proto)) -- 1.7.9.5
From: Balint Kovacs <blint@blint.hu> When displaying debug-csv information, the loop variable was not only incremented in the for statement, but also within the loop, which caused an index mismatch when iterating over the dbg_info array Signed-off-by: Balint Kovacs <blint@blint.hu> --- modules/dbparser/pdbtool/pdbtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/dbparser/pdbtool/pdbtool.c b/modules/dbparser/pdbtool/pdbtool.c index 25014fe..c560874 100644 --- a/modules/dbparser/pdbtool/pdbtool.c +++ b/modules/dbparser/pdbtool/pdbtool.c @@ -577,7 +577,7 @@ pdbtool_match(int argc, char *argv[]) name = nv_registry_get_handle_name(logmsg_registry, dbg_info->pnode->handle, &name_len); printf("PDBTOOL_DEBUG=%d:%d:%d:%d:%d:%s:%s\n", - i++, dbg_info->i, dbg_info->node->keylen, dbg_info->match_off, dbg_info->match_len, + i, dbg_info->i, dbg_info->node->keylen, dbg_info->match_off, dbg_info->match_len, dbg_info->pnode ? r_parser_type_name(dbg_info->pnode->type) : "", dbg_info->pnode && name_len ? name : "" ); -- 1.7.9.5
participants (1)
-
balint.kovacs@balabit.com