Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3163478imu; Wed, 7 Nov 2018 06:10:49 -0800 (PST) X-Google-Smtp-Source: AJdET5eoVZDXGnFTUxYohIYmz1/feuAV+RrQHroOyeEg5fzqkuzUlWoT9nPSZU2zgzcHdw8WHpro X-Received: by 2002:a17:902:7c0b:: with SMTP id x11-v6mr396135pll.60.1541599849554; Wed, 07 Nov 2018 06:10:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541599849; cv=none; d=google.com; s=arc-20160816; b=n4gHZggKtrjl/qxTiX7xJQn589YLIBN8FoXmqN5RpJDQKRXno0zi/Stp7cOTqwcVw8 FZlLeV8tHXLszsVfGSv9awkb+Ck3tXRgVd9xtGsjx/cE8/GWGjPj0FOW0NDDkzO1Ng75 G7D9+uI3+4ZlsbDEoPrRhuqoH+nrq+wtKlglEa+cP+T88CWVNKlPTnkkpjRzMSX9JZaA 9h3SIe9n+LnUrAaiWwPNMMngHceVu9ik8QeWxoRd5MUEFwBTC3MbNdC9f4XV5Ji2arlw kKRUlPrDGSFKsfSbfTuKfA3RDxvg4ar1LnpEHqt8b2hLtsbUnJmviZWSI3BkvxzOWJBl F7Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=NeUAWUz1RYiPKwnhZYJ6tWYFefLlmwkSa/PNV6w1DGc=; b=e0EzTgqB7+E62xP2qYO+HbP22x5rxIa9Gg1bgN/JLHPXAQ7xPWebG4WQ8TtWfMyAnQ Qi8FwfDctb+DogR4xBNvspssHQl3WmI0S5SS01Rzt0Mnc+1wBt3UmPcdItbN5/3fqcci vnEX+FU0E6gWz9gtgSKgfHkjgybGhdEnQYsE1rVdO6rVxo8qok6MXK1NiIx7eGFKziPA KGflvsqPE9oRLJE97hiPhZufPxf1YGdBthatYyTaWuVGzjlsyf2mrG9RDTljtqn72fTU EylwQPUI1hF8yTtypjoXnKZWChgPBbHCUHSK358WEuT/JwLmHCI4Hg9qldcsz9AgRJzv BuFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m7si604550pgi.547.2018.11.07.06.10.33; Wed, 07 Nov 2018 06:10:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727721AbeKGXkn (ORCPT + 99 others); Wed, 7 Nov 2018 18:40:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58218 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726635AbeKGXkn (ORCPT ); Wed, 7 Nov 2018 18:40:43 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7F5FD31256B1; Wed, 7 Nov 2018 14:10:11 +0000 (UTC) Received: from krava (unknown [10.40.205.37]) by smtp.corp.redhat.com (Postfix) with SMTP id 32451662F3; Wed, 7 Nov 2018 14:10:07 +0000 (UTC) Date: Wed, 7 Nov 2018 15:10:06 +0100 From: Jiri Olsa To: leo.yan@linaro.org Cc: acme@redhat.com, Jiri Olsa , Mathieu Poirier , Coresight ML , linux-kernel@vger.kernel.org Subject: Re: Question: perf dso support for /proc/kallsyms Message-ID: <20181107141006.GD12870@krava> References: <20181102025516.GA25374@leoy-ThinkPad-X240s> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181102025516.GA25374@leoy-ThinkPad-X240s> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Wed, 07 Nov 2018 14:10:11 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 02, 2018 at 10:55:16AM +0800, leo.yan@linaro.org wrote: > Hi all, > > Now I found that if use the command 'perf script' for Arm CoreSight trace > data, it fails to parse kernel symbols if we don't specify kernel vmlinux > file. So when we don't specify kernel symbol files then perf tool will > roll back to use /proc/kallsyms for kernel symbols parsing, as result it will > run into below flow: yep, AFAIK if there's no vmlinux found we fallback to /proc/kallsyms > > thread__find_addr_map(thread, cpumode, MAP__FUNCTION, address, &al); > map__load(al.map); > dso__data_read_offset(al.map->dso, machine, offset, buffer, size); > `-> data_read_offset() so what is the actual error you see in the perf script? unresolved samples? could you please describe your config and workload? thanks, jirka > > I can observe the function data_read_offset() returns failure, this is caused > by checking the offset sanity "if (offset > dso->data.file_size)" (I pasted > the whole function code at below in case you want to get more context for it), > but if perf use "/proc/kallsyms" to load kernel symbols, the variable > 'dso->data.file_size' will be set to zero thus the sanity checking always > thinks the offset is out of the file size bound. > > Now I still don't understand how the dso/map support "/proc/kallsyms" and > have no idea to fix this issue, though I spent some time to look into it. > > Could you give some suggestion for this? Or even better if you have fixing > for this, I am glad to test at my side. > > static ssize_t data_read_offset(struct dso *dso, struct machine *machine, > u64 offset, u8 *data, ssize_t size) > { > if (data_file_size(dso, machine)) > return -1; > > /* Check the offset sanity. */ > if (offset > dso->data.file_size) > return -1; > > if (offset + size < offset) > return -1; > > return cached_read(dso, machine, offset, data, size); > } > > Thanks, > Leo Yan