From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932213AbbCFHcZ (ORCPT ); Fri, 6 Mar 2015 02:32:25 -0500 Received: from mail7.hitachi.co.jp ([133.145.228.42]:40310 "EHLO mail7.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752224AbbCFHcX (ORCPT ); Fri, 6 Mar 2015 02:32:23 -0500 X-AuditID: 85900ec0-a2cc8b90000043ee-99-54f957c68f4b Subject: [PATCH perf/core v2 0/5] perf-probe: improve glibc support From: Masami Hiramatsu To: Arnaldo Carvalho de Melo Cc: Naohiro Aota , Peter Zijlstra , Linux Kernel Mailing List , David Ahern , namhyung@kernel.org, Jiri Olsa , Ingo Molnar Date: Fri, 06 Mar 2015 16:31:18 +0900 Message-ID: <20150306073118.6904.72740.stgit@localhost.localdomain> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: AAAAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Here is a series of patches which improves perf-probe to handle glibc's aliased symbols and weak symbols more correctly. This version includes 2 new patches from Namhyung (Thanks!) which solves a problem on weak symbols. I added a fix on his latter patch to modify find_alternative_probe_point, and dropped a bugfix which is already merged. So, this series is a merged series of below 2 series. http://lkml.kernel.org/g/20150302124939.9191.33564.stgit@localhost.localdomain http://lkml.kernel.org/g/1425477143-5310-1-git-send-email-namhyung@kernel.org ====== A major known issue of probing on glibc is that the some aliased symbols(e.g. malloc) and weak symbols (e.g. calloc) can not find by perf-probe. Actually, glibc's malloc symbol is just an alias of __libc_malloc. Its debuginfo knows only __libc_malloc, and perf's symbol map knows only malloc. This difference always confuses users that they can see malloc by perf report or annotate, but they can not probe on it, nor find definitions by --line option. And weak symbols have been dropped when loading. Previously, I've made a commit 906451b98b67 which solved this problem partly, but not completely fixed. So I decided to solve this issue completely by finding the symbols like malloc from perf's symbol map, and converting the symbol's address into debuginfo's location infomation. With this series, you can use --vars, --line and --add with the aliased symbols and weak symbols on glibc. Thank you, --- Masami Hiramatsu (3): perf-probe: Fix to handle aliased symbols in glibc perf-probe: Fix --line to handle aliased symbols in glibc Revert "perf probe: Fix to fall back to find probe point in symbols" Namhyung Kim (2): perf symbols: Allow symbol alias when loading map for symbol name perf probe: Allow weak symbols to be probed tools/perf/util/machine.c | 2 tools/perf/util/map.c | 6 + tools/perf/util/map.h | 8 +- tools/perf/util/probe-event.c | 185 +++++++++++++++++++++++++++++++++----- tools/perf/util/symbol-elf.c | 5 + tools/perf/util/symbol-minimal.c | 2 tools/perf/util/symbol.c | 8 +- tools/perf/util/symbol.h | 5 + 8 files changed, 182 insertions(+), 39 deletions(-) -- Masami HIRAMATSU Software Platform Research Dpt. Linux Technology Center Hitachi, Ltd., Yokohama Research Laboratory E-mail: masami.hiramatsu.pt@hitachi.com