]> www.infradead.org Git - users/mchehab/rasdaemon.git/commitdiff
parse_ras_data: flush trace buffer immediately, not on next call
authorSergio Gelato <Sergio.Gelato@astro.su.se>
Wed, 19 Sep 2018 14:57:42 +0000 (11:57 -0300)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Wed, 4 Sep 2019 23:48:38 +0000 (20:48 -0300)
parse_ras_data() was calling fflush() before, not after printf().
As a result, information about an event would not be printed
immediately but possibly much later.

Signed-off-by: Sergio Gelato <Sergio.Gelato@astro.su.se>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
ras-events.c

index a63725ce451bbd7bb4690c7685601f0b8740d23e..9c3f210489570ab5f4663206b1993d0c8d6a8f9a 100644 (file)
@@ -310,10 +310,10 @@ static void parse_ras_data(struct pthread_data *pdata, struct kbuffer *kbuf,
        /* TODO - logging */
        trace_seq_init(&s);
        printf("cpu %02d:", pdata->cpu);
-       fflush(stdout);
        pevent_print_event(pdata->ras->pevent, &s, &record);
        trace_seq_do_printf(&s);
        printf("\n");
+       fflush(stdout);
 }
 
 static int get_num_cpus(struct ras_events *ras)