From: Vincent Donnefort <vdonnefort@google.com>
To: kernel test robot <lkp@intel.com>
Cc: rostedt@goodmis.org, mhiramat@kernel.org,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
oe-kbuild-all@lists.linux.dev, mathieu.desnoyers@efficios.com,
kernel-team@android.com
Subject: Re: [PATCH v13 3/6] tracing: Add snapshot refcount
Date: Tue, 30 Jan 2024 10:32:45 +0000 [thread overview]
Message-ID: <ZbjQTZ4SIkG703QM@google.com> (raw)
In-Reply-To: <202401301740.qzZlpcYV-lkp@intel.com>
On Tue, Jan 30, 2024 at 05:30:38PM +0800, kernel test robot wrote:
> Hi Vincent,
>
> kernel test robot noticed the following build errors:
>
> [auto build test ERROR on 29142dc92c37d3259a33aef15b03e6ee25b0d188]
>
> url: https://github.com/intel-lab-lkp/linux/commits/Vincent-Donnefort/ring-buffer-Zero-ring-buffer-sub-buffers/20240129-223025
> base: 29142dc92c37d3259a33aef15b03e6ee25b0d188
> patch link: https://lore.kernel.org/r/20240129142802.2145305-4-vdonnefort%40google.com
> patch subject: [PATCH v13 3/6] tracing: Add snapshot refcount
> config: arc-randconfig-002-20240130 (https://download.01.org/0day-ci/archive/20240130/202401301740.qzZlpcYV-lkp@intel.com/config)
> compiler: arceb-elf-gcc (GCC) 13.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240130/202401301740.qzZlpcYV-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202401301740.qzZlpcYV-lkp@intel.com/
>
> All errors (new ones prefixed by >>):
>
> kernel/trace/trace.c: In function 'tracing_set_tracer':
> kernel/trace/trace.c:6644:17: error: implicit declaration of function 'tracing_disarm_snapshot_locked'; did you mean 'tracing_disarm_snapshot'? [-Werror=implicit-function-declaration]
> 6644 | tracing_disarm_snapshot_locked(tr);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> | tracing_disarm_snapshot
> >> kernel/trace/trace.c:6648:23: error: implicit declaration of function 'tracing_arm_snapshot_locked'; did you mean 'tracing_arm_snapshot'? [-Werror=implicit-function-declaration]
> 6648 | ret = tracing_arm_snapshot_locked(tr);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
> | tracing_arm_snapshot
> cc1: some warnings being treated as errors
Right, two tracers (hwlat and osnoise) select _only_ MAX_TRACE and not
TRACER_SNAPSHOT.
However, AFAICT, they will not call any of the swapping functions (they don't
set use_max_tr). So I suppose arm/disarm can be ommited in that case.
>
>
> vim +6648 kernel/trace/trace.c
>
> 6560
> 6561 int tracing_set_tracer(struct trace_array *tr, const char *buf)
> 6562 {
> 6563 struct tracer *t;
> 6564 #ifdef CONFIG_TRACER_MAX_TRACE
> 6565 bool had_max_tr;
> 6566 #endif
> 6567 int ret = 0;
> 6568
> 6569 mutex_lock(&trace_types_lock);
> 6570
> 6571 if (!tr->ring_buffer_expanded) {
> 6572 ret = __tracing_resize_ring_buffer(tr, trace_buf_size,
> 6573 RING_BUFFER_ALL_CPUS);
> 6574 if (ret < 0)
> 6575 goto out;
> 6576 ret = 0;
> 6577 }
> 6578
> 6579 for (t = trace_types; t; t = t->next) {
> 6580 if (strcmp(t->name, buf) == 0)
> 6581 break;
> 6582 }
> 6583 if (!t) {
> 6584 ret = -EINVAL;
> 6585 goto out;
> 6586 }
> 6587 if (t == tr->current_trace)
> 6588 goto out;
> 6589
> 6590 #ifdef CONFIG_TRACER_SNAPSHOT
> 6591 if (t->use_max_tr) {
> 6592 local_irq_disable();
> 6593 arch_spin_lock(&tr->max_lock);
> 6594 if (tr->cond_snapshot)
> 6595 ret = -EBUSY;
> 6596 arch_spin_unlock(&tr->max_lock);
> 6597 local_irq_enable();
> 6598 if (ret)
> 6599 goto out;
> 6600 }
> 6601 #endif
> 6602 /* Some tracers won't work on kernel command line */
> 6603 if (system_state < SYSTEM_RUNNING && t->noboot) {
> 6604 pr_warn("Tracer '%s' is not allowed on command line, ignored\n",
> 6605 t->name);
> 6606 goto out;
> 6607 }
> 6608
> 6609 /* Some tracers are only allowed for the top level buffer */
> 6610 if (!trace_ok_for_array(t, tr)) {
> 6611 ret = -EINVAL;
> 6612 goto out;
> 6613 }
> 6614
> 6615 /* If trace pipe files are being read, we can't change the tracer */
> 6616 if (tr->trace_ref) {
> 6617 ret = -EBUSY;
> 6618 goto out;
> 6619 }
> 6620
> 6621 trace_branch_disable();
> 6622
> 6623 tr->current_trace->enabled--;
> 6624
> 6625 if (tr->current_trace->reset)
> 6626 tr->current_trace->reset(tr);
> 6627
> 6628 #ifdef CONFIG_TRACER_MAX_TRACE
> 6629 had_max_tr = tr->current_trace->use_max_tr;
> 6630
> 6631 /* Current trace needs to be nop_trace before synchronize_rcu */
> 6632 tr->current_trace = &nop_trace;
> 6633
> 6634 if (had_max_tr && !t->use_max_tr) {
> 6635 /*
> 6636 * We need to make sure that the update_max_tr sees that
> 6637 * current_trace changed to nop_trace to keep it from
> 6638 * swapping the buffers after we resize it.
> 6639 * The update_max_tr is called from interrupts disabled
> 6640 * so a synchronized_sched() is sufficient.
> 6641 */
> 6642 synchronize_rcu();
> 6643 free_snapshot(tr);
> 6644 tracing_disarm_snapshot_locked(tr);
> 6645 }
> 6646
> 6647 if (t->use_max_tr) {
> > 6648 ret = tracing_arm_snapshot_locked(tr);
> 6649 if (ret)
> 6650 goto out;
> 6651 }
> 6652 #else
> 6653 tr->current_trace = &nop_trace;
> 6654 #endif
> 6655
> 6656 if (t->init) {
> 6657 ret = tracer_init(t, tr);
> 6658 if (ret) {
> 6659 #ifdef CONFIG_TRACER_MAX_TRACE
> 6660 if (t->use_max_tr)
> 6661 tracing_disarm_snapshot_locked(tr);
> 6662 #endif
> 6663 goto out;
> 6664 }
> 6665 }
> 6666
> 6667 tr->current_trace = t;
> 6668 tr->current_trace->enabled++;
> 6669 trace_branch_enable(tr);
> 6670 out:
> 6671 mutex_unlock(&trace_types_lock);
> 6672
> 6673 return ret;
> 6674 }
> 6675
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2024-01-30 10:32 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-29 14:27 [PATCH v13 0/6] Introducing trace buffer mapping by user-space Vincent Donnefort
2024-01-29 14:27 ` [PATCH v13 1/6] ring-buffer: Zero ring-buffer sub-buffers Vincent Donnefort
2024-01-29 14:27 ` [PATCH v13 2/6] ring-buffer: Introducing ring-buffer mapping functions Vincent Donnefort
2024-01-30 14:55 ` Masami Hiramatsu
2024-01-30 16:22 ` Vincent Donnefort
2024-02-04 0:54 ` Steven Rostedt
2024-02-04 0:33 ` Steven Rostedt
2024-02-05 9:43 ` Vincent Donnefort
2024-01-29 14:27 ` [PATCH v13 3/6] tracing: Add snapshot refcount Vincent Donnefort
2024-01-30 9:30 ` kernel test robot
2024-01-30 10:32 ` Vincent Donnefort [this message]
2024-02-05 10:25 ` Steven Rostedt
2024-01-29 14:28 ` [PATCH v13 4/6] tracing: Allow user-space mapping of the ring-buffer Vincent Donnefort
2024-01-29 14:28 ` [PATCH v13 5/6] Documentation: tracing: Add ring-buffer mapping Vincent Donnefort
2024-01-29 14:28 ` [PATCH v13 6/6] ring-buffer/selftest: Add ring-buffer mapping test Vincent Donnefort
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZbjQTZ4SIkG703QM@google.com \
--to=vdonnefort@google.com \
--cc=kernel-team@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.