From patchwork Tue Oct 18 18:10:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 13010874 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F54FC4332F for ; Tue, 18 Oct 2022 18:11:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AAA056B0075; Tue, 18 Oct 2022 14:10:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A33306B0078; Tue, 18 Oct 2022 14:10:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8FB066B007B; Tue, 18 Oct 2022 14:10:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 790CB6B0075 for ; Tue, 18 Oct 2022 14:10:59 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 3CFF9160806 for ; Tue, 18 Oct 2022 18:10:59 +0000 (UTC) X-FDA: 80034861438.19.CE07492 Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by imf13.hostedemail.com (Postfix) with ESMTP id DB20720043 for ; Tue, 18 Oct 2022 18:10:58 +0000 (UTC) Received: by mail-ed1-f54.google.com with SMTP id q19so21712120edd.10 for ; Tue, 18 Oct 2022 11:10:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=se3AV6vebDZ5YP2shntPND551GMkzS6L+QPXNqXiQ7o=; b=EiH1XPctTsH40jJoCVZZQ2IWCv/qUknaMjZUF6TgNR1NyiiSgP1FKDRwgS3YgvgusO KAuH+P3qhGPDvn9cHgJYQ3UTGZGWiJlnO/BPHA/hsY8Ri9HPyj/YX5Tr7/BV7dnuoHlQ AtOfDu0kXX/3QfwsV1hlmwVz9X+MeAL0TpbJIQ2awoBkxBa+iQkwbt4U+XoHEetoQ3J5 SnhRrjXJuyZiyawCxpUsB/X1SVmr2DP4dlXgGt39dKrXXpQnovJNwgHhtrEYxPAF9Yp5 zigl8L0Dn6HAeQDpPGtOBDWQmEvL6nC2ySfy50CgtLQmONHTErp3JDAE9H2hq5yQ3prC 3mvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=se3AV6vebDZ5YP2shntPND551GMkzS6L+QPXNqXiQ7o=; b=WuHMfRIO6Zkf9fdukidnrt6j4AwFmWDTgeT49N9vLWzusMxyMIOTaAnYmXoWZcZjW/ W1JMO8NwZ18Ez+3uEtha3EuhpD0zkVUBA9x+xliIK++RQE6dtF4axrS2+Mt2lf9rokjm Yki9VgzgjEJ3BIaFU4XLlYVSRuLKcEXEiBbRLzA9FQuM6IUF4jhgkRW17277BJWD9Ci/ j5IcXdhCeezjqCskqVdcWxbF6nA7zgwk/Iwqzij0/bisZHDgjIZJqoEbXsTaiH4LPSS9 KwWAAN+pWsD1ptYpjmSHIntCbJKFNDoAZYySESRbQuOrJAU3THPYyP9671pMMMNYiIDh vJiQ== X-Gm-Message-State: ACrzQf3AAGDQZKsYrDbV+BB6qyI09GRkY5QLGJafIjPc9GJVq/5Unw4d J4gUlzkCp2qs98eHIeD7vt0= X-Google-Smtp-Source: AMsMyM555IpSQr3xQVjxZqzGIi4S+lkctx+n6jalt6F4k/WIUgkQUw6UHLeQ3jOaPacFX26PYZk0HA== X-Received: by 2002:a05:6402:5193:b0:45c:e2c6:6f0e with SMTP id q19-20020a056402519300b0045ce2c66f0emr3820266edd.29.1666116657449; Tue, 18 Oct 2022 11:10:57 -0700 (PDT) Received: from pc638.lan ([155.137.26.201]) by smtp.gmail.com with ESMTPSA id c1-20020a17090618a100b007877ad05b32sm7739302ejf.208.2022.10.18.11.10.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Oct 2022 11:10:56 -0700 (PDT) From: "Uladzislau Rezki (Sony)" To: Andrew Morton Cc: linux-mm@kvack.org, LKML , Christoph Hellwig , Matthew Wilcox , Nicholas Piggin , Steven Rostedt , Uladzislau Rezki , Oleksiy Avramchenko Subject: [PATCH v2 1/7] mm: vmalloc: Add alloc_vmap_area trace event Date: Tue, 18 Oct 2022 20:10:47 +0200 Message-Id: <20221018181053.434508-2-urezki@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221018181053.434508-1-urezki@gmail.com> References: <20221018181053.434508-1-urezki@gmail.com> MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666116658; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=se3AV6vebDZ5YP2shntPND551GMkzS6L+QPXNqXiQ7o=; b=gbP/M/3zlubH+ZkNdfW0ywqQ0Vvg1XMneiflAGTopfSEVY6K+XjDwpaSRc2eeqNmuVN2Ls 3gMJ/E/c5hTGQHcz/90oHQIkdq4qTJV3seOraqSaJgdlCWi0N7NtsNI0HUalik+RV/Y8Ta 1vZrMarKqu4jWKGgRompCarWVeKn4kU= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=EiH1XPct; spf=pass (imf13.hostedemail.com: domain of urezki@gmail.com designates 209.85.208.54 as permitted sender) smtp.mailfrom=urezki@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666116659; a=rsa-sha256; cv=none; b=yaitxMYDWnis8AbbJCrSsEWZUaPORlzL0nYkfKVLCraJrWQHYOeOgXLfacHaWutsFWJSay D39W1Ndle478AohXyotoxcB++u1vj1crR9zLaQzGYO0KdlWZIjado/us4Dyp101kLiFxpB jazRcK6sC5FfVur+yj4E8R4iP5tHRDg= X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: DB20720043 X-Rspam-User: Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=EiH1XPct; spf=pass (imf13.hostedemail.com: domain of urezki@gmail.com designates 209.85.208.54 as permitted sender) smtp.mailfrom=urezki@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Stat-Signature: ogy1jd6n7j15snx73bmho8sarnxt6yps X-HE-Tag: 1666116658-170616 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: It is for a debug purpose and for validation of passed parameters. Signed-off-by: Uladzislau Rezki (Sony) Reviewed-by: Christoph Hellwig --- include/trace/events/vmalloc.h | 56 ++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 include/trace/events/vmalloc.h diff --git a/include/trace/events/vmalloc.h b/include/trace/events/vmalloc.h new file mode 100644 index 000000000000..39fbd77c91e7 --- /dev/null +++ b/include/trace/events/vmalloc.h @@ -0,0 +1,56 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM vmalloc + +#if !defined(_TRACE_VMALLOC_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_VMALLOC_H + +#include + +/** + * 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_VMALLOC_H */ + +/* This part must be outside protection */ +#include