提交 47cb1708 编写于 作者: P Pete Zaitcev 提交者: Greg Kroah-Hartman

USB: usbmon: mask seconds properly in text API

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: NPete Zaitcev <zaitcev@redhat.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 444dc54c
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册