Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756144AbbHZM1X (ORCPT ); Wed, 26 Aug 2015 08:27:23 -0400 Received: from mail7.hitachi.co.jp ([133.145.228.42]:60402 "EHLO mail7.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751859AbbHZM1W (ORCPT ); Wed, 26 Aug 2015 08:27:22 -0400 From: =?utf-8?B?5bmz5p2+6ZuF5bezIC8gSElSQU1BVFXvvIxNQVNBTUk=?= To: "'Wang Nan'" , "acme@kernel.org" , "rostedt@goodmis.org" CC: "mingo@redhat.com" , "namhyung@kernel.org" , "pi3orama@163.com" , "lizefan@huawei.com" , "linux-kernel@vger.kernel.org" , sysp-manager Subject: RE: [PATCH v3 2/6] perf probe: Fix list result when symbol can't be found Thread-Topic: [PATCH v3 2/6] perf probe: Fix list result when symbol can't be found Thread-Index: AQHQ3+4n3cs7WfMQJkqyUL4alaJ15Z4eHilQ Date: Wed, 26 Aug 2015 12:27:19 +0000 Message-ID: <50399556C9727B4D88A595C8584AAB37524ECCCA@GSjpTKYDCembx32.service.hitachi.net> References: <1440586666-235233-1-git-send-email-wangnan0@huawei.com> <1440586666-235233-4-git-send-email-wangnan0@huawei.com> In-Reply-To: <1440586666-235233-4-git-send-email-wangnan0@huawei.com> Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.198.219.51] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id t7QCRU7b024716 Content-Length: 1974 Lines: 58 > From: Wang Nan [mailto:wangnan0@huawei.com] > > 'perf probe -l' reports error if it is unable find symbol through > address. Here is an example. > > # echo 'p:probe_libc/abs_5 /lib64/libc.so.6:0x5' > > /sys/kernel/debug/tracing/uprobe_events > # cat /sys/kernel/debug/tracing/uprobe_events > p:probe_libc/abs_5 /lib64/libc.so.6:0x0000000000000005 > # perf probe -l > Error: Failed to show event list > > Also, this situation triggers a logical inconsistency in > convert_to_perf_probe_point() that, it returns ENOMEM but actually > it never try strdup(). > > This patch removes !tp->module && !is_kprobe condition, so it > always uses address to build function name if symbol not found. > > Test result: > > # perf probe -l > probe_libc:abs_5 (on 0x5 in /lib64/libc.so.6) > Looks good! Acked-by: Masami Hiramatsu Thank you! > Signed-off-by: Wang Nan > Cc: Arnaldo Carvalho de Melo > Cc: Ingo Molnar > Cc: Masami Hiramatsu > Cc: Namhyung Kim > Cc: Steven Rostedt > --- > tools/perf/util/probe-event.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c > index 6c7e538..f7bacbb 100644 > --- a/tools/perf/util/probe-event.c > +++ b/tools/perf/util/probe-event.c > @@ -1866,7 +1866,7 @@ static int convert_to_perf_probe_point(struct probe_trace_point *tp, > if (tp->symbol) { > pp->function = strdup(tp->symbol); > pp->offset = tp->offset; > - } else if (!tp->module && !is_kprobe) { > + } else { > ret = e_snprintf(buf, 128, "0x%" PRIx64, (u64)tp->address); > if (ret < 0) > return ret; > -- > 1.8.3.4 ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?