linux-imx/kernel
Steven Rostedt (VMware) eaaa250505 ring-buffer: Have ring_buffer_iter_empty() return true when empty
commit 78f7a45dac upstream.

I noticed that reading the snapshot file when it is empty no longer gives a
status. It suppose to show the status of the snapshot buffer as well as how
to allocate and use it. For example:

 ># cat snapshot
 # tracer: nop
 #
 #
 # * Snapshot is allocated *
 #
 # Snapshot commands:
 # echo 0 > snapshot : Clears and frees snapshot buffer
 # echo 1 > snapshot : Allocates snapshot buffer, if not already allocated.
 #                      Takes a snapshot of the main buffer.
 # echo 2 > snapshot : Clears snapshot buffer (but does not allocate or free)
 #                      (Doesn't have to be '2' works with any number that
 #                       is not a '0' or '1')

But instead it just showed an empty buffer:

 ># cat snapshot
 # tracer: nop
 #
 # entries-in-buffer/entries-written: 0/0   #P:4
 #
 #                              _-----=> irqs-off
 #                             / _----=> need-resched
 #                            | / _---=> hardirq/softirq
 #                            || / _--=> preempt-depth
 #                            ||| /     delay
 #           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
 #              | |       |   ||||       |         |

What happened was that it was using the ring_buffer_iter_empty() function to
see if it was empty, and if it was, it showed the status. But that function
was returning false when it was empty. The reason was that the iter header
page was on the reader page, and the reader page was empty, but so was the
buffer itself. The check only tested to see if the iter was on the commit
page, but the commit page was no longer pointing to the reader page, but as
all pages were empty, the buffer is also.

Fixes: 651e22f270 ("ring-buffer: Always reset iterator to reader page")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
2017-05-09 08:19:33 +02:00
..
cpu sched, idle: Fix the idle polling state logic 2013-11-29 11:27:55 -08:00
debug kdb: fix incorrect counts in KDB summary command output 2015-03-01 23:34:21 +01:00
events perf/core: Fix event inheritance on fork() 2017-04-07 09:17:49 +02:00
gcov kernel: replace strict_strto*() with kstrto*() 2013-09-12 15:38:03 -07:00
irq genirq/generic_chip: Add irq_unmap callback 2016-11-08 16:38:25 +01:00
power PM / sleep: fix device reference leak in test_suspend 2016-11-24 16:23:57 +01:00
printk printk: use rcuidle console tracepoint 2017-03-01 10:38:14 +01:00
sched sched/rt: Add a missing rescheduling point 2017-04-07 10:59:35 +02:00
time tick/broadcast: Prevent NULL pointer dereference 2017-01-26 17:40:21 +01:00
trace ring-buffer: Have ring_buffer_iter_empty() return true when empty 2017-05-09 08:19:33 +02:00
.gitignore kernel/hz.bc: ignore. 2013-04-22 07:09:06 -07:00
acct.c fs: Fix hang with BSD accounting on frozen filesystem 2013-05-04 14:57:58 -04:00
async.c async: rename and redefine async_func_ptr 2013-03-12 13:59:14 -07:00
audit_tree.c audit: keep inode pinned 2014-11-19 18:38:16 +01:00
audit_watch.c
audit.c CAPABILITIES: remove undefined caps from all processes 2014-09-17 16:55:03 +02:00
audit.h audit: fix mq_open and mq_unlink to add the MQ root as a hidden parent audit_names record 2013-07-09 10:33:19 -07:00
auditfilter.c audit: restore AUDIT_LOGINUID unset ABI 2015-01-07 17:55:16 +01:00
auditsc.c audit: create private file name copies when auditing inodes 2015-11-12 14:09:10 +01:00
backtracetest.c
bounds.c
capability.c CAPABILITIES: remove undefined caps from all processes 2014-09-17 16:55:03 +02:00
cgroup_freezer.c cgroup: make css_for_each_descendant() and friends include the origin css in the iteration 2013-08-08 20:11:27 -04:00
cgroup.c move d_rcu from overlapping d_child to overlapping d_alias 2015-01-29 15:45:16 +01:00
compat.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal 2013-05-01 07:21:43 -07:00
configs.c proc: Supply PDE attribute setting accessor functions 2013-05-01 17:29:18 -04:00
context_tracking.c arm: Fix build error with context tracking calls 2013-09-27 17:59:47 +02:00
cpu_pm.c
cpu.c hotplug: Make register and unregister notifier API symmetric 2017-01-26 17:22:20 +01:00
cpuset.c cpuset: Fix cpuset sched_relax_domain_level 2015-04-09 13:14:06 +02:00
crash_dump.c
cred.c
delayacct.c
dma.c
elfcore.c
exec_domain.c
exit.c introduce for_each_thread() to replace the buggy while_each_thread() 2014-06-04 16:25:18 +02:00
extable.c extable: skip sorting if the table is empty 2013-09-11 15:58:25 -07:00
fork.c kernek/fork.c: allocate idle task for a CPU always on its local node 2017-04-07 09:17:48 +02:00
freezer.c freezer: Do not freeze tasks killed by OOM killer 2014-11-13 19:02:40 +01:00
futex_compat.c ptrace: use fsuid, fsgid, effective creds for fs access checks 2016-02-24 10:23:22 +01:00
futex.c futex: Add missing error handling to FUTEX_REQUEUE_PI 2017-03-28 15:49:28 +02:00
groups.c userns: Don't allow setgroups until a gid mapping has been setablished 2015-01-07 17:55:11 +01:00
hrtimer.c ktime: export ktime_divns 2016-07-21 08:36:05 +02:00
hung_task.c hung_task debugging: Print more info when reporting the problem 2013-08-02 11:02:42 +02:00
irq_work.c
itimer.c
jump_label.c jump_labels: API for flushing deferred jump label updates 2017-01-26 17:40:35 +01:00
kallsyms.c kernel: kallsyms: memory override issue, need check destination buffer length 2013-04-15 15:17:26 +09:30
kcmp.c ptrace: use fsuid, fsgid, effective creds for fs access checks 2016-02-24 10:23:22 +01:00
Kconfig.freezer
Kconfig.hz
Kconfig.locks locking/mutex: Disable optimistic spinning on some architectures 2014-07-29 17:01:47 +02:00
Kconfig.preempt
kexec.c kexec: allocate the kexec control page with KEXEC_CONTROL_MEMORY_GFP 2015-08-04 16:51:58 +02:00
kmod.c kernel/kmod.c: check for NULL in call_usermodehelper_exec() 2013-09-30 14:31:02 -07:00
kprobes.c kprobes: allow to specify custom allocator for insn caches 2013-09-11 15:58:52 -07:00
ksysfs.c kernel: replace strict_strto*() with kstrto*() 2013-09-12 15:38:03 -07:00
kthread.c kthread: implement probe_kthread_data() 2013-04-30 17:04:02 -07:00
latencytop.c
lglock.c lglock: Update lockdep annotations to report recursive local locks 2013-07-12 13:51:19 +02:00
lockdep_internals.h
lockdep_proc.c
lockdep_states.h
lockdep.c lockdep: remove task argument from debug_check_no_locks_held 2013-05-12 14:16:21 +02:00
Makefile Remove GENERIC_HARDIRQ config option 2013-09-13 15:09:52 +02:00
modsign_certificate.S CONFIG_SYMBOL_PREFIX: cleanup. 2013-03-15 15:09:43 +10:30
modsign_pubkey.c kernel/modsign_pubkey.c: fix init const for module signing code 2013-09-11 15:58:21 -07:00
module_signing.c
module-internal.h
module.c module: Invalidate signatures on force-loaded modules 2016-08-19 12:02:43 +02:00
mutex-debug.c
mutex-debug.h
mutex.c mutex: Avoid gcc version dependent __builtin_constant_p() usage 2013-10-18 21:58:54 +02:00
mutex.h
notifier.c
nsproxy.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2013-09-07 14:35:32 -07:00
padata.c padata: avoid race in reordering 2017-04-10 15:09:47 +02:00
panic.c kernel/panic.c: turn off locks debug before releasing console lock 2016-11-28 22:22:57 +01:00
params.c kernel/params: fix handling of signed integer types 2013-09-28 12:35:52 -07:00
pid_namespace.c pid_namespace: pidns_get() should check task_active_pid_ns() != NULL 2014-05-05 14:24:38 +02:00
pid.c fork: report pid reservation failure properly 2015-06-10 14:07:32 +02:00
posix-cpu-timers.c posix_timers: fix racy timer delta caching on task exit 2013-07-03 16:54:42 +02:00
posix-timers.c posix-timers: Fix stack info leak in timer_create() 2014-11-13 19:03:02 +01:00
profile.c kernel: delete __cpuinit usage from all core kernel files 2013-07-14 19:36:59 -04:00
ptrace.c ptrace: fix PTRACE_LISTEN race corrupting task->state 2017-04-26 20:05:00 +02:00
range.c range: Do not add new blank slot with add_range_with_merge 2013-06-18 11:32:10 -05:00
rcu.h rcu: Make call_rcu() leak callbacks for debug-object errors 2013-08-18 17:40:03 -07:00
rcupdate.c Not much changes for the 3.12 merge window. The major tracing changes 2013-09-09 14:42:15 -07:00
rcutiny_plugin.h rcu: Add const annotation to char * for RCU tracepoints and functions 2013-07-29 17:07:49 -04:00
rcutiny.c rcu: Correctly handle non-empty Tiny RCU callback list with none ready 2015-07-30 14:10:45 +02:00
rcutorture.c rcu: Make rcutorture emit online failures if verbose 2013-08-20 11:38:45 -07:00
rcutree_plugin.h rcu: Fix soft lockup for rcu_nocb_kthread 2016-12-12 15:25:24 +01:00
rcutree_trace.c rcutrace: single_open() leaks 2013-05-05 00:16:35 -04:00
rcutree.c rcu: Reject memory-order-induced stall-warning false positives 2015-10-07 09:24:51 +02:00
rcutree.h rcu: Throttle rcu_try_advance_all_cbs() execution 2014-03-12 13:25:37 +01:00
reboot.c kexec: migrate to reboot cpu 2014-01-09 12:25:07 -08:00
relay.c kernel: delete __cpuinit usage from all core kernel files 2013-07-14 19:36:59 -04:00
res_counter.c memcg: reduce function dereference 2013-09-12 15:38:02 -07:00
resource.c kernel/resource.c: fix muxed resource handling in __request_region() 2016-03-03 12:46:07 +01:00
rtmutex_common.h locking/rtmutex: Use READ_ONCE() in rt_mutex_owner() 2017-01-26 17:22:16 +01:00
rtmutex-debug.c
rtmutex-debug.h rtmutex: Handle deadlock detection smarter 2014-07-16 11:31:17 +02:00
rtmutex-tester.c locking/rtmutex/tester: Set correct permissions on sysfs files 2013-04-10 14:48:37 +02:00
rtmutex.c locking/rtmutex: Prevent dequeue vs. unlock race 2017-01-26 17:22:16 +01:00
rtmutex.h rtmutex: Handle deadlock detection smarter 2014-07-16 11:31:17 +02:00
rwsem.c Revert "rw_semaphore: remove up/down_read_non_owner" 2013-03-23 15:53:52 -07:00
seccomp.c seccomp: allow BPF_XOR based ALU instructions. 2013-03-26 11:07:19 +11:00
semaphore.c semaphore: use `bool' type for semaphore_waiter's up 2013-04-30 17:04:08 -07:00
signal.c signal: remove warning about using SI_TKILL in rt_[tg]sigqueueinfo 2016-07-21 08:36:13 +02:00
smp.c kernel/smp.c:on_each_cpu_cond(): fix warning in fallback path 2014-09-17 16:55:03 +02:00
smpboot.c smpboot: Add missing get_online_cpus() in smpboot_register_percpu_thread() 2015-02-09 10:50:24 +01:00
smpboot.h
softirq.c ksoftirqd: Enable IRQs and call cond_resched() before poking RCU 2015-05-15 09:10:37 +02:00
spinlock.c kernel/spinlock.c: add default arch_*_relax definitions for GENERIC_LOCKBREAK 2013-09-11 15:58:21 -07:00
srcu.c
stacktrace.c
stop_machine.c stop_machine: Mark per cpu stopper enabled early 2013-02-26 22:25:17 +01:00
sys_ni.c unify compat fanotify_mark(2), switch to COMPAT_SYSCALL_DEFINE 2013-05-09 13:46:38 -04:00
sys.c userns: Kill nsown_capable it makes the wrong thing easy 2013-08-30 23:44:11 -07:00
sysctl_binary.c fs/coredump: prevent fsuid=0 dumps into user-controlled directories 2016-04-11 16:44:20 +02:00
sysctl.c sysctl: fix proc_doulongvec_ms_jiffies_minmax() 2017-02-15 11:56:07 +01:00
task_work.c task_work: documentation 2013-09-11 15:58:27 -07:00
taskstats.c
test_kprobes.c kernel/: rename random32() to prandom_u32() 2013-04-29 18:28:42 -07:00
time.c time: settimeofday: Validate the values of tv from user 2015-01-29 15:45:01 +01:00
timeconst.bc
timer.c timers: Use proper base migration in add_timer_on() 2016-09-29 11:14:07 +02:00
tracepoint.c tracepoint: Do not waste memory on mods with no tracepoints 2014-05-29 11:38:10 +02:00
tsacct.c
uid16.c groups: Consolidate the setgroups permission checks 2015-01-07 17:55:10 +01:00
up.c smp.h: move !SMP version of on_each_cpu() out-of-line 2013-09-11 15:58:25 -07:00
user_namespace.c userns: Allow setting gid_maps without privilege when setgroups is disabled 2015-01-07 17:55:14 +01:00
user-return-notifier.c hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
user.c userns: Add a knob to disable setgroups on a per user namespace basis 2015-01-07 17:55:14 +01:00
utsname_sysctl.c kernel/utsname_sysctl.c: put get/get_uts() into CONFIG_PROC_SYSCTL code block 2013-02-27 19:10:22 -08:00
utsname.c userns: Kill nsown_capable it makes the wrong thing easy 2013-08-30 23:44:11 -07:00
wait.c kernel: fix new kernel-doc warning in wait.c 2013-08-19 09:08:54 -07:00
watchdog.c watchdog: update watchdog_thresh properly 2013-09-24 17:00:25 -07:00
workqueue_internal.h sched: Rename sched.c as sched/core.c in comments and Documentation 2013-06-19 12:58:42 +02:00
workqueue.c workqueue: fix ghost PENDING flag while doing MQ IO 2016-05-02 19:54:56 +02:00