Re: [PATCH v2 40/40] tracing: Add trace_event_buffer_reserve() variant that allows recursion

From: kbuild test robot
Date: Thu Sep 07 2017 - 18:35:40 EST


Hi Tom,

[auto build test ERROR on tip/perf/core]
[also build test ERROR on v4.13 next-20170907]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Tom-Zanussi/tracing-Inter-event-e-g-latency-support/20170908-054142
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 4.9.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=xtensa

All errors (new ones prefixed by >>):

kernel/trace/ring_buffer.c: In function 'rb_write_something':
>> kernel/trace/ring_buffer.c:4836:10: error: too few arguments to function 'ring_buffer_lock_reserve'
event = ring_buffer_lock_reserve(data->buffer, len);
^
kernel/trace/ring_buffer.c:2846:1: note: declared here
ring_buffer_lock_reserve(struct ring_buffer *buffer, unsigned long length,
^

vim +/ring_buffer_lock_reserve +4836 kernel/trace/ring_buffer.c

6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4813)
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4814) static __init int rb_write_something(struct rb_test_data *data, bool nested)
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4815) {
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4816) struct ring_buffer_event *event;
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4817) struct rb_item *item;
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4818) bool started;
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4819) int event_len;
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4820) int size;
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4821) int len;
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4822) int cnt;
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4823)
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4824) /* Have nested writes different that what is written */
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4825) cnt = data->cnt + (nested ? 27 : 0);
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4826)
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4827) /* Multiply cnt by ~e, to make some unique increment */
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4828) size = (data->cnt * 68 / 25) % (sizeof(rb_string) - 1);
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4829)
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4830) len = size + sizeof(struct rb_item);
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4831)
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4832) started = rb_test_started;
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4833) /* read rb_test_started before checking buffer enabled */
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4834) smp_rmb();
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4835)
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 @4836) event = ring_buffer_lock_reserve(data->buffer, len);
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4837) if (!event) {
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4838) /* Ignore dropped events before test starts. */
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4839) if (started) {
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4840) if (nested)
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4841) data->bytes_dropped += len;
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4842) else
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4843) data->bytes_dropped_nested += len;
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4844) }
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4845) return len;
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4846) }
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4847)
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4848) event_len = ring_buffer_event_length(event);
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4849)
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4850) if (RB_WARN_ON(data->buffer, event_len < len))
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4851) goto out;
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4852)
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4853) item = ring_buffer_event_data(event);
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4854) item->size = size;
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4855) memcpy(item->str, rb_string, size);
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4856)
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4857) if (nested) {
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4858) data->bytes_alloc_nested += event_len;
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4859) data->bytes_written_nested += len;
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4860) data->events_nested++;
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4861) if (!data->min_size_nested || len < data->min_size_nested)
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4862) data->min_size_nested = len;
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4863) if (len > data->max_size_nested)
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4864) data->max_size_nested = len;
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4865) } else {
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4866) data->bytes_alloc += event_len;
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4867) data->bytes_written += len;
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4868) data->events++;
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4869) if (!data->min_size || len < data->min_size)
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4870) data->max_size = len;
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4871) if (len > data->max_size)
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4872) data->max_size = len;
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4873) }
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4874)
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4875) out:
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4876) ring_buffer_unlock_commit(data->buffer, event);
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4877)
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4878) return 0;
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4879) }
6c43e554a2 Steven Rostedt (Red Hat 2013-03-15 4880)

:::::: The code at line 4836 was first introduced by commit
:::::: 6c43e554a2a5c1f2caf1733d46719bc58de3e37b ring-buffer: Add ring buffer startup selftest

:::::: TO: Steven Rostedt (Red Hat) <rostedt@xxxxxxxxxxx>
:::::: CC: Steven Rostedt <rostedt@xxxxxxxxxxx>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip