Received: by 2002:a05:7208:3003:b0:81:def:69cd with SMTP id f3csp172114rba; Tue, 26 Mar 2024 12:22:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXPxSXWYmNbajPgNelE8xgZmwE74sSINZiWJ9fa0CtkYQ8J/NSlI5khHMrOxEhX2DM75UJBCt3nde72AnT5DB9xFILJplq+GSNah0p8vA== X-Google-Smtp-Source: AGHT+IGes1thZrCoYE/86yWHqyEhEapNq6cc5yUajp1dPtsyCTfSdQ5zg9yzdOl9cBVH3XYU7764 X-Received: by 2002:a05:6870:1382:b0:21e:de18:38d with SMTP id 2-20020a056870138200b0021ede18038dmr410520oas.27.1711480958167; Tue, 26 Mar 2024 12:22:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711480958; cv=pass; d=google.com; s=arc-20160816; b=PCaRS2KPC+UzLUq3gkpqPCrNhXot91gSyn1y0nHPn+3IHNtbE233OgbbXcJgvWboAm WfrUcysbz3zt6M4tGCmEMGJM9OXEtMLbmRrf3LrDNX6AFZRjf8ZKZSy2amPpe+LR4PyE cn0Xm7xjiYR/WHUew2LxXz5LzYbcJnVcnVTH0Gc45zgsXzLkbhG8Yt/t1mGeYVTJUpWc uAqx9OpG7ByMnQ7AlJZ137t9Z5hoMVnJdEPGNDXte7LZqw4G5Put5uRgU89nD+emlnaZ M0dMhYT+IdXiZ5OZi8FO9waqLct8s7+UcSK9pa3TWb0+EJAp6KSguinv/27w7C82Zzq4 1mRQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=CWDnJWjsGyR5bMSxtWzq19TTn4cNaR7RRe3msB2JQWY=; fh=JN7tMyF6zC6ERZ5PXsr4V7IKiYp4vRUwR5tQFwkRxbI=; b=lfUBih/skZyPQZ3aXzPr/J3j32JEqrZ4+mAq+HTpTo3jpEtvUzxhP3oZ5xUBUBWDpF 1OFLcTXzfZQxfmCtc1a714CboG5ZOQW2quvCfWj+qVT2SbgrzI+Gzs/IgvaNimRA7i8P bA7gpSoN7TF28Sk9VW0X/MsIesuvRCJRAH+pngC4feGZXaN5KQPMmxwGqtOSRavtLQHC iesY5Xbkst3zABggIQ9X4GCoMs4oaZ0ikwf/AjNlHWX9ZjDG8DMwo996M8YQddxbENag RzNzd+8s37zmPh5AAwBXQnVam1zdFFunmaCGP6Hsf/P04sP2L50vhTulx7UR6XQv4+sA NyMw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=R5KMHK5C; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-5300-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5300-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id jd16-20020a05622a719000b004313752c10fsi9650894qtb.484.2024.03.26.12.22.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 12:22:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-5300-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=R5KMHK5C; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-5300-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5300-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E28411C6072C for ; Tue, 26 Mar 2024 19:22:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EF2A013D526; Tue, 26 Mar 2024 19:21:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="R5KMHK5C" X-Original-To: linux-wireless@vger.kernel.org Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 35C5D13D26E; Tue, 26 Mar 2024 19:21:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711480902; cv=none; b=ODD9L5ASJJz8EYNPM95c+V73KHkPPjb+DBvUQJFjVMIJ5lhwKG5b4rgv+kMtihYjuPVJFeQGTG4GMbU3wAHRzmoOrdul7ecLjkM81pooUh7pr/kW0QSG4EVowKhoiVmUUskUaXpRdzGGlFyt4cApfPjb+SEBp2a63GF23p2iW2k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711480902; c=relaxed/simple; bh=3A3cUofIlRna705vx5jsCPCgaHRLlKXj/Nz0QjfDrdk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LNFQAahyJlxN2Kmq4JYxKgJvZ4ZQCeY58TbM2o/32w/O+eDbsQMI53u6Ka+xu1VOI7wmTIqNyNTbYbDmCKxeZRhr4clrupYYto3u3IxFJer0scUfVq2aiEc8x/6WQl6a5zvlcXofcoBWIf1vuYmzT8Css+1cufEh4uJcBk9V7fE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=R5KMHK5C; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Content-Type:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=CWDnJWjsGyR5bMSxtWzq19TTn4cNaR7RRe3msB2JQWY=; t=1711480901; x=1712690501; b=R5KMHK5C5UAKY8E905YeRlpAPjuYJtTc/ozGWGjAxjISSM7 xzMKQzqBRpsygw+ahuWUwbQ/DuAse6BvFqpNmOsv3GN02Db1SRgi9Ymrbq9ufrUzzKRjHv59CIcYd lnOUCgy/+BW9cvD7AgrIfbTok7S0rNWnQrLWTIAtd7pmM3nyV/EifmviLU6pz2xkjzY/zX07stSEf +cpmh5Qxtlb9DjuWwZHF0uvRkljs+mt+i5htA3+WdiuhpgRkwh6uoBbcmjZacSwNz/EwFJS3pNQHi tgrNylaqfMR8khmqldg90zkMG5dPInQVI46OC/A3ZI24TwxnV0KLfESV2V04ihlg==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1rpCMc-0000000FvLV-1Pu0; Tue, 26 Mar 2024 20:21:38 +0100 From: Johannes Berg To: linux-kernel@vger.kernel.org Cc: linux-trace-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, Johannes Berg Subject: [RFC PATCH v2 4/4] tracing/timer: use __print_sym() Date: Tue, 26 Mar 2024 20:15:59 +0100 Message-ID: <20240326202131.666447ad089a.I5e112e423a69704fa05db74a05a6ebaad45d4f6e@changeid> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240326192131.438648-6-johannes@sipsolutions.net> References: <20240326192131.438648-6-johannes@sipsolutions.net> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Johannes Berg Use the new __print_sym() in the timer tracing, just to show how to convert something. This adds ~80 bytes of .text for a saving of ~1.5K of data in my builds. Note the format changes from print fmt: "success=%d dependency=%s", REC->success, __print_symbolic(REC->dependency, { 0, "NONE" }, { (1 << 0), "POSIX_TIMER" }, { (1 << 1), "PERF_EVENTS" }, { (1 << 2), "SCHED" }, { (1 << 3), "CLOCK_UNSTABLE" }, { (1 << 4), "RCU" }, { (1 << 5), "RCU_EXP" }) to print fmt: "success=%d dependency=%s", REC->success, __print_symbolic(REC->dependency, { 0, "NONE" }, { 1, "POSIX_TIMER" }, { 2, "PERF_EVENTS" }, { 4, "SCHED" }, { 8, "CLOCK_UNSTABLE" }, { 16, "RCU" }, { 32, "RCU_EXP" }) Since the values are now just printed in the show function as pure decimal values. Signed-off-by: Johannes Berg --- include/trace/events/timer.h | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/include/trace/events/timer.h b/include/trace/events/timer.h index 1ef58a04fc57..d483abffed78 100644 --- a/include/trace/events/timer.h +++ b/include/trace/events/timer.h @@ -402,26 +402,18 @@ TRACE_EVENT(itimer_expire, #undef tick_dep_mask_name #undef tick_dep_name_end -/* The MASK will convert to their bits and they need to be processed too */ -#define tick_dep_name(sdep) TRACE_DEFINE_ENUM(TICK_DEP_BIT_##sdep); \ - TRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep); -#define tick_dep_name_end(sdep) TRACE_DEFINE_ENUM(TICK_DEP_BIT_##sdep); \ - TRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep); -/* NONE only has a mask defined for it */ -#define tick_dep_mask_name(sdep) TRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep); - -TICK_DEP_NAMES - -#undef tick_dep_name -#undef tick_dep_mask_name -#undef tick_dep_name_end - #define tick_dep_name(sdep) { TICK_DEP_MASK_##sdep, #sdep }, #define tick_dep_mask_name(sdep) { TICK_DEP_MASK_##sdep, #sdep }, #define tick_dep_name_end(sdep) { TICK_DEP_MASK_##sdep, #sdep } +TRACE_DEFINE_SYM_LIST(tick_dep_names, TICK_DEP_NAMES); + +#undef tick_dep_name +#undef tick_dep_mask_name +#undef tick_dep_name_end + #define show_tick_dep_name(val) \ - __print_symbolic(val, TICK_DEP_NAMES) + __print_sym(val, tick_dep_names) TRACE_EVENT(tick_stop, -- 2.44.0