Received: by 2002:ab2:6f44:0:b0:1fd:c486:4f03 with SMTP id l4csp198851lqq; Wed, 12 Jun 2024 23:35:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX2howN2TVwpnKmV+wlalil0vRqACyGapZnW0qNugJoeA/xQf1i1hPmsvkYuMDIZxpJ9TIumO2es4X0bQ0zekF2rryFAv3NWTg27Ilo1Q== X-Google-Smtp-Source: AGHT+IGpOz+WR/q9omIntYQvYl1AzUluw/e+PAFzpul6O/Hml9ildX222OWUPyTibtkLriB0skzK X-Received: by 2002:a05:6870:d60f:b0:254:d05e:4cd2 with SMTP id 586e51a60fabf-25514c5ffc0mr4631747fac.27.1718260551295; Wed, 12 Jun 2024 23:35:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718260551; cv=pass; d=google.com; s=arc-20160816; b=nSAgijCpB9FImqkmAQPqxbjoprsLTGvYwPqbXrzNVyM885bEIgHUTCjam6LfnDCW47 xR/si5C3gcVjX1Fu0sDS9SKNH/9Dj8dqsptHFOwi+kBuH13nlO/Kn2LzfwiN1wDzDNH8 r4Ct+t/Y9dtkImr3inv1WwnOi1KkTt87mwUXLyHIFLtkDGl+c8XdRu+GLk/R/YsxzMww RugTPRARxlKqYQ4pbvPFy2tNH7xSm304JT2U/7RFbM8ynEHF8pb8aVKCQnnGC1bEf6sR cI9OqOQZpGwZ5vcAaIn6t5SbIa5nqyMGxEtPv6T5R8J1UytHAqrSBtcAqYAp3AmXtXcz bboQ== 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:message-id:date:subject:cc:to :from; bh=opX+GL77quChxEex4UtNnoypMSQMn5SLxpASd6hvqzY=; fh=oqZyDXyMmuwXC127KYP8yZvvclD9htJbfhHWow5HG6Q=; b=vhWbEThhEbemblzsEpMRqVQ75OVtJDEw8DGn3WpGFJsTEwahxinTKsOri2X+PEPRyg BjQe89bgeI0YvGivpB1iJpIEPmwkH8E4wkIKB8QNjZc22pQmRYnXbaumos9SKIt39+bD coXEa566dGysajPQGaYZ2TkgK/3VWa0oH0Le2DblyAAWJVge5PscFUpFLOrpFYCaUYgC GYXtSxQjaklcwSUQgc4ji16gyLQcrPQCUeL4i0LuD4w9UyyFX5503RRMHWig0lIxvc6S m6dvTX1G5/At2meqCwpHbi2XfdhHVa1xnhhOW8C49nLyM4Qyk7vxPpc/E+vgz9DhGcDL hTfg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-212635-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212635-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2e1a72fcca58-705cfc23010si330017b3a.0.2024.06.12.23.35.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 23:35:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-212635-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-212635-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212635-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id DA290284F8D for ; Thu, 13 Jun 2024 06:35:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 813A1136E1D; Thu, 13 Jun 2024 06:35:31 +0000 (UTC) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) (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 78101137762; Thu, 13 Jun 2024 06:35:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.189 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718260531; cv=none; b=FgCeaLWISAU/cbDWHtnREZK14yyeGKNdVaIczSuzlNMJt+TlTrNblkX7bU5dcxAnQBsE0+Mbq3u+1432FItFO+3rLic+jm/kNe+N+N74mz8Spek+u1PkNnGwQvF9S/hD1O39V8y99DTJUh6hr+MzADEvDI76u0VrKJS8z9d3b/M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718260531; c=relaxed/simple; bh=OWo4rrebCjJM7qWQjGzNFquIUysjDOnaqUlR2C+r7Xg=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=meoMaAnPSjwmpLxnZASdtYrcrO7G3VLwOeSvmdxTUkfNWc8gA7THQBmUXXW1h5WppWTxaJb3TO8+lWMCCVyNA2SiuXWiPfPVTBpw6Pj2SdLFFe2BzV+gHmxAqJ2x5hZXrel2SxtyeXEDXc9/OxaWb0bFFpYTL5FKOTZJP7x98AY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.189 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.105]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4W0CHg4SmyzPpN3; Thu, 13 Jun 2024 14:31:59 +0800 (CST) Received: from kwepemd100011.china.huawei.com (unknown [7.221.188.204]) by mail.maildlp.com (Postfix) with ESMTPS id 93662140382; Thu, 13 Jun 2024 14:35:25 +0800 (CST) Received: from M910t.huawei.com (10.110.54.157) by kwepemd100011.china.huawei.com (7.221.188.204) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.34; Thu, 13 Jun 2024 14:35:24 +0800 From: Changbin Du To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Nathan Chancellor CC: Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , "Liang, Kan" , Nick Desaulniers , Bill Wendling , Justin Stitt , , , , Changbin Du Subject: [PATCH 0/2] perf: support specify vdso path in cmdline Date: Thu, 13 Jun 2024 14:35:08 +0800 Message-ID: <20240613063510.348692-1-changbin.du@huawei.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemd100011.china.huawei.com (7.221.188.204) The vdso dumped from process memory (in buildid-cache) lacks debugging info. To annotate vdso symbols with source lines we need specify a debugging version. For x86, we can find them from your local build as arch/x86/entry/vdso/vdso{32,64}.so.dbg. Or they may resides in /lib/modules//vdso/vdso{32,64}.so on Ubuntu. But notice that the builid has to match. $ sudo perf record -a $ sudo perf report --objdump=llvm-objdump \ --vdso arch/x86/entry/vdso/vdso64.so.dbg,arch/x86/entry/vdso/vdso32.so.dbg Samples: 17K of event 'cycles:P', 4000 Hz, Event count (approx.): 1760 __vdso_clock_gettime /work/linux-host/arch/x86/entry/vdso/vdso64.so.d Percent│ movq -48(%rbp),%rsi ▒ │ testq %rax,%rax ▒ │ ; return vread_hvclock(); ▒ │ movq %rax,%rdx ▒ │ ; if (unlikely(!vdso_cycles_ok(cycles))) ▒ │ ↑ js eb ▒ │ ↑ jmp 74 ▒ │ ; ts->tv_sec = vdso_ts->sec; ▒ 0.02 │147: leaq 2(%rbx),%rax ▒ │ shlq $4, %rax ▒ │ addq %r10,%rax ▒ │ ; while ((seq = READ_ONCE(vd->seq)) & 1) {▒ 9.38 │152: movl (%r10),%ecx ▒ When doing cross platform analysis, we also need specify the vdso path if we are interested in its symbols. Changbin Du (2): perf: support specify vdso path in cmdline perf: disasm: prefer symsrc_filename for filename tools/perf/builtin-annotate.c | 2 + tools/perf/builtin-c2c.c | 2 + tools/perf/builtin-inject.c | 2 + tools/perf/builtin-report.c | 2 + tools/perf/builtin-script.c | 2 + tools/perf/builtin-top.c | 2 + tools/perf/util/disasm.c | 5 +++ tools/perf/util/symbol.c | 82 ++++++++++++++++++++++++++++++++++- tools/perf/util/symbol_conf.h | 5 +++ 9 files changed, 102 insertions(+), 2 deletions(-) -- 2.34.1