From patchwork Fri Mar 26 15:54:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 12167049 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35DC0C433C1 for ; Fri, 26 Mar 2021 15:54:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CAD9461A26 for ; Fri, 26 Mar 2021 15:54:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CAD9461A26 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 46A0D6B006E; Fri, 26 Mar 2021 11:54:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3E1216B0070; Fri, 26 Mar 2021 11:54:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 233836B0071; Fri, 26 Mar 2021 11:54:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0220.hostedemail.com [216.40.44.220]) by kanga.kvack.org (Postfix) with ESMTP id 036E96B006E for ; Fri, 26 Mar 2021 11:54:36 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id AF92F824999B for ; Fri, 26 Mar 2021 15:54:36 +0000 (UTC) X-FDA: 77962472952.04.F8A0B1A Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by imf24.hostedemail.com (Postfix) with ESMTP id 979CEA001AB1 for ; Fri, 26 Mar 2021 15:54:27 +0000 (UTC) Received: by mail-wr1-f53.google.com with SMTP id e18so6116529wrt.6 for ; Fri, 26 Mar 2021 08:54:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0gM6MhylLmsS8UCBArcB0UX6YnOZb1avXJIhdnV1ZL0=; b=Nvokwcp8C6Q63inAZFN/z19xXEPEDjuV+T40QLKS7Z2tiQi2UyGBw6rh40N2x1Rgkf QKWZBe03CGLxL1YDoXiwB5w8+q2xYtG68POgDy/ZisoSbg4XTrph51WFSy5POkz+Jjue x+ouFQ3ufKuH5/siuV0OegqR9cO+/baYiM5d5hxmVKlGG07lv1wDajwd3uN6lDcusyTo UvP+bWC2FKBHnj4kHTYID0i55T/1VA0kGy1iHN7/FVqpnB0D7xLBfQoDe4SkQ7rqFZ+H 0o3mOgHCbasZ+KOaBRzNa2DOA7PITG6RwYrn6k20qasU6NWWbEa9EwgFueNp6Z13rm7K dKTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0gM6MhylLmsS8UCBArcB0UX6YnOZb1avXJIhdnV1ZL0=; b=AeyJ2FB2VVIlrdMMP2CZD3owmypUCpov+8c+/7P8nwjBsSVv5rm1p0VfYPz037aKpS K0ZhhkaCLF7038w6kGPf7v6TgWFMLNCWYZ0W6UYUI80QA0BMSN8BKBKpZkdVydRaHnCj udGJjdGLQHHFv9oMLC7mtYUR5SM8ad5QU0Roa7WbBNqcwsilkG+jXNvqH9+D2J8cwaZg W4EKktJH5y844QchXj7aZ6J8ggjjbhaPXCNyVlYcgZCSlroybG3ul5jEm0wDJrSkDt+g NhYJkQW7r8vT6S+ZxR5YnL+LsDXlY6uwAOqS0yNIJNUhYk3aVAIe/ZIhWDaWYNSxznsQ jpCg== X-Gm-Message-State: AOAM533Y2RROkK/xqS9dM7o2D7/xGcMcULipiwNRJhxwWLOKSjkxRLKS CvjrykYlOmJHfRDl+8kV6jBczA== X-Google-Smtp-Source: ABdhPJyKW70DH/l/rfFUAPqGEausbzi3IVnX01AzVH/A1qIwTZxD2XB7mjeWj8CQjUy/aVtfuEO2EQ== X-Received: by 2002:a5d:4312:: with SMTP id h18mr15209521wrq.193.1616774056883; Fri, 26 Mar 2021 08:54:16 -0700 (PDT) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id k24sm11338971wmr.48.2021.03.26.08.54.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Mar 2021 08:54:16 -0700 (PDT) From: Georgi Djakov To: minchan@kernel.org Cc: rostedt@goodmis.org, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, georgi.djakov@linaro.org Subject: [PATCH] mm: cma: Add the CMA instance name to the cma_alloc_start trace event Date: Fri, 26 Mar 2021 17:54:14 +0200 Message-Id: <20210326155414.25006-1-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.29.0 MIME-Version: 1.0 X-Stat-Signature: 1wfk3qbbcxcaa1kitmpenmextgntfhrg X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 979CEA001AB1 Received-SPF: none (linaro.org>: No applicable sender policy available) receiver=imf24; identity=mailfrom; envelope-from=""; helo=mail-wr1-f53.google.com; client-ip=209.85.221.53 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1616774067-565968 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: During CMA allocation, print also the name to identify the CMA instance. Suggested-by: Minchan Kim Signed-off-by: Georgi Djakov Acked-by: Minchan Kim --- include/trace/events/cma.h | 9 ++++++--- mm/cma.c | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/trace/events/cma.h b/include/trace/events/cma.h index cdfd06afb39a..be1525a10457 100644 --- a/include/trace/events/cma.h +++ b/include/trace/events/cma.h @@ -63,21 +63,24 @@ TRACE_EVENT(cma_release, TRACE_EVENT(cma_alloc_start, - TP_PROTO(unsigned int count, unsigned int align), + TP_PROTO(const char *name, unsigned int count, unsigned int align), - TP_ARGS(count, align), + TP_ARGS(name, count, align), TP_STRUCT__entry( + __string(name, name) __field(unsigned int, count) __field(unsigned int, align) ), TP_fast_assign( + __assign_str(name, name); __entry->count = count; __entry->align = align; ), - TP_printk("count=%u align=%u", + TP_printk("name=%s count=%u align=%u", + __get_str(name), __entry->count, __entry->align) ); diff --git a/mm/cma.c b/mm/cma.c index 984c85fd16ec..df5673d0b23d 100644 --- a/mm/cma.c +++ b/mm/cma.c @@ -443,7 +443,7 @@ struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align, if (!count) goto out; - trace_cma_alloc_start(count, align); + trace_cma_alloc_start(cma->name, count, align); mask = cma_bitmap_aligned_mask(cma, align); offset = cma_bitmap_aligned_offset(cma, align);