From patchwork Wed Dec 11 08:56:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhenhua Huang X-Patchwork-Id: 13903146 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 A3C5FE77180 for ; Wed, 11 Dec 2024 08:56:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0DB6A8D0015; Wed, 11 Dec 2024 03:56:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 08C108D0013; Wed, 11 Dec 2024 03:56:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E951F8D0015; Wed, 11 Dec 2024 03:56:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id CA79F8D0013 for ; Wed, 11 Dec 2024 03:56:50 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 4CCC91605FB for ; Wed, 11 Dec 2024 08:56:50 +0000 (UTC) X-FDA: 82882071636.09.D46A7A9 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by imf08.hostedemail.com (Postfix) with ESMTP id EB23716000F for ; Wed, 11 Dec 2024 08:56:32 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b=CO9Lmqk0; spf=pass (imf08.hostedemail.com: domain of quic_zhenhuah@quicinc.com designates 205.220.180.131 as permitted sender) smtp.mailfrom=quic_zhenhuah@quicinc.com; dmarc=pass (policy=none) header.from=quicinc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733907397; 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-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=mnkTWhh/H73fvu1GHFu+JRPYbASHz6VCplZ/mfBshIw=; b=mBT6+XfQZWWDGn2RIYLhOaiESbscTB8A6steVSiWbWS6Ngw4EJEDeZ93R4BprJavFHnCCm YzRNg3kErplLJqBwYrNZvFOcG10yHPmfB3O4w08JG0CBQmxpHI+ZGIQKPPqN58cv5chXi0 RYAna8vjCJojq+bqXUThoWLOk91cbbQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733907397; a=rsa-sha256; cv=none; b=6/wi9FBIybT4ts7uDG5mTBxZ3PygtQTJaks3e3ejczCXiikLHTKjre52vXnE6Pzb8+sVdj GvVnIluu2stC4M0CkRTTAHpxXYwlk38P9f6+9PkX9mSZorzuJjJQP8iKkogskcl9khMpq9 OrmnPCSC1gcY6czYocUVqYGaQo/uYOE= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b=CO9Lmqk0; spf=pass (imf08.hostedemail.com: domain of quic_zhenhuah@quicinc.com designates 205.220.180.131 as permitted sender) smtp.mailfrom=quic_zhenhuah@quicinc.com; dmarc=pass (policy=none) header.from=quicinc.com Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BB2OrXb001566; Wed, 11 Dec 2024 08:56:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=qcppdkim1; bh=mnkTWhh/H73fvu1GHFu+JR PYbASHz6VCplZ/mfBshIw=; b=CO9Lmqk0An9arlh8FZgDZE7STlv4M4BJFrQ8k6 xVi9udZAY2eyJKPwmM/MqppeghA4JSuTtYRrgkOXH//4qeOdPCpQzp9rGvFKMPGO GEP+/IlixjPdEBcGQLv+i2OnruGxmNEIjPoeZAUr+xl66iUad6QiZB+7e3OT+/fB mPMz5mf8sw1rDGXmn2ES5PABXJeeD3V6q9v6K1MXPLUZX+72PLQWIhMHHo3Q43Rm 3l5t5Bf7kbua6Jxqj282a3X5UPimgtZxPJla6XIT11ffSy9jN1ODZemMGsbUttGa zxwN9PYhunNvXkjOGHb19FX9LDbN6xwZV8Y42Vbb5Ye5ihhg== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 43f1xd11f8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Dec 2024 08:56:45 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 4BB8ujk3004945 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Dec 2024 08:56:45 GMT Received: from ap-kernel-sh01-lnx.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Wed, 11 Dec 2024 00:56:43 -0800 From: Zhenhua Huang To: , , CC: , , Zhenhua Huang Subject: [PATCH] mm/code_tag: Skip displaying the code_tag if it is not called Date: Wed, 11 Dec 2024 16:56:16 +0800 Message-ID: <20241211085616.2471901-1-quic_zhenhuah@quicinc.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: KUm7iSj61Yk96K2urOeeGbp4dpFiyd5R X-Proofpoint-GUID: KUm7iSj61Yk96K2urOeeGbp4dpFiyd5R X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxlogscore=999 priorityscore=1501 mlxscore=0 clxscore=1011 bulkscore=0 adultscore=0 suspectscore=0 impostorscore=0 spamscore=0 lowpriorityscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412110067 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: EB23716000F X-Stat-Signature: hmqsaksqngymynzjknwn4jf46s1cbnni X-Rspam-User: X-HE-Tag: 1733907392-356372 X-HE-Meta: U2FsdGVkX1+mUG7sF6UlhC4v1JZqgy0oSCIAHoAfSSyfkV4uszPPTzLEYkxfKCyBIBSE1UWXtgw+4fIXsW4CNLCJHEm94KDHVlxlyYlCTD6BM2gcIaUWwE6XyjLut7lEmTZ8KnguEQIDKEaXu8yXGts5aTCrfTuoiJj5QjlMSmkCnz2P7EYwFIOh68ej03qUc+i0OOZg85t+aWDYfH3W7FT1ZCK6q9eHKXQNmRz4QcI2RdCvufBQ8MnpEK6i0le81jKTLnz9bA5MDVVcod6Q0oEGUNqjBB9ogtDHT+LcxspMxbh+zoNR1LF4zmNhwXD56nVydwm3RSTF6J7GIY0nuu3Kzv64depa/h+u1jsnwM391/X/kRgKl+sjzS3tWuYZyN18SolYo0mfYbqmzJ4DCYodQK0fNiPrvRLwYzVDoo2h3ZC0WGo+l/kUKJJRUJoXd9EekxoLy2gn8wLNEpFFGrmy3Kq7U2KRhOI2QfMJU0kSc+BRIU72UCQ81PFhzhjU2YR4yGkb/iIeqI02jsFE35C4/hprvD18MIux5Nk8thfvV2cr7g3MjA8PORd0JLzY0VpnDeDzGJ51CZXV9TzBpElYHSgBmYxPIbMi4h++MxnsoVyPEuBVv5KkBnomukfaOIt30VAjZ5rhL1r4sduLaOorfk7LVeGmI8uXqWgC814vIGannrAnEDj6WOU9fTCEMDPTYU1ULptbqY2GCnIdup6bCP6OtJn7JXsLcc6OGQCQubMlLD4nXy18mFkkdzZFb/8rt1yyLv1JXAeGlj6F/0D86Gb6xgg9IEwn0qTk2lel4QMQ6mVDhjdZgBmXgfXv96GzkqVt4g5qvZ2K8Ca+oo+WHMUYYvO7qkQ2q4eNYvI1cjxpYiKrXeShl4fvFhiU6hLDKRL9ovbFVR46rR0AW+jv3FJ/DvfCKHyZ1srrqUEE6EYOefXKmT3IpLZQ8JJUiUbxxiQJzrjdFhGuvUY obNltxMN 4ly1n6hqZp7nFwWyWXflhn9sJNjGdkQl2nUV29KPntGNxhC6ZO+P6wPmCWsQ5hHsRaVMF8x+W7gUnDxNLCuG6MaBg2B6rBo71Xuj8g7NIPIWsbuOZlPZlg/p8IrvZjQA5KxkC6PYWPEiWla+H3iwCFTLLxzmRHAVacEnDY6psWBRRoa7M9NRGT4jewDUHvaAbbJF+LibTwnlgfhzE52qXUrv9/AbU6spFWnNxnnbIQKwTd+0280kiMcP4596tAa5gXqMeJpFMrW5XHNUBwIXcINhcKSBP6Rzuc9q7sQpwSzqYKdiK/BOae+hINjed7iqeQ7oaqRQ6cFBL85oMeFEM0leATpvdKjpr05Re6q8iB+u5KWw= 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: List-Subscribe: List-Unsubscribe: /proc/allocinfo is full of callsites which are not called at all. Let's only output if the callsite actually been invoked. Signed-off-by: Zhenhua Huang --- lib/alloc_tag.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/alloc_tag.c b/lib/alloc_tag.c index 35f7560a309a..06fb7eb5c0bc 100644 --- a/lib/alloc_tag.c +++ b/lib/alloc_tag.c @@ -95,10 +95,12 @@ static void alloc_tag_to_text(struct seq_buf *out, struct codetag *ct) struct alloc_tag_counters counter = alloc_tag_read(tag); s64 bytes = counter.bytes; - seq_buf_printf(out, "%12lli %8llu ", bytes, counter.calls); - codetag_to_text(out, ct); - seq_buf_putc(out, ' '); - seq_buf_putc(out, '\n'); + if (bytes || counter.calls) { + seq_buf_printf(out, "%12lli %8llu ", bytes, counter.calls); + codetag_to_text(out, ct); + seq_buf_putc(out, ' '); + seq_buf_putc(out, '\n'); + } } static int allocinfo_show(struct seq_file *m, void *arg)