From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752279AbdLLP1a (ORCPT ); Tue, 12 Dec 2017 10:27:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:41090 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751653AbdLLP11 (ORCPT ); Tue, 12 Dec 2017 10:27:27 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C723F20740 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=acme@kernel.org Date: Tue, 12 Dec 2017 12:27:24 -0300 From: Arnaldo Carvalho de Melo To: Masami Hiramatsu Cc: bhargavb , linux-kernel@vger.kernel.org, Paul Clarke , Ravi Bangoria , Thomas Richter , linux-rt-users@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: Re: [PATCH v4] perf-probe: Support escaped character in parser Message-ID: <20171212152724.GO3958@kernel.org> References: <151309111236.18107.5634753157435343410.stgit@devbox> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <151309111236.18107.5634753157435343410.stgit@devbox> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Wed, Dec 13, 2017 at 12:05:12AM +0900, Masami Hiramatsu escreveu: > Support the special characters escaped by '\' in parser. > This allows user to specify versions directly like below. > > ===== > # ./perf probe -x /lib64/libc-2.25.so malloc_get_state\\@GLIBC_2.2.5 > Added new event: > probe_libc:malloc_get_state (on malloc_get_state@GLIBC_2.2.5 in /usr/lib64/libc-2.25.so) > > You can now use it in all perf tools, such as: > > perf record -e probe_libc:malloc_get_state -aR sleep 1 > > ===== > > Or, you can use separators in source filename, e.g. > > ===== > # ./perf probe -x /opt/test/a.out foo+bar.c:3 > Semantic error :There is non-digit character in offset. > Error: Command Parse Error. > ===== > > Usually "+" in source file cause parser error, but > > ===== > # ./perf probe -x /opt/test/a.out foo\\+bar.c:4 > Added new event: > probe_a:main (on @foo+bar.c:4 in /opt/test/a.out) > > You can now use it in all perf tools, such as: > > perf record -e probe_a:main -aR sleep 1 > ===== > > escaped "\+" allows you to specify that. > Changes in v4: > - Fix a build error (Thanks for Arnaldo!) > This time, I ensured that I ran "make build-test" and it passed. Thanks, testing it I still have that artifact: --------------------------------------- [root@jouet perf]# perf probe -x /lib64/libc-2.25.so malloc_get_state\\@GLIBC_2.2.5 Added new event: probe_libc:malloc_get_state (on malloc_get_state@GLIBC_2.2.5 in /usr/lib64/libc-2.25.so) You can now use it in all perf tools, such as: perf record -e probe_libc:malloc_get_state -aR sleep 1 [root@jouet perf]# perf probe -l Failed to find debug information for address dd38eca7 probe_libc:malloc_get_state (on 0xdd38eca7 in /usr/lib64/libc-2.25.so) [root@jouet perf]# --------------------------------------- I mean the "on 0xdd38eca7" part: That failed to find debug information part: [root@jouet perf]# perf probe -vv -l Add filter: * Opening /sys/kernel/debug/tracing//kprobe_events write=0 Opening /sys/kernel/debug/tracing//uprobe_events write=0 Parsing probe_events: p:probe_libc/malloc_get_state /usr/lib64/libc-2.25.so:0x00000000dd38eca7 Group:probe_libc Event:malloc_get_state probe:p try to find information at dd38eca7 in /usr/lib64/libc-2.25.so Open Debuginfo file: /usr/lib/debug/usr/lib64/libc-2.25.so.debug Failed to find debug information for address dd38eca7 Failed to find corresponding probes from debuginfo. symsrc__init: build id mismatch for /usr/lib/debug/usr/lib64/libc-2.25.so.debug. Failed to find probe point from both of dwarf and map. probe_libc:malloc_get_state (on 0xdd38eca7 in /usr/lib64/libc-2.25.so) [root@jouet perf]# Ok, so build-id mismatch, lets see: [root@jouet perf]# rpm -q glibc glibc-debuginfo glibc-2.25-10.fc26.x86_64 glibc-2.25-10.fc26.i686 glibc-debuginfo-2.25-12.fc26.x86_64 [root@jouet perf]# Ok, the debuginfo file is newer than the glibc installed, updating glibc now... We could have a more informative message in this case, right? I.e. something like: [root@jouet perf]# perf probe -l There was a build-id mismatch while trying to resolve 0xdd38eca7, please check your system's debuginfo files for mismatches, e.g. check the versions for glibc and glibc-debuginfo. probe_libc:malloc_get_state (on 0xdd38eca7 in /usr/lib64/libc-2.25.so) [root@jouet perf]# - Arnaldo