Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753083AbbEKKRc (ORCPT ); Mon, 11 May 2015 06:17:32 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:35994 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752610AbbEKKRb (ORCPT ); Mon, 11 May 2015 06:17:31 -0400 Subject: Re: [PATCH v3 3/3] perf probe: Show better error message when failed to find variable To: Ingo Molnar References: <1431336304-16863-1-git-send-email-hekuang@huawei.com> <1431336304-16863-3-git-send-email-hekuang@huawei.com> <20150511093010.GA31869@gmail.com> <555079CF.40701@huawei.com> <20150511095052.GA7441@gmail.com> CC: , , , , , , From: He Kuang Message-ID: <55508149.8040404@huawei.com> Date: Mon, 11 May 2015 18:15:37 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.0 MIME-Version: 1.0 In-Reply-To: <20150511095052.GA7441@gmail.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.110.54.65] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2306 Lines: 66 On 2015/5/11 17:50, Ingo Molnar wrote: > * He Kuang wrote: > >> Hi, Ingo >> >> On 2015/5/11 17:30, Ingo Molnar wrote: >>> * He Kuang wrote: >>> >>>> Indicate to check variable location range in error message when we got >>>> failed to find the variable. >>>> >>>> Before this patch: >>>> >>>> $ perf probe --add 'generic_perform_write+118 bytes' >>>> Failed to find the location of bytes at this address. >>>> Perhaps, it has been optimized out. >>>> Error: Failed to add events. >>>> >>>> After this patch: >>>> $ perf probe --add 'generic_perform_write+118 bytes' >>>> Failed to find the location of bytes at this address. >>> What does this sentence mean? I thought 'address' means 'location of >>> bytes'. So the address identifies the location and obviously we know >>> that. So this message wants to say something else. >> 'generic_perform_write' is a function name, while 'bytes' is a local >> variable in this function. Maybe the variable I chose make you confused. >> >> This maybe clear: >> Failed to find the location of 'bytes' at this address. > Yeah, absolutely! This highlights the importance of putting > user-supplied symbols into quotes and such. > > Maybe even write: > > Failed to find the location of the 'bytes' variable at this address. > > Another question: what does 'generic_perform_write+118' mean here? Why > the offset? This is for setting a kprobe at the location has an offset of 118 bytes to the entry of the function 'generic_perform_write'. In the previous patch: https://lkml.org/lkml/2015/5/11/170, we show a valid byte offset range of variables in scope, 118 is an invalid address which can be read from the result, this offset is just for showing the error message. > > Thanks, > > Ingo > -- > 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/ > -- 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/