aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/sctop.py
diff options
context:
space:
mode:
authorAlex Elder <[email protected]>2014-08-06 16:08:59 -0700
committerLinus Torvalds <[email protected]>2014-08-06 18:01:24 -0700
commite97e1267e9faa6480898a1fc34c8e40d74d702f2 (patch)
treef60eafec77791616da6b12fc1ceb2c2039a11640 /tools/perf/scripts/python/sctop.py
parent23b2899f7f194f06e09b52a1f46f027a21fae17c (diff)
printk: tweak do_syslog() to match comments
In do_syslog() there's a path used by kmsg_poll() and kmsg_read() that only needs to know whether there's any data available to read (and not its size). These callers only check for non-zero return. As a shortcut, do_syslog() returns the difference between what has been logged and what has been "seen." The comments say that the "count of records" should be returned but it's not. Instead it returns (log_next_idx - syslog_idx), which is a difference between buffer offsets--and the result could be negative. The behavior is the same (it'll be zero or not in the same cases), but the count of records is more meaningful and it matches what the comments say. So change the code to return that. Signed-off-by: Alex Elder <[email protected]> Cc: Petr Mladek <[email protected]> Cc: Jan Kara <[email protected]> Cc: Joe Perches <[email protected]> Cc: John Stultz <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/sctop.py')
0 files changed, 0 insertions, 0 deletions