From patchwork Thu Apr 14 08:57:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hyeonggon Yoo <42.hyeyoo@gmail.com> X-Patchwork-Id: 12813168 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 73340C433EF for ; Thu, 14 Apr 2022 08:59:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1B9706B007D; Thu, 14 Apr 2022 04:59:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 169E16B0071; Thu, 14 Apr 2022 04:59:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F25AB6B0080; Thu, 14 Apr 2022 04:59:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id E5D0D6B007D for ; Thu, 14 Apr 2022 04:59:19 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id B687724974 for ; Thu, 14 Apr 2022 08:59:19 +0000 (UTC) X-FDA: 79354885638.13.ED41B78 Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) by imf17.hostedemail.com (Postfix) with ESMTP id 5359940005 for ; Thu, 14 Apr 2022 08:59:19 +0000 (UTC) Received: by mail-pj1-f47.google.com with SMTP id g12-20020a17090a640c00b001cb59d7a57cso5548158pjj.1 for ; Thu, 14 Apr 2022 01:59:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hsQvWpubllx7PdWg9lbvyVRg4B3WKq0E84Aji7H3XUg=; b=RcI79TDVfUjEI+i7r0zv9DyFEarSCFOyyJ0yAe7QADd7JMamrld0EL4b0MRQQtrJFP yl5lGZBKoYaISvBtIUFjkwkE4uRd4hqa75Q8rX2cOSKVe7/OSGuDyPqfJVYs2ji6ZbGH jwAFBBf00cMN6ViOCeY6jFXivsR0+KSCaodvMFqGNHgQPtoYlW7W7OuOywUtOkIw6o2A 4oxeUjuOGCfQ6MpC3ZvHMcRv6IJnmXTXjN5djExNqEzEFYByKGuvntX4KDlBhmv+ZQDE 1Ph97XF0XJ3amt/G8ZzZcNMasQKt7vl8pveXq3v2fOc9v7JM1R58uRuyFHh3lu0WYjj7 T8Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hsQvWpubllx7PdWg9lbvyVRg4B3WKq0E84Aji7H3XUg=; b=xziaGcCYHxNsp/rVj5T7TUev6qCBDt3TbyEpPtBIAyjrbPwKHoT1QSqj8EKwinLY+U HptJtVwoAFnNIoOEO4pOrRGxLFveuUHvM0mZvyxFiKxN2pHD8fZA6eMgj6eSV3YJSdZE OtP0UpmkIrV/qx1vN4BCxio0hUbNjGcQnB/oNwicoPQ2QDyModrzhZmsZLyLX+zbJvyU M7j8GVFgSFRa6RVo4O7jq2umj+Q0k+uOecYFwS5S8hLORVBg4pbu+oEJSc3CUMb0X/QA azqOFUyGthHSjFvgEjW6Ib+7fpuwUzoaF19P33KtQsd39lXk+1XGTORVXXjO5wjAwGqT BBug== X-Gm-Message-State: AOAM530Yrk9v3k5YRLljjy11B8jYBWdNasq6NeCNiGFcmtbPxzskLfLG ggCrOi+b+tK+23K8RN8/qBY= X-Google-Smtp-Source: ABdhPJz7HfWYTCuY7TqGCZq82ODBwRzEgJAykfwr5rZXPv7yJZnkLjt8584O0Wr3hN6glVAZ5QpD3g== X-Received: by 2002:a17:902:aa85:b0:155:ceb9:3710 with SMTP id d5-20020a170902aa8500b00155ceb93710mr12561403plr.59.1649926758443; Thu, 14 Apr 2022 01:59:18 -0700 (PDT) Received: from hyeyoo.. ([114.29.24.243]) by smtp.gmail.com with ESMTPSA id p9-20020aa79e89000000b00505fada20dfsm1403537pfq.117.2022.04.14.01.59.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Apr 2022 01:59:16 -0700 (PDT) From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Vlastimil Babka Cc: Marco Elver , Matthew WilCox , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Roman Gushchin , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 16/23] mm/slab_common: rename tracepoint Date: Thu, 14 Apr 2022 17:57:20 +0900 Message-Id: <20220414085727.643099-17-42.hyeyoo@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220414085727.643099-1-42.hyeyoo@gmail.com> References: <20220414085727.643099-1-42.hyeyoo@gmail.com> MIME-Version: 1.0 Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=RcI79TDV; spf=pass (imf17.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.216.47 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Stat-Signature: 9w7979mpnrx9i4wr4muyra8sez17m5et X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 5359940005 X-HE-Tag: 1649926759-49289 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: To reduce overhead of printing tracepoint name, rename trace_kmem_cache_alloc_node to kmem_cache_alloc. Suggested-by: Vlastimil Babka Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> --- include/trace/events/kmem.h | 4 ++-- mm/slab.c | 8 ++++---- mm/slab_common.c | 6 +++--- mm/slob.c | 22 +++++++++++----------- mm/slub.c | 16 ++++++++-------- 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/include/trace/events/kmem.h b/include/trace/events/kmem.h index ca67ba5fd76a..58edb2e3e5a4 100644 --- a/include/trace/events/kmem.h +++ b/include/trace/events/kmem.h @@ -9,7 +9,7 @@ #include #include -DECLARE_EVENT_CLASS(kmem_alloc_node, +DECLARE_EVENT_CLASS(kmem_alloc, TP_PROTO(const char *name, unsigned long call_site, @@ -51,7 +51,7 @@ DECLARE_EVENT_CLASS(kmem_alloc_node, __entry->node) ); -DEFINE_EVENT(kmem_alloc_node, kmem_cache_alloc_node, +DEFINE_EVENT(kmem_alloc, kmem_cache_alloc, TP_PROTO(const char *name, unsigned long call_site, const void *ptr, size_t bytes_req, size_t bytes_alloc, diff --git a/mm/slab.c b/mm/slab.c index b9959a6b5c48..424168b96790 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -3448,7 +3448,7 @@ void *__kmem_cache_alloc_node(struct kmem_cache *cachep, struct list_lru *lru, void *ret = slab_alloc_node(cachep, lru, flags, nodeid, cachep->object_size, caller); - trace_kmem_cache_alloc_node(cachep->name, caller, ret, + trace_kmem_cache_alloc(cachep->name, caller, ret, cachep->object_size, cachep->size, flags, nodeid); @@ -3519,9 +3519,9 @@ void *kmem_cache_alloc_node_trace(struct kmem_cache *cachep, ret = slab_alloc_node(cachep, NULL, flags, nodeid, size, _RET_IP_); ret = kasan_kmalloc(cachep, ret, size, flags); - trace_kmem_cache_alloc_node(cachep->name, _RET_IP_, ret, - size, cachep->size, - flags, nodeid); + trace_kmem_cache_alloc(cachep->name, _RET_IP_, ret, + size, cachep->size, + flags, nodeid); return ret; } EXPORT_SYMBOL(kmem_cache_alloc_node_trace); diff --git a/mm/slab_common.c b/mm/slab_common.c index 3d1569085c54..3cd5d7a47ec7 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -957,8 +957,8 @@ void *kmalloc_large_node(size_t size, gfp_t flags, int node) ptr = kasan_kmalloc_large(ptr, size, flags); /* As ptr might get tagged, call kmemleak hook after KASAN. */ kmemleak_alloc(ptr, size, 1, flags); - trace_kmem_cache_alloc_node(KMALLOC_LARGE_NAME, _RET_IP_, ptr, size, - PAGE_SIZE << order, flags, node); + trace_kmem_cache_alloc(KMALLOC_LARGE_NAME, _RET_IP_, ptr, size, + PAGE_SIZE << order, flags, node); return ptr; } EXPORT_SYMBOL(kmalloc_large_node); @@ -1291,7 +1291,7 @@ size_t ksize(const void *objp) EXPORT_SYMBOL(ksize); /* Tracepoints definitions. */ -EXPORT_TRACEPOINT_SYMBOL(kmem_cache_alloc_node); +EXPORT_TRACEPOINT_SYMBOL(kmem_cache_alloc); EXPORT_TRACEPOINT_SYMBOL(kmem_cache_free); int should_failslab(struct kmem_cache *s, gfp_t gfpflags) diff --git a/mm/slob.c b/mm/slob.c index b1f291128e94..1bb4c577b908 100644 --- a/mm/slob.c +++ b/mm/slob.c @@ -505,8 +505,8 @@ __do_kmalloc_node(size_t size, gfp_t gfp, int node, unsigned long caller) *m = size; ret = (void *)m + minalign; - trace_kmem_cache_alloc_node(KMALLOC_NAME, caller, ret, - size, size + minalign, gfp, node); + trace_kmem_cache_alloc(KMALLOC_NAME, caller, ret, + size, size + minalign, gfp, node); } else { unsigned int order = get_order(size); @@ -514,9 +514,9 @@ __do_kmalloc_node(size_t size, gfp_t gfp, int node, unsigned long caller) gfp |= __GFP_COMP; ret = slob_new_pages(gfp, order, node); - trace_kmem_cache_alloc_node(KMALLOC_LARGE_NAME, caller, - ret, size, PAGE_SIZE << order, - gfp, node); + trace_kmem_cache_alloc(KMALLOC_LARGE_NAME, caller, + ret, size, PAGE_SIZE << order, + gfp, node); } kmemleak_alloc(ret, size, 1, gfp); @@ -599,14 +599,14 @@ static void *slob_alloc_node(struct kmem_cache *c, gfp_t flags, int node, if (c->size < PAGE_SIZE) { b = slob_alloc(c->size, flags, c->align, node, 0); - trace_kmem_cache_alloc_node(c->name, caller, b, c->object_size, - SLOB_UNITS(c->size) * SLOB_UNIT, - flags, node); + trace_kmem_cache_alloc(c->name, caller, b, c->object_size, + SLOB_UNITS(c->size) * SLOB_UNIT, + flags, node); } else { b = slob_new_pages(flags, get_order(c->size), node); - trace_kmem_cache_alloc_node(c->name, caller, b, c->object_size, - PAGE_SIZE << get_order(c->size), - flags, node); + trace_kmem_cache_alloc(c->name, caller, b, c->object_size, + PAGE_SIZE << get_order(c->size), + flags, node); } if (b && c->ctor) { diff --git a/mm/slub.c b/mm/slub.c index d53e9e22d67e..a088d4fa1062 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -3215,8 +3215,8 @@ void *__kmem_cache_alloc_node(struct kmem_cache *s, struct list_lru *lru, gfp_t { void *ret = slab_alloc_node(s, lru, gfpflags, node, caller, s->object_size); - trace_kmem_cache_alloc_node(s->name, caller, ret, s->object_size, - s->size, gfpflags, node); + trace_kmem_cache_alloc(s->name, caller, ret, s->object_size, + s->size, gfpflags, node); return ret; } @@ -3229,8 +3229,8 @@ void *kmem_cache_alloc_node_trace(struct kmem_cache *s, { void *ret = slab_alloc_node(s, NULL, gfpflags, node, _RET_IP_, size); - trace_kmem_cache_alloc_node(s->name, _RET_IP_, ret, - size, s->size, gfpflags, node); + trace_kmem_cache_alloc(s->name, _RET_IP_, ret, + size, s->size, gfpflags, node); ret = kasan_kmalloc(s, ret, size, gfpflags); return ret; @@ -4352,8 +4352,8 @@ void *__kmalloc_node(size_t size, gfp_t flags, int node) ret = slab_alloc_node(s, NULL, flags, node, _RET_IP_, size); - trace_kmem_cache_alloc_node(s->name, _RET_IP_, ret, size, - s->size, flags, node); + trace_kmem_cache_alloc(s->name, _RET_IP_, ret, size, + s->size, flags, node); ret = kasan_kmalloc(s, ret, size, flags); @@ -4815,8 +4815,8 @@ void *__kmalloc_node_track_caller(size_t size, gfp_t gfpflags, ret = slab_alloc_node(s, NULL, gfpflags, node, caller, size); /* Honor the call site pointer we received. */ - trace_kmem_cache_alloc_node(s->name, caller, ret, size, - s->size, gfpflags, node); + trace_kmem_cache_alloc(s->name, caller, ret, size, + s->size, gfpflags, node); return ret; }