Skip to content

Commit

Permalink
USB: usbmon: mask seconds properly in text API
Browse files Browse the repository at this point in the history
The code does not implement the comment, so timestamps for long traces
become confusing instead of wrapping neatly as expected. This was actually
observed. Fortunately for API being in debugfs, we can just fix this instead
of staying bug-for-bug compatible. Double fortunately, the stable binary
API is not affected.

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Pete Zaitcev authored and Greg Kroah-Hartman committed Mar 2, 2010
1 parent 444dc54 commit 47cb170
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/mon/mon_text.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ static inline unsigned int mon_get_timestamp(void)
unsigned int stamp;

do_gettimeofday(&tval);
stamp = tval.tv_sec & 0xFFFF; /* 2^32 = 4294967296. Limit to 4096s. */
stamp = tval.tv_sec & 0xFFF; /* 2^32 = 4294967296. Limit to 4096s. */
stamp = stamp * 1000000 + tval.tv_usec;
return stamp;
}
Expand Down

0 comments on commit 47cb170

Please sign in to comment.