Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753154AbbD0Qi6 (ORCPT ); Mon, 27 Apr 2015 12:38:58 -0400 Received: from mail.kernel.org ([198.145.29.136]:33990 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752184AbbD0Qi5 (ORCPT ); Mon, 27 Apr 2015 12:38:57 -0400 Date: Mon, 27 Apr 2015 13:38:53 -0300 From: Arnaldo Carvalho de Melo To: Masami Hiramatsu Cc: He Kuang , a.p.zijlstra@chello.nl, mingo@redhat.com, paulus@samba.org, wangnan0@huawei.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf probe: Fix bug in perf probe with global variables Message-ID: <20150427163853.GD16849@kernel.org> References: <1429949338-18678-1-git-send-email-hekuang@huawei.com> <553C37A6.3090206@hitachi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <553C37A6.3090206@hitachi.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1781 Lines: 47 Em Sun, Apr 26, 2015 at 09:56:06AM +0900, Masami Hiramatsu escreveu: > (2015/04/25 17:08), He Kuang wrote: > > There are missing curly braces which causes find_variable() return wrong > > value when probing with global variables. > > > > This problem can be reproduced as following: > > > > $ perf probe -v --add='generic_perform_write global_variable_for_test' > > ... > > Try to find probe point from debuginfo. > > Probe point found: generic_perform_write+0 > > Searching 'global_variable_for_test' variable in context. > > An error occurred in debuginfo analysis (-2). > > Error: Failed to add events. Reason: No such file or directory (Code: -2) > > > > After this patch: > > > > $ perf probe -v --add='generic_perform_write global_variable_for_test' > > ... > > Converting variable global_variable_for_test into trace event. > > global_variable_for_test type is int. > > Found 1 probe_trace_events. > > Opening /sys/kernel/debug/tracing/kprobe_events write=1 > > Added new event: > > Writing event: p:probe/generic_perform_write _stext+1237464 > > global_variable_for_test=@global_variable_for_test+0:s32 > > probe:generic_perform_write (on generic_perform_write with > > global_variable_for_test) > > > > You can now use it in all perf tools, such as: > > > > perf record -e probe:generic_perform_write -aR sleep 1 > > Oops, that's my fault! :( > > Acked-by: Masami Hiramatsu > > Thank you!! Thanks, applied to perf/urgent. - Arnaldo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/