linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>,
	Christoph Hellwig <hch@infradead.org>,
	Matthew Wilcox <willy@infradead.org>,
	Nicholas Piggin <npiggin@gmail.com>,
	Uladzislau Rezki <urezki@gmail.com>,
	Oleksiy Avramchenko <oleksiy.avramchenko@sony.com>
Subject: [PATCH 1/7] mm: vmap: Add alloc_vmap_area trace event
Date: Mon, 17 Oct 2022 18:02:25 +0200	[thread overview]
Message-ID: <20221017160233.16582-2-urezki@gmail.com> (raw)
In-Reply-To: <20221017160233.16582-1-urezki@gmail.com>

It is for a debug purpose and for validation of passed parameters.

To: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
---
 include/trace/events/vmap.h | 56 +++++++++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)
 create mode 100644 include/trace/events/vmap.h

diff --git a/include/trace/events/vmap.h b/include/trace/events/vmap.h
new file mode 100644
index 000000000000..504870d95a4e
--- /dev/null
+++ b/include/trace/events/vmap.h
@@ -0,0 +1,56 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM vmap
+
+#if !defined(_TRACE_VMAP_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACE_VMAP_H
+
+#include <linux/tracepoint.h>
+
+/**
+ * alloc_vmap_area - called when a new vmap allocation occurs
+ * @addr:	an allocated address
+ * @size:	a requested size
+ * @align:	a requested alignment
+ * @vstart:	a requested start range
+ * @vend:	a requested end range
+ * @failed:	an allocation failed or not
+ *
+ * This event is used for a debug purpose, it can give an extra
+ * information for a developer about how often it occurs and which
+ * parameters are passed for further validation.
+ */
+TRACE_EVENT(alloc_vmap_area,
+
+	TP_PROTO(unsigned long addr, unsigned long size, unsigned long align,
+		unsigned long vstart, unsigned long vend, int failed),
+
+	TP_ARGS(addr, size, align, vstart, vend, failed),
+
+	TP_STRUCT__entry(
+		__field(unsigned long, addr)
+		__field(unsigned long, size)
+		__field(unsigned long, align)
+		__field(unsigned long, vstart)
+		__field(unsigned long, vend)
+		__field(int, failed)
+	),
+
+	TP_fast_assign(
+		__entry->addr = addr;
+		__entry->size = size;
+		__entry->align = align;
+		__entry->vstart = vstart;
+		__entry->vend = vend;
+		__entry->failed = failed;
+	),
+
+	TP_printk("va_start: %lu size=%lu align=%lu vstart=0x%lx vend=0x%lx failed=%d",
+		__entry->addr, __entry->size, __entry->align,
+		__entry->vstart, __entry->vend, __entry->failed)
+);
+
+#endif /*  _TRACE_VMAP_H */
+
+/* This part must be outside protection */
+#include <trace/define_trace.h>
-- 
2.30.2



  reply	other threads:[~2022-10-17 16:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-17 16:02 [PATCH 0/7] Add basic trace events for vmap/vmalloc Uladzislau Rezki (Sony)
2022-10-17 16:02 ` Uladzislau Rezki (Sony) [this message]
2022-10-18 16:41   ` [PATCH 1/7] mm: vmap: Add alloc_vmap_area trace event Steven Rostedt
2022-10-18 16:57     ` Uladzislau Rezki
2022-10-17 16:02 ` [PATCH 2/7] mm: vmap: Add a purge_vmap_area_lazy " Uladzislau Rezki (Sony)
2022-10-17 16:02 ` [PATCH 2/7] mm: vmap: Add " Uladzislau Rezki (Sony)
2022-10-17 16:02 ` [PATCH 3/7] mm: vmap: Add a free_vmap_area_noflush " Uladzislau Rezki (Sony)
2022-10-17 16:02 ` [PATCH 3/7] mm: vmap: Add " Uladzislau Rezki (Sony)
2022-10-17 16:02 ` [PATCH 4/7] mm/vmalloc: Use a trace_alloc_vmap_area event Uladzislau Rezki (Sony)
2022-10-17 19:12   ` kernel test robot
2022-10-18 16:17     ` Uladzislau Rezki
2022-10-18 16:44       ` Steven Rostedt
2022-10-18 16:55         ` Uladzislau Rezki
2022-10-17 16:02 ` [PATCH 5/7] mm/vmalloc: Use a trace_purge_vmap_area_lazy event Uladzislau Rezki (Sony)
2022-10-17 16:02 ` [PATCH 6/7] mm/vmalloc: Use a trace_free_vmap_area_noflush event Uladzislau Rezki (Sony)
2022-10-17 16:02 ` [PATCH 7/7] vmalloc: Add reviewers for vmalloc code Uladzislau Rezki (Sony)

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=20221017160233.16582-2-urezki@gmail.com \
    --to=urezki@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=npiggin@gmail.com \
    --cc=oleksiy.avramchenko@sony.com \
    --cc=willy@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).