From patchwork Thu Sep 21 08:51:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 14332 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp5205000vqi; Thu, 21 Sep 2023 16:26:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGcIhWc6nhJ0tJauKbzWbPnZZlHAb2KoDbfsfDRnqtXzRXbzzeJ59PcSg032fpx75WKxkEn X-Received: by 2002:a05:6a20:160c:b0:153:dff0:c998 with SMTP id l12-20020a056a20160c00b00153dff0c998mr9073004pzj.6.1695338766614; Thu, 21 Sep 2023 16:26:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695338766; cv=none; d=google.com; s=arc-20160816; b=i5cQkgVhim2WyLRnFuJypWxG0ISc5x7iG/558/KCTWIWAwcc8XpReM5xuxuTxNzfz0 eZZzgL2WVUxnPZm/J/tVpeSjKZ+bedzC2ObJFqeKUjtvj6LOUE1pGZZLseDWxXVgUNr0 nrwof0bBuA7HeQjJGjvLGHHnCpY1QFp97dFf/5I1nPZfzCcyzriqb+LZ/Hu73tAai5+k 7vpmEuZhCqcxv0ZapkvKYdLt5fOP/82Q32eEVd2inJjizkAgNwi6gIfnsDhGOMVqzwAt LAKgq13JvLaFmzMHGD72R7Za00ngd/ZxdWu7LWNEP0LY3l94J/ZvY2sRpFGOT8GVk5R2 Dc3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=gpXWMEFRdkUqRYHtPtMKumIpIyQIjDxThum2oS+gMZU=; fh=0SBe+t1js5zeYMEyXzzQomX6HgQxfVe9bp7Wvicz83I=; b=RNt5/eIlet8JZ9knBgHdEB/ciCsqXUgT5QrWwcdfU/L+m7dxlt3kORKSzxb8pB3ZoI xFihtW43rTLwqX/k3iCfaUkhAHWdL97CSOnlOrPcHIuTekz2/qGEgNc/rvl4pOreMMAp HnADLDOMfbyc3fPvDJE1YPirDJDgz7cYX7Vd06dAHWOIo1gZ0dsN9ShK3J5UrXPOnfhg N1+9nPAKKOiGbJ/FZkz2KWdh+u2br7pRK7T900l86ERVt8BUoMQOqsLs853QMYpzojfE bviPPG9pggtR+QsEeoHEHRC88J+qFkdLc0XsnFN8s433OLppI1USPraGtHhDScDxl7EC OeKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=BogcftVB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id g123-20020a636b81000000b005775a4a2960si2390674pgc.261.2023.09.21.16.26.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 16:26:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=BogcftVB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id DCA3E808E55C; Thu, 21 Sep 2023 10:30:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230307AbjIUR3b (ORCPT + 29 others); Thu, 21 Sep 2023 13:29:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229962AbjIUR2u (ORCPT ); Thu, 21 Sep 2023 13:28:50 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:242:246e::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 556B0728F; Thu, 21 Sep 2023 10:10:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: 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:In-Reply-To:References; bh=gpXWMEFRdkUqRYHtPtMKumIpIyQIjDxThum2oS+gMZU=; t=1695316206; x=1696525806; b=BogcftVBbpBYJX+dnGuaduFUghCyA5YB+3Mrlv3IKYWAdffEWEzOCxJ9gPLUfLt/aNQx68aLYhh wewb23qMM6Tk7rwRC2Ye0el61CtLtvR1RHMPHLkrVnhW/dLQqXLmKWKb2jhd8JB34jsRzisvXxKIG IjfYFCb46uMtLICWCyl+f76e6kMuXK2SvZzele+mEszMIxT67IDrXLR+cgiD5itoPut+E2iaO1WxG wenDf+opidxl2T9p1ONcsuTQNaiE6bI7eVKDOzRCuQehYVMQf7Vlt0JVcYtp7M1XLJ2F6PVhxJsxL Xg3WrX7DZggr6eRh/jbyvkQkrFFqnVi9VqVA==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1qjFPk-00D3lb-1B; Thu, 21 Sep 2023 10:52:00 +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 Subject: [PATCH 0/4] tracing: improve symbolic printing Date: Thu, 21 Sep 2023 10:51:30 +0200 Message-ID: <20230921085129.261556-5-johannes@sipsolutions.net> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 21 Sep 2023 10:30:46 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777691542592295421 X-GMAIL-MSGID: 1777691542592295421 So I was frustrated with not seeing the names of SKB dropreasons for all but the core reasons, and then while looking into this all, realized, that the current __print_symbolic() is pretty bad anyway. So I came up with a new approach, using a separate declaration of the symbols, and __print_sym() in there, but to userspace it all doesn't matter, it shows it the same way, just dyamically instead of munging with the strings all the time. This is a huge .data savings as far as I can tell, with a modest amount (~4k) of .text addition, while making it all dynamic and in the SKB dropreason case even reusing the existing list that dropmonitor uses today. Surely patch 3 isn't needed here, but it felt right. Anyway, I think it's a pretty reasonable approach overall, and it does works. I've listed a number of open questions in the first patch since that's where the real changes for this are. johannes