From patchwork Tue Apr 18 03:15:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Changbin Du X-Patchwork-Id: 8334 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2559584vqo; Mon, 17 Apr 2023 20:42:31 -0700 (PDT) X-Google-Smtp-Source: AKy350YvFwnAbTaulotXkFboUjx/vjZiRf/lPo6DmQdobKxY0T8evO3YC0C9SnPNCe6gbUKchQ2V X-Received: by 2002:a17:902:ec88:b0:1a6:ef75:3c53 with SMTP id x8-20020a170902ec8800b001a6ef753c53mr936962plg.11.1681789351545; Mon, 17 Apr 2023 20:42:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681789351; cv=none; d=google.com; s=arc-20160816; b=VlBf5544I3dX1UnK4RWRD0N3TXkywai0IqiwjVVQxE92/9hlOL5hgfkpnMP4eK0txW cPPLzaKQyP8+SsI+gqxvJnJG2rBn0BD1jbTyG9poBVJzcKKt7EGp3T/2oDz4T2oxWxsE pWSC2mJHeMWxXuxwKyU0dW1Fl3HrGvD2rrXc0ztSB4yXMtqI9DL4nBftluXijB6dWH8j WXWJPhJrO563jQfZzYKIQmJzfXG3NvTZ7GSj9v7+gL/zZ6e98IdWaweEQhh/6dvyTSPH GLEEJQ+45+lmVMBvteyZaqORW+w/SYYIwOjd9sqYUDHwN+W7xkvqn5htfo4zhiXKlNSv h7BQ== 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; bh=+VTTXQZFYV4pyRe2xeO4Yd3Cn3gk3SUczAAqAZvKfVE=; b=YCEh2jqsj9ju/5QAvM1LJDYEgZcSH/Y6t1lydAe6IlDbosKatCYkAqSsuTrEYDxkZR I322FQDlcwdK46JSHieKhsLmS9Xf312uT24NUWdmlU9Ebl13Tiw++0uKNZJ3l+4+mPgn Yyqn5DAEO+uPeViamiseS57xIYjMRiHltKCsg3P2lr5IFXEuz66RWeqTC0CtBEzWzDlh kdYbK8iuM0cTvuxNguu/zzXWTbX/B+IRwK09SP4oDELvJV7n1I8N+YuVuS0ipzvZn462 rtuN9Z6+bwRnKQrywag77OYUHvxL4s747FT0WqiCLjHs5Y9i5R3SN6M5lA+NWx6xO+Ih J4VA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p1-20020a170902e74100b001a6983da1d9si12420961plf.139.2023.04.17.20.42.17; Mon, 17 Apr 2023 20:42:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229946AbjDRDQ7 (ORCPT + 99 others); Mon, 17 Apr 2023 23:16:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229619AbjDRDQ4 (ORCPT ); Mon, 17 Apr 2023 23:16:56 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26DE23595; Mon, 17 Apr 2023 20:16:55 -0700 (PDT) Received: from kwepemi500013.china.huawei.com (unknown [7.221.188.120]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4Q0pwM2BMhzKs73; Tue, 18 Apr 2023 11:16:03 +0800 (CST) Received: from M910t.huawei.com (10.110.54.157) by kwepemi500013.china.huawei.com (7.221.188.120) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 18 Apr 2023 11:15:34 +0800 From: Changbin Du To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar CC: Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , , , Hui Wang , Changbin Du Subject: [PATCH v5 0/2] perf script: Have consistent output for symbol address Date: Tue, 18 Apr 2023 11:15:17 +0800 Message-ID: <20230418031519.1261310-1-changbin.du@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.110.54.157] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemi500013.china.huawei.com (7.221.188.120) X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763483776967665280?= X-GMAIL-MSGID: =?utf-8?q?1763483951077127065?= The goal of this change is to achieve consistent output for symbol address. Before this, the raw ip is printed for non-callchain and dso offset for callchain. Mostly what we expect is the raw ip. This patch does two changes: - Always print raw ip for resolved symbols. - Add a new 'dsoff' field if we really need the dso offset, and the offset is appended to dso name. v5: o add helper map__fprintf_dsoname_dsoff() to eliminate repeated dso printing code. (Adrian) o do not print offset for kernel dso (a.k.a [kernel.kallsyms]) v4: o also print 'dsoff' for brstack,brstacksym,brstackoff,etc. v3: o 'dsoff' implys 'dso' field. (Namhyung) v2: o split into two patches. (Adrian) o do not print offset for unresolved symbols. (Adrian) Changbin Du (2): perf: add helper map__fprintf_dsoname_dsoff perf: script: add new output field 'dsoff' to print dso offset tools/perf/Documentation/perf-script.txt | 2 +- tools/perf/builtin-script.c | 60 ++++++++++-------------- tools/perf/util/evsel_fprintf.c | 16 +++---- tools/perf/util/evsel_fprintf.h | 1 + tools/perf/util/map.c | 13 +++++ tools/perf/util/map.h | 1 + 6 files changed, 46 insertions(+), 47 deletions(-)