From: Steven Rostedt <rostedt@goodmis.org>
To: Vincent Donnefort <vdonnefort@google.com>
Cc: mhiramat@kernel.org, linux-kernel@vger.kernel.org,
linux-trace-kernel@vger.kernel.org,
mathieu.desnoyers@efficios.com, kernel-team@android.com
Subject: Re: [PATCH v17 2/6] ring-buffer: Introducing ring-buffer mapping functions
Date: Tue, 13 Feb 2024 15:53:09 -0500 [thread overview]
Message-ID: <20240213155309.01c7c2b2@gandalf.local.home> (raw)
In-Reply-To: <20240213114945.3528801-3-vdonnefort@google.com>
On Tue, 13 Feb 2024 11:49:41 +0000
Vincent Donnefort <vdonnefort@google.com> wrote:
Did you test with lockdep?
> +static int __rb_inc_dec_mapped(struct trace_buffer *buffer,
> + struct ring_buffer_per_cpu *cpu_buffer,
> + bool inc)
> +{
> + unsigned long flags;
> +
> + lockdep_assert_held(cpu_buffer->mapping_lock);
/work/git/linux-trace.git/kernel/trace/ring_buffer.c: In function ‘__rb_inc_dec_mapped’:
/work/git/linux-trace.git/include/linux/lockdep.h:234:61: error: invalid type argument of ‘->’ (have ‘struct mutex’)
234 | #define lockdep_is_held(lock) lock_is_held(&(lock)->dep_map)
| ^~
/work/git/linux-trace.git/include/asm-generic/bug.h:123:32: note: in definition of macro ‘WARN_ON’
123 | int __ret_warn_on = !!(condition); \
| ^~~~~~~~~
/work/git/linux-trace.git/include/linux/lockdep.h:267:9: note: in expansion of macro ‘lockdep_assert’
267 | lockdep_assert(lockdep_is_held(l) != LOCK_STATE_NOT_HELD)
| ^~~~~~~~~~~~~~
/work/git/linux-trace.git/include/linux/lockdep.h:267:24: note: in expansion of macro ‘lockdep_is_held’
267 | lockdep_assert(lockdep_is_held(l) != LOCK_STATE_NOT_HELD)
| ^~~~~~~~~~~~~~~
/work/git/linux-trace.git/kernel/trace/ring_buffer.c:6167:9: note: in expansion of macro ‘lockdep_assert_held’
6167 | lockdep_assert_held(cpu_buffer->mapping_lock);
| ^~~~~~~~~~~~~~~~~~~
I believe that is supposed to be:
lockdep_assert_held(&cpu_buffer->mapping_lock);
-- Steve
> +
> + if (inc && cpu_buffer->mapped == UINT_MAX)
> + return -EBUSY;
> +
> + if (WARN_ON(!inc && cpu_buffer->mapped == 0))
> + return -EINVAL;
> +
> + mutex_lock(&buffer->mutex);
> + raw_spin_lock_irqsave(&cpu_buffer->reader_lock, flags);
> +
> + if (inc)
> + cpu_buffer->mapped++;
> + else
> + cpu_buffer->mapped--;
> +
> + raw_spin_unlock_irqrestore(&cpu_buffer->reader_lock, flags);
> + mutex_unlock(&buffer->mutex);
> +
> + return 0;
> +}
next prev parent reply other threads:[~2024-02-13 20:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-13 11:49 [PATCH v17 0/6] Introducing trace buffer mapping by user-space Vincent Donnefort
2024-02-13 11:49 ` [PATCH v17 1/6] ring-buffer: Zero ring-buffer sub-buffers Vincent Donnefort
2024-02-13 11:49 ` [PATCH v17 2/6] ring-buffer: Introducing ring-buffer mapping functions Vincent Donnefort
2024-02-13 20:53 ` Steven Rostedt [this message]
2024-02-13 22:51 ` Steven Rostedt
2024-02-14 1:23 ` kernel test robot
2024-02-14 10:26 ` kernel test robot
2024-02-13 11:49 ` [PATCH v17 3/6] tracing: Add snapshot refcount Vincent Donnefort
2024-02-19 18:17 ` Steven Rostedt
2024-02-19 18:22 ` Steven Rostedt
2024-02-13 11:49 ` [PATCH v17 4/6] tracing: Allow user-space mapping of the ring-buffer Vincent Donnefort
2024-02-13 11:49 ` [PATCH v17 5/6] Documentation: tracing: Add ring-buffer mapping Vincent Donnefort
2024-02-13 11:49 ` [PATCH v17 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=20240213155309.01c7c2b2@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=kernel-team@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=vdonnefort@google.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®