Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1141306lqt; Fri, 7 Jun 2024 09:06:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVjysw8UqgcCQmcsRUCY9a5o9HzGdIqYBaYZetb75bp0aHEwBrRwQhZtKkRQxyOfkKpXtLBz29Ma3r4h+a+5gjsicxWvyBwOqaNyD/7IA== X-Google-Smtp-Source: AGHT+IHxYsuQC4cQ5gV3P30ud+8yy+jS932e2UOIIO4pkIMUtPwGUZQRN7vI0YXN4AsMsc2VDDMT X-Received: by 2002:a25:ab4e:0:b0:dca:c369:fac2 with SMTP id 3f1490d57ef6-dfaf654aa4cmr3007303276.3.1717776360610; Fri, 07 Jun 2024 09:06:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717776360; cv=pass; d=google.com; s=arc-20160816; b=RqdhM1O9a2nFdz2lJdvSrIvmVt8Sfr4XaiF0JGyPR3A4Te4r7UtPxIlEruO1mKDieb qG4h/3QxDjHu641Mmc0H2uId1Ldq0dBVJqNC1gC4qAHDgjxxuJHrn2i5qMZOiz5SNoXu EqhQVKZmWLzorFbV4wOM5ekKCRqvb+/pq/H45CVHl2mv3xFJHaOvyRkTUYQjEJ8+o82P +0JEwGglQzAt4xbWjz9QhchGA18Bck8iI7KPrATIllq290LJyGoc5koMz1EIjjye0Dst TvtdhZoj3kb6ucxWglyIt0a+JP3I+wfgVc5juectzv/ckOqry5NPl7rDfE/B+nunkKxf 20AQ== 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=g4Sbxzk3R+WtfowpSIKfFh9uV3XXl4AJmyTZPcpwMqU=; fh=JN7tMyF6zC6ERZ5PXsr4V7IKiYp4vRUwR5tQFwkRxbI=; b=ILBjdLuN3QGITVjXoxSGBbZINBgucarLT+S2hBkjr2sSax9+5Rpn0SW0XqvUJADiwr TLLnbVtcYY0LXutuTZujYOIYDiOCY/5glbjLKUMl6NV1sUFaWC25yfhqeCl9sBgOXQ65 ugEDX11vbSKBymIlc1oOwmVRl0IR9qe1NVIQnsAzhpOLkARbnOf4sniX63mn8E95MdJs yj7Fox2do4HJ6coxxrk/tEJRMZHHdtvu/hHk0zR1sp9H0TLuA/1XOfGZT/KWO1KSRyCu LzM/fPANlrPqf2qVhL8TDKY/9awOkBMYMi+n4PKtuYUpNQkZH50X0dOg8TXBlzOHToWV Fklg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=qiJy566S; 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-8701-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8701-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 3f1490d57ef6-dfae53ca9cesi2026872276.240.2024.06.07.09.06.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 09:06:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-8701-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=qiJy566S; 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-8701-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8701-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 8DECE1C22371 for ; Fri, 7 Jun 2024 16:05:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3ED5A19AD58; Fri, 7 Jun 2024 16:05:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="qiJy566S" 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 4C6F719A29C; Fri, 7 Jun 2024 16:05:33 +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=1717776336; cv=none; b=m5wEdrmklY93MxGukQlWlQhT0S9Tbr8tgnOkdfSEorZLB828YBS5aHf9G/fcQ33Mlamx5/liAxx6llXFjxRmP/apwjdtb5ROyM6QnsKHrX9Bce06/JP1vwm3QPQXj/cw0CquBhEKH1kEZqpOGEAOH99S7gr7P8Eb+dUpOnCoPjA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717776336; c=relaxed/simple; bh=h0S/+RKtX+8ma8OFYEofvkiKQvp4mAWM7WJnL6VEXUk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mGrY1MMwWpzk/U02utln2/4mMq1WOZ96bOMAplN+Hb2luY4HE6pAAPVQaxgs4YLduyyBlEVhV6F8jHTzbjhQgj1uphhQYJDtzChVHN9KMhTfFFZlauIE3oSSWd6275ZcSg3ZFKwmB9VXRCbdsdsaM2ibppamqD1bNKiaadOnu6k= 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=qiJy566S; 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=g4Sbxzk3R+WtfowpSIKfFh9uV3XXl4AJmyTZPcpwMqU=; t=1717776334; x=1718985934; b=qiJy566SVxP3/ApiSl/Js2nB2RMDCpbprDrymzWPc5unZdq 6HXPk8wJikrbE4TBmH61bwfuRJecXJcNNGuLy4l/BktA6TKziu8/B+eqw0tbtmUUXX808aHgf1TqN LvqF3nxyTHS89s4cuTD0g42qfx8h6gorqw/2aNB1hl9iMy3QzPtSIqbQYhEpFxEexnGS3vRIvjpJ3 d8P0TltBVqjA4z7eD0QHn5XbQMOIy44/jgY+S9+QZXV8C+Vj3nJwb8roy/Drg7LD1KdHtqCohFmBR 1GcBma4Nn312G4LzSIzkMT+vI4zDRUnoCLIaDfWm4eAVq5azn5cJOsxFI/4ns4Sw==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1sFc5r-00000001Iyu-3QFa; Fri, 07 Jun 2024 18:05:32 +0200 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: [PATCH v4 2/4] tracing/timer: use __print_sym() Date: Fri, 7 Jun 2024 18:04:24 +0200 Message-ID: <20240607160527.23624-8-johannes@sipsolutions.net> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240607160527.23624-6-johannes@sipsolutions.net> References: <20240607160527.23624-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.45.2