diff options
author | 2017-11-06 06:38:38 -0800 | |
---|---|---|
committer | 2017-11-13 15:53:57 -0500 | |
commit | d61ea0751aa097182291c7ceed447bc73e020109 (patch) | |
tree | 8b78c4ea599d5268f4f83db9ff232a36f35b2c0c /tools/perf/scripts/python/export-to-postgresql.py | |
parent | IB/hfi1: Remove wrapper function in mmu_rb (diff) | |
download | linux-dev-d61ea0751aa097182291c7ceed447bc73e020109.tar.xz linux-dev-d61ea0751aa097182291c7ceed447bc73e020109.zip |
IB/hfi1: Fix a wrapping test to insure the correct timeout
The "2 * UINT_MAX" statement:
if ((u64)(ts - cce->timestamp) > 2 * UINT_MAX) {
is equivalent to:
if ((u64)(ts - cce->timestamp) > UINT_MAX - 1) {
This results in a premature timeout of the cong log entry.
Fix by using unsigned 64 bit integers, removing casts, and using
an algebraic equivalent test to avoid the "2 * UINT_MAX" issue.
Also make use of kernel API to get nanoseconds instead of
open coding.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions