gpu: nvgpu: flush the UTF fprintf buffer on each call

In case of segmentation fault or hang unit test prints are not coming
in GVS logs which has already run. It makes difficult to find exact
faulty test/unit.

Adds fflush which flush the msg buffer after each call.

Bug 200577095

Change-Id: Ib77ec40636d9416414ef1a00dcf8886b7aae0f3b
Signed-off-by: Prateek sethi <prsethi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2275538
Reviewed-by: Shashank Singh <shashsingh@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Philip Elcan <pelcan@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Prateek sethi
2020-01-08 10:41:23 +05:30
committed by Alex Waterman
parent 4649631d38
commit 5f74899178

View File

@@ -45,6 +45,7 @@ static void __core_print_file(struct unit_fw *fw, FILE *filp,
fprintf(filp, "[%s%s%s] %s%s%s",
color, prefix, reset,
color, msg, reset);
fflush(stdout);
}
__attribute__((format (printf, 3, 4)))