Patchwork lib: fwts_klog: forgot to log a klog error using the pattern string

login
register
mail settings
Submitter Colin King
Date Nov. 22, 2012, 2:41 p.m.
Message ID <1353595271-27186-1-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/201054/
State Accepted
Headers show

Comments

Colin King - Nov. 22, 2012, 2:41 p.m.
From: Colin Ian King <colin.king@canonical.com>

It seems that I overlooked actually printing out a klog error using
the pre-loaded (or pre-converted) label string, which is a bit stupid
since this makes the majority of the work in the commit
"lib: klog: load labels from json data file rather than auto-generate"
a bit pointless.  Anyhow, fix it now.  Klog errors will now report using
the label from the json data file rather than generating it from the
pattern string or regex.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/lib/src/fwts_klog.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
Keng-Yu Lin - Nov. 27, 2012, 8:07 a.m.
On Thu, Nov 22, 2012 at 10:41 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> It seems that I overlooked actually printing out a klog error using
> the pre-loaded (or pre-converted) label string, which is a bit stupid
> since this makes the majority of the work in the commit
> "lib: klog: load labels from json data file rather than auto-generate"
> a bit pointless.  Anyhow, fix it now.  Klog errors will now report using
> the label from the json data file rather than generating it from the
> pattern string or regex.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/lib/src/fwts_klog.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/src/lib/src/fwts_klog.c b/src/lib/src/fwts_klog.c
> index c611247..54beae2 100644
> --- a/src/lib/src/fwts_klog.c
> +++ b/src/lib/src/fwts_klog.c
> @@ -253,8 +253,7 @@ void fwts_klog_scan_patterns(fwts_framework *fw,
>                                 fwts_log_info(fw, "Kernel message: %s", line);
>                         else {
>                                 fwts_tag_failed(fw, pattern->tag);
> -                               fwts_failed(fw, pattern->level,
> -                                       fwts_klog_unique_label(pattern->pattern),
> +                               fwts_failed(fw, pattern->level, pattern->label,
>                                         "%s Kernel message: %s", fwts_log_level_to_str(pattern->level), line);
>                                 (*errors)++;
>                         }
> --
> 1.8.0
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>
Ivan Hu - Nov. 28, 2012, 9:06 a.m.
On 11/22/2012 10:41 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> It seems that I overlooked actually printing out a klog error using
> the pre-loaded (or pre-converted) label string, which is a bit stupid
> since this makes the majority of the work in the commit
> "lib: klog: load labels from json data file rather than auto-generate"
> a bit pointless.  Anyhow, fix it now.  Klog errors will now report using
> the label from the json data file rather than generating it from the
> pattern string or regex.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/lib/src/fwts_klog.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/src/lib/src/fwts_klog.c b/src/lib/src/fwts_klog.c
> index c611247..54beae2 100644
> --- a/src/lib/src/fwts_klog.c
> +++ b/src/lib/src/fwts_klog.c
> @@ -253,8 +253,7 @@ void fwts_klog_scan_patterns(fwts_framework *fw,
>   				fwts_log_info(fw, "Kernel message: %s", line);
>   			else {
>   				fwts_tag_failed(fw, pattern->tag);
> -				fwts_failed(fw, pattern->level,
> -					fwts_klog_unique_label(pattern->pattern),
> +				fwts_failed(fw, pattern->level, pattern->label,
>   					"%s Kernel message: %s", fwts_log_level_to_str(pattern->level), line);
>   				(*errors)++;
>   			}
>

Acked-by: Ivan Hu <ivan.hu@canonical.com>

Patch

diff --git a/src/lib/src/fwts_klog.c b/src/lib/src/fwts_klog.c
index c611247..54beae2 100644
--- a/src/lib/src/fwts_klog.c
+++ b/src/lib/src/fwts_klog.c
@@ -253,8 +253,7 @@  void fwts_klog_scan_patterns(fwts_framework *fw,
 				fwts_log_info(fw, "Kernel message: %s", line);
 			else {
 				fwts_tag_failed(fw, pattern->tag);
-				fwts_failed(fw, pattern->level,
-					fwts_klog_unique_label(pattern->pattern),
+				fwts_failed(fw, pattern->level, pattern->label,
 					"%s Kernel message: %s", fwts_log_level_to_str(pattern->level), line);
 				(*errors)++;
 			}