The format string contains %lu to print a long unsigned, but we
possibly multiply the value with -1, which can lead to output like
Jun 13 13:36:37 baader (3) compute_time_diff: time diff jump: 4294808018ms
Fix this by replacing the multiplication with an additional format
string directive to print the leading +/- explicitly. This is easy
since we already have the sign in a variable, and it avoids any
integer conversion/overflow issues.
if (count > 5) {
int s = tv_diff(&diff, &stat_task->sa_time_diff, &tmp);
if (tv_diff(&max_deviation, &tmp, NULL) < 0)
- PARA_WARNING_LOG("time diff jump: %lums\n",
- s * tv2ms(&tmp));
+ PARA_WARNING_LOG("time diff jump: %c%lums\n",
+ s < 0? '-' : '+', tv2ms(&tmp));
}
count++;
sa_time_diff_sign = tv_convex_combination(