Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp632706lqt; Thu, 6 Jun 2024 13:33:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW2VrzeZ66fzrKMeB0s4MtiMWVrQq4IwW2CvSm1Is6+mmjfM1odpD0tp2Q5LiJOmqOiw5ZCFV7GNuA5FlSaD/qFGbpxUHhIHTB/Jy2V1g== X-Google-Smtp-Source: AGHT+IG06EwFlpPQhNTcNufBbyAlTWHMzMuokjWVtAScK2I4HEFcgQWVSLx7gdvEpi5qeVk5pkrT X-Received: by 2002:a2e:241a:0:b0:2ea:8ac6:d193 with SMTP id 38308e7fff4ca-2eadce7f71dmr4224841fa.47.1717706011650; Thu, 06 Jun 2024 13:33:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717706011; cv=pass; d=google.com; s=arc-20160816; b=PDzPwqaHjnyOVzMsOxr/zTeJxoYpcXMgLdfFviiOy0ZtYC64RWJyBXqBUvylb3EosO TjqvPahrexCo6DhEBEPPtViRkOyvtB1F3W3T21/HQMRkymyHqQAaM+XQ3Ih4vTCUf0gl UQ1+GXuIHxDcor88PAQT7hCNOFheSHsr0zu7ZiOvUXca1ywV5HIoexAV/gU7h5BdcKR0 Ce+wpFeuRpHWMkXwUTC69y/09x3Q6mTqktCHMXFTkMdBowjbmnOY8mU4dvz/ORDFPQzo VOMy/4P6HapcatTyFNkhuBGYdZ6sjY4ny91wBSmfHQzsq/8y3Ml1Ymse9j7qW+4KXfUC MlNw== 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=7H/FqwBpM+5q3YJTobEqpfZakcN/zmH9Xcq0xGw6tnc=; fh=JN7tMyF6zC6ERZ5PXsr4V7IKiYp4vRUwR5tQFwkRxbI=; b=cpNL1bZi8H34NI4HBg7rQ6lCHTX53t55yn4aN+zjR/BnRlS0IFD3yLd4h7W+kY4C5L 98dhV8+T9Fmod2Q0XQJhzVkQ91EgN3rT3dRRtxId2ucsdvcHFfbMnaUxaCpo3svSv2/T APLe05mKX5WCEFxptp5SdgNshOqFuZrVG/F2lgZhvRP3YXTUdzkUlWncsdaSMe4vOOGh zxIZMzenJkSg5FEFJ1g3IpKJ7gj/RFsvjGvreuHR2fJ9GQm9OSwQXdqbp5iAozee5Oqi Un/cx4efu5jiyrIQkr/1aa532jXBW3tzI2tLLWQIu61T2OhgxVu1N1DLp5np3KbPBFQK h5mQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b="V9Xc/4qC"; 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-8644-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8644-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57aae26ad68si1080053a12.591.2024.06.06.13.33.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 13:33:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-8644-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b="V9Xc/4qC"; 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-8644-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8644-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 5E2801F239D9 for ; Thu, 6 Jun 2024 20:33:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 784B4196446; Thu, 6 Jun 2024 20:33:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="V9Xc/4qC" 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 9F9D513AD30; Thu, 6 Jun 2024 20:33:09 +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=1717705992; cv=none; b=Oey5pIq9HrriAkvDK6duFrJuq2iI/Y00BFCLGO9EX6FiZgYtvsCeJYmFxaezA1lSTjreCag8kzo2clACOen9TQTCzveV2nDNMeOrBpjWrxwlVoNj5moVahYbPTkMcSKr7E1wL+CFZRe6XAOgINRZLli3ZFODyxLPJhu6q6D4Rl0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717705992; c=relaxed/simple; bh=yokXtXFUfqclyFGAp2a6WDFNNDfrpZ77U7BOeMXwYEI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Nwb4HZeZI8OcSQ029OIpJH/OUoELh4LuRCkBFFKZyGCvgm9+6rGZmj6GYePJYBnHv7cuehbdMkoSGNnjpXwsIWrAR/62+U8qAr52WJZfoUH2hsuKnoH0BOSSRgrMG3W/Z56nsLyLbWoWghtg25DmnacOOEMBJsVq+AHFj/uGfnQ= 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=V9Xc/4qC; 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=7H/FqwBpM+5q3YJTobEqpfZakcN/zmH9Xcq0xGw6tnc=; t=1717705989; x=1718915589; b=V9Xc/4qCBdRnAr05QMtYkKQjQqixFJZsY5cDohfENeAC0uQ oda2LDJAzHt/yD/WF1FIB5XiynEXuWYp5c9bqwx58qToBGa8lRbZjmmBKu0wxlzoWt4MhJFtdEFRu z0GnJkG0GP77NSniYtlFUPGCkeDB33QCpO+zfCig5Xlj8nLfxtBtAwi7Jvo7cEvontQOLLMOV2qGQ IGB9R1mj9byvaJBjVlI3zTfFER/DIaX+4byU9JY/xcq+UlNZsgMSGcXr6B4MlClUgSGTObXJL/xQc BrZ/P6tAlgHw4Bn+txXcicwq2z2VVcRYB3rfZps/BSJ9PAZTXLI2zmqk6rmsBPCQ==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1sFJnB-0000000HDhM-0WfF; Thu, 06 Jun 2024 22:33:01 +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 v3 2/4] tracing/timer: use __print_sym() Date: Thu, 6 Jun 2024 22:32:02 +0200 Message-ID: <20240606203255.49433-8-johannes@sipsolutions.net> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240606203255.49433-6-johannes@sipsolutions.net> References: <20240606203255.49433-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.1