Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp189130lqz; Fri, 29 Mar 2024 12:58:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXEgc51iBUFoEgutJ7EAwqp8qGAkoBdAIqHi5ythYM28u32xMewNsGsS5XhQUaYCMHrYyJvTr9U0zqjz7FwtEnDzQP7y4elXX/0eLxitA== X-Google-Smtp-Source: AGHT+IFI1Jd1iPc2pHGHTm2B20O9isak03kdcHLoeqTvE9ZQRQSv63JPrG/WfHKrptEpWmWrW7Y3 X-Received: by 2002:a05:6402:348d:b0:56b:b5d6:1efc with SMTP id v13-20020a056402348d00b0056bb5d61efcmr2438165edc.18.1711742322618; Fri, 29 Mar 2024 12:58:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711742322; cv=pass; d=google.com; s=arc-20160816; b=EQI8RlVv5ZXWt2ZQa5NY3nqmrtFW24/hvvENSb8Bzeol6ukY5PsW2g0dWi/ISyS6T+ zX4Yg02tB8+twdcsQ0pKh99B/tjKfMgNHC/5JoSPkaYXvFEybTUxG/U8WbvrnqFMAbIU 99I8OkAqk7ityvWrG2DxYOAqmmD5/qESxCqS/QtSCnn9daxmXI1WzUXGulEcOBBLgw1V +piEkcSW/sqwLY7rbnkjV8hChB0a+i3334ETZ9z9AdOoweto4qmuS02mYlNQqnYCfykC Yj3EwnTwpa/2P9/Hbp7yMu5MZZV9XyVOWY7O9ALFP1t7SLaNvLvgVz7iDH3oADrVwKVr 9yjg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence; bh=4s8+DG4ef6vbCXZ0BFAbjvZwYptw5QONeO+ShZzGSPg=; fh=BU1T1cUybvzJIVC5YGSwsJpE1zD3GKlF0Mh/38c1bUg=; b=d/azUeipjMQwle3aUXSVbj9+uVywPtAfZPGYoP8T/QBF+eWn629MVkxC2OStrY7TkL 91F4XnLQ0ZvVmZBcEqIHlcPXUmiYxd7rnvd1c1d+CtGBSHpliRy5wgVTD9eBB78g8e6T YLSkveypBil07lUUWN7G8S6N4v7GjZkQ2LTzL74MOk9FVuoWw0Wc0Ohd7HKnwq8zadKU pLLddkJq6X8tdR9RBae466euMY3nQbZXC/Zoe53ieGCOUTtlZfM/LkxxKJ7WdlCJHbrj qcSrimhHQpXclWwcWf+Z57n2+RsmbEJMY791DfuIjnsOqMJ9AqIM3/qh1vNiUSj8Bkpn Ue8g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-125371-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-125371-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id x42-20020a50baad000000b00568cd675c8csi2064683ede.103.2024.03.29.12.58.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 12:58:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-125371-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-125371-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-125371-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 621801F23FB5 for ; Fri, 29 Mar 2024 19:57:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1172013AA54; Fri, 29 Mar 2024 19:57:50 +0000 (UTC) Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F3DA13A403; Fri, 29 Mar 2024 19:57:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711742269; cv=none; b=L4+CT4agXuegKc3zTGsyn7bkr3vIwOmbHF7rZZ7OzfZNPRk/wjIMTR2T0rFht7RXY5xH0UJ7+2ial2MXzD2ktC+wb/85CBpVz3REaifPuZ9ulyDbrMWBAeN8CBUgmkRdd1S6v7sdCSwEWFksSPV0XDoKV0j5RSH6LgmyEK41+g4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711742269; c=relaxed/simple; bh=Eb00Nd/4FbSasWchIqCKO3IHhuDaMWOWUkVBp3B0ox8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=vFU6XDTl9GkCxi7eNG8pKtFPUgQ1JA4NqX68RglFinj/5ycwtJZNJN5oYZUS7qEa6/ARt7kk6mZPFu/M4Pjg0b005FgZn23ypn8XyUT8mreKNzHnDdYuo+oalqseAhLNfqhoCcyJIeaiyxqPSWHyKaSkT4jOmVMdlmiwzSTe5H4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.216.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-f49.google.com with SMTP id 98e67ed59e1d1-2a1fdcc3659so1698570a91.2; Fri, 29 Mar 2024 12:57:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711742267; x=1712347067; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4s8+DG4ef6vbCXZ0BFAbjvZwYptw5QONeO+ShZzGSPg=; b=JeEkGCJOvjMBO9pszmPrO20uVOxiX/XbgYiHN1VSHZFTsjbX2oueMDJp/Xscb4OnvE qSSm7nxFUMDt6VxqQZE/UJwLcnTBK1LvnkdIVs79ZE6LncpiPER1Pll6smFM/cSt3w+3 awSHFJ8asK0vTOkjxq9k2oU8AzLd798ZhtndvAgEOfFnwEQoURCdDRs2rLOoAYYEm6Oa mpN2/CTYl37dlETLTJ622F6gXQiHZOUouChptkJ0Po6n4TLiNRlcSh2hUwWJzepug0cu E/WEzADO3jTUE+pwnR5dWNb/20uMeS1TgUyMrVxdU+TCxNI/M3KZYKTCtz9DhCw5Fcke NAMQ== X-Forwarded-Encrypted: i=1; AJvYcCU+/kuIfsj45XlyM2cii8nIbLmFZWE6weWf1SCna7NqZQ7dgG217qjf+IsKdjfL7Cix2US8dwz2Ly9j6XjmlhSLB6XJYZE5FPA05yTFcBSaWmkiDnbV4jP9jzHbwYM+QoTq4zSOh5vshsk1JPn0xw== X-Gm-Message-State: AOJu0YwvDDN7WvnkMSMDvSA0HUi0W7oQn+Q4fDxzNmkJQT6cy9jxiPdP i3IrqBCxDlogR7IsMFydQ95qblNffOHwoBaqDNhGVaQJDOi0M3aEQh+VEP5ti2Qe5W9CQ3GxrOm juDY9ZwBpNnP4rSYvHtsgYbvXaZgDVKNt X-Received: by 2002:a17:90a:7e03:b0:299:5b95:cd7d with SMTP id i3-20020a17090a7e0300b002995b95cd7dmr2762225pjl.45.1711742267378; Fri, 29 Mar 2024 12:57:47 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240328232009.466018-1-namhyung@kernel.org> In-Reply-To: From: Namhyung Kim Date: Fri, 29 Mar 2024 12:57:35 -0700 Message-ID: Subject: Re: [PATCH 0/4] perf annotate: Use libcapstone as a disasssembler To: Ian Rogers Cc: Changbin Du , Arnaldo Carvalho de Melo , Kan Liang , Jiri Olsa , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Ian, On Fri, Mar 29, 2024 at 9:33=E2=80=AFAM Ian Rogers wro= te: > > On Thu, Mar 28, 2024 at 4:20=E2=80=AFPM Namhyung Kim wrote: > > > > Hello, > > > > As we've added libcapstone support, it's natural to use it for perf ann= otate > > as well. This change added the capstone support on x86 first. Other a= rchs > > can be added later (by someone who can verify it doesn't break things). > > > > For now it tries to use capstone (if available) before objdump. But it > > doesn't support source file and line number info. So users should use = the > > objdump (by passing --objdump=3DPATH option) if they need them. For ex= ample, > > this command line will keep the existing behavior (i.e. using objdump). > > > > # not to use capstone for disassembly > > $ perf annotate --objdump=3Dobjdump > > > > The capstone uses LLVM objdump style output which is slightly different= than > > the GNU objdump. But it should not have differences besides that. I'v= e > > verified the result of data type profiling and it produced the same out= put > > but gave me ~3x speedups. > > > > Thanks, > > Namhyung > > I wanted to see what -fsanitize=3Daddress would think of libcaptstone > and no issues, so: > > Tested-by: Ian Rogers Thanks for checking it! > > Some thoughts: > - it may be worth adding to the commit message in "perf annotate: > Split out util/disasm.c" that there's no functional change, > - we lack perf annotate testing, > - it seems capstone should be opt-out rather than opt-in as a library > dependency (given the performance delta and the objdump interactions > are at best messy), > - if libcapstone could solve our addr2line issues too this would be grea= t :-). I think addr2line should be handled using libdw. I'll take a look. Thanks, Namhyung